define(["exports","./Cartographic-3309dd0d","./Check-7b2a090c","./when-b60132fc","./Cartesian2-47311507","./Math-119be1a3","./PrimitiveType-a54dc62f","./Event-16a2dfbf","./RuntimeError-4a5c8994"],(function(e,t,r,n,a,i,s,o,u){"use strict";function c(e){this._ellipsoid=n.defaultValue(e,a.Ellipsoid.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(c.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),c.prototype.project=function(e,r){var a=this._semimajorAxis,i=e.longitude*a,s=e.latitude*a,o=e.height;return n.defined(r)?(r.x=i,r.y=s,r.z=o,r):new t.Cartesian3(i,s,o)},c.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,s=e.y*a,o=e.z;return n.defined(r)?(r.longitude=i,r.latitude=s,r.height=o,r):new t.Cartographic(i,s,o)};var d=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});function f(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 p=new t.Cartesian3,h=new t.Cartesian3,m=new t.Cartesian3,y=new t.Cartesian3,v=new t.Cartesian3,C=new t.Cartesian3,g=new t.Cartesian3,q=new t.Cartesian3,w=new t.Cartesian3,b=new t.Cartesian3,R=new t.Cartesian3,x=new t.Cartesian3,A=4/3*i.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),s=t.Cartesian3.clone(i,p),o=t.Cartesian3.clone(i,h),u=t.Cartesian3.clone(i,m),c=t.Cartesian3.clone(i,y),d=t.Cartesian3.clone(i,v),f=t.Cartesian3.clone(i,C),A=e.length;for(a=1;ac.x&&t.Cartesian3.clone(i,c),Ed.y&&t.Cartesian3.clone(i,d),Sf.z&&t.Cartesian3.clone(i,f)}var _=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(c,s,q)),I=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(d,o,q)),T=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(f,u,q)),P=s,k=c,U=_;I>U&&(U=I,P=o,k=d),T>U&&(U=T,P=u,k=f);var B=w;B.x=.5*(P.x+k.x),B.y=.5*(P.y+k.y),B.z=.5*(P.z+k.z);var z=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(k,B,q)),D=Math.sqrt(z),V=b;V.x=s.x,V.y=o.y,V.z=u.z;var j=R;j.x=c.x,j.y=d.y,j.z=f.z;var L=t.Cartesian3.midpoint(V,j,x),M=0;for(a=0;aM&&(M=K);var N=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(i,B,q));if(N>z){var F=Math.sqrt(N);z=(D=.5*(D+F))*D;var H=F-D;B.x=(D*B.x+H*i.x)/F,B.y=(D*B.y+H*i.y)/F,B.z=(D*B.z+H*i.z)/F}}return Df.x&&t.Cartesian3.clone(s,f),_A.y&&t.Cartesian3.clone(s,A),IO.z&&t.Cartesian3.clone(s,O)}var T=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(f,u,q)),P=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(A,c,q)),k=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(O,d,q)),U=u,B=f,z=T;P>z&&(z=P,U=c,B=A),k>z&&(z=k,U=d,B=O);var D=w;D.x=.5*(U.x+B.x),D.y=.5*(U.y+B.y),D.z=.5*(U.z+B.z);var V=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(B,D,q)),j=Math.sqrt(V),L=b;L.x=u.x,L.y=c.y,L.z=d.z;var M=R;M.x=f.x,M.y=A.y,M.z=O.z;var K=t.Cartesian3.midpoint(L,M,x),N=0;for(o=0;oN&&(N=F);var H=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(s,D,q));if(H>V){var Y=Math.sqrt(H);V=(j=.5*(j+Y))*j;var J=Y-j;D.x=(j*D.x+J*s.x)/Y,D.y=(j*D.y+J*s.y)/Y,D.z=(j*D.z+J*s.z)/Y}}return jd.x&&t.Cartesian3.clone(i,d),Sf.y&&t.Cartesian3.clone(i,f),_A.z&&t.Cartesian3.clone(i,A)}var I=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(d,o,q)),T=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(f,u,q)),P=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(A,c,q)),k=o,U=d,B=I;T>B&&(B=T,k=u,U=f),P>B&&(B=P,k=c,U=A);var z=w;z.x=.5*(k.x+U.x),z.y=.5*(k.y+U.y),z.z=.5*(k.z+U.z);var D=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(U,z,q)),V=Math.sqrt(D),j=b;j.x=o.x,j.y=u.y,j.z=c.z;var L=R;L.x=d.x,L.y=f.y,L.z=A.z;var M=t.Cartesian3.midpoint(j,L,x),K=0;for(s=0;sK&&(K=N);var F=t.Cartesian3.magnitudeSquared(t.Cartesian3.subtract(i,z,q));if(F>D){var H=Math.sqrt(F);D=(V=.5*(V+H))*V;var Y=H-V;z.x=(V*z.x+Y*i.x)/H,z.y=(V*z.y+Y*i.y)/H,z.z=(V*z.z+Y*i.z)/H}}return V=d+u)return e.clone(a),a;if(u>=d+s)return r.clone(a),a;var f=.5*(s+d+u),p=t.Cartesian3.multiplyByScalar(c,(-s+f)/d,D);return t.Cartesian3.add(p,i,p),t.Cartesian3.clone(p,a.center),a.radius=f,a};var V=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,V));return a>n.radius&&(n.radius=a),n},l.intersectPlane=function(e,r){var n=e.center,a=e.radius,i=r.normal,s=t.Cartesian3.dot(i,n)+r.distance;return s<-a?d.OUTSIDE:s0){var s=a.substring(0,i),o=a.substring(i+2);t[s]=o}}return t}(this.responseHeaders))}function me(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}function ye(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}pe.prototype.cancel=function(){this.cancelled=!0},pe.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 pe(this)},he.prototype.toString=function(){var e="Request has failed.";return n.defined(this.statusCode)&&(e+=" Status Code: "+this.statusCode),e},Object.defineProperties(me.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){this._maximumLength=e,this._length>e&&e>0&&(this._length=e,this._array.length=e)}},comparator:{get:function(){return this._comparator}}}),me.prototype.reserve=function(e){e=n.defaultValue(e,this._length),this._array.length=e},me.prototype.heapify=function(e){e=n.defaultValue(e,0);for(var t=this._length,r=this._comparator,a=this._array,i=-1,s=!0;s;){var o=2*(e+1),u=o-1;i=u=0;--t)this.heapify(t)},me.prototype.insert=function(e){var t,r=this._array,a=this._comparator,i=this._maximumLength,s=this._length++;for(si&&(t=r[i],r.pop(),this._length=i),t},me.prototype.pop=function(e){if(e=n.defaultValue(e,0),0!==this._length){var t=this._array,r=t[e];return ye(t,e,--this._length),t[this._length]=void 0,this.heapify(e),r}};var ve="undefined"!=typeof performance&&"function"==typeof performance.now&&isFinite(performance.now())?function(){return performance.now()}:function(){return Date.now()};function Ce(e,t){return e.priority-t.priority}var ge={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0,totalRequestTime:0},qe=20,we=new me({comparator:Ce});we.maximumLength=qe,we.reserve(qe);var be=[],Re={},xe="undefined"!=typeof document?new Q(document.location.href):new Q,Ae=new o.Event;function Oe(){}function Ee(e){n.defined(e.priorityFunction)&&(e.priority=e.priorityFunction())}function Se(e){var t=n.defaultValue(Oe.requestsByServer[e],Oe.maximumRequestsPerServer);return Re[e]0||e.type!==le.OTHER)&&(ge.totalRequestTime+=e.endTime-e.startTime),e.type===le.BLOCK||e.type===le.BLOCKPACK)){var r=Ie(e);n.defined(Oe.blockDefer[r])&&(Oe.blockDefer[r]=void 0,delete Oe.blockDefer[r])}}}(e)).otherwise(function(e){return function(t){e.state!==fe.CANCELLED&&(++ge.numberOfFailedRequests,--ge.numberOfActiveRequests,--Re[e.serverKey],Ae.raiseEvent(t),e.state=fe.FAILED,e.deferred.reject(t))}}(e)),r}function Ve(e){var t=e.state===fe.ACTIVE;e.state=fe.CANCELLED,++ge.numberOfCancelledRequests,e.deferred.reject(),t&&(--ge.numberOfActiveRequests,--Re[e.serverKey],++ge.numberOfCancelledActiveRequests),n.defined(e.cancelFunction)&&e.cancelFunction()}Oe.TIMEOUT=5e3,Oe.CANCLE_COUNT=3,Oe.statisticRequestTime=-1,Oe.maximumRequests=50,Oe.maximumRequestsPerServer=6,Oe.perPacketCount=20,Oe.requestsByServer={"api.cesium.com:443":18,"assets.cesium.com:443":18},Oe.throttleRequests=!0,Oe.debugShowStatistics=!1,Oe.requestCompletedEvent=Ae,Object.defineProperties(Oe,{activeRequestLength:{get:function(){return be.length}},statistics:{get:function(){return ge}},priorityHeapLength:{get:function(){return qe},set:function(e){if(ee;){Ve(we.pop())}qe=e,we.maximumLength=e,we.reserve(e)}}}),Oe.packRequestGroup={},Oe.packRequestPromise={},Oe.packRequestQuadKey={},Oe.quadKeyIndex={},Oe.packRequestHeap={},Oe.blockDefer={},Oe.blockRequest={},Oe.update=function(){var e,t,r=0,n=be.length;for(e=0;e0&&(be[e-r]=t):++r;be.length-=r;var a=we.internalArray,i=we.length;for(e=0;e0;){var r=t.pop();r.cancelled?Ve(r):Te(r)}Ue()}();for(var s=Math.max(Oe.maximumRequests-be.length,0),o=0;o0;)(t=we.pop()).cancelled?Ve(t):!t.throttleByServer||Se(t.serverKey)?(De(t),++o):Ve(t);!function(){if(!Oe.debugShowStatistics)return;0===ge.numberOfActiveRequests&&ge.lastNumberOfActiveRequests>0&&(ge.numberOfAttemptedRequests>0&&(console.log("Number of attempted requests: "+ge.numberOfAttemptedRequests),ge.numberOfAttemptedRequests=0),ge.numberOfCancelledRequests>0&&(console.log("Number of cancelled requests: "+ge.numberOfCancelledRequests),ge.numberOfCancelledRequests=0),ge.numberOfCancelledActiveRequests>0&&(console.log("Number of cancelled active requests: "+ge.numberOfCancelledActiveRequests),ge.numberOfCancelledActiveRequests=0),ge.numberOfFailedRequests>0&&(console.log("Number of failed requests: "+ge.numberOfFailedRequests),ge.numberOfFailedRequests=0));ge.lastNumberOfActiveRequests=ge.numberOfActiveRequests}()},Oe.getServerKey=function(e){var t=new Q(e).resolve(xe);t.normalize();var r=t.authority;/:/.test(r)||(r=r+":"+("https"===t.scheme?"443":"80"));var a=Re[r];return n.defined(a)||(Re[r]=0),r},Oe.request=function(e){if(de(e.url)||ue(e.url))return Ae.raiseEvent(),e.state=fe.RECEIVED,e.requestFunction();if(++ge.numberOfAttemptedRequests,n.defined(e.serverKey)||(e.serverKey=Oe.getServerKey(e.url)),e.type===le.BLOCK)return function(e){var t=Ie(e),r=Oe.blockDefer[t];return n.defined(r)||(r=Oe.blockDefer[t]=n.when.defer(),Oe.blockRequest[t]=e),e.deferred=r,e.state=fe.ISSUED,e.deferred.promise}(e);if(!e.throttleByServer||Se(e.serverKey)){if(!Oe.throttleRequests||!e.throttle)return De(e);if(!(be.length>=Oe.maximumRequests)){var t;if(Ee(e),e.type===le.PACK||e.type===le.BLOCKPACK){var r=function(e){var t=_e(e),r=Oe.packRequestHeap[t];return n.defined(r)||((r=Oe.packRequestHeap[t]=new me({comparator:Ce})).maximumLength=Oe.perPacketCount,r.reserve(qe)),r}(e),a=!0;if(e.type===le.BLOCKPACK)for(var i=0;i0;){Ve(we.pop())}for(var e=be.length,t=0;t2){var o=r[a].indexOf("=");s=[r[a].substring(0,o),r[a].substring(o+1,r[a].length)]}var u=decodeURIComponent(s[0]),c=s[1];c=n.defined(c)?decodeURIComponent(c):"";var d=t[u];"string"==typeof d?t[u]=[d,c]:Array.isArray(d)?d.push(c):t[u]=c}return t}(s);t._queryParameters=r?Xe(i,t._queryParameters,a):i,e.query=void 0}function Ye(e,t){var r=t._queryParameters,a=Object.keys(r);1!==a.length||n.defined(r[a[0]])?e.query=function(e,t){var r="";for(var n in e)if(e.hasOwnProperty(n)){var a=e[n],i=encodeURIComponent(n)+"=";if(Array.isArray(a))for(var s=0,o=a.length;s0}}}),Qe.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;var r=new Q(this._url);e&&Ye(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},Qe.prototype.setQueryParameters=function(e,t){this._queryParameters=t?Xe(this._queryParameters,e,!1):Xe(e,this._queryParameters,!1)},Qe.prototype.appendQueryParameters=function(e){this._queryParameters=Xe(e,this._queryParameters,!0)},Qe.prototype.setTemplateValues=function(e,t){this._templateValues=t?ae(this._templateValues,e):ae(e,this._templateValues)},Qe.prototype.getDerivedResource=function(e){var t=this.clone();if(t._retryCount=0,n.defined(e.url)){var r=new Q(e.url);He(r,t,!0,n.defaultValue(e.preserveQueryParameters,!1)),r.fragment=void 0,t._url=r.resolve(new Q(ie(this._url))).toString()}return n.defined(e.queryParameters)&&(t._queryParameters=ae(e.queryParameters,t._queryParameters)),n.defined(e.templateValues)&&(t._templateValues=ae(e.templateValues,t.templateValues)),n.defined(e.headers)&&(t.headers=ae(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},Qe.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}))},Qe.prototype.clone=function(e){return n.defined(e)||(e=new Qe({url:this._url})),e._url=this._url,e._queryParameters=ne(this._queryParameters),e._templateValues=ne(this._templateValues),e.headers=ne(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e},Qe.prototype.getBaseUri=function(e){return function(e,t){var r="",a=e.lastIndexOf("/");return-1!==a&&(r=e.substring(0,a+1)),t?(e=new Q(e),n.defined(e.query)&&(r+="?"+e.query),n.defined(e.fragment)&&(r+="#"+e.fragment),r):r}(this.getUrlComponent(e),e)},Qe.prototype.appendForwardSlash=function(){var e;this._url=(0!==(e=this._url).length&&"/"===e[e.length-1]||(e+="/"),e)},Qe.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},Qe.fetchArrayBuffer=function(e){return new Qe(e).fetchArrayBuffer()},Qe.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},Qe.fetchBlob=function(e){return new Qe(e).fetchBlob()},Qe.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);if(Ge(this.request),!Fe||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!r)return Ze({resource:this,flipY:a,preferImageBitmap:t});var i,s,o,u=this.fetchBlob();return n.defined(u)?Qe.supportsImageBitmapOptions().then((function(e){return i=e&&t,u})).then((function(e){if(n.defined(e)){if(o=e,i)return Qe.createImageBitmapFromBlob(e,{flipY:a,premultiplyAlpha:!1});var t=window.URL.createObjectURL(e);return Ze({resource:s=new Qe({url:t}),flipY:a,preferImageBitmap:!1})}})).then((function(e){if(n.defined(e))return e.blob=o,i||window.URL.revokeObjectURL(s.url),e})).otherwise((function(e){return n.defined(s)&&window.URL.revokeObjectURL(s.url),e.blob=o,n.when.reject(e)})):void 0},Qe.fetchImage=function(e){return new Qe(e).fetchImage({flipY:e.flipY,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},Qe.prototype.fetchText=function(){return this.fetch({responseType:"text"})},Qe.fetchText=function(e){return new Qe(e).fetchText()},Qe.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)}))},Qe.fetchJson=function(e){return new Qe(e).fetchJson()},Qe.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},Qe.fetchXML=function(e){return new Qe(e).fetchXML()},Qe.prototype.fetchJsonp=function(e){var t;e=n.defaultValue(e,"callback"),Ge(this.request);do{t="loadJsonp"+Math.random().toString().substring(2,8)}while(n.defined(window[t]));return We(this,e,t)},Qe.fetchJsonp=function(e){return new Qe(e).fetchJsonp(e.callbackParameterName)},Qe.prototype._makeRequest=function(e){var t=this;Ge(t.request);var r=t.request;r.url=t.url,r.requestFunction=function(a){var i=e.responseType,s=ae(e.headers,t.headers),o=e.overrideMimeType,u=e.method,c=e.data,d=n.when.defer(),f=n.defined(a)?a:t.url,l=Qe._Implementations.loadWithXhr(f,i,u,c,s,d,o);return n.defined(l)&&n.defined(l.abort)&&(r.cancelFunction=function(){l.abort()}),d.promise};var a=Oe.request(r);if(n.defined(a))return a.then((function(e){return e})).otherwise((function(a){return r.state!==fe.FAILED?n.when.reject(a):t.retryOnError(a).then((function(i){return i?(r.state=fe.UNISSUED,r.deferred=void 0,t.fetch(e)):n.when.reject(a)}))}))};var $e=/^data:(.*?)(;base64)?,(.*)$/;function et(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function tt(e,t){for(var r=et(e,t),n=new ArrayBuffer(r.length),a=new Uint8Array(n),i=0;i=300)||l&&0===d.status){var e=d.response,a=d.responseType;if("HEAD"===r||"OPTIONS"===r){var i=d.getAllResponseHeaders().trim().split(/[\r\n]+/),o={};return i.forEach((function(e){var t=e.split(": "),r=t.shift();o[r]=t.join(": ")})),void s.resolve(o)}if(204===d.status)s.resolve();else if(!n.defined(e)||n.defined(t)&&a!==t)if("json"===t&&"string"==typeof e)try{s.resolve(JSON.parse(e))}catch(e){s.reject(e)}else(""===a||"document"===a)&&n.defined(d.responseXML)&&d.responseXML.hasChildNodes()?s.resolve(d.responseXML):""!==a&&"text"!==a||!n.defined(d.responseText)?s.reject(new u.RuntimeError("Invalid XMLHttpRequest response type.")):s.resolve(d.responseText);else s.resolve(e)}else s.reject(new he(d.status,d.response,d.getAllResponseHeaders()))},d.onerror=function(e){s.reject(new he)},d.send(a),d}!function(e,t,r,n,a,i,s){var o=require("url").parse(e),c="https:"===o.protocol?require("https"):require("http"),d=require("zlib"),f={protocol:o.protocol,hostname:o.hostname,port:o.port,path:o.path,query:o.query,method:r,headers:a};c.request(f).on("response",(function(e){if(e.statusCode<200||e.statusCode>=300)i.reject(new he(e.statusCode,e,e.headers));else{var r=[];e.on("data",(function(e){r.push(e)})),e.on("end",(function(){var n=Buffer.concat(r);"gzip"===e.headers["content-encoding"]?d.gunzip(n,(function(e,r){e?i.reject(new u.RuntimeError("Error decompressing response.")):i.resolve(rt(r,t))})):i.resolve(rt(n,t))}))}})).on("error",(function(e){i.reject(new he)})).end()}(e,t,r,0,i,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 et(a,i);case"arraybuffer":return tt(a,i);case"blob":var s=tt(a,i);return new Blob([s],{type:r});case"document":return(new DOMParser).parseFromString(et(a,i),r);case"json":return JSON.parse(et(a,i))}}(c,t))},Qe._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)},Qe._DefaultImplementations={},Qe._DefaultImplementations.createImage=Qe._Implementations.createImage,Qe._DefaultImplementations.loadWithXhr=Qe._Implementations.loadWithXhr,Qe._DefaultImplementations.loadAndExecuteScript=Qe._Implementations.loadAndExecuteScript,Qe.DEFAULT=Object.freeze(new Qe({url:"undefined"==typeof document?"":document.location.href.split("?")[0]}));var at,it,st,ot=/((?:.*\/)|^)Cesium\.js$/;function ut(e){return"undefined"==typeof document?e:(n.defined(at)||(at=document.createElement("a")),at.href=e,at.href=at.href,at.href)}function ct(){return n.defined(it)||(e="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:"object"==typeof define&&n.defined(define.amd)&&!define.amd.toUrlUndefined&&n.defined(require.toUrl)?ie("..",lt("Core/buildModuleUrl.js")):function(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;t