define(["exports","./Matrix2-ccd5b911","./RuntimeError-346a3079","./when-4bbc8319","./ComponentDatatype-93750d1a","./combine-83860057"],function(e,I,v,P,c,d){"use strict";function t(e){this._ellipsoid=P.defaultValue(e,I.Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(t.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),t.prototype.project=function(e,t){var r=this._semimajorAxis,n=e.longitude*r,r=e.latitude*r,e=e.height;return P.defined(t)?(t.x=n,t.y=r,t.z=e,t):new I.Cartesian3(n,r,e)},t.prototype.unproject=function(e,t){var r=this._oneOverSemimajorAxis,n=e.x*r,r=e.y*r,e=e.z;return P.defined(t)?(t.longitude=n,t.latitude=r,t.height=e,t):new I.Cartographic(n,r,e)};var a=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function i(e,t){this.start=P.defaultValue(e,0),this.stop=P.defaultValue(t,0)}function T(e,t){this.center=I.Cartesian3.clone(P.defaultValue(e,I.Cartesian3.ZERO)),this.radius=P.defaultValue(t,0)}var q=new I.Cartesian3,z=new I.Cartesian3,M=new I.Cartesian3,D=new I.Cartesian3,U=new I.Cartesian3,k=new I.Cartesian3,F=new I.Cartesian3,N=new I.Cartesian3,j=new I.Cartesian3,B=new I.Cartesian3,V=new I.Cartesian3,L=new I.Cartesian3,r=4/3*c.CesiumMath.PI;T.fromPoints=function(e,t){if(P.defined(t)||(t=new T),!P.defined(e)||0===e.length)return t.center=I.Cartesian3.clone(I.Cartesian3.ZERO,t.center),t.radius=0,t;for(var r=I.Cartesian3.clone(e[0],F),n=I.Cartesian3.clone(r,q),a=I.Cartesian3.clone(r,z),i=I.Cartesian3.clone(r,M),o=I.Cartesian3.clone(r,D),s=I.Cartesian3.clone(r,U),u=I.Cartesian3.clone(r,k),l=e.length,c=1;co.x&&I.Cartesian3.clone(r,o),fs.y&&I.Cartesian3.clone(r,s),pu.z&&I.Cartesian3.clone(r,u)}var h=I.Cartesian3.magnitudeSquared(I.Cartesian3.subtract(o,n,N)),m=I.Cartesian3.magnitudeSquared(I.Cartesian3.subtract(s,a,N)),g=I.Cartesian3.magnitudeSquared(I.Cartesian3.subtract(u,i,N)),y=n,v=o,w=h;hu.x&&I.Cartesian3.clone(a,u),hl.y&&I.Cartesian3.clone(a,l),mc.z&&I.Cartesian3.clone(a,c)}var g=I.Cartesian3.magnitudeSquared(I.Cartesian3.subtract(u,i,N)),y=I.Cartesian3.magnitudeSquared(I.Cartesian3.subtract(l,o,N)),v=I.Cartesian3.magnitudeSquared(I.Cartesian3.subtract(c,s,N)),w=i,C=u,_=g;gs.x&&I.Cartesian3.clone(n,s),pu.y&&I.Cartesian3.clone(n,u),hl.z&&I.Cartesian3.clone(n,l)}var m=I.Cartesian3.magnitudeSquared(I.Cartesian3.subtract(s,a,N)),g=I.Cartesian3.magnitudeSquared(I.Cartesian3.subtract(u,i,N)),y=I.Cartesian3.magnitudeSquared(I.Cartesian3.subtract(l,o,N)),v=a,w=s,C=m;mr.radius&&(r.radius=t),r},T.intersectPlane=function(e,t){var r=e.center,n=e.radius,e=t.normal,t=I.Cartesian3.dot(e,r)+t.distance;return t<-n?a.OUTSIDE:t=t.length?t.length-1:r].offset;0=r.length)return bt.addSeconds(e,-r[n-1].offset,t);var a=bt.secondsDifference(r[n].julianDate,e);return 0===a?bt.addSeconds(e,-r[n].offset,t):a<=1?void 0:bt.addSeconds(e,-r[--n].offset,t)}function ft(e,t,r){var n=t/at.SECONDS_PER_DAY|0;return e+=n,(t-=at.SECONDS_PER_DAY*n)<0&&(e--,t+=at.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function pt(e,t,r,n,a,i,o){var s=(t-14)/12|0,e=e+4800+s,r=(1461*e/4|0)+(367*(t-2-12*s)/12|0)-(3*((e+100)/100|0)/4|0)+r-32075;(n-=12)<0&&(n+=24);o=i+(n*at.SECONDS_PER_HOUR+a*at.SECONDS_PER_MINUTE+o*at.SECONDS_PER_MILLISECOND);return 43200<=o&&--r,[r,o]}var ht=/^(\d{4})$/,mt=/^(\d{4})-(\d{2})$/,gt=/^(\d{4})-?(\d{3})$/,yt=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,vt=/^(\d{4})-?(\d{2})-?(\d{2})$/,be=/([Z+\-])?(\d{2})?:?(\d{2})?$/,wt=/^(\d{2})(\.\d+)?/.source+be.source,Ct=/^(\d{2}):?(\d{2})(\.\d+)?/.source+be.source,_t=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+be.source;function bt(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=P.defaultValue(e,0),t=P.defaultValue(t,0),r=P.defaultValue(r,it.UTC);var n=0|e;ft(n,t+=(e-n)*at.SECONDS_PER_DAY,this),r===it.UTC&&ct(this)}bt.fromGregorianDate=function(e,t){e=pt(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return P.defined(t)?(ft(e[0],e[1],t),ct(t),t):new bt(e[0],e[1],it.UTC)},bt.fromDate=function(e,t){e=pt(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return P.defined(t)?(ft(e[0],e[1],t),ct(t),t):new bt(e[0],e[1],it.UTC)},bt.fromIso8601=function(e,t){var r,n,a,i,o,s=(e=e.replace(",",".")).split("T"),u=1,l=1,c=0,d=0,f=0,p=0,h=s[0],e=s[1];if(null!==(s=h.match(vt))?(a=+s[1],u=+s[2],l=+s[3]):null!==(s=h.match(mt))?(a=+s[1],u=+s[2]):null!==(s=h.match(ht))?a=+s[1]:(null!==(s=h.match(gt))?(a=+s[1],i=+s[2],n=rt(a)):null!==(s=h.match(yt))&&(a=+s[1],i=7*+s[2]+(+s[3]||0)-new Date(Date.UTC(a,0,4)).getUTCDay()-3),(r=new Date(Date.UTC(a,0,1))).setUTCDate(i),u=r.getUTCMonth()+1,l=r.getUTCDate()),n=rt(a),P.defined(e)){null!==(s=e.match(_t))?(c=+s[1],d=+s[2],f=+s[3],p=1e3*+(s[4]||0),o=5):null!==(s=e.match(Ct))?(c=+s[1],d=+s[2],f=60*+(s[3]||0),o=4):null!==(s=e.match(wt))&&(c=+s[1],d=60*+(s[2]||0),o=3);var m=s[o],g=+s[o+1],y=+(s[o+2]||0);switch(m){case"+":c-=g,d-=y;break;case"-":c+=g,d+=y;break;case"Z":break;default:d+=new Date(Date.UTC(a,u-1,l,c,d)).getTimezoneOffset()}}m=60===f;for(m&&f--;60<=d;)d-=60,c++;for(;24<=c;)c-=24,l++;for(r=n&&2===u?29:st[u-1];r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=y-1,w=Math.floor,C=String.fromCharCode;function _(e){throw new RangeError(d[e])}function p(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function h(e,t){var r=e.split("@"),n="";return 1>>10&1023|55296),e=56320|1023&e),t+=C(e)}).join("")}function x(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function S(e,t,r){var n=0;for(e=r?w(e/s):e>>1,e+=w(e/t);f*v>>1w((g-c)/i))&&_("overflow"),c+=s*i,!(s<(s=o<=f?1:f+v<=o?v:o-f));o+=y)i>w(g/(s=y-s))&&_("overflow"),i*=s;f=S(c-a,t=u.length+1,0==a),w(c/t)>g-d&&_("overflow"),d+=w(c/t),c%=t,u.splice(c++,0,d)}return m(u)}function A(e){for(var t,r,n,a,i,o,s,u,l,c,d=[],f=(e=b(e)).length,p=128,h=72,m=t=0;mw((g-t)/(u=r+1))&&_("overflow"),t+=(a-p)*u,p=a,m=0;mg&&_("overflow"),s==p){for(i=t,o=y;!(i<(l=o<=h?1:h+v<=o?v:o-h));o+=y)d.push(C(x(l+(c=i-l)%(l=y-l),0))),i=w(c/l);d.push(C(x(i,0))),h=S(t,u,r==n),t=0,++r}++t,++p}return d.join("")}if(a={version:"1.3.2",ucs2:{decode:b,encode:m},decode:E,encode:A,toASCII:function(e){return h(e,function(e){return l.test(e)?"xn--"+A(e):e})},toUnicode:function(e){return h(e,function(e){return u.test(e)?E(e.slice(4).toLowerCase()):e})}},t&&r)if(O.exports==t)r.exports=a;else for(i in a)a.hasOwnProperty(i)&&(t[i]=a[i]);else e.punycode=a}(P.commonjsGlobal)}),Et=P.createCommonjsModule(function(e){var t,r;t=P.commonjsGlobal,r=function(e){var t=e&&e.IPv6;return{best:function(e){var t,r=e.toLowerCase().split(":"),n=r.length,a=8;for(""===r[0]&&""===r[1]&&""===r[2]?(r.shift(),r.shift()):""===r[0]&&""===r[1]?r.shift():""===r[n-1]&&""===r[n-2]&&r.pop(),-1!==r[(n=r.length)-1].indexOf(".")&&(a=7),t=0;t=e.length-1)return!1;var r=e.lastIndexOf(".",t-1);if(r<=0||t-1<=r)return!1;var n=a.list[e.slice(t+1)];return!!n&&0<=n.indexOf(" "+e.slice(r+1,t)+" ")},is:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;if(0<=e.lastIndexOf(".",t-1))return!1;var r=a.list[e.slice(t+1)];return!!r&&0<=r.indexOf(" "+e.slice(0,t)+" ")},get:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return null;var r=e.lastIndexOf(".",t-1);if(r<=0||t-1<=r)return null;var n=a.list[e.slice(t+1)];return!n||n.indexOf(" "+e.slice(r+1,t)+" ")<0?null:e.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return a},e.exports?e.exports=r():t.SecondLevelDomains=r(t)}),Ot=P.createCommonjsModule(function(e){var t,r;t=P.commonjsGlobal,r=function(s,t,l,r){var n=r&&r.URI;function h(e,t){var r=1<=arguments.length;if(!(this instanceof h))return r?2<=arguments.length?new h(e,t):new h(e):new h;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}h.version="1.19.7";var e=h.prototype,u=Object.prototype.hasOwnProperty;function o(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function c(e){return void 0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}function d(e){return"Array"===c(e)}function f(e,t){var r,n,a={};if("RegExp"===c(t))a=null;else if(d(t))for(r=0,n=t.length;r]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,h.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},h.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},h.hostProtocols=["http","https"],h.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,h.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"},h.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)return h.domAttributes[t]}},h.encode=i,h.decode=decodeURIComponent,h.iso8859=function(){h.encode=escape,h.decode=unescape},h.unicode=function(){h.encode=i,h.decode=decodeURIComponent},h.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"}}}},h.encodeQuery=function(e,t){e=h.encode(e+"");return(t=void 0===t?h.escapeQuerySpace:t)?e.replace(/%20/g,"+"):e},h.decodeQuery=function(t,e){t+="",void 0===e&&(e=h.escapeQuerySpace);try{return h.decode(e?t.replace(/\+/g,"%20"):t)}catch(e){return t}};function y(r,n){return function(t){try{return h[n](t+"").replace(h.characters[r][n].expression,function(e){return h.characters[r][n].map[e]})}catch(e){return t}}}var v,w={encode:"encode",decode:"decode"};for(v in w)h[v+"PathSegment"]=y("pathname",w[v]),h[v+"UrnPathSegment"]=y("urnpath",w[v]);function C(i,o,s){return function(e){for(var t=s?function(e){return h[o](h[s](e))}:h[o],r=(e+"").split(i),n=0,a=r.length;na&&(t=r[a],this._length=a),t},Bt.prototype.pop=function(e){if(e=P.defaultValue(e,0),0!==this._length){var t=this._array,r=t[e];return Vt(t,e,--this._length),this.heapify(e),t[this._length]=void 0,r}};var Lt={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},Qt=20,Wt=new Bt({comparator:function(e,t){return e.priority-t.priority}});Wt.maximumLength=Qt,Wt.reserve(Qt);var Ht=[],Yt={},Zt="undefined"!=typeof document?new Ot(document.location.href):new Ot,Gt=new Nt;function Jt(){}function $t(e){P.defined(e.priorityFunction)&&(e.priority=e.priorityFunction())}function Xt(e){return e.state===Dt.UNISSUED&&(e.state=Dt.ISSUED,e.deferred=P.when.defer()),e.deferred.promise}function Kt(e){var t,r,n=Xt(e);return e.state=Dt.ACTIVE,Ht.push(e),++Lt.numberOfActiveRequests,++Lt.numberOfActiveRequestsEver,++Yt[e.serverKey],e.requestFunction().then((r=e,function(e){var t;r.state!==Dt.CANCELLED&&(t=r.deferred,--Lt.numberOfActiveRequests,--Yt[r.serverKey],Gt.raiseEvent(),r.state=Dt.RECEIVED,r.deferred=void 0,t.resolve(e))})).otherwise((t=e,function(e){t.state!==Dt.CANCELLED&&(++Lt.numberOfFailedRequests,--Lt.numberOfActiveRequests,--Yt[t.serverKey],Gt.raiseEvent(e),t.state=Dt.FAILED,t.deferred.reject(e))})),n}function er(e){var t,r=e.state===Dt.ACTIVE;e.state=Dt.CANCELLED,++Lt.numberOfCancelledRequests,P.defined(e.deferred)&&(t=e.deferred,e.deferred=void 0,t.reject()),r&&(--Lt.numberOfActiveRequests,--Yt[e.serverKey],++Lt.numberOfCancelledActiveRequests),P.defined(e.cancelFunction)&&e.cancelFunction()}Jt.maximumRequests=50,Jt.maximumRequestsPerServer=6,Jt.requestsByServer={"api.cesium.com:443":18,"assets.cesium.com:443":18},Jt.throttleRequests=!0,Jt.debugShowStatistics=!1,Jt.requestCompletedEvent=Gt,Object.defineProperties(Jt,{statistics:{get:function(){return Lt}},priorityHeapLength:{get:function(){return Qt},set:function(e){if(ee;)er(Wt.pop());Qt=e,Wt.maximumLength=e,Wt.reserve(e)}}}),Jt.serverHasOpenSlots=function(e,t){t=P.defaultValue(t,1);var r=P.defaultValue(Jt.requestsByServer[e],Jt.maximumRequestsPerServer);return Yt[e]+t<=r},Jt.heapHasOpenSlots=function(e){return Wt.length+e<=Qt},Jt.update=function(){for(var e,t=0,r=Ht.length,n=0;n=Jt.maximumRequests)){$t(e);var t=Wt.insert(e);if(P.defined(t)){if(t===e)return;er(t)}return Xt(e)}}},Jt.clearForSpecs=function(){for(;0=this.retryAttempts)return P.when(!1);var r=this;return P.when(t(this,e)).then(function(e){return++r._retryCount,e})},cr.prototype.clone=function(e){return(e=!P.defined(e)?new cr({url:this._url}):e)._url=this._url,e._queryParameters=Rt(this._queryParameters),e._templateValues=Rt(this._templateValues),e.headers=Rt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e},cr.prototype.getBaseUri=function(e){return t=this.getUrlComponent(e),r=e,n="",-1!==(e=t.lastIndexOf("/"))&&(n=t.substring(0,e+1)),r&&(0!==(t=new Ot(t)).query().length&&(n+="?"+t.query()),0!==t.fragment().length&&(n+="#"+t.fragment())),n;var t,r,n},cr.prototype.appendForwardSlash=function(){var e;this._url=(0!==(e=this._url).length&&"/"===e[e.length-1]||(e+="/"),e)},cr.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},cr.fetchArrayBuffer=function(e){return new cr(e).fetchArrayBuffer()},cr.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},cr.fetchBlob=function(e){return new cr(e).fetchBlob()},cr.prototype.fetchImage=function(e){e=P.defaultValue(e,P.defaultValue.EMPTY_OBJECT);var t=P.defaultValue(e.preferImageBitmap,!1),r=P.defaultValue(e.preferBlob,!1),n=P.defaultValue(e.flipY,!1),a=P.defaultValue(e.skipColorSpaceConversion,!1);if(ur(this.request),!ar||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!r)return dr({resource:this,flipY:n,skipColorSpaceConversion:a,preferImageBitmap:t});var i,o,s,u=this.fetchBlob();return P.defined(u)?cr.supportsImageBitmapOptions().then(function(e){return i=e&&t,u}).then(function(e){if(P.defined(e)){if(s=e,i)return cr.createImageBitmapFromBlob(e,{flipY:n,premultiplyAlpha:!1,skipColorSpaceConversion:a});e=window.URL.createObjectURL(e);return dr({resource:o=new cr({url:e}),flipY:n,skipColorSpaceConversion:a,preferImageBitmap:!1})}}).then(function(e){if(P.defined(e))return e.blob=s,i||window.URL.revokeObjectURL(o.url),e}).otherwise(function(e){return P.defined(o)&&window.URL.revokeObjectURL(o.url),e.blob=s,P.when.reject(e)}):void 0},cr.fetchImage=function(e){return new cr(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},cr.prototype.fetchText=function(){return this.fetch({responseType:"text"})},cr.fetchText=function(e){return new cr(e).fetchText()},cr.prototype.fetchJson=function(){var e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(P.defined(e))return e.then(function(e){if(P.defined(e))return JSON.parse(e)})},cr.fetchJson=function(e){return new cr(e).fetchJson()},cr.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},cr.fetchXML=function(e){return new cr(e).fetchXML()},cr.prototype.fetchJsonp=function(e){var t;for(e=P.defaultValue(e,"callback"),ur(this.request);t="loadJsonp"+c.CesiumMath.nextRandomNumber().toString().substring(2,8),P.defined(window[t]););return function r(n,a,i){var e={};e[a]=i;n.setQueryParameters(e);var o=n.request;o.url=n.url;o.requestFunction=function(){var t=P.when.defer();return window[i]=function(e){t.resolve(e);try{delete window[i]}catch(e){window[i]=void 0}},cr._Implementations.loadAndExecuteScript(n.url,i,t),t.promise};e=Jt.request(o);if(!P.defined(e))return;return e.otherwise(function(t){return o.state!==Dt.FAILED?P.when.reject(t):n.retryOnError(t).then(function(e){return e?(o.state=Dt.UNISSUED,o.deferred=void 0,r(n,a,i)):P.when.reject(t)})})}(this,e,t)},cr.fetchJsonp=function(e){return new cr(e).fetchJsonp(e.callbackParameterName)},cr.prototype._makeRequest=function(s){var u=this;ur(u.request);var l=u.request;l.url=u.url,l.requestFunction=function(){var e=s.responseType,t=d.combine(s.headers,u.headers),r=s.overrideMimeType,n=s.method,a=s.data,i=P.when.defer(),o=cr._Implementations.loadWithXhr(u.url,e,n,a,t,i,r);return P.defined(o)&&P.defined(o.abort)&&(l.cancelFunction=function(){o.abort()}),i.promise};var e=Jt.request(l);if(P.defined(e))return e.then(function(e){return l.cancelFunction=void 0,e}).otherwise(function(t){return l.cancelFunction=void 0,l.state!==Dt.FAILED?P.when.reject(t):u.retryOnError(t).then(function(e){return e?(l.state=Dt.UNISSUED,l.deferred=void 0,u.fetch(s)):P.when.reject(t)})})};var fr=/^data:(.*?)(;base64)?,(.*)$/;function pr(e,t){t=decodeURIComponent(t);return e?atob(t):t}function hr(e,t){for(var r=pr(e,t),t=new ArrayBuffer(r.length),n=new Uint8Array(t),a=0;at.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 Cr(e,r,a,s,o),o;if(n.equals(l))return Cr(e,r,i,s,o),o;var c=bt.secondsDifference(n,u)/bt.secondsDifference(l,u),d=a*s,t=i*s,u=r[d+e._ut1MinusUtcSecondsColumn],a=r[t+e._ut1MinusUtcSecondsColumn],i=a-u;return!(.5=this._totalSamples&&(n=this._totalSamples-1);for(var t=(t=t<0?0:t)/this._samplesPerXysFile|0,a=n/this._samplesPerXysFile|0,i=[],o=t;o<=a;++o)i.push(kr(this,o));return P.when.all(i)},Mr.prototype.computeXysRadians=function(e,t,r){var n=Ur(this,e,t);if(!(n<0)){e=n/this._stepSizeDays|0;if(!(e>=this._totalSamples)){var a=this._interpolationOrder,i=e-(a/2|0),t=(i=i<0?0:i)+a;t>=this._totalSamples&&(i=(t=this._totalSamples-1)-a)<0&&(i=0);var e=!1,o=this._samples;if(P.defined(o[3*i])||(kr(this,i/this._samplesPerXysFile|0),e=!0),P.defined(o[3*t])||(kr(this,t/this._samplesPerXysFile|0),e=!0),!e){P.defined(r)?(r.x=0,r.y=0,r.s=0):r=new zr(0,0,0);for(var s,u=n-i*this._stepSizeDays,l=this._work,c=this._denominators,d=this._coef,f=this._xTable,p=0;p<=a;++p)l[p]=u-f[p];for(p=0;p<=a;++p){for(d[p]=1,s=0;s<=a;++s)s!==p&&(d[p]*=l[s]);d[p]*=c[p];var h=3*(i+p);r.x+=d[p]*o[h++],r.y+=d[p]*o[h++],r.s+=d[p]*o[h]}return r}}}};var Fr={},Nr={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"}},jr={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Br={},Vr={east:new I.Cartesian3,north:new I.Cartesian3,up:new I.Cartesian3,west:new I.Cartesian3,south:new I.Cartesian3,down:new I.Cartesian3},Lr=new I.Cartesian3,Qr=new I.Cartesian3,Wr=new I.Cartesian3;Fr.localFrameToFixedFrameGenerator=function(a,i){if(!Nr.hasOwnProperty(a)||!Nr[a].hasOwnProperty(i))throw new v.DeveloperError("firstAxis and secondAxis must be east, north, up, west, south or down.");var e,o=Nr[a][i],t=a+i;return P.defined(Br[t])?e=Br[t]:(e=function(e,t,r){var n;return P.defined(r)||(r=new I.Matrix4),I.Cartesian3.equalsEpsilon(e,I.Cartesian3.ZERO,c.CesiumMath.EPSILON14)?(I.Cartesian3.unpack(jr[a],0,Lr),I.Cartesian3.unpack(jr[i],0,Qr),I.Cartesian3.unpack(jr[o],0,Wr)):c.CesiumMath.equalsEpsilon(e.x,0,c.CesiumMath.EPSILON14)&&c.CesiumMath.equalsEpsilon(e.y,0,c.CesiumMath.EPSILON14)?(n=c.CesiumMath.sign(e.z),I.Cartesian3.unpack(jr[a],0,Lr),"east"!==a&&"west"!==a&&I.Cartesian3.multiplyByScalar(Lr,n,Lr),I.Cartesian3.unpack(jr[i],0,Qr),"east"!==i&&"west"!==i&&I.Cartesian3.multiplyByScalar(Qr,n,Qr),I.Cartesian3.unpack(jr[o],0,Wr),"east"!==o&&"west"!==o&&I.Cartesian3.multiplyByScalar(Wr,n,Wr)):((t=P.defaultValue(t,I.Ellipsoid.WGS84)).geodeticSurfaceNormal(e,Vr.up),n=Vr.up,(t=Vr.east).x=-e.y,t.y=e.x,t.z=0,I.Cartesian3.normalize(t,Vr.east),I.Cartesian3.cross(n,t,Vr.north),I.Cartesian3.multiplyByScalar(Vr.up,-1,Vr.down),I.Cartesian3.multiplyByScalar(Vr.east,-1,Vr.west),I.Cartesian3.multiplyByScalar(Vr.north,-1,Vr.south),Lr=Vr[a],Qr=Vr[i],Wr=Vr[o]),r[0]=Lr.x,r[1]=Lr.y,r[2]=Lr.z,r[3]=0,r[4]=Qr.x,r[5]=Qr.y,r[6]=Qr.z,r[7]=0,r[8]=Wr.x,r[9]=Wr.y,r[10]=Wr.z,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},Br[t]=e),e},Fr.eastNorthUpToFixedFrame=Fr.localFrameToFixedFrameGenerator("east","north"),Fr.northEastDownToFixedFrame=Fr.localFrameToFixedFrameGenerator("north","east"),Fr.northUpEastToFixedFrame=Fr.localFrameToFixedFrameGenerator("north","up"),Fr.northWestUpToFixedFrame=Fr.localFrameToFixedFrameGenerator("north","west");var Hr=new Se,Yr=new I.Cartesian3(1,1,1),Zr=new I.Matrix4;Fr.headingPitchRollToFixedFrame=function(e,t,r,n,a){n=P.defaultValue(n,Fr.eastNorthUpToFixedFrame);t=Se.fromHeadingPitchRoll(t,Hr),t=I.Matrix4.fromTranslationQuaternionRotationScale(I.Cartesian3.ZERO,t,Yr,Zr);return a=n(e,r,a),I.Matrix4.multiply(a,t,a)};var Gr=new I.Matrix4,Jr=new I.Matrix3;Fr.headingPitchRollQuaternion=function(e,t,r,n,a){n=Fr.headingPitchRollToFixedFrame(e,t,r,n,Gr),n=I.Matrix4.getMatrix3(n,Jr);return Se.fromRotationMatrix(n,a)};var $r=new I.Cartesian3(1,1,1),Xr=new I.Cartesian3,Kr=new I.Matrix4,en=new I.Matrix4,tn=new I.Matrix3,rn=new Se;Fr.fixedFrameToHeadingPitchRoll=function(e,t,r,n){t=P.defaultValue(t,I.Ellipsoid.WGS84),r=P.defaultValue(r,Fr.eastNorthUpToFixedFrame),P.defined(n)||(n=new xr);var a=I.Matrix4.getTranslation(e,Xr);if(I.Cartesian3.equals(a,I.Cartesian3.ZERO))return n.heading=0,n.pitch=0,n.roll=0,n;t=I.Matrix4.inverseTransformation(r(a,t,Kr),Kr),e=I.Matrix4.setScale(e,$r,en),e=I.Matrix4.setTranslation(e,I.Cartesian3.ZERO,e),t=I.Matrix4.multiply(t,e,t),t=Se.fromRotationMatrix(I.Matrix4.getMatrix3(t,tn),rn),t=Se.normalize(t,t);return xr.fromQuaternion(t,n)};var nn=c.CesiumMath.TWO_PI/86400,an=new bt;Fr.computeTemeToPseudoFixedMatrix=function(e,t){var r=(an=bt.addSeconds(e,-bt.computeTaiMinusUtc(e),an)).dayNumber,n=an.secondsOfDay,e=r-2451545,e=43200<=n?(.5+e)/at.DAYS_PER_JULIAN_CENTURY:(e-.5)/at.DAYS_PER_JULIAN_CENTURY,r=(24110.54841+e*(8640184.812866+e*(.093104+-62e-7*e)))*nn%c.CesiumMath.TWO_PI+(72921158553e-15+11772758384668e-32*(r-2451545.5))*((n+.5*at.SECONDS_PER_DAY)%at.SECONDS_PER_DAY),n=Math.cos(r),r=Math.sin(r);return P.defined(t)?(t[0]=n,t[1]=-r,t[2]=0,t[3]=r,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new I.Matrix3(n,r,0,-r,n,0,0,0,1)},Fr.iau2006XysData=new Mr,Fr.earthOrientationParameters=yr.NONE;var on=32.184;Fr.preloadIcrfFixed=function(e){var t=e.start.dayNumber,r=e.start.secondsOfDay+on,n=e.stop.dayNumber,e=e.stop.secondsOfDay+on,n=Fr.iau2006XysData.preload(t,r,n,e),e=Fr.earthOrientationParameters.getPromiseToLoad();return P.when.all([n,e])},Fr.computeIcrfToFixedMatrix=function(e,t){P.defined(t)||(t=new I.Matrix3);e=Fr.computeFixedToIcrfMatrix(e,t);if(P.defined(e))return I.Matrix3.transpose(e,t)};var sn=new zr(0,0,0),un=new et(0,0,0,0,0),ln=new I.Matrix3,cn=new I.Matrix3;Fr.computeFixedToIcrfMatrix=function(e,t){P.defined(t)||(t=new I.Matrix3);var r=Fr.earthOrientationParameters.compute(e,un);if(P.defined(r)){var n=e.dayNumber,a=e.secondsOfDay+on,i=Fr.iau2006XysData.computeXysRadians(n,a,sn);if(P.defined(i)){var o=i.x+r.xPoleOffset,s=i.y+r.yPoleOffset,u=1/(1+Math.sqrt(1-o*o-s*s)),l=ln;l[0]=1-u*o*o,l[3]=-u*o*s,l[6]=o,l[1]=-u*o*s,l[4]=1-u*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-u*(o*o+s*s);o=I.Matrix3.fromRotationZ(-i.s,cn),s=I.Matrix3.multiply(l,o,ln),i=e.dayNumber,l=(e.secondsOfDay-bt.computeTaiMinusUtc(e)+r.ut1MinusUtc)/at.SECONDS_PER_DAY,o=(o=.779057273264+l+.00273781191135448*(i-2451545+l))%1*c.CesiumMath.TWO_PI,e=I.Matrix3.fromRotationZ(o,cn),i=I.Matrix3.multiply(s,e,ln),l=Math.cos(r.xPoleWander),o=Math.cos(r.yPoleWander),s=Math.sin(r.xPoleWander),e=Math.sin(r.yPoleWander),r=n-2451545+a/at.SECONDS_PER_DAY,n=-47e-6*(r/=36525)*c.CesiumMath.RADIANS_PER_DEGREE/3600,a=Math.cos(n),r=Math.sin(n),n=cn;return n[0]=l*a,n[1]=l*r,n[2]=s,n[3]=-o*r+e*s*a,n[4]=o*a+e*s*r,n[5]=-e*l,n[6]=-e*r-o*s*a,n[7]=e*a-o*s*r,n[8]=o*l,I.Matrix3.multiply(i,n,t)}}};var dn=new I.Cartesian4;Fr.pointToWindowCoordinates=function(e,t,r,n){return(n=Fr.pointToGLWindowCoordinates(e,t,r,n)).y=2*t[5]-n.y,n},Fr.pointToGLWindowCoordinates=function(e,t,r,n){P.defined(n)||(n=new I.Cartesian2);var a=dn;return I.Matrix4.multiplyByVector(e,I.Cartesian4.fromElements(r.x,r.y,r.z,1,a),a),I.Cartesian4.multiplyByScalar(a,1/a.w,a),I.Matrix4.multiplyByVector(t,a,a),I.Cartesian2.fromCartesian4(a,n)};var fn=new I.Cartesian3,pn=new I.Cartesian3,hn=new I.Cartesian3;Fr.rotationMatrixFromPositionVelocity=function(e,t,r,n){r=P.defaultValue(r,I.Ellipsoid.WGS84).geodeticSurfaceNormal(e,fn),e=I.Cartesian3.cross(t,r,pn);I.Cartesian3.equalsEpsilon(e,I.Cartesian3.ZERO,c.CesiumMath.EPSILON6)&&(e=I.Cartesian3.clone(I.Cartesian3.UNIT_X,e));r=I.Cartesian3.cross(e,t,hn);return I.Cartesian3.normalize(r,r),I.Cartesian3.cross(t,r,e),I.Cartesian3.negate(e,e),I.Cartesian3.normalize(e,e),(n=!P.defined(n)?new I.Matrix3:n)[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=e.x,n[4]=e.y,n[5]=e.z,n[6]=r.x,n[7]=r.y,n[8]=r.z,n};var mn=new I.Matrix4(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),gn=new I.Cartographic,yn=new I.Cartesian3,vn=new I.Cartesian3,wn=new I.Matrix3,Cn=new I.Matrix4,_n=new I.Matrix4;Fr.basisTo2D=function(e,t,r){var n=I.Matrix4.getTranslation(t,vn),a=e.ellipsoid,i=a.cartesianToCartographic(n,gn),i=e.project(i,yn);I.Cartesian3.fromElements(i.z,i.x,i.y,i);a=Fr.eastNorthUpToFixedFrame(n,a,Cn),a=I.Matrix4.inverseTransformation(a,_n),t=I.Matrix4.getMatrix3(t,wn),t=I.Matrix4.multiplyByMatrix3(a,t,r);return I.Matrix4.multiply(mn,t,r),I.Matrix4.setTranslation(r,i,r),r},Fr.wgs84To2DModelMatrix=function(e,t,r){var n=e.ellipsoid,a=Fr.eastNorthUpToFixedFrame(t,n,Cn),a=I.Matrix4.inverseTransformation(a,_n),t=n.cartesianToCartographic(t,gn),t=e.project(t,yn);I.Cartesian3.fromElements(t.z,t.x,t.y,t);t=I.Matrix4.fromTranslation(t,Cn);return I.Matrix4.multiply(mn,a,r),I.Matrix4.multiply(t,r,r),r},e.BoundingSphere=T,e.FeatureDetection=xe,e.GeographicProjection=t,e.Intersect=a,e.Interval=i,e.Quaternion=Se,e.Resource=cr,e.Transforms=Fr,e.buildModuleUrl=qr});