define(["exports","./Matrix2-9aa31791","./RuntimeError-346a3079","./when-4bbc8319","./ComponentDatatype-93750d1a","./combine-83860057"],(function(e,t,r,n,a,i){"use strict";function o(e){this._ellipsoid=n.defaultValue(e,t.Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(o.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),o.prototype.project=function(e,r){var a=this._semimajorAxis,i=e.longitude*a,o=e.latitude*a,s=e.height;return n.defined(r)?(r.x=i,r.y=o,r.z=s,r):new t.Cartesian3(i,o,s)},o.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,s=e.z;return n.defined(r)?(r.longitude=i,r.latitude=o,r.height=s,r):new t.Cartographic(i,o,s)};var s=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function u(e,t){this.start=n.defaultValue(e,0),this.stop=n.defaultValue(t,0)}function l(e,r){this.center=t.Cartesian3.clone(n.defaultValue(e,t.Cartesian3.ZERO)),this.radius=n.defaultValue(r,0)}var c=new t.Cartesian3,d=new t.Cartesian3,f=new t.Cartesian3,p=new t.Cartesian3,h=new t.Cartesian3,m=new t.Cartesian3,g=new t.Cartesian3,v=new t.Cartesian3,y=new t.Cartesian3,w=new t.Cartesian3,C=new t.Cartesian3,_=new t.Cartesian3,b=4/3*a.CesiumMath.PI;l.fromPoints=function(e,r){if(n.defined(r)||(r=new l),!n.defined(e)||0===e.length)return r.center=t.Cartesian3.clone(t.Cartesian3.ZERO,r.center),r.radius=0,r;var a,i=t.Cartesian3.clone(e[0],g),o=t.Cartesian3.clone(i,c),s=t.Cartesian3.clone(i,d),u=t.Cartesian3.clone(i,f),b=t.Cartesian3.clone(i,p),x=t.Cartesian3.clone(i,h),S=t.Cartesian3.clone(i,m),E=e.length;for(a=1;ab.x&&t.Cartesian3.clone(i,b),Ox.y&&t.Cartesian3.clone(i,x),IS.z&&t.Cartesian3.clone(i,S)}var R=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(b,o,v)),P=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(x,s,v)),T=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(S,u,v)),q=o,z=b,M=R;P>M&&(M=P,q=s,z=x),T>M&&(M=T,q=u,z=S);var D=y;D.x=.5*(q.x+z.x),D.y=.5*(q.y+z.y),D.z=.5*(q.z+z.z);var U=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(z,D,v)),k=Math.sqrt(U),F=w;F.x=o.x,F.y=s.y,F.z=u.z;var N=C;N.x=b.x,N.y=x.y,N.z=S.z;var j=t.Cartesian3.midpoint(F,N,_),B=0;for(a=0;aB&&(B=V);var L=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(i,D,v));if(L>U){var Q=Math.sqrt(L);U=(k=.5*(k+Q))*k;var W=Q-k;D.x=(k*D.x+W*i.x)/Q,D.y=(k*D.y+W*i.y)/Q,D.z=(k*D.z+W*i.z)/Q}}return kS.x&&t.Cartesian3.clone(o,S),RE.y&&t.Cartesian3.clone(o,E),PA.z&&t.Cartesian3.clone(o,A)}var T=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(S,u,v)),q=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(E,b,v)),z=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(A,x,v)),M=u,D=S,U=T;q>U&&(U=q,M=b,D=E),z>U&&(U=z,M=x,D=A);var k=y;k.x=.5*(M.x+D.x),k.y=.5*(M.y+D.y),k.z=.5*(M.z+D.z);var F=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(D,k,v)),N=Math.sqrt(F),j=w;j.x=u.x,j.y=b.y,j.z=x.z;var B=C;B.x=S.x,B.y=E.y,B.z=A.z;var V=t.Cartesian3.midpoint(j,B,_),L=0;for(s=0;sL&&(L=Q);var W=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(o,k,v));if(W>F){var H=Math.sqrt(W);F=(N=.5*(N+H))*N;var Y=H-N;k.x=(N*k.x+Y*o.x)/H,k.y=(N*k.y+Y*o.y)/H,k.z=(N*k.z+Y*o.z)/H}}return Nx.x&&t.Cartesian3.clone(i,x),IS.y&&t.Cartesian3.clone(i,S),RE.z&&t.Cartesian3.clone(i,E)}var P=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(x,s,v)),T=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(S,u,v)),q=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(E,b,v)),z=s,M=x,D=P;T>D&&(D=T,z=u,M=S),q>D&&(D=q,z=b,M=E);var U=y;U.x=.5*(z.x+M.x),U.y=.5*(z.y+M.y),U.z=.5*(z.z+M.z);var k=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(M,U,v)),F=Math.sqrt(k),N=w;N.x=s.x,N.y=u.y,N.z=b.z;var j=C;j.x=x.x,j.y=S.y,j.z=E.z;var B=t.Cartesian3.midpoint(N,j,_),V=0;for(o=0;oV&&(V=L);var Q=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(i,U,v));if(Q>k){var W=Math.sqrt(Q);k=(F=.5*(F+W))*F;var H=W-F;U.x=(F*U.x+H*i.x)/W,U.y=(F*U.y+H*i.y)/W,U.z=(F*U.z+H*i.z)/W}}return F=d+u)return e.clone(a),a;if(u>=d+o)return r.clone(a),a;var f=.5*(o+d+u),p=t.Cartesian3.multiplyByScalar(c,(-o+f)/d,M);return t.Cartesian3.add(p,i,p),t.Cartesian3.clone(p,a.center),a.radius=f,a};var D=new t.Cartesian3;l.expand=function(e,r,n){n=l.clone(e,n);var a=t.Cartesian3.magnitude(t.Cartesian3.subtract(r,n.center,D));return a>n.radius&&(n.radius=a),n},l.intersectPlane=function(e,r){var n=e.center,a=e.radius,i=r.normal,o=t.Cartesian3.dot(i,n)+r.distance;return o<-a?s.OUTSIDE:o0&&t.height>0,e.resolve(_e._result)},t.onerror=function(){_e._result=!1,e.resolve(_e._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.promise},Object.defineProperties(_e,{initialized:{get:function(){return n.defined(_e._result)}}});var be=[];"undefined"!=typeof ArrayBuffer&&(be.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),"undefined"!=typeof Uint8ClampedArray&&be.push(Uint8ClampedArray),"undefined"!=typeof Uint8ClampedArray&&be.push(Uint8ClampedArray),"undefined"!=typeof BigInt64Array&&be.push(BigInt64Array),"undefined"!=typeof BigUint64Array&&be.push(BigUint64Array));var xe={isChrome:he,chromeVersion:function(){return he()&&J},isSafari:me,safariVersion:function(){return me()&&X},isWebkit:ge,webkitVersion:function(){return ge()&&ee},isInternetExplorer:ve,internetExplorerVersion:function(){return ve()&&re},isEdge:ye,edgeVersion:function(){return ye()&&ae},isFirefox:we,firefoxVersion:function(){return we()&&oe},isWindows:function(){return n.defined(se)||(se=/Windows/i.test(Z.appVersion)),se},hardwareConcurrency:n.defaultValue(Z.hardwareConcurrency,3),supportsPointerEvents:function(){return n.defined(ue)||(ue=!we()&&"undefined"!=typeof PointerEvent&&(!n.defined(Z.pointerEnabled)||Z.pointerEnabled)),ue},supportsImageRenderingPixelated:Ce,supportsWebP:_e,imageRenderingValue:function(){return Ce()?le:void 0},typedArrayTypes:be};function Se(e,t,r,a){this.x=n.defaultValue(e,0),this.y=n.defaultValue(t,0),this.z=n.defaultValue(r,0),this.w=n.defaultValue(a,0)}xe.supportsBasis=function(e){return xe.supportsWebAssembly()&&e.context.supportsBasis},xe.supportsFullscreen=function(){return fe.supportsFullscreen()},xe.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},xe.supportsBigInt64Array=function(){return"undefined"!=typeof BigInt64Array},xe.supportsBigUint64Array=function(){return"undefined"!=typeof BigUint64Array},xe.supportsBigInt=function(){return"undefined"!=typeof BigInt},xe.supportsWebWorkers=function(){return"undefined"!=typeof Worker},xe.supportsWebAssembly=function(){return"undefined"!=typeof WebAssembly&&!xe.isEdge()};var Ee=new t.Cartesian3;Se.fromAxisAngle=function(e,r,a){var i=r/2,o=Math.sin(i),s=(Ee=t.Cartesian3.normalize(e,Ee)).x*o,u=Ee.y*o,l=Ee.z*o,c=Math.cos(i);return n.defined(a)?(a.x=s,a.y=u,a.z=l,a.w=c,a):new Se(s,u,l,c)};var Ae=[1,2,0],Oe=new Array(3);Se.fromRotationMatrix=function(e,r){var a,i,o,s,u,l=e[t.Matrix3.COLUMN0ROW0],c=e[t.Matrix3.COLUMN1ROW1],d=e[t.Matrix3.COLUMN2ROW2],f=l+c+d;if(f>0)u=.5*(a=Math.sqrt(f+1)),a=.5/a,i=(e[t.Matrix3.COLUMN1ROW2]-e[t.Matrix3.COLUMN2ROW1])*a,o=(e[t.Matrix3.COLUMN2ROW0]-e[t.Matrix3.COLUMN0ROW2])*a,s=(e[t.Matrix3.COLUMN0ROW1]-e[t.Matrix3.COLUMN1ROW0])*a;else{var p=0;c>l&&(p=1),d>l&&d>c&&(p=2);var h=Ae[p],m=Ae[h];a=Math.sqrt(e[t.Matrix3.getElementIndex(p,p)]-e[t.Matrix3.getElementIndex(h,h)]-e[t.Matrix3.getElementIndex(m,m)]+1);var g=Oe;g[p]=.5*a,a=.5/a,u=(e[t.Matrix3.getElementIndex(m,h)]-e[t.Matrix3.getElementIndex(h,m)])*a,g[h]=(e[t.Matrix3.getElementIndex(h,p)]+e[t.Matrix3.getElementIndex(p,h)])*a,g[m]=(e[t.Matrix3.getElementIndex(m,p)]+e[t.Matrix3.getElementIndex(p,m)])*a,i=-g[0],o=-g[1],s=-g[2]}return n.defined(r)?(r.x=i,r.y=o,r.z=s,r.w=u,r):new Se(i,o,s,u)};var Ie=new Se,Re=new Se,Pe=new Se,Te=new Se;Se.fromHeadingPitchRoll=function(e,r){return Te=Se.fromAxisAngle(t.Cartesian3.UNIT_X,e.roll,Ie),Pe=Se.fromAxisAngle(t.Cartesian3.UNIT_Y,-e.pitch,r),r=Se.multiply(Pe,Te,Pe),Re=Se.fromAxisAngle(t.Cartesian3.UNIT_Z,-e.heading,Ie),Se.multiply(Re,r,r)};var qe=new t.Cartesian3,ze=new t.Cartesian3,Me=new Se,De=new Se,Ue=new Se;Se.packedLength=4,Se.pack=function(e,t,r){return r=n.defaultValue(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},Se.unpack=function(e,t,r){return t=n.defaultValue(t,0),n.defined(r)||(r=new Se),r.x=e[t],r.y=e[t+1],r.z=e[t+2],r.w=e[t+3],r},Se.packedInterpolationLength=3,Se.convertPackedArrayForInterpolation=function(e,t,r,a){Se.unpack(e,4*r,Ue),Se.conjugate(Ue,Ue);for(var i=0,o=r-t+1;i0))return n;o=n-1}return~(o+1)}function tt(e,t,r,n,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=r,this.yPoleOffset=n,this.ut1MinusUtc=a}function rt(e,t,r,n,a,i,o,s){this.year=e,this.month=t,this.day=r,this.hour=n,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=s}function nt(e){return e%4==0&&e%100!=0||e%400==0}function at(e,t){this.julianDate=e,this.offset=t}Ye[7]=He/136,Ze[7]=8*He/17,Se.fastSlerp=function(e,t,r,n){var a,i=Se.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,s=1-r,u=r*r,l=s*s,c=7;c>=0;--c)Ge[c]=(Ye[c]*u-Ze[c])*o,Je[c]=(Ye[c]*l-Ze[c])*o;var d=a*r*(1+Ge[0]*(1+Ge[1]*(1+Ge[2]*(1+Ge[3]*(1+Ge[4]*(1+Ge[5]*(1+Ge[6]*(1+Ge[7])))))))),f=s*(1+Je[0]*(1+Je[1]*(1+Je[2]*(1+Je[3]*(1+Je[4]*(1+Je[5]*(1+Je[6]*(1+Je[7])))))))),p=Se.multiplyByScalar(e,f,We);return Se.multiplyByScalar(t,d,n),Se.add(p,n,n)},Se.fastSquad=function(e,t,r,n,a,i){var o=Se.fastSlerp(e,t,a,Le),s=Se.fastSlerp(r,n,a,Qe);return Se.fastSlerp(o,s,2*a*(1-a),i)},Se.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},Se.equalsEpsilon=function(e,t,r){return r=n.defaultValue(r,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},Se.ZERO=Object.freeze(new Se(0,0,0,0)),Se.IDENTITY=Object.freeze(new Se(0,0,0,1)),Se.prototype.clone=function(e){return Se.clone(this,e)},Se.prototype.equals=function(e){return Se.equals(this,e)},Se.prototype.equalsEpsilon=function(e,t){return Se.equalsEpsilon(this,e,t)},Se.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"};var it=Object.freeze({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:2400000.5}),ot=Object.freeze({UTC:0,TAI:1}),st=new rt,ut=[31,28,31,30,31,30,31,31,30,31,30,31];function lt(e,t){return St.compare(e.julianDate,t.julianDate)}var ct=new at;function dt(e){ct.julianDate=e;var t=St.leapSeconds,r=et(t,ct,lt);r<0&&(r=~r),r>=t.length&&(r=t.length-1);var n=t[r].offset;r>0&&(St.secondsDifference(t[r].julianDate,e)>n&&(n=t[--r].offset));St.addSeconds(e,n,e)}function ft(e,t){ct.julianDate=e;var r=St.leapSeconds,n=et(r,ct,lt);if(n<0&&(n=~n),0===n)return St.addSeconds(e,-r[0].offset,t);if(n>=r.length)return St.addSeconds(e,-r[n-1].offset,t);var a=St.secondsDifference(r[n].julianDate,e);return 0===a?St.addSeconds(e,-r[n].offset,t):a<=1?void 0:St.addSeconds(e,-r[--n].offset,t)}function pt(e,t,r){var n=t/it.SECONDS_PER_DAY|0;return e+=n,(t-=it.SECONDS_PER_DAY*n)<0&&(e--,t+=it.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function ht(e,t,r,n,a,i,o){var s=(t-14)/12|0,u=e+4800+s,l=(1461*u/4|0)+(367*(t-2-12*s)/12|0)-(3*((u+100)/100|0)/4|0)+r-32075;(n-=12)<0&&(n+=24);var c=i+(n*it.SECONDS_PER_HOUR+a*it.SECONDS_PER_MINUTE+o*it.SECONDS_PER_MILLISECOND);return c>=43200&&(l-=1),[l,c]}var mt=/^(\d{4})$/,gt=/^(\d{4})-(\d{2})$/,vt=/^(\d{4})-?(\d{3})$/,yt=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,wt=/^(\d{4})-?(\d{2})-?(\d{2})$/,Ct=/([Z+\-])?(\d{2})?:?(\d{2})?$/,_t=/^(\d{2})(\.\d+)?/.source+Ct.source,bt=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Ct.source,xt=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Ct.source;function St(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n.defaultValue(e,0),t=n.defaultValue(t,0),r=n.defaultValue(r,ot.UTC);var a=0|e;pt(a,t+=(e-a)*it.SECONDS_PER_DAY,this),r===ot.UTC&&dt(this)}St.fromGregorianDate=function(e,t){var r=ht(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return n.defined(t)?(pt(r[0],r[1],t),dt(t),t):new St(r[0],r[1],ot.UTC)},St.fromDate=function(e,t){var r=ht(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return n.defined(t)?(pt(r[0],r[1],t),dt(t),t):new St(r[0],r[1],ot.UTC)},St.fromIso8601=function(e,t){var r,a,i,o,s=(e=e.replace(",",".")).split("T"),u=1,l=1,c=0,d=0,f=0,p=0,h=s[0],m=s[1];if(null!==(s=h.match(wt)))r=+s[1],u=+s[2],l=+s[3];else if(null!==(s=h.match(gt)))r=+s[1],u=+s[2];else if(null!==(s=h.match(mt)))r=+s[1];else{var g;if(null!==(s=h.match(vt)))r=+s[1],g=+s[2],i=nt(r);else if(null!==(s=h.match(yt)))r=+s[1],g=7*+s[2]+(+s[3]||0)-new Date(Date.UTC(r,0,4)).getUTCDay()-3;(a=new Date(Date.UTC(r,0,1))).setUTCDate(g),u=a.getUTCMonth()+1,l=a.getUTCDate()}if(i=nt(r),n.defined(m)){null!==(s=m.match(xt))?(c=+s[1],d=+s[2],f=+s[3],p=1e3*+(s[4]||0),o=5):null!==(s=m.match(bt))?(c=+s[1],d=+s[2],f=60*+(s[3]||0),o=4):null!==(s=m.match(_t))&&(c=+s[1],d=60*+(s[2]||0),o=3);var v=s[o],y=+s[o+1],w=+(s[o+2]||0);switch(v){case"+":c-=y,d-=w;break;case"-":c+=y,d+=w;break;case"Z":break;default:d+=new Date(Date.UTC(r,u-1,l,c,d)).getTimezoneOffset()}}var C=60===f;for(C&&f--;d>=60;)d-=60,c++;for(;c>=24;)c-=24,l++;for(a=i&&2===u?29:ut[u-1];l>a;)l-=a,++u>12&&(u-=12,r++),a=i&&2===u?29:ut[u-1];for(;d<0;)d+=60,c--;for(;c<0;)c+=24,l--;for(;l<1;)--u<1&&(u+=12,r--),l+=a=i&&2===u?29:ut[u-1];var _=ht(r,u,l,c,d,f,p);return n.defined(t)?(pt(_[0],_[1],t),dt(t)):t=new St(_[0],_[1],ot.UTC),C&&St.addSeconds(t,1,t),t},St.now=function(e){return St.fromDate(new Date,e)};var Et=new St(0,0,ot.TAI);St.toGregorianDate=function(e,t){var r=!1,a=ft(e,Et);n.defined(a)||(St.addSeconds(e,-1,Et),a=ft(Et,Et),r=!0);var i=a.dayNumber,o=a.secondsOfDay;o>=43200&&(i+=1);var s=i+68569|0,u=4*s/146097|0,l=4e3*((s=s-((146097*u+3)/4|0)|0)+1)/1461001|0,c=80*(s=s-(1461*l/4|0)+31|0)/2447|0,d=s-(2447*c/80|0)|0,f=c+2-12*(s=c/11|0)|0,p=100*(u-49)+l+s|0,h=o/it.SECONDS_PER_HOUR|0,m=o-h*it.SECONDS_PER_HOUR,g=m/it.SECONDS_PER_MINUTE|0,v=0|(m-=g*it.SECONDS_PER_MINUTE),y=(m-v)/it.SECONDS_PER_MILLISECOND;return(h+=12)>23&&(h-=24),r&&(v+=1),n.defined(t)?(t.year=p,t.month=f,t.day=d,t.hour=h,t.minute=g,t.second=v,t.millisecond=y,t.isLeapSecond=r,t):new rt(p,f,d,h,g,v,y,r)},St.toDate=function(e){var t=St.toGregorianDate(e,st),r=t.second;return t.isLeapSecond&&(r-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,r,t.millisecond))},St.toIso8601=function(e,t){var r,a=St.toGregorianDate(e,st),i=a.year,o=a.month,s=a.day,u=a.hour,l=a.minute,c=a.second,d=a.millisecond;return 1e4===i&&1===o&&1===s&&0===u&&0===l&&0===c&&0===d&&(i=9999,o=12,s=31,u=24),n.defined(t)||0===d?n.defined(t)&&0!==t?(r=(.01*d).toFixed(t).replace(".","").slice(0,t),i.toString().padStart(4,"0")+"-"+o.toString().padStart(2,"0")+"-"+s.toString().padStart(2,"0")+"T"+u.toString().padStart(2,"0")+":"+l.toString().padStart(2,"0")+":"+c.toString().padStart(2,"0")+"."+r+"Z"):i.toString().padStart(4,"0")+"-"+o.toString().padStart(2,"0")+"-"+s.toString().padStart(2,"0")+"T"+u.toString().padStart(2,"0")+":"+l.toString().padStart(2,"0")+":"+c.toString().padStart(2,"0")+"Z":(r=(.01*d).toString().replace(".",""),i.toString().padStart(4,"0")+"-"+o.toString().padStart(2,"0")+"-"+s.toString().padStart(2,"0")+"T"+u.toString().padStart(2,"0")+":"+l.toString().padStart(2,"0")+":"+c.toString().padStart(2,"0")+"."+r+"Z")},St.clone=function(e,t){if(n.defined(e))return n.defined(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new St(e.dayNumber,e.secondsOfDay,ot.TAI)},St.compare=function(e,t){var r=e.dayNumber-t.dayNumber;return 0!==r?r:e.secondsOfDay-t.secondsOfDay},St.equals=function(e,t){return e===t||n.defined(e)&&n.defined(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},St.equalsEpsilon=function(e,t,r){return r=n.defaultValue(r,0),e===t||n.defined(e)&&n.defined(t)&&Math.abs(St.secondsDifference(e,t))<=r},St.totalDays=function(e){return e.dayNumber+e.secondsOfDay/it.SECONDS_PER_DAY},St.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*it.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)},St.daysDifference=function(e,t){return e.dayNumber-t.dayNumber+(e.secondsOfDay-t.secondsOfDay)/it.SECONDS_PER_DAY},St.computeTaiMinusUtc=function(e){ct.julianDate=e;var t=St.leapSeconds,r=et(t,ct,lt);return r<0&&(r=~r,--r<0&&(r=0)),t[r].offset},St.addSeconds=function(e,t,r){return pt(e.dayNumber,e.secondsOfDay+t,r)},St.addMinutes=function(e,t,r){var n=e.secondsOfDay+t*it.SECONDS_PER_MINUTE;return pt(e.dayNumber,n,r)},St.addHours=function(e,t,r){var n=e.secondsOfDay+t*it.SECONDS_PER_HOUR;return pt(e.dayNumber,n,r)},St.addDays=function(e,t,r){return pt(e.dayNumber+t,e.secondsOfDay,r)},St.lessThan=function(e,t){return St.compare(e,t)<0},St.lessThanOrEquals=function(e,t){return St.compare(e,t)<=0},St.greaterThan=function(e,t){return St.compare(e,t)>0},St.greaterThanOrEquals=function(e,t){return St.compare(e,t)>=0},St.prototype.clone=function(e){return St.clone(this,e)},St.prototype.equals=function(e){return St.equals(this,e)},St.prototype.equalsEpsilon=function(e,t){return St.equalsEpsilon(this,e,t)},St.prototype.toString=function(){return St.toIso8601(this)},St.leapSeconds=[new at(new St(2441317,43210,ot.TAI),10),new at(new St(2441499,43211,ot.TAI),11),new at(new St(2441683,43212,ot.TAI),12),new at(new St(2442048,43213,ot.TAI),13),new at(new St(2442413,43214,ot.TAI),14),new at(new St(2442778,43215,ot.TAI),15),new at(new St(2443144,43216,ot.TAI),16),new at(new St(2443509,43217,ot.TAI),17),new at(new St(2443874,43218,ot.TAI),18),new at(new St(2444239,43219,ot.TAI),19),new at(new St(2444786,43220,ot.TAI),20),new at(new St(2445151,43221,ot.TAI),21),new at(new St(2445516,43222,ot.TAI),22),new at(new St(2446247,43223,ot.TAI),23),new at(new St(2447161,43224,ot.TAI),24),new at(new St(2447892,43225,ot.TAI),25),new at(new St(2448257,43226,ot.TAI),26),new at(new St(2448804,43227,ot.TAI),27),new at(new St(2449169,43228,ot.TAI),28),new at(new St(2449534,43229,ot.TAI),29),new at(new St(2450083,43230,ot.TAI),30),new at(new St(2450630,43231,ot.TAI),31),new at(new St(2451179,43232,ot.TAI),32),new at(new St(2453736,43233,ot.TAI),33),new at(new St(2454832,43234,ot.TAI),34),new at(new St(2456109,43235,ot.TAI),35),new at(new St(2457204,43236,ot.TAI),36),new at(new St(2457754,43237,ot.TAI),37)];var At=n.createCommonjsModule((function(e,t){!function(r){var a=t&&!t.nodeType&&t,i=e&&!e.nodeType&&e,o="object"==typeof n.commonjsGlobal&&n.commonjsGlobal;o.global!==o&&o.window!==o&&o.self!==o||(r=o);var s,u,l=2147483647,c=36,d=/^xn--/,f=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,g=String.fromCharCode;function v(e){throw new RangeError(h[e])}function y(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function w(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+y((e=e.replace(p,".")).split("."),t).join(".")}function C(e){for(var t,r,n=[],a=0,i=e.length;a=55296&&t<=56319&&a65535&&(t+=g((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=g(e)})).join("")}function b(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function x(e,t,r){var n=0;for(e=r?m(e/700):e>>1,e+=m(e/t);e>455;n+=c)e=m(e/35);return m(n+36*e/(e+38))}function S(e){var t,r,n,a,i,o,s,u,d,f,p,h=[],g=e.length,y=0,w=128,C=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n=128&&v("not-basic"),h.push(e.charCodeAt(n));for(a=r>0?r+1:0;a=g&&v("invalid-input"),((u=(p=e.charCodeAt(a++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:c)>=c||u>m((l-y)/o))&&v("overflow"),y+=u*o,!(u<(d=s<=C?1:s>=C+26?26:s-C));s+=c)o>m(l/(f=c-d))&&v("overflow"),o*=f;C=x(y-i,t=h.length+1,0==i),m(y/t)>l-w&&v("overflow"),w+=m(y/t),y%=t,h.splice(y++,0,w)}return _(h)}function E(e){var t,r,n,a,i,o,s,u,d,f,p,h,y,w,_,S=[];for(h=(e=C(e)).length,t=128,r=0,i=72,o=0;o=t&&pm((l-r)/(y=n+1))&&v("overflow"),r+=(s-t)*y,t=s,o=0;ol&&v("overflow"),p==t){for(u=r,d=c;!(u<(f=d<=i?1:d>=i+26?26:d-i));d+=c)_=u-f,w=c-f,S.push(g(b(f+_%w,0))),u=m(_/w);S.push(g(b(u,0))),i=x(r,y,n==a),r=0,++n}++r,++t}return S.join("")}if(s={version:"1.3.2",ucs2:{decode:C,encode:_},decode:S,encode:E,toASCII:function(e){return w(e,(function(e){return f.test(e)?"xn--"+E(e):e}))},toUnicode:function(e){return w(e,(function(e){return d.test(e)?S(e.slice(4).toLowerCase()):e}))}},a&&i)if(e.exports==a)i.exports=s;else for(u in s)s.hasOwnProperty(u)&&(a[u]=s[u]);else r.punycode=s}(n.commonjsGlobal)})),Ot=n.createCommonjsModule((function(e){ /*! * URI.js - Mutating URLs * IPv6 Support * * Version: 1.19.7 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ * * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * */var t,r;t=n.commonjsGlobal,r=function(e){var t=e&&e.IPv6;return{best:function(e){var t,r,n=e.toLowerCase().split(":"),a=n.length,i=8;for(""===n[0]&&""===n[1]&&""===n[2]?(n.shift(),n.shift()):""===n[0]&&""===n[1]?n.shift():""===n[a-1]&&""===n[a-2]&&n.pop(),-1!==n[(a=n.length)-1].indexOf(".")&&(i=7),t=0;t1;s++)r.splice(0,1);n[o]=r.join("")}var u=-1,l=0,c=0,d=-1,f=!1;for(o=0;ol&&(u=d,l=c)):"0"===n[o]&&(f=!0,d=o,c=1);c>l&&(u=d,l=c),l>1&&n.splice(u,l,""),a=n.length;var p="";for(""===n[0]&&(p=":"),o=0;o=e.length-1)return!1;var n=e.lastIndexOf(".",t-1);if(n<=0||n>=t-1)return!1;var a=r.list[e.slice(t+1)];return!!a&&a.indexOf(" "+e.slice(n+1,t)+" ")>=0},is:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;if(e.lastIndexOf(".",t-1)>=0)return!1;var n=r.list[e.slice(t+1)];return!!n&&n.indexOf(" "+e.slice(0,t)+" ")>=0},get:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return null;var n=e.lastIndexOf(".",t-1);if(n<=0||n>=t-1)return null;var a=r.list[e.slice(t+1)];return a?a.indexOf(" "+e.slice(n+1,t)+" ")<0?null:e.slice(n+1):null},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return r},e.exports?e.exports=r():t.SecondLevelDomains=r(t)})),Rt=n.createCommonjsModule((function(e){ /*! * URI.js - Mutating URLs * * Version: 1.19.7 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ * * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * */var t,r;t=n.commonjsGlobal,r=function(e,t,r,n){var a=n&&n.URI;function i(e,t){var r=arguments.length>=1,n=arguments.length>=2;if(!(this instanceof i))return r?n?new i(e,t):new i(e):new i;if(void 0===e){if(r)throw new TypeError("undefined is not a valid argument for URI");e="undefined"!=typeof location?location.href+"":""}if(null===e&&r)throw new TypeError("null is not a valid argument for URI");return this.href(e),void 0!==t?this.absoluteTo(t):this}i.version="1.19.7";var o=i.prototype,s=Object.prototype.hasOwnProperty;function u(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function l(e){return void 0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function c(e){return"Array"===l(e)}function d(e,t){var r,n,a={};if("RegExp"===l(t))a=null;else if(c(t))for(r=0,n=t.length;r]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,i.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},i.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},i.hostProtocols=["http","https"],i.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,i.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"},i.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)return i.domAttributes[t]}},i.encode=g,i.decode=decodeURIComponent,i.iso8859=function(){i.encode=escape,i.decode=unescape},i.unicode=function(){i.encode=g,i.decode=decodeURIComponent},i.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/gi,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)/gi,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)/gi,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},i.encodeQuery=function(e,t){var r=i.encode(e+"");return void 0===t&&(t=i.escapeQuerySpace),t?r.replace(/%20/g,"+"):r},i.decodeQuery=function(e,t){e+="",void 0===t&&(t=i.escapeQuerySpace);try{return i.decode(t?e.replace(/\+/g,"%20"):e)}catch(t){return e}};var v,y={encode:"encode",decode:"decode"},w=function(e,t){return function(r){try{return i[t](r+"").replace(i.characters[e][t].expression,(function(r){return i.characters[e][t].map[r]}))}catch(e){return r}}};for(v in y)i[v+"PathSegment"]=w("pathname",y[v]),i[v+"UrnPathSegment"]=w("urnpath",y[v]);var C=function(e,t,r){return function(n){var a;a=r?function(e){return i[t](i[r](e))}:i[t];for(var o=(n+"").split(e),s=0,u=o.length;s-1&&(t.fragment=e.substring(r+1)||null,e=e.substring(0,r)),(r=e.indexOf("?"))>-1&&(t.query=e.substring(r+1)||null,e=e.substring(0,r)),"//"===(e=e.replace(/^(https?|ftp|wss?)?:[/\\]*/,"$1://")).substring(0,2)?(t.protocol=null,e=e.substring(2),e=i.parseAuthority(e,t)):(r=e.indexOf(":"))>-1&&(t.protocol=e.substring(0,r)||null,t.protocol&&!t.protocol.match(i.protocol_expression)?t.protocol=void 0:"//"===e.substring(r+1,r+3).replace(/\\/g,"/")?(e=e.substring(r+3),e=i.parseAuthority(e,t)):(e=e.substring(r+1),t.urn=!0)),t.path=e,t},i.parseHost=function(e,t){e||(e="");var r,n,a=(e=e.replace(/\\/g,"/")).indexOf("/");if(-1===a&&(a=e.length),"["===e.charAt(0))r=e.indexOf("]"),t.hostname=e.substring(1,r)||null,t.port=e.substring(r+2,a)||null,"/"===t.port&&(t.port=null);else{var o=e.indexOf(":"),s=e.indexOf("/"),u=e.indexOf(":",o+1);-1!==u&&(-1===s||u-1?a:e.length-1);return o>-1&&(-1===a||o-1?p.slice(0,h)+p.slice(h).replace(o,""):p.replace(o,"")).length<=l[0].length||r.ignore&&r.ignore.test(p))){var v=t(p,c,f=c+p.length,e);void 0!==v?(v=String(v),e=e.slice(0,c)+v+e.slice(f),n.lastIndex=c+v.length):n.lastIndex=f}}return n.lastIndex=0,e},i.ensureValidHostname=function(t,r){var n=!!t,a=!1;if(!!r&&(a=f(i.hostProtocols,r)),a&&!n)throw new TypeError("Hostname cannot be empty, if protocol is "+r);if(t&&t.match(i.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(t).match(i.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},i.ensureValidPort=function(e){if(e){var t=Number(e);if(!(/^[0-9]+$/.test(t)&&t>0&&t<65536))throw new TypeError('Port "'+e+'" is not a valid port')}},i.noConflict=function(e){if(e){var t={URI:this.noConflict()};return n.URITemplate&&"function"==typeof n.URITemplate.noConflict&&(t.URITemplate=n.URITemplate.noConflict()),n.IPv6&&"function"==typeof n.IPv6.noConflict&&(t.IPv6=n.IPv6.noConflict()),n.SecondLevelDomains&&"function"==typeof n.SecondLevelDomains.noConflict&&(t.SecondLevelDomains=n.SecondLevelDomains.noConflict()),t}return n.URI===this&&(n.URI=a),this},o.build=function(e){return!0===e?this._deferred_build=!0:(void 0===e||this._deferred_build)&&(this._string=i.build(this._parts),this._deferred_build=!1),this},o.clone=function(){return new i(this)},o.valueOf=o.toString=function(){return this.build(!1)._string},o.protocol=_("protocol"),o.username=_("username"),o.password=_("password"),o.hostname=_("hostname"),o.port=_("port"),o.query=b("query","?"),o.fragment=b("fragment","#"),o.search=function(e,t){var r=this.query(e,t);return"string"==typeof r&&r.length?"?"+r:r},o.hash=function(e,t){var r=this.fragment(e,t);return"string"==typeof r&&r.length?"#"+r:r},o.pathname=function(e,t){if(void 0===e||!0===e){var r=this._parts.path||(this._parts.hostname?"/":"");return e?(this._parts.urn?i.decodeUrnPath:i.decodePath)(r):r}return this._parts.urn?this._parts.path=e?i.recodeUrnPath(e):"":this._parts.path=e?i.recodePath(e):"/",this.build(!t),this},o.path=o.pathname,o.href=function(e,t){var r;if(void 0===e)return this.toString();this._string="",this._parts=i._parts();var n=e instanceof i,a="object"==typeof e&&(e.hostname||e.path||e.pathname);if(e.nodeName&&(e=e[i.getDomAttribute(e)]||"",a=!1),!n&&a&&void 0!==e.pathname&&(e=e.toString()),"string"==typeof e||e instanceof String)this._parts=i.parse(String(e),this._parts);else{if(!n&&!a)throw new TypeError("invalid input");var o=n?e._parts:e;for(r in o)"query"!==r&&s.call(this._parts,r)&&(this._parts[r]=o[r]);o.query&&this.query(o.query,!1)}return this.build(!t),this},o.is=function(e){var t=!1,n=!1,a=!1,o=!1,s=!1,u=!1,l=!1,c=!this._parts.urn;switch(this._parts.hostname&&(c=!1,n=i.ip4_expression.test(this._parts.hostname),a=i.ip6_expression.test(this._parts.hostname),s=(o=!(t=n||a))&&r&&r.has(this._parts.hostname),u=o&&i.idn_expression.test(this._parts.hostname),l=o&&i.punycode_expression.test(this._parts.hostname)),e.toLowerCase()){case"relative":return c;case"absolute":return!c;case"domain":case"name":return o;case"sld":return s;case"ip":return t;case"ip4":case"ipv4":case"inet4":return n;case"ip6":case"ipv6":case"inet6":return a;case"idn":return u;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return l}return null};var x=o.protocol,S=o.port,E=o.hostname;o.protocol=function(e,t){if(e&&!(e=e.replace(/:(\/\/)?$/,"")).match(i.protocol_expression))throw new TypeError('Protocol "'+e+"\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]");return x.call(this,e,t)},o.scheme=o.protocol,o.port=function(e,t){return this._parts.urn?void 0===e?"":this:(void 0!==e&&(0===e&&(e=null),e&&(":"===(e+="").charAt(0)&&(e=e.substring(1)),i.ensureValidPort(e))),S.call(this,e,t))},o.hostname=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0!==e){var r={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==i.parseHost(e,r))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');e=r.hostname,this._parts.preventInvalidHostname&&i.ensureValidHostname(e,this._parts.protocol)}return E.call(this,e,t)},o.origin=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var r=this.protocol();return this.authority()?(r?r+"://":"")+this.authority():""}var n=i(e);return this.protocol(n.protocol()).authority(n.authority()).build(!t),this},o.host=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildHost(this._parts):"";if("/"!==i.parseHost(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},o.authority=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?i.buildAuthority(this._parts):"";if("/"!==i.parseAuthority(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},o.userinfo=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var r=i.buildUserinfo(this._parts);return r?r.substring(0,r.length-1):r}return"@"!==e[e.length-1]&&(e+="@"),i.parseUserinfo(e,this._parts),this.build(!t),this},o.resource=function(e,t){var r;return void 0===e?this.path()+this.search()+this.hash():(r=i.parse(e),this._parts.path=r.path,this._parts.query=r.query,this._parts.fragment=r.fragment,this.build(!t),this)},o.subdomain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,r)||""}var n=this._parts.hostname.length-this.domain().length,a=this._parts.hostname.substring(0,n),o=new RegExp("^"+u(a));if(e&&"."!==e.charAt(e.length-1)&&(e+="."),-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");return e&&i.ensureValidHostname(e,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(o,e),this.build(!t),this},o.domain=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var r=this._parts.hostname.match(/\./g);if(r&&r.length<2)return this._parts.hostname;var n=this._parts.hostname.length-this.tld(t).length-1;return n=this._parts.hostname.lastIndexOf(".",n-1)+1,this._parts.hostname.substring(n)||""}if(!e)throw new TypeError("cannot set domain empty");if(-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");if(i.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=e;else{var a=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(a,e)}return this.build(!t),this},o.tld=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("boolean"==typeof e&&(t=e,e=void 0),void 0===e){if(!this._parts.hostname||this.is("IP"))return"";var n=this._parts.hostname.lastIndexOf("."),a=this._parts.hostname.substring(n+1);return!0!==t&&r&&r.list[a.toLowerCase()]&&r.get(this._parts.hostname)||a}var i;if(!e)throw new TypeError("cannot set TLD empty");if(e.match(/[^a-zA-Z0-9-]/)){if(!r||!r.is(e))throw new TypeError('TLD "'+e+'" contains characters other than [A-Z0-9]');i=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");i=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(i,e)}return this.build(!t),this},o.directory=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path&&!this._parts.hostname)return"";if("/"===this._parts.path)return"/";var r=this._parts.path.length-this.filename().length-1,n=this._parts.path.substring(0,r)||(this._parts.hostname?"/":"");return e?i.decodePath(n):n}var a=this._parts.path.length-this.filename().length,o=this._parts.path.substring(0,a),s=new RegExp("^"+u(o));return this.is("relative")||(e||(e="/"),"/"!==e.charAt(0)&&(e="/"+e)),e&&"/"!==e.charAt(e.length-1)&&(e+="/"),e=i.recodePath(e),this._parts.path=this._parts.path.replace(s,e),this.build(!t),this},o.filename=function(e,t){if(this._parts.urn)return void 0===e?"":this;if("string"!=typeof e){if(!this._parts.path||"/"===this._parts.path)return"";var r=this._parts.path.lastIndexOf("/"),n=this._parts.path.substring(r+1);return e?i.decodePathSegment(n):n}var a=!1;"/"===e.charAt(0)&&(e=e.substring(1)),e.match(/\.?\//)&&(a=!0);var o=new RegExp(u(this.filename())+"$");return e=i.recodePath(e),this._parts.path=this._parts.path.replace(o,e),a?this.normalizePath(t):this.build(!t),this},o.suffix=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e||!0===e){if(!this._parts.path||"/"===this._parts.path)return"";var r,n,a=this.filename(),o=a.lastIndexOf(".");return-1===o?"":(r=a.substring(o+1),n=/^[a-z0-9%]+$/i.test(r)?r:"",e?i.decodePathSegment(n):n)}"."===e.charAt(0)&&(e=e.substring(1));var s,l=this.suffix();if(l)s=e?new RegExp(u(l)+"$"):new RegExp(u("."+l)+"$");else{if(!e)return this;this._parts.path+="."+i.recodePath(e)}return s&&(e=i.recodePath(e),this._parts.path=this._parts.path.replace(s,e)),this.build(!t),this},o.segment=function(e,t,r){var n=this._parts.urn?":":"/",a=this.path(),i="/"===a.substring(0,1),o=a.split(n);if(void 0!==e&&"number"!=typeof e&&(r=t,t=e,e=void 0),void 0!==e&&"number"!=typeof e)throw new Error('Bad segment "'+e+'", must be 0-based integer');if(i&&o.shift(),e<0&&(e=Math.max(o.length+e,0)),void 0===t)return void 0===e?o:o[e];if(null===e||void 0===o[e])if(c(t)){o=[];for(var s=0,u=t.length;s0){var o=a.substring(0,i),s=a.substring(i+2);t[o]=s}}return t}(this.responseHeaders))}function Bt(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}function Vt(e,t){return t-e}function Lt(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}function Qt(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}Nt.prototype.cancel=function(){this.cancelled=!0},Nt.prototype.clone=function(e){return n.defined(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=this.RequestState.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new Nt(this)},jt.prototype.toString=function(){var e="Request has failed.";return n.defined(this.statusCode)&&(e+=" Status Code: "+this.statusCode),e},Object.defineProperties(Bt.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),Bt.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);var r=this;return function(){r.removeEventListener(e,t)}},Bt.prototype.removeEventListener=function(e,t){for(var r=this._listeners,n=this._scopes,a=-1,i=0;i0){for(o.sort(Vt),e=0;e=0;--t)this.heapify(t)},Lt.prototype.insert=function(e){var t,r=this._array,a=this._comparator,i=this._maximumLength,o=this._length++;for(oi&&(t=r[i],this._length=i),t},Lt.prototype.pop=function(e){if(e=n.defaultValue(e,0),0!==this._length){var t=this._array,r=t[e];return Qt(t,e,--this._length),this.heapify(e),t[this._length]=void 0,r}};var Wt={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},Ht=20,Yt=new Lt({comparator:function(e,t){return e.priority-t.priority}});Yt.maximumLength=Ht,Yt.reserve(Ht);var Zt=[],Gt={},Jt="undefined"!=typeof document?new Rt(document.location.href):new Rt,$t=new Bt;function Xt(){}function Kt(e){n.defined(e.priorityFunction)&&(e.priority=e.priorityFunction())}function er(e){return e.state===kt.UNISSUED&&(e.state=kt.ISSUED,e.deferred=n.when.defer()),e.deferred.promise}function tr(e){var t=er(e);return e.state=kt.ACTIVE,Zt.push(e),++Wt.numberOfActiveRequests,++Wt.numberOfActiveRequestsEver,++Gt[e.serverKey],e.requestFunction().then(function(e){return function(t){if(e.state!==kt.CANCELLED){var r=e.deferred;--Wt.numberOfActiveRequests,--Gt[e.serverKey],$t.raiseEvent(),e.state=kt.RECEIVED,e.deferred=void 0,r.resolve(t)}}}(e)).otherwise(function(e){return function(t){e.state!==kt.CANCELLED&&(++Wt.numberOfFailedRequests,--Wt.numberOfActiveRequests,--Gt[e.serverKey],$t.raiseEvent(t),e.state=kt.FAILED,e.deferred.reject(t))}}(e)),t}function rr(e){var t=e.state===kt.ACTIVE;if(e.state=kt.CANCELLED,++Wt.numberOfCancelledRequests,n.defined(e.deferred)){var r=e.deferred;e.deferred=void 0,r.reject()}t&&(--Wt.numberOfActiveRequests,--Gt[e.serverKey],++Wt.numberOfCancelledActiveRequests),n.defined(e.cancelFunction)&&e.cancelFunction()}Xt.maximumRequests=50,Xt.maximumRequestsPerServer=6,Xt.requestsByServer={"api.cesium.com:443":18,"assets.cesium.com:443":18},Xt.throttleRequests=!0,Xt.debugShowStatistics=!1,Xt.requestCompletedEvent=$t,Object.defineProperties(Xt,{statistics:{get:function(){return Wt}},priorityHeapLength:{get:function(){return Ht},set:function(e){if(ee;){rr(Yt.pop())}Ht=e,Yt.maximumLength=e,Yt.reserve(e)}}}),Xt.serverHasOpenSlots=function(e,t){t=n.defaultValue(t,1);var r=n.defaultValue(Xt.requestsByServer[e],Xt.maximumRequestsPerServer);return Gt[e]+t<=r},Xt.heapHasOpenSlots=function(e){return Yt.length+e<=Ht},Xt.update=function(){var e,t,r=0,n=Zt.length;for(e=0;e0&&(Zt[e-r]=t):++r;Zt.length-=r;var a=Yt.internalArray,i=Yt.length;for(e=0;e0;)(t=Yt.pop()).cancelled?rr(t):!t.throttleByServer||Xt.serverHasOpenSlots(t.serverKey)?(tr(t),++s):rr(t);!function(){if(!Xt.debugShowStatistics)return;0===Wt.numberOfActiveRequests&&Wt.lastNumberOfActiveRequests>0&&(Wt.numberOfAttemptedRequests>0&&(console.log("Number of attempted requests: "+Wt.numberOfAttemptedRequests),Wt.numberOfAttemptedRequests=0),Wt.numberOfCancelledRequests>0&&(console.log("Number of cancelled requests: "+Wt.numberOfCancelledRequests),Wt.numberOfCancelledRequests=0),Wt.numberOfCancelledActiveRequests>0&&(console.log("Number of cancelled active requests: "+Wt.numberOfCancelledActiveRequests),Wt.numberOfCancelledActiveRequests=0),Wt.numberOfFailedRequests>0&&(console.log("Number of failed requests: "+Wt.numberOfFailedRequests),Wt.numberOfFailedRequests=0));Wt.lastNumberOfActiveRequests=Wt.numberOfActiveRequests}()},Xt.getServerKey=function(e){var t=new Rt(e);""===t.scheme()&&(t=new Rt(e).absoluteTo(Jt)).normalize();var r=t.authority();/:/.test(r)||(r=r+":"+("https"===t.scheme()?"443":"80"));var a=Gt[r];return n.defined(a)||(Gt[r]=0),r},Xt.request=function(e){if(Ut(e.url)||Mt(e.url))return $t.raiseEvent(),e.state=kt.RECEIVED,e.requestFunction();if(++Wt.numberOfAttemptedRequests,n.defined(e.serverKey)||(e.serverKey=Xt.getServerKey(e.url)),!Xt.throttleRequests||!e.throttleByServer||Xt.serverHasOpenSlots(e.serverKey)){if(!Xt.throttleRequests||!e.throttle)return tr(e);if(!(Zt.length>=Xt.maximumRequests)){Kt(e);var t=Yt.insert(e);if(n.defined(t)){if(t===e)return;rr(t)}return er(e)}}},Xt.clearForSpecs=function(){for(;Yt.length>0;){rr(Yt.pop())}for(var e=Zt.length,t=0;t0}}}),fr.prototype.toString=function(){return this.getUrlComponent(!0,!0)},fr.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;var r=new Rt(this._url);e&&ur(r,this);var a=r.toString().replace(/%7B/g,"{").replace(/%7D/g,"}"),i=this._templateValues;return a=a.replace(/{(.*?)}/g,(function(e,t){var r=i[t];return n.defined(r)?encodeURIComponent(r):e})),t&&n.defined(this.proxy)&&(a=this.proxy.getURL(a)),a},fr.prototype.setQueryParameters=function(e,t){this._queryParameters=t?dr(this._queryParameters,e,!1):dr(e,this._queryParameters,!1)},fr.prototype.appendQueryParameters=function(e){this._queryParameters=dr(e,this._queryParameters,!0)},fr.prototype.setTemplateValues=function(e,t){this._templateValues=t?i.combine(this._templateValues,e):i.combine(e,this._templateValues)},fr.prototype.getDerivedResource=function(e){var t=this.clone();if(t._retryCount=0,n.defined(e.url)){var r=new Rt(e.url);sr(r,t,!0,n.defaultValue(e.preserveQueryParameters,!1)),r.fragment(""),""!==r.scheme()?t._url=r.toString():t._url=r.absoluteTo(new Rt(Tt(this._url))).toString()}return n.defined(e.queryParameters)&&(t._queryParameters=i.combine(e.queryParameters,t._queryParameters)),n.defined(e.templateValues)&&(t._templateValues=i.combine(e.templateValues,t.templateValues)),n.defined(e.headers)&&(t.headers=i.combine(e.headers,t.headers)),n.defined(e.proxy)&&(t.proxy=e.proxy),n.defined(e.request)&&(t.request=e.request),n.defined(e.retryCallback)&&(t.retryCallback=e.retryCallback),n.defined(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t},fr.prototype.retryOnError=function(e){var t=this.retryCallback;if("function"!=typeof t||this._retryCount>=this.retryAttempts)return n.when(!1);var r=this;return n.when(t(this,e)).then((function(e){return++r._retryCount,e}))},fr.prototype.clone=function(e){return n.defined(e)||(e=new fr({url:this._url})),e._url=this._url,e._queryParameters=Pt(this._queryParameters),e._templateValues=Pt(this._templateValues),e.headers=Pt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e},fr.prototype.getBaseUri=function(e){return function(e,t){var r="",n=e.lastIndexOf("/");return-1!==n&&(r=e.substring(0,n+1)),t?(0!==(e=new Rt(e)).query().length&&(r+="?"+e.query()),0!==e.fragment().length&&(r+="#"+e.fragment()),r):r}(this.getUrlComponent(e),e)},fr.prototype.appendForwardSlash=function(){var e;this._url=(0!==(e=this._url).length&&"/"===e[e.length-1]||(e+="/"),e)},fr.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},fr.fetchArrayBuffer=function(e){return new fr(e).fetchArrayBuffer()},fr.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},fr.fetchBlob=function(e){return new fr(e).fetchBlob()},fr.prototype.fetchImage=function(e){e=n.defaultValue(e,n.defaultValue.EMPTY_OBJECT);var t=n.defaultValue(e.preferImageBitmap,!1),r=n.defaultValue(e.preferBlob,!1),a=n.defaultValue(e.flipY,!1),i=n.defaultValue(e.skipColorSpaceConversion,!1);if(cr(this.request),!or||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!r)return pr({resource:this,flipY:a,skipColorSpaceConversion:i,preferImageBitmap:t});var o,s,u,l=this.fetchBlob();return n.defined(l)?fr.supportsImageBitmapOptions().then((function(e){return o=e&&t,l})).then((function(e){if(n.defined(e)){if(u=e,o)return fr.createImageBitmapFromBlob(e,{flipY:a,premultiplyAlpha:!1,skipColorSpaceConversion:i});var t=window.URL.createObjectURL(e);return pr({resource:s=new fr({url:t}),flipY:a,skipColorSpaceConversion:i,preferImageBitmap:!1})}})).then((function(e){if(n.defined(e))return e.blob=u,o||window.URL.revokeObjectURL(s.url),e})).otherwise((function(e){return n.defined(s)&&window.URL.revokeObjectURL(s.url),e.blob=u,n.when.reject(e)})):void 0},fr.fetchImage=function(e){return new fr(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},fr.prototype.fetchText=function(){return this.fetch({responseType:"text"})},fr.fetchText=function(e){return new fr(e).fetchText()},fr.prototype.fetchJson=function(){var e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(n.defined(e))return e.then((function(e){if(n.defined(e))return JSON.parse(e)}))},fr.fetchJson=function(e){return new fr(e).fetchJson()},fr.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},fr.fetchXML=function(e){return new fr(e).fetchXML()},fr.prototype.fetchJsonp=function(e){var t;e=n.defaultValue(e,"callback"),cr(this.request);do{t="loadJsonp"+a.CesiumMath.nextRandomNumber().toString().substring(2,8)}while(n.defined(window[t]));return hr(this,e,t)},fr.fetchJsonp=function(e){return new fr(e).fetchJsonp(e.callbackParameterName)},fr.prototype._makeRequest=function(e){var t=this;cr(t.request);var r=t.request;r.url=t.url,r.requestFunction=function(){var a=e.responseType,o=i.combine(e.headers,t.headers),s=e.overrideMimeType,u=e.method,l=e.data,c=n.when.defer(),d=fr._Implementations.loadWithXhr(t.url,a,u,l,o,c,s);return n.defined(d)&&n.defined(d.abort)&&(r.cancelFunction=function(){d.abort()}),c.promise};var a=Xt.request(r);if(n.defined(a))return a.then((function(e){return r.cancelFunction=void 0,e})).otherwise((function(a){return r.cancelFunction=void 0,r.state!==kt.FAILED?n.when.reject(a):t.retryOnError(a).then((function(i){return i?(r.state=kt.UNISSUED,r.deferred=void 0,t.fetch(e)):n.when.reject(a)}))}))};var mr=/^data:(.*?)(;base64)?,(.*)$/;function gr(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function vr(e,t){for(var r=gr(e,t),n=new ArrayBuffer(r.length),a=new Uint8Array(n),i=0;it.length-1)return o.xPoleWander=0,o.yPoleWander=0,o.xPoleOffset=0,o.yPoleOffset=0,o.ut1MinusUtc=0,o;var u=t[a],l=t[i];if(u.equals(l)||n.equals(u))return xr(e,r,a,s,o),o;if(n.equals(l))return xr(e,r,i,s,o),o;var c=St.secondsDifference(n,u)/St.secondsDifference(l,u),d=a*s,f=i*s,p=r[d+e._ut1MinusUtcSecondsColumn],h=r[f+e._ut1MinusUtcSecondsColumn],m=h-p;if(m>.5||m<-.5){var g=r[d+e._taiMinusUtcSecondsColumn],v=r[f+e._taiMinusUtcSecondsColumn];g!==v&&(l.equals(n)?p=h:h-=v-g)}return o.xPoleWander=Sr(c,r[d+e._xPoleWanderRadiansColumn],r[f+e._xPoleWanderRadiansColumn]),o.yPoleWander=Sr(c,r[d+e._yPoleWanderRadiansColumn],r[f+e._yPoleWanderRadiansColumn]),o.xPoleOffset=Sr(c,r[d+e._xCelestialPoleOffsetRadiansColumn],r[f+e._xCelestialPoleOffsetRadiansColumn]),o.yPoleOffset=Sr(c,r[d+e._yCelestialPoleOffsetRadiansColumn],r[f+e._yCelestialPoleOffsetRadiansColumn]),o.ut1MinusUtc=Sr(c,p,h),o}function Ar(e,t,r){this.heading=n.defaultValue(e,0),this.pitch=n.defaultValue(t,0),this.roll=n.defaultValue(r,0)}fr._Implementations.loadWithXhr=function(e,t,a,i,o,s,u){var l=mr.exec(e);if(null===l){if(!wr){var c=new XMLHttpRequest;if(nr.contains(e)&&(c.withCredentials=!0),c.open(a,e,!0),n.defined(u)&&n.defined(c.overrideMimeType)&&c.overrideMimeType(u),n.defined(o))for(var d in o)o.hasOwnProperty(d)&&c.setRequestHeader(d,o[d]);n.defined(t)&&(c.responseType=t);var f=!1;return"string"==typeof e&&(f=0===e.indexOf("file://")||"undefined"!=typeof window&&"file://"===window.location.origin),c.onload=function(){if(!(c.status<200||c.status>=300)||f&&0===c.status){var e=c.response,i=c.responseType;if("HEAD"===a||"OPTIONS"===a){var o=c.getAllResponseHeaders().trim().split(/[\r\n]+/),u={};return o.forEach((function(e){var t=e.split(": "),r=t.shift();u[r]=t.join(": ")})),void s.resolve(u)}if(204===c.status)s.resolve();else if(!n.defined(e)||n.defined(t)&&i!==t)if("json"===t&&"string"==typeof e)try{s.resolve(JSON.parse(e))}catch(e){s.reject(e)}else(""===i||"document"===i)&&n.defined(c.responseXML)&&c.responseXML.hasChildNodes()?s.resolve(c.responseXML):""!==i&&"text"!==i||!n.defined(c.responseText)?s.reject(new r.RuntimeError("Invalid XMLHttpRequest response type.")):s.resolve(c.responseText);else s.resolve(e)}else s.reject(new jt(c.status,c.response,c.getAllResponseHeaders()))},c.onerror=function(e){s.reject(new jt)},c.send(i),c}!function(e,t,n,a,i,o,s){var u=require("url").parse(e),l="https:"===u.protocol?require("https"):require("http"),c=require("zlib"),d={protocol:u.protocol,hostname:u.hostname,port:u.port,path:u.path,query:u.query,method:n,headers:i};l.request(d).on("response",(function(e){if(e.statusCode<200||e.statusCode>=300)o.reject(new jt(e.statusCode,e,e.headers));else{var n=[];e.on("data",(function(e){n.push(e)})),e.on("end",(function(){var a=Buffer.concat(n);"gzip"===e.headers["content-encoding"]?c.gunzip(a,(function(e,n){e?o.reject(new r.RuntimeError("Error decompressing response.")):o.resolve(yr(n,t))})):o.resolve(yr(a,t))}))}})).on("error",(function(e){o.reject(new jt)})).end()}(e,t,a,0,o,s)}else s.resolve(function(e,t){t=n.defaultValue(t,"");var r=e[1],a=!!e[2],i=e[3];switch(t){case"":case"text":return gr(a,i);case"arraybuffer":return vr(a,i);case"blob":var o=vr(a,i);return new Blob([o],{type:r});case"document":return(new DOMParser).parseFromString(gr(a,i),r);case"json":return JSON.parse(gr(a,i))}}(l,t))},fr._Implementations.loadAndExecuteScript=function(e,t,r){return function(e){var t=n.when.defer(),r=document.createElement("script");r.async=!0,r.src=e;var a=document.getElementsByTagName("head")[0];return r.onload=function(){r.onload=void 0,a.removeChild(r),t.resolve()},r.onerror=function(e){t.reject(e)},a.appendChild(r),t.promise}(e).otherwise(r.reject)},fr._DefaultImplementations={},fr._DefaultImplementations.createImage=fr._Implementations.createImage,fr._DefaultImplementations.loadWithXhr=fr._Implementations.loadWithXhr,fr._DefaultImplementations.loadAndExecuteScript=fr._Implementations.loadAndExecuteScript,fr.DEFAULT=Object.freeze(new fr({url:"undefined"==typeof document?"":document.location.href.split("?")[0]})),Cr.NONE=Object.freeze({getPromiseToLoad:function(){return n.when.resolve()},compute:function(e,t){return n.defined(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new tt(0,0,0,0,0),t}}),Cr.prototype.getPromiseToLoad=function(){return n.when(this._downloadPromise)},Cr.prototype.compute=function(e,t){if(n.defined(this._samples)){if(n.defined(t)||(t=new tt(0,0,0,0,0)),0===this._samples.length)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;var a=this._dates,i=this._lastIndex,o=0,s=0;if(n.defined(i)){var u=a[i],l=a[i+1],c=St.lessThanOrEquals(u,e),d=!n.defined(l),f=d||St.greaterThanOrEquals(l,e);if(c&&f)return o=i,!d&&l.equals(e)&&++o,s=o+1,Er(this,a,this._samples,e,o,s,t),t}var p=et(a,e,St.compare,this._dateColumn);return p>=0?(p=this._totalSamples&&(u=this._totalSamples-1);for(var l=s/this._samplesPerXysFile|0,c=u/this._samplesPerXysFile|0,d=[],f=l;f<=c;++f)d.push(jr(this,f));return n.when.all(d)},kr.prototype.computeXysRadians=function(e,t,r){var a=Nr(this,e,t);if(!(a<0)){var i=a/this._stepSizeDays|0;if(!(i>=this._totalSamples)){var o=this._interpolationOrder,s=i-(o/2|0);s<0&&(s=0);var u=s+o;u>=this._totalSamples&&(s=(u=this._totalSamples-1)-o)<0&&(s=0);var l=!1,c=this._samples;if(n.defined(c[3*s])||(jr(this,s/this._samplesPerXysFile|0),l=!0),n.defined(c[3*u])||(jr(this,u/this._samplesPerXysFile|0),l=!0),!l){n.defined(r)?(r.x=0,r.y=0,r.s=0):r=new Ur(0,0,0);var d,f,p=a-s*this._stepSizeDays,h=this._work,m=this._denominators,g=this._coef,v=this._xTable;for(d=0;d<=o;++d)h[d]=p-v[d];for(d=0;d<=o;++d){for(g[d]=1,f=0;f<=o;++f)f!==d&&(g[d]*=h[f]);g[d]*=m[d];var y=3*(s+d);r.x+=g[d]*c[y++],r.y+=g[d]*c[y++],r.s+=g[d]*c[y]}return r}}}};var Br={},Vr={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"}},Lr={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Qr={},Wr={east:new t.Cartesian3,north:new t.Cartesian3,up:new t.Cartesian3,west:new t.Cartesian3,south:new t.Cartesian3,down:new t.Cartesian3},Hr=new t.Cartesian3,Yr=new t.Cartesian3,Zr=new t.Cartesian3;Br.localFrameToFixedFrameGenerator=function(e,i){if(!Vr.hasOwnProperty(e)||!Vr[e].hasOwnProperty(i))throw new r.DeveloperError("firstAxis and secondAxis must be east, north, up, west, south or down.");var o,s=Vr[e][i],u=e+i;return n.defined(Qr[u])?o=Qr[u]:(o=function(r,o,u){if(n.defined(u)||(u=new t.Matrix4),t.Cartesian3.equalsEpsilon(r,t.Cartesian3.ZERO,a.CesiumMath.EPSILON14))t.Cartesian3.unpack(Lr[e],0,Hr),t.Cartesian3.unpack(Lr[i],0,Yr),t.Cartesian3.unpack(Lr[s],0,Zr);else if(a.CesiumMath.equalsEpsilon(r.x,0,a.CesiumMath.EPSILON14)&&a.CesiumMath.equalsEpsilon(r.y,0,a.CesiumMath.EPSILON14)){var l=a.CesiumMath.sign(r.z);t.Cartesian3.unpack(Lr[e],0,Hr),"east"!==e&&"west"!==e&&t.Cartesian3.multiplyByScalar(Hr,l,Hr),t.Cartesian3.unpack(Lr[i],0,Yr),"east"!==i&&"west"!==i&&t.Cartesian3.multiplyByScalar(Yr,l,Yr),t.Cartesian3.unpack(Lr[s],0,Zr),"east"!==s&&"west"!==s&&t.Cartesian3.multiplyByScalar(Zr,l,Zr)}else{(o=n.defaultValue(o,t.Ellipsoid.WGS84)).geodeticSurfaceNormal(r,Wr.up);var c=Wr.up,d=Wr.east;d.x=-r.y,d.y=r.x,d.z=0,t.Cartesian3.normalize(d,Wr.east),t.Cartesian3.cross(c,d,Wr.north),t.Cartesian3.multiplyByScalar(Wr.up,-1,Wr.down),t.Cartesian3.multiplyByScalar(Wr.east,-1,Wr.west),t.Cartesian3.multiplyByScalar(Wr.north,-1,Wr.south),Hr=Wr[e],Yr=Wr[i],Zr=Wr[s]}return u[0]=Hr.x,u[1]=Hr.y,u[2]=Hr.z,u[3]=0,u[4]=Yr.x,u[5]=Yr.y,u[6]=Yr.z,u[7]=0,u[8]=Zr.x,u[9]=Zr.y,u[10]=Zr.z,u[11]=0,u[12]=r.x,u[13]=r.y,u[14]=r.z,u[15]=1,u},Qr[u]=o),o},Br.eastNorthUpToFixedFrame=Br.localFrameToFixedFrameGenerator("east","north"),Br.northEastDownToFixedFrame=Br.localFrameToFixedFrameGenerator("north","east"),Br.northUpEastToFixedFrame=Br.localFrameToFixedFrameGenerator("north","up"),Br.northWestUpToFixedFrame=Br.localFrameToFixedFrameGenerator("north","west");var Gr=new Se,Jr=new t.Cartesian3(1,1,1),$r=new t.Matrix4;Br.headingPitchRollToFixedFrame=function(e,r,a,i,o){i=n.defaultValue(i,Br.eastNorthUpToFixedFrame);var s=Se.fromHeadingPitchRoll(r,Gr),u=t.Matrix4.fromTranslationQuaternionRotationScale(t.Cartesian3.ZERO,s,Jr,$r);return o=i(e,a,o),t.Matrix4.multiply(o,u,o)};var Xr=new t.Matrix4,Kr=new t.Matrix3;Br.headingPitchRollQuaternion=function(e,r,n,a,i){var o=Br.headingPitchRollToFixedFrame(e,r,n,a,Xr),s=t.Matrix4.getMatrix3(o,Kr);return Se.fromRotationMatrix(s,i)};var en=new t.Cartesian3(1,1,1),tn=new t.Cartesian3,rn=new t.Matrix4,nn=new t.Matrix4,an=new t.Matrix3,on=new Se;Br.fixedFrameToHeadingPitchRoll=function(e,r,a,i){r=n.defaultValue(r,t.Ellipsoid.WGS84),a=n.defaultValue(a,Br.eastNorthUpToFixedFrame),n.defined(i)||(i=new Ar);var o=t.Matrix4.getTranslation(e,tn);if(t.Cartesian3.equals(o,t.Cartesian3.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;var s=t.Matrix4.inverseTransformation(a(o,r,rn),rn),u=t.Matrix4.setScale(e,en,nn);u=t.Matrix4.setTranslation(u,t.Cartesian3.ZERO,u),s=t.Matrix4.multiply(s,u,s);var l=Se.fromRotationMatrix(t.Matrix4.getMatrix3(s,an),on);return l=Se.normalize(l,l),Ar.fromQuaternion(l,i)};var sn=a.CesiumMath.TWO_PI/86400,un=new St;Br.computeTemeToPseudoFixedMatrix=function(e,r){var i,o=(un=St.addSeconds(e,-St.computeTaiMinusUtc(e),un)).dayNumber,s=un.secondsOfDay,u=o-2451545,l=(24110.54841+(i=s>=43200?(u+.5)/it.DAYS_PER_JULIAN_CENTURY:(u-.5)/it.DAYS_PER_JULIAN_CENTURY)*(8640184.812866+i*(.093104+-62e-7*i)))*sn%a.CesiumMath.TWO_PI+(72921158553e-15+11772758384668e-32*(o-2451545.5))*((s+.5*it.SECONDS_PER_DAY)%it.SECONDS_PER_DAY),c=Math.cos(l),d=Math.sin(l);return n.defined(r)?(r[0]=c,r[1]=-d,r[2]=0,r[3]=d,r[4]=c,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r):new t.Matrix3(c,d,0,-d,c,0,0,0,1)},Br.iau2006XysData=new kr,Br.earthOrientationParameters=Cr.NONE;var ln=32.184;Br.preloadIcrfFixed=function(e){var t=e.start.dayNumber,r=e.start.secondsOfDay+ln,a=e.stop.dayNumber,i=e.stop.secondsOfDay+ln,o=Br.iau2006XysData.preload(t,r,a,i),s=Br.earthOrientationParameters.getPromiseToLoad();return n.when.all([o,s])},Br.computeIcrfToFixedMatrix=function(e,r){n.defined(r)||(r=new t.Matrix3);var a=Br.computeFixedToIcrfMatrix(e,r);if(n.defined(a))return t.Matrix3.transpose(a,r)};var cn=new Ur(0,0,0),dn=new tt(0,0,0,0,0,0),fn=new t.Matrix3,pn=new t.Matrix3;Br.computeFixedToIcrfMatrix=function(e,r){n.defined(r)||(r=new t.Matrix3);var i=Br.earthOrientationParameters.compute(e,dn);if(n.defined(i)){var o=e.dayNumber,s=e.secondsOfDay+ln,u=Br.iau2006XysData.computeXysRadians(o,s,cn);if(n.defined(u)){var l=u.x+i.xPoleOffset,c=u.y+i.yPoleOffset,d=1/(1+Math.sqrt(1-l*l-c*c)),f=fn;f[0]=1-d*l*l,f[3]=-d*l*c,f[6]=l,f[1]=-d*l*c,f[4]=1-d*c*c,f[7]=c,f[2]=-l,f[5]=-c,f[8]=1-d*(l*l+c*c);var p=t.Matrix3.fromRotationZ(-u.s,pn),h=t.Matrix3.multiply(f,p,fn),m=e.dayNumber-2451545,g=(e.secondsOfDay-St.computeTaiMinusUtc(e)+i.ut1MinusUtc)/it.SECONDS_PER_DAY,v=.779057273264+g+.00273781191135448*(m+g);v=v%1*a.CesiumMath.TWO_PI;var y=t.Matrix3.fromRotationZ(v,pn),w=t.Matrix3.multiply(h,y,fn),C=Math.cos(i.xPoleWander),_=Math.cos(i.yPoleWander),b=Math.sin(i.xPoleWander),x=Math.sin(i.yPoleWander),S=o-2451545+s/it.SECONDS_PER_DAY,E=-47e-6*(S/=36525)*a.CesiumMath.RADIANS_PER_DEGREE/3600,A=Math.cos(E),O=Math.sin(E),I=pn;return I[0]=C*A,I[1]=C*O,I[2]=b,I[3]=-_*O+x*b*A,I[4]=_*A+x*b*O,I[5]=-x*C,I[6]=-x*O-_*b*A,I[7]=x*A-_*b*O,I[8]=_*C,t.Matrix3.multiply(w,I,r)}}};var hn=new t.Cartesian4;Br.pointToWindowCoordinates=function(e,t,r,n){return(n=Br.pointToGLWindowCoordinates(e,t,r,n)).y=2*t[5]-n.y,n},Br.pointToGLWindowCoordinates=function(e,r,a,i){n.defined(i)||(i=new t.Cartesian2);var o=hn;return t.Matrix4.multiplyByVector(e,t.Cartesian4.fromElements(a.x,a.y,a.z,1,o),o),t.Cartesian4.multiplyByScalar(o,1/o.w,o),t.Matrix4.multiplyByVector(r,o,o),t.Cartesian2.fromCartesian4(o,i)};var mn=new t.Cartesian3,gn=new t.Cartesian3,vn=new t.Cartesian3;Br.rotationMatrixFromPositionVelocity=function(e,r,i,o){var s=n.defaultValue(i,t.Ellipsoid.WGS84).geodeticSurfaceNormal(e,mn),u=t.Cartesian3.cross(r,s,gn);t.Cartesian3.equalsEpsilon(u,t.Cartesian3.ZERO,a.CesiumMath.EPSILON6)&&(u=t.Cartesian3.clone(t.Cartesian3.UNIT_X,u));var l=t.Cartesian3.cross(u,r,vn);return t.Cartesian3.normalize(l,l),t.Cartesian3.cross(r,l,u),t.Cartesian3.negate(u,u),t.Cartesian3.normalize(u,u),n.defined(o)||(o=new t.Matrix3),o[0]=r.x,o[1]=r.y,o[2]=r.z,o[3]=u.x,o[4]=u.y,o[5]=u.z,o[6]=l.x,o[7]=l.y,o[8]=l.z,o};var yn=new t.Matrix4(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),wn=new t.Cartographic,Cn=new t.Cartesian3,_n=new t.Cartesian3,bn=new t.Matrix3,xn=new t.Matrix4,Sn=new t.Matrix4;Br.basisTo2D=function(e,r,n){var a=t.Matrix4.getTranslation(r,_n),i=e.ellipsoid,o=i.cartesianToCartographic(a,wn),s=e.project(o,Cn);t.Cartesian3.fromElements(s.z,s.x,s.y,s);var u=Br.eastNorthUpToFixedFrame(a,i,xn),l=t.Matrix4.inverseTransformation(u,Sn),c=t.Matrix4.getMatrix3(r,bn),d=t.Matrix4.multiplyByMatrix3(l,c,n);return t.Matrix4.multiply(yn,d,n),t.Matrix4.setTranslation(n,s,n),n},Br.wgs84To2DModelMatrix=function(e,r,n){var a=e.ellipsoid,i=Br.eastNorthUpToFixedFrame(r,a,xn),o=t.Matrix4.inverseTransformation(i,Sn),s=a.cartesianToCartographic(r,wn),u=e.project(s,Cn);t.Cartesian3.fromElements(u.z,u.x,u.y,u);var l=t.Matrix4.fromTranslation(u,xn);return t.Matrix4.multiply(yn,o,n),t.Matrix4.multiply(l,n,n),n},e.BoundingSphere=l,e.FeatureDetection=xe,e.GeographicProjection=o,e.Intersect=s,e.Interval=u,e.Quaternion=Se,e.Resource=fr,e.Transforms=Br,e.buildModuleUrl=Dr}));