/**
 * @license
 * Cesium - https://github.com/CesiumGS/cesium
 * Version 1.122
 *
 * Copyright 2011-2022 Cesium Contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Columbus View (Pat. Pend.)
 *
 * Portions licensed separately.
 * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
 */
import{a as _,b as Me,c as Oe,d as ze,e as W,f as ft}from"./chunk-RFPX772U.js";import{a as E}from"./chunk-RAYRECQS.js";import{a as Se}from"./chunk-QE3ZUOZY.js";import{a as O}from"./chunk-6KLVDWWE.js";import{a as A,b as s}from"./chunk-6P5KAIBX.js";import{a as _t,c as St,d as Ze,e as p}from"./chunk-4FSVUTPL.js";var Un=St(((e,t)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */!function(r){var n="object"==typeof e&&e&&!e.nodeType&&e,o="object"==typeof t&&t&&!t.nodeType&&t,s="object"==typeof global&&global;(s.global===s||s.window===s||s.self===s)&&(r=s);var i,a,u=2147483647,l=36,c=1,p=26,f=38,h=700,d=72,m=128,y="-",g=/^xn--/,O=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},v=l-c,_=Math.floor,x=String.fromCharCode;function E(e){throw new RangeError(w[e])}function S(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function A(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+S((e=e.replace(b,".")).split("."),t).join(".")}function R(e){for(var t,r,n=[],o=0,s=e.length;o<s;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<s?56320==(64512&(r=e.charCodeAt(o++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--):n.push(t);return n}function I(e){return S(e,(function(e){var t="";return e>65535&&(t+=x((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=x(e)})).join("")}function j(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:l}function T(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function M(e,t,r){var n=0;for(e=r?_(e/h):e>>1,e+=_(e/t);e>v*p>>1;n+=l)e=_(e/v);return _(n+(v+1)*e/(e+f))}function q(e){var t,r,n,o,s,i,a,f,h,g,O=[],b=e.length,w=0,v=m,x=d;for((r=e.lastIndexOf(y))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&E("not-basic"),O.push(e.charCodeAt(n));for(o=r>0?r+1:0;o<b;){for(s=w,i=1,a=l;o>=b&&E("invalid-input"),((f=j(e.charCodeAt(o++)))>=l||f>_((u-w)/i))&&E("overflow"),w+=f*i,!(f<(h=a<=x?c:a>=x+p?p:a-x));a+=l)i>_(u/(g=l-h))&&E("overflow"),i*=g;x=M(w-s,t=O.length+1,0==s),_(w/t)>u-v&&E("overflow"),v+=_(w/t),w%=t,O.splice(w++,0,v)}return I(O)}function U(e){var t,r,n,o,s,i,a,f,h,g,O,b,w,v,S,A=[];for(b=(e=R(e)).length,t=m,r=0,s=d,i=0;i<b;++i)(O=e[i])<128&&A.push(x(O));for(n=o=A.length,o&&A.push(y);n<b;){for(a=u,i=0;i<b;++i)(O=e[i])>=t&&O<a&&(a=O);for(a-t>_((u-r)/(w=n+1))&&E("overflow"),r+=(a-t)*w,t=a,i=0;i<b;++i)if((O=e[i])<t&&++r>u&&E("overflow"),O==t){for(f=r,h=l;!(f<(g=h<=s?c:h>=s+p?p:h-s));h+=l)S=f-g,v=l-g,A.push(x(T(g+S%v,0))),f=_(S/v);A.push(x(T(f,0))),s=M(r,w,n==o),r=0,++n}++r,++t}return A.join("")}if(i={version:"1.3.2",ucs2:{decode:R,encode:I},decode:q,encode:U,toASCII:function(e){return A(e,(function(e){return O.test(e)?"xn--"+U(e):e}))},toUnicode:function(e){return A(e,(function(e){return g.test(e)?q(e.slice(4).toLowerCase()):e}))}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",(function(){return i}));else if(n&&o)if(t.exports==n)o.exports=i;else for(a in i)i.hasOwnProperty(a)&&(n[a]=i[a]);else r.punycode=i}(e)})),zn=St(((e,t)=>{
/*!
 * URI.js - Mutating URLs
 * IPv6 Support
 *
 * Version: 1.19.11
 *
 * Author: Rodney Rehm
 * Web: http://medialize.github.io/URI.js/
 *
 * Licensed under
 *   MIT License http://www.opensource.org/licenses/mit-license
 *
 */
!function(e,r){"use strict";"object"==typeof t&&t.exports?t.exports=r():"function"==typeof define&&define.amd?define(r):e.IPv6=r(e)}(e,(function(e){"use strict";var t=e&&e.IPv6;return{best:function(e){var t,r=e.toLowerCase().split(":"),n=r.length,o=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(".")&&(o=7),t=0;t<n&&""!==r[t];t++);if(t<o)for(r.splice(t,1,"0000");r.length<o;)r.splice(t,0,"0000");for(var s,i=0;i<o;i++){s=r[i].split("");for(var a=0;a<3&&"0"===s[0]&&s.length>1;a++)s.splice(0,1);r[i]=s.join("")}var u=-1,l=0,c=0,p=-1,f=!1;for(i=0;i<o;i++)f?"0"===r[i]?c+=1:(f=!1,c>l&&(u=p,l=c)):"0"===r[i]&&(f=!0,p=i,c=1);c>l&&(u=p,l=c),l>1&&r.splice(u,l,""),n=r.length;var h="";for(""===r[0]&&(h=":"),i=0;i<n&&(h+=r[i],i!==n-1);i++)h+=":";return""===r[n-1]&&(h+=":"),h},noConflict:function(){return e.IPv6===this&&(e.IPv6=t),this}}}))})),Dn=St(((e,t)=>{
/*!
 * URI.js - Mutating URLs
 * Second Level Domain (SLD) Support
 *
 * Version: 1.19.11
 *
 * Author: Rodney Rehm
 * Web: http://medialize.github.io/URI.js/
 *
 * Licensed under
 *   MIT License http://www.opensource.org/licenses/mit-license
 *
 */
!function(e,r){"use strict";"object"==typeof t&&t.exports?t.exports=r():"function"==typeof define&&define.amd?define(r):e.SecondLevelDomains=r(e)}(e,(function(e){"use strict";var t=e&&e.SecondLevelDomains,r={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(e){var t=e.lastIndexOf(".");if(t<=0||t>=e.length-1)return!1;var n=e.lastIndexOf(".",t-1);if(n<=0||n>=t-1)return!1;var o=r.list[e.slice(t+1)];return!!o&&o.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 o=r.list[e.slice(t+1)];return!o||o.indexOf(" "+e.slice(n+1,t)+" ")<0?null:e.slice(n+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return r}))})),We=St(((e,t)=>{
/*!
 * URI.js - Mutating URLs
 *
 * Version: 1.19.11
 *
 * Author: Rodney Rehm
 * Web: http://medialize.github.io/URI.js/
 *
 * Licensed under
 *   MIT License http://www.opensource.org/licenses/mit-license
 *
 */
!function(e,r){"use strict";"object"==typeof t&&t.exports?t.exports=r(Un(),zn(),Dn()):"function"==typeof define&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],r):e.URI=r(e.punycode,e.IPv6,e.SecondLevelDomains,e)}(e,(function(e,t,r,n){"use strict";var o=n&&n.URI;function s(e,t){var r=arguments.length>=1;if(!(this instanceof s))return r?arguments.length>=2?new s(e,t):new s(e):new s;if(void 0===e){if(r)throw new TypeError("undefined is not a valid argument for URI");e=typeof location<"u"?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}s.version="1.19.11";var i=s.prototype,a=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 p(e,t){var r,n,o={};if("RegExp"===l(t))o=null;else if(c(t))for(r=0,n=t.length;r<n;r++)o[t[r]]=!0;else o[t]=!0;for(r=0,n=e.length;r<n;r++){(o&&void 0!==o[e[r]]||!o&&t.test(e[r]))&&(e.splice(r,1),n--,r--)}return e}function f(e,t){var r,n;if(c(t)){for(r=0,n=t.length;r<n;r++)if(!f(e,t[r]))return!1;return!0}var o=l(t);for(r=0,n=e.length;r<n;r++)if("RegExp"===o){if("string"==typeof e[r]&&e[r].match(t))return!0}else if(e[r]===t)return!0;return!1}function h(e,t){if(!c(e)||!c(t)||e.length!==t.length)return!1;e.sort(),t.sort();for(var r=0,n=e.length;r<n;r++)if(e[r]!==t[r])return!1;return!0}function d(e){return e.replace(/^\/+|\/+$/g,"")}function m(e){return escape(e)}function y(e){return encodeURIComponent(e).replace(/[!'()*]/g,m).replace(/\*/g,"%2A")}s._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:s.preventInvalidHostname,duplicateQueryParameters:s.duplicateQueryParameters,escapeQuerySpace:s.escapeQuerySpace}},s.preventInvalidHostname=!1,s.duplicateQueryParameters=!1,s.escapeQuerySpace=!0,s.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,s.idn_expression=/[^a-z0-9\._-]/i,s.punycode_expression=/(xn--)/i,s.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,s.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,s.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,s.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},s.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,s.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},s.hostProtocols=["http","https"],s.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,s.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"},s.getDomAttribute=function(e){if(e&&e.nodeName){var t=e.nodeName.toLowerCase();if("input"!==t||"image"===e.type)return s.domAttributes[t]}},s.encode=y,s.decode=decodeURIComponent,s.iso8859=function(){s.encode=escape,s.decode=unescape},s.unicode=function(){s.encode=y,s.decode=decodeURIComponent},s.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"}}}},s.encodeQuery=function(e,t){var r=s.encode(e+"");return void 0===t&&(t=s.escapeQuerySpace),t?r.replace(/%20/g,"+"):r},s.decodeQuery=function(e,t){e+="",void 0===t&&(t=s.escapeQuerySpace);try{return s.decode(t?e.replace(/\+/g,"%20"):e)}catch{return e}};var g,O={encode:"encode",decode:"decode"},b=function(e,t){return function(r){try{return s[t](r+"").replace(s.characters[e][t].expression,(function(r){return s.characters[e][t].map[r]}))}catch{return r}}};for(g in O)s[g+"PathSegment"]=b("pathname",O[g]),s[g+"UrnPathSegment"]=b("urnpath",O[g]);var w=function(e,t,r){return function(n){var o;o=r?function(e){return s[t](s[r](e))}:s[t];for(var i=(n+"").split(e),a=0,u=i.length;a<u;a++)i[a]=o(i[a]);return i.join(e)}};function v(e){return function(t,r){return void 0===t?this._parts[e]||"":(this._parts[e]=t||null,this.build(!r),this)}}function _(e,t){return function(r,n){return void 0===r?this._parts[e]||"":(null!==r&&((r+="").charAt(0)===t&&(r=r.substring(1))),this._parts[e]=r,this.build(!n),this)}}s.decodePath=w("/","decodePathSegment"),s.decodeUrnPath=w(":","decodeUrnPathSegment"),s.recodePath=w("/","encodePathSegment","decode"),s.recodeUrnPath=w(":","encodeUrnPathSegment","decode"),s.encodeReserved=b("reserved","encode"),s.parse=function(e,t){var r;return t||(t={preventInvalidHostname:s.preventInvalidHostname}),(r=(e=(e=e.replace(s.leading_whitespace_expression,"")).replace(s.ascii_tab_whitespace,"")).indexOf("#"))>-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=e.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://")).replace(/^[/\\]{2,}/i,"//")).substring(0,2)?(t.protocol=null,e=e.substring(2),e=s.parseAuthority(e,t)):(r=e.indexOf(":"))>-1&&(t.protocol=e.substring(0,r)||null,t.protocol&&!t.protocol.match(s.protocol_expression)?t.protocol=void 0:"//"===e.substring(r+1,r+3).replace(/\\/g,"/")?(e=e.substring(r+3),e=s.parseAuthority(e,t)):(e=e.substring(r+1),t.urn=!0)),t.path=e,t},s.parseHost=function(e,t){e||(e="");var r,n,o=(e=e.replace(/\\/g,"/")).indexOf("/");if(-1===o&&(o=e.length),"["===e.charAt(0))r=e.indexOf("]"),t.hostname=e.substring(1,r)||null,t.port=e.substring(r+2,o)||null,"/"===t.port&&(t.port=null);else{var i=e.indexOf(":"),a=e.indexOf("/"),u=e.indexOf(":",i+1);-1!==u&&(-1===a||u<a)?(t.hostname=e.substring(0,o)||null,t.port=null):(n=e.substring(0,o).split(":"),t.hostname=n[0]||null,t.port=n[1]||null)}return t.hostname&&"/"!==e.substring(o).charAt(0)&&(o++,e="/"+e),t.preventInvalidHostname&&s.ensureValidHostname(t.hostname,t.protocol),t.port&&s.ensureValidPort(t.port),e.substring(o)||"/"},s.parseAuthority=function(e,t){return e=s.parseUserinfo(e,t),s.parseHost(e,t)},s.parseUserinfo=function(e,t){var r=e;-1!==e.indexOf("\\")&&(e=e.replace(/\\/g,"/"));var n,o=e.indexOf("/"),i=e.lastIndexOf("@",o>-1?o:e.length-1);return i>-1&&(-1===o||i<o)?(n=e.substring(0,i).split(":"),t.username=n[0]?s.decode(n[0]):null,n.shift(),t.password=n[0]?s.decode(n.join(":")):null,e=r.substring(i+1)):(t.username=null,t.password=null),e},s.parseQuery=function(e,t){if(!e)return{};if(!(e=e.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,"")))return{};for(var r,n,o,i={},u=e.split("&"),l=u.length,c=0;c<l;c++)r=u[c].split("="),n=s.decodeQuery(r.shift(),t),o=r.length?s.decodeQuery(r.join("="),t):null,"__proto__"!==n&&(a.call(i,n)?(("string"==typeof i[n]||null===i[n])&&(i[n]=[i[n]]),i[n].push(o)):i[n]=o);return i},s.build=function(e){var t="",r=!1;return e.protocol&&(t+=e.protocol+":"),!e.urn&&(t||e.hostname)&&(t+="//",r=!0),t+=s.buildAuthority(e)||"","string"==typeof e.path&&("/"!==e.path.charAt(0)&&r&&(t+="/"),t+=e.path),"string"==typeof e.query&&e.query&&(t+="?"+e.query),"string"==typeof e.fragment&&e.fragment&&(t+="#"+e.fragment),t},s.buildHost=function(e){var t="";return e.hostname?(s.ip6_expression.test(e.hostname)?t+="["+e.hostname+"]":t+=e.hostname,e.port&&(t+=":"+e.port),t):""},s.buildAuthority=function(e){return s.buildUserinfo(e)+s.buildHost(e)},s.buildUserinfo=function(e){var t="";return e.username&&(t+=s.encode(e.username)),e.password&&(t+=":"+s.encode(e.password)),t&&(t+="@"),t},s.buildQuery=function(e,t,r){var n,o,i,u,l="";for(o in e)if("__proto__"!==o&&a.call(e,o))if(c(e[o]))for(n={},i=0,u=e[o].length;i<u;i++)void 0!==e[o][i]&&void 0===n[e[o][i]+""]&&(l+="&"+s.buildQueryParameter(o,e[o][i],r),!0!==t&&(n[e[o][i]+""]=!0));else void 0!==e[o]&&(l+="&"+s.buildQueryParameter(o,e[o],r));return l.substring(1)},s.buildQueryParameter=function(e,t,r){return s.encodeQuery(e,r)+(null!==t?"="+s.encodeQuery(t,r):"")},s.addQuery=function(e,t,r){if("object"==typeof t)for(var n in t)a.call(t,n)&&s.addQuery(e,n,t[n]);else{if("string"!=typeof t)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");if(void 0===e[t])return void(e[t]=r);"string"==typeof e[t]&&(e[t]=[e[t]]),c(r)||(r=[r]),e[t]=(e[t]||[]).concat(r)}},s.setQuery=function(e,t,r){if("object"==typeof t)for(var n in t)a.call(t,n)&&s.setQuery(e,n,t[n]);else{if("string"!=typeof t)throw new TypeError("URI.setQuery() accepts an object, string as the name parameter");e[t]=void 0===r?null:r}},s.removeQuery=function(e,t,r){var n,o,i;if(c(t))for(n=0,o=t.length;n<o;n++)e[t[n]]=void 0;else if("RegExp"===l(t))for(i in e)t.test(i)&&(e[i]=void 0);else if("object"==typeof t)for(i in t)a.call(t,i)&&s.removeQuery(e,i,t[i]);else{if("string"!=typeof t)throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter");void 0!==r?"RegExp"===l(r)?!c(e[t])&&r.test(e[t])?e[t]=void 0:e[t]=p(e[t],r):e[t]!==String(r)||c(r)&&1!==r.length?c(e[t])&&(e[t]=p(e[t],r)):e[t]=void 0:e[t]=void 0}},s.hasQuery=function(e,t,r,n){switch(l(t)){case"String":break;case"RegExp":for(var o in e)if(a.call(e,o)&&t.test(o)&&(void 0===r||s.hasQuery(e,o,r)))return!0;return!1;case"Object":for(var i in t)if(a.call(t,i)&&!s.hasQuery(e,i,t[i]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(l(r)){case"Undefined":return t in e;case"Boolean":return r===!!(c(e[t])?e[t].length:e[t]);case"Function":return!!r(e[t],t,e);case"Array":return!!c(e[t])&&(n?f:h)(e[t],r);case"RegExp":return c(e[t])?!!n&&f(e[t],r):!(!e[t]||!e[t].match(r));case"Number":r=String(r);case"String":return c(e[t])?!!n&&f(e[t],r):e[t]===r;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},s.joinPaths=function(){for(var e=[],t=[],r=0,n=0;n<arguments.length;n++){var o=new s(arguments[n]);e.push(o);for(var i=o.segment(),a=0;a<i.length;a++)"string"==typeof i[a]&&t.push(i[a]),i[a]&&r++}if(!t.length||!r)return new s("");var u=new s("").segment(t);return(""===e[0].path()||"/"===e[0].path().slice(0,1))&&u.path("/"+u.path()),u.normalize()},s.commonPath=function(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r<n;r++)if(e.charAt(r)!==t.charAt(r)){r--;break}return r<1?e.charAt(0)===t.charAt(0)&&"/"===e.charAt(0)?"/":"":(("/"!==e.charAt(r)||"/"!==t.charAt(r))&&(r=e.substring(0,r).lastIndexOf("/")),e.substring(0,r+1))},s.withinString=function(e,t,r){r||(r={});var n=r.start||s.findUri.start,o=r.end||s.findUri.end,i=r.trim||s.findUri.trim,a=r.parens||s.findUri.parens,u=/[a-z0-9-]=["']?$/i;for(n.lastIndex=0;;){var l=n.exec(e);if(!l)break;var c=l.index;if(r.ignoreHtml){var p=e.slice(Math.max(c-3,0),c);if(p&&u.test(p))continue}for(var f=c+e.slice(c).search(o),h=e.slice(c,f),d=-1;;){var m=a.exec(h);if(!m)break;var y=m.index+m[0].length;d=Math.max(d,y)}if(!((h=d>-1?h.slice(0,d)+h.slice(d).replace(i,""):h.replace(i,"")).length<=l[0].length||r.ignore&&r.ignore.test(h))){var g=t(h,c,f=c+h.length,e);if(void 0===g){n.lastIndex=f;continue}g=String(g),e=e.slice(0,c)+g+e.slice(f),n.lastIndex=c+g.length}}return n.lastIndex=0,e},s.ensureValidHostname=function(t,r){var n=!!t,o=!1;if(!!r&&(o=f(s.hostProtocols,r)),o&&!n)throw new TypeError("Hostname cannot be empty, if protocol is "+r);if(t&&t.match(s.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(s.invalid_hostname_characters))throw new TypeError('Hostname "'+t+'" contains characters other than [A-Z0-9.-:_]')}},s.ensureValidPort=function(e){if(e){var t=Number(e);if(!(function(e){return/^[0-9]+$/.test(e)}(t)&&t>0&&t<65536))throw new TypeError('Port "'+e+'" is not a valid port')}},s.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=o),this},i.build=function(e){return!0===e?this._deferred_build=!0:(void 0===e||this._deferred_build)&&(this._string=s.build(this._parts),this._deferred_build=!1),this},i.clone=function(){return new s(this)},i.valueOf=i.toString=function(){return this.build(!1)._string},i.protocol=v("protocol"),i.username=v("username"),i.password=v("password"),i.hostname=v("hostname"),i.port=v("port"),i.query=_("query","?"),i.fragment=_("fragment","#"),i.search=function(e,t){var r=this.query(e,t);return"string"==typeof r&&r.length?"?"+r:r},i.hash=function(e,t){var r=this.fragment(e,t);return"string"==typeof r&&r.length?"#"+r:r},i.pathname=function(e,t){if(void 0===e||!0===e){var r=this._parts.path||(this._parts.hostname?"/":"");return e?(this._parts.urn?s.decodeUrnPath:s.decodePath)(r):r}return this._parts.urn?this._parts.path=e?s.recodeUrnPath(e):"":this._parts.path=e?s.recodePath(e):"/",this.build(!t),this},i.path=i.pathname,i.href=function(e,t){var r;if(void 0===e)return this.toString();this._string="",this._parts=s._parts();var n=e instanceof s,o="object"==typeof e&&(e.hostname||e.path||e.pathname);e.nodeName&&(e=e[s.getDomAttribute(e)]||"",o=!1);if(!n&&o&&void 0!==e.pathname&&(e=e.toString()),"string"==typeof e||e instanceof String)this._parts=s.parse(String(e),this._parts);else{if(!n&&!o)throw new TypeError("invalid input");var i=n?e._parts:e;for(r in i)"query"!==r&&a.call(this._parts,r)&&(this._parts[r]=i[r]);i.query&&this.query(i.query,!1)}return this.build(!t),this},i.is=function(e){var t=!1,n=!1,o=!1,i=!1,a=!1,u=!1,l=!1,c=!this._parts.urn;switch(this._parts.hostname&&(c=!1,n=s.ip4_expression.test(this._parts.hostname),o=s.ip6_expression.test(this._parts.hostname),a=(i=!(t=n||o))&&r&&r.has(this._parts.hostname),u=i&&s.idn_expression.test(this._parts.hostname),l=i&&s.punycode_expression.test(this._parts.hostname)),e.toLowerCase()){case"relative":return c;case"absolute":return!c;case"domain":case"name":return i;case"sld":return a;case"ip":return t;case"ip4":case"ipv4":case"inet4":return n;case"ip6":case"ipv6":case"inet6":return o;case"idn":return u;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return l}return null};var x=i.protocol,E=i.port,S=i.hostname;i.protocol=function(e,t){if(e&&!(e=e.replace(/:(\/\/)?$/,"")).match(s.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)},i.scheme=i.protocol,i.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)),s.ensureValidPort(e))),E.call(this,e,t))},i.hostname=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0!==e){var r={preventInvalidHostname:this._parts.preventInvalidHostname};if("/"!==s.parseHost(e,r))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');e=r.hostname,this._parts.preventInvalidHostname&&s.ensureValidHostname(e,this._parts.protocol)}return S.call(this,e,t)},i.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=s(e);return this.protocol(n.protocol()).authority(n.authority()).build(!t),this},i.host=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?s.buildHost(this._parts):"";if("/"!==s.parseHost(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},i.authority=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e)return this._parts.hostname?s.buildAuthority(this._parts):"";if("/"!==s.parseAuthority(e,this._parts))throw new TypeError('Hostname "'+e+'" contains characters other than [A-Z0-9.-]');return this.build(!t),this},i.userinfo=function(e,t){if(this._parts.urn)return void 0===e?"":this;if(void 0===e){var r=s.buildUserinfo(this._parts);return r&&r.substring(0,r.length-1)}return"@"!==e[e.length-1]&&(e+="@"),s.parseUserinfo(e,this._parts),this.build(!t),this},i.resource=function(e,t){var r;return void 0===e?this.path()+this.search()+this.hash():(r=s.parse(e),this._parts.path=r.path,this._parts.query=r.query,this._parts.fragment=r.fragment,this.build(!t),this)},i.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,o=this._parts.hostname.substring(0,n),i=new RegExp("^"+u(o));if(e&&"."!==e.charAt(e.length-1)&&(e+="."),-1!==e.indexOf(":"))throw new TypeError("Domains cannot contain colons");return e&&s.ensureValidHostname(e,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(i,e),this.build(!t),this},i.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(s.ensureValidHostname(e,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=e;else{var o=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(o,e)}return this.build(!t),this},i.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("."),o=this._parts.hostname.substring(n+1);return!0!==t&&r&&r.list[o.toLowerCase()]&&r.get(this._parts.hostname)||o}var s;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]');s=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(s,e)}else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");s=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(s,e)}return this.build(!t),this},i.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?s.decodePath(n):n}var o=this._parts.path.length-this.filename().length,i=this._parts.path.substring(0,o),a=new RegExp("^"+u(i));return this.is("relative")||(e||(e="/"),"/"!==e.charAt(0)&&(e="/"+e)),e&&"/"!==e.charAt(e.length-1)&&(e+="/"),e=s.recodePath(e),this._parts.path=this._parts.path.replace(a,e),this.build(!t),this},i.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?s.decodePathSegment(n):n}var o=!1;"/"===e.charAt(0)&&(e=e.substring(1)),e.match(/\.?\//)&&(o=!0);var i=new RegExp(u(this.filename())+"$");return e=s.recodePath(e),this._parts.path=this._parts.path.replace(i,e),o?this.normalizePath(t):this.build(!t),this},i.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,o=this.filename(),i=o.lastIndexOf(".");return-1===i?"":(r=o.substring(i+1),n=/^[a-z0-9%]+$/i.test(r)?r:"",e?s.decodePathSegment(n):n)}"."===e.charAt(0)&&(e=e.substring(1));var a,l=this.suffix();if(l)a=e?new RegExp(u(l)+"$"):new RegExp(u("."+l)+"$");else{if(!e)return this;this._parts.path+="."+s.recodePath(e)}return a&&(e=s.recodePath(e),this._parts.path=this._parts.path.replace(a,e)),this.build(!t),this},i.segment=function(e,t,r){var n=this._parts.urn?":":"/",o=this.path(),s="/"===o.substring(0,1),i=o.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(s&&i.shift(),e<0&&(e=Math.max(i.length+e,0)),void 0===t)return void 0===e?i:i[e];if(null===e||void 0===i[e])if(c(t)){i=[];for(var a=0,u=t.length;a<u;a++)!t[a].length&&(!i.length||!i[i.length-1].length)||(i.length&&!i[i.length-1].length&&i.pop(),i.push(d(t[a])))}else(t||"string"==typeof t)&&(t=d(t),""===i[i.length-1]?i[i.length-1]=t:i.push(t));else t?i[e]=d(t):i.splice(e,1);return s&&i.unshift(""),this.path(i.join(n),r)},i.segmentCoded=function(e,t,r){var n,o,i;if("number"!=typeof e&&(r=t,t=e,e=void 0),void 0===t){if(c(n=this.segment(e,t,r)))for(o=0,i=n.length;o<i;o++)n[o]=s.decode(n[o]);else n=void 0!==n?s.decode(n):void 0;return n}if(c(t))for(o=0,i=t.length;o<i;o++)t[o]=s.encode(t[o]);else t="string"==typeof t||t instanceof String?s.encode(t):t;return this.segment(e,t,r)};var A=i.query;return i.query=function(e,t){if(!0===e)return s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("function"==typeof e){var r=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace),n=e.call(this,r);return this._parts.query=s.buildQuery(n||r,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this}return void 0!==e&&"string"!=typeof e?(this._parts.query=s.buildQuery(e,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!t),this):A.call(this,e,t)},i.setQuery=function(e,t,r){var n=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if("string"==typeof e||e instanceof String)n[e]=void 0!==t?t:null;else{if("object"!=typeof e)throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");for(var o in e)a.call(e,o)&&(n[o]=e[o])}return this._parts.query=s.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(r=t),this.build(!r),this},i.addQuery=function(e,t,r){var n=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return s.addQuery(n,e,void 0===t?null:t),this._parts.query=s.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(r=t),this.build(!r),this},i.removeQuery=function(e,t,r){var n=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return s.removeQuery(n,e,t),this._parts.query=s.buildQuery(n,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),"string"!=typeof e&&(r=t),this.build(!r),this},i.hasQuery=function(e,t,r){var n=s.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return s.hasQuery(n,e,t,r)},i.setSearch=i.setQuery,i.addSearch=i.addQuery,i.removeSearch=i.removeQuery,i.hasSearch=i.hasQuery,i.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},i.normalizeProtocol=function(e){return"string"==typeof this._parts.protocol&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!e)),this},i.normalizeHostname=function(r){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!r)),this},i.normalizePort=function(e){return"string"==typeof this._parts.protocol&&this._parts.port===s.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!e)),this},i.normalizePath=function(e){var t=this._parts.path;if(!t)return this;if(this._parts.urn)return this._parts.path=s.recodeUrnPath(this._parts.path),this.build(!e),this;if("/"===this._parts.path)return this;var r,n,o,i="";for("/"!==(t=s.recodePath(t)).charAt(0)&&(r=!0,t="/"+t),("/.."===t.slice(-3)||"/."===t.slice(-2))&&(t+="/"),t=t.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),r&&((i=t.substring(1).match(/^(\.\.\/)+/)||"")&&(i=i[0]));-1!==(n=t.search(/\/\.\.(\/|$)/));)0!==n?(-1===(o=t.substring(0,n).lastIndexOf("/"))&&(o=n),t=t.substring(0,o)+t.substring(n+3)):t=t.substring(3);return r&&this.is("relative")&&(t=i+t.substring(1)),this._parts.path=t,this.build(!e),this},i.normalizePathname=i.normalizePath,i.normalizeQuery=function(e){return"string"==typeof this._parts.query&&(this._parts.query.length?this.query(s.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!e)),this},i.normalizeFragment=function(e){return this._parts.fragment||(this._parts.fragment=null,this.build(!e)),this},i.normalizeSearch=i.normalizeQuery,i.normalizeHash=i.normalizeFragment,i.iso8859=function(){var e=s.encode,t=s.decode;s.encode=escape,s.decode=decodeURIComponent;try{this.normalize()}finally{s.encode=e,s.decode=t}return this},i.unicode=function(){var e=s.encode,t=s.decode;s.encode=y,s.decode=unescape;try{this.normalize()}finally{s.encode=e,s.decode=t}return this},i.readable=function(){var t=this.clone();t.username("").password("").normalize();var r="";if(t._parts.protocol&&(r+=t._parts.protocol+"://"),t._parts.hostname&&(t.is("punycode")&&e?(r+=e.toUnicode(t._parts.hostname),t._parts.port&&(r+=":"+t._parts.port)):r+=t.host()),t._parts.hostname&&t._parts.path&&"/"!==t._parts.path.charAt(0)&&(r+="/"),r+=t.path(!0),t._parts.query){for(var n="",o=0,i=t._parts.query.split("&"),a=i.length;o<a;o++){var u=(i[o]||"").split("=");n+="&"+s.decodeQuery(u[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),void 0!==u[1]&&(n+="="+s.decodeQuery(u[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}r+="?"+n.substring(1)}return r+=s.decodeQuery(t.hash(),!0)},i.absoluteTo=function(e){var t,r,n,o=this.clone(),i=["protocol","username","password","hostname","port"];if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e instanceof s||(e=new s(e)),o._parts.protocol||(o._parts.protocol=e._parts.protocol,this._parts.hostname))return o;for(r=0;n=i[r];r++)o._parts[n]=e._parts[n];return o._parts.path?(".."===o._parts.path.substring(-2)&&(o._parts.path+="/"),"/"!==o.path().charAt(0)&&(t=(t=e.directory())||(0===e.path().indexOf("/")?"/":""),o._parts.path=(t?t+"/":"")+o._parts.path,o.normalizePath())):(o._parts.path=e._parts.path,o._parts.query||(o._parts.query=e._parts.query)),o.build(),o},i.relativeTo=function(e){var t,r,n,o,i,a=this.clone().normalize();if(a._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(e=new s(e).normalize(),t=a._parts,r=e._parts,o=a.path(),i=e.path(),"/"!==o.charAt(0))throw new Error("URI is already relative");if("/"!==i.charAt(0))throw new Error("Cannot calculate a URI relative to another relative URI");if(t.protocol===r.protocol&&(t.protocol=null),t.username!==r.username||t.password!==r.password||null!==t.protocol||null!==t.username||null!==t.password)return a.build();if(t.hostname!==r.hostname||t.port!==r.port)return a.build();if(t.hostname=null,t.port=null,o===i)return t.path="",a.build();if(!(n=s.commonPath(o,i)))return a.build();var u=r.path.substring(n.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return t.path=u+t.path.substring(n.length)||"./",a.build()},i.equals=function(e){var t,r,n,o,i,u=this.clone(),l=new s(e),p={};if(u.normalize(),l.normalize(),u.toString()===l.toString())return!0;if(n=u.query(),o=l.query(),u.query(""),l.query(""),u.toString()!==l.toString()||n.length!==o.length)return!1;for(i in t=s.parseQuery(n,this._parts.escapeQuerySpace),r=s.parseQuery(o,this._parts.escapeQuerySpace),t)if(a.call(t,i)){if(c(t[i])){if(!h(t[i],r[i]))return!1}else if(t[i]!==r[i])return!1;p[i]=!0}for(i in r)if(a.call(r,i)&&!p[i])return!1;return!0},i.preventInvalidHostname=function(e){return this._parts.preventInvalidHostname=!!e,this},i.duplicateQueryParameters=function(e){return this._parts.duplicateQueryParameters=!!e,this},i.escapeQuerySpace=function(e){return this._parts.escapeQuerySpace=!!e,this},s}))}));function M(e,t,r,n){this.x=O(e,0),this.y=O(t,0),this.z=O(r,0),this.w=O(n,0)}M.fromElements=function(e,t,r,n,o){return p(o)?(o.x=e,o.y=t,o.z=r,o.w=n,o):new M(e,t,r,n)},M.fromColor=function(e,t){return s.typeOf.object("color",e),p(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new M(e.red,e.green,e.blue,e.alpha)},M.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new M(e.x,e.y,e.z,e.w)},M.packedLength=4,M.pack=function(e,t,r){return s.typeOf.object("value",e),s.defined("array",t),r=O(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},M.unpack=function(e,t,r){return s.defined("array",e),t=O(t,0),p(r)||(r=new M),r.x=e[t++],r.y=e[t++],r.z=e[t++],r.w=e[t],r},M.packArray=function(e,t){s.defined("array",e);let r=e.length,n=4*r;if(p(t)){if(!Array.isArray(t)&&t.length!==n)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==n&&(t.length=n)}else t=new Array(n);for(let n=0;n<r;++n)M.pack(e[n],t,4*n);return t},M.unpackArray=function(e,t){if(s.defined("array",e),s.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!=0)throw new A("array length must be a multiple of 4.");let r=e.length;p(t)?t.length=r/4:t=new Array(r/4);for(let n=0;n<r;n+=4){let r=n/4;t[r]=M.unpack(e,n,t[r])}return t},M.fromArray=M.unpack,M.maximumComponent=function(e){return s.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)},M.minimumComponent=function(e){return s.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)},M.minimumByComponent=function(e,t,r){return s.typeOf.object("first",e),s.typeOf.object("second",t),s.typeOf.object("result",r),r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r.w=Math.min(e.w,t.w),r},M.maximumByComponent=function(e,t,r){return s.typeOf.object("first",e),s.typeOf.object("second",t),s.typeOf.object("result",r),r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r.w=Math.max(e.w,t.w),r},M.clamp=function(e,t,r,n){s.typeOf.object("value",e),s.typeOf.object("min",t),s.typeOf.object("max",r),s.typeOf.object("result",n);let o=E.clamp(e.x,t.x,r.x),i=E.clamp(e.y,t.y,r.y),a=E.clamp(e.z,t.z,r.z),u=E.clamp(e.w,t.w,r.w);return n.x=o,n.y=i,n.z=a,n.w=u,n},M.magnitudeSquared=function(e){return s.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},M.magnitude=function(e){return Math.sqrt(M.magnitudeSquared(e))};var Rt=new M;M.distance=function(e,t){return s.typeOf.object("left",e),s.typeOf.object("right",t),M.subtract(e,t,Rt),M.magnitude(Rt)},M.distanceSquared=function(e,t){return s.typeOf.object("left",e),s.typeOf.object("right",t),M.subtract(e,t,Rt),M.magnitudeSquared(Rt)},M.normalize=function(e,t){s.typeOf.object("cartesian",e),s.typeOf.object("result",t);let r=M.magnitude(e);if(t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new A("normalized result is not a number");return t},M.dot=function(e,t){return s.typeOf.object("left",e),s.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},M.multiplyComponents=function(e,t,r){return s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",r),r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r.w=e.w*t.w,r},M.divideComponents=function(e,t,r){return s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",r),r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r.w=e.w/t.w,r},M.add=function(e,t,r){return s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",r),r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},M.subtract=function(e,t,r){return s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",r),r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},M.multiplyByScalar=function(e,t,r){return s.typeOf.object("cartesian",e),s.typeOf.number("scalar",t),s.typeOf.object("result",r),r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},M.divideByScalar=function(e,t,r){return s.typeOf.object("cartesian",e),s.typeOf.number("scalar",t),s.typeOf.object("result",r),r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},M.negate=function(e,t){return s.typeOf.object("cartesian",e),s.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},M.abs=function(e,t){return s.typeOf.object("cartesian",e),s.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var Tn=new M;M.lerp=function(e,t,r,n){return s.typeOf.object("start",e),s.typeOf.object("end",t),s.typeOf.number("t",r),s.typeOf.object("result",n),M.multiplyByScalar(t,r,Tn),n=M.multiplyByScalar(e,1-r,n),M.add(Tn,n,n)};var No=new M;M.mostOrthogonalAxis=function(e,t){s.typeOf.object("cartesian",e),s.typeOf.object("result",t);let r=M.normalize(e,No);return M.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?M.clone(M.UNIT_X,t):M.clone(M.UNIT_W,t):r.z<=r.w?M.clone(M.UNIT_Z,t):M.clone(M.UNIT_W,t):r.y<=r.z?r.y<=r.w?M.clone(M.UNIT_Y,t):M.clone(M.UNIT_W,t):r.z<=r.w?M.clone(M.UNIT_Z,t):M.clone(M.UNIT_W,t)},M.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},M.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},M.equalsEpsilon=function(e,t,r,n){return e===t||p(e)&&p(t)&&E.equalsEpsilon(e.x,t.x,r,n)&&E.equalsEpsilon(e.y,t.y,r,n)&&E.equalsEpsilon(e.z,t.z,r,n)&&E.equalsEpsilon(e.w,t.w,r,n)},M.ZERO=Object.freeze(new M(0,0,0,0)),M.ONE=Object.freeze(new M(1,1,1,1)),M.UNIT_X=Object.freeze(new M(1,0,0,0)),M.UNIT_Y=Object.freeze(new M(0,1,0,0)),M.UNIT_Z=Object.freeze(new M(0,0,1,0)),M.UNIT_W=Object.freeze(new M(0,0,0,1)),M.prototype.clone=function(e){return M.clone(this,e)},M.prototype.equals=function(e){return M.equals(this,e)},M.prototype.equalsEpsilon=function(e,t,r){return M.equalsEpsilon(this,e,t,r)},M.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Jt=new Float32Array(1),le=new Uint8Array(Jt.buffer),ko=new Uint32Array([287454020]),Fo=new Uint8Array(ko.buffer),vn=68===Fo[0];M.packFloat=function(e,t){return s.typeOf.number("value",e),p(t)||(t=new M),Jt[0]=e,vn?(t.x=le[0],t.y=le[1],t.z=le[2],t.w=le[3]):(t.x=le[3],t.y=le[2],t.z=le[1],t.w=le[0]),t},M.unpackFloat=function(e){return s.typeOf.object("packedFloat",e),vn?(le[0]=e.x,le[1]=e.y,le[2]=e.z,le[3]=e.w):(le[0]=e.w,le[1]=e.z,le[2]=e.y,le[3]=e.x),Jt[0]};var qe=M;function S(e,t,r,n,o,s,i,a,u,l,c,p,f,h,d,m){this[0]=O(e,0),this[1]=O(o,0),this[2]=O(u,0),this[3]=O(f,0),this[4]=O(t,0),this[5]=O(s,0),this[6]=O(l,0),this[7]=O(h,0),this[8]=O(r,0),this[9]=O(i,0),this[10]=O(c,0),this[11]=O(d,0),this[12]=O(n,0),this[13]=O(a,0),this[14]=O(p,0),this[15]=O(m,0)}S.packedLength=16,S.pack=function(e,t,r){return s.typeOf.object("value",e),s.defined("array",t),r=O(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},S.unpack=function(e,t,r){return s.defined("array",e),t=O(t,0),p(r)||(r=new S),r[0]=e[t++],r[1]=e[t++],r[2]=e[t++],r[3]=e[t++],r[4]=e[t++],r[5]=e[t++],r[6]=e[t++],r[7]=e[t++],r[8]=e[t++],r[9]=e[t++],r[10]=e[t++],r[11]=e[t++],r[12]=e[t++],r[13]=e[t++],r[14]=e[t++],r[15]=e[t],r},S.packArray=function(e,t){s.defined("array",e);let r=e.length,n=16*r;if(p(t)){if(!Array.isArray(t)&&t.length!==n)throw new A("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==n&&(t.length=n)}else t=new Array(n);for(let n=0;n<r;++n)S.pack(e[n],t,16*n);return t},S.unpackArray=function(e,t){if(s.defined("array",e),s.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!=0)throw new A("array length must be a multiple of 16.");let r=e.length;p(t)?t.length=r/16:t=new Array(r/16);for(let n=0;n<r;n+=16){let r=n/16;t[r]=S.unpack(e,n,t[r])}return t},S.clone=function(e,t){if(p(e))return p(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new S(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},S.fromArray=S.unpack,S.fromColumnMajorArray=function(e,t){return s.defined("values",e),S.clone(e,t)},S.fromRowMajorArray=function(e,t){return s.defined("values",e),p(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new S(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},S.fromRotationTranslation=function(e,t,r){return s.typeOf.object("rotation",e),t=O(t,_.ZERO),p(r)?(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=0,r[4]=e[3],r[5]=e[4],r[6]=e[5],r[7]=0,r[8]=e[6],r[9]=e[7],r[10]=e[8],r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r):new S(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)},S.fromTranslationQuaternionRotationScale=function(e,t,r,n){s.typeOf.object("translation",e),s.typeOf.object("rotation",t),s.typeOf.object("scale",r),p(n)||(n=new S);let o=r.x,i=r.y,a=r.z,u=t.x*t.x,l=t.x*t.y,c=t.x*t.z,f=t.x*t.w,h=t.y*t.y,d=t.y*t.z,m=t.y*t.w,y=t.z*t.z,g=t.z*t.w,O=t.w*t.w,b=u-h-y+O,w=2*(l-g),v=2*(c+m),_=2*(l+g),x=-u+h-y+O,E=2*(d-f),A=2*(c-m),R=2*(d+f),I=-u-h+y+O;return n[0]=b*o,n[1]=_*o,n[2]=A*o,n[3]=0,n[4]=w*i,n[5]=x*i,n[6]=R*i,n[7]=0,n[8]=v*a,n[9]=E*a,n[10]=I*a,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},S.fromTranslationRotationScale=function(e,t){return s.typeOf.object("translationRotationScale",e),S.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},S.fromTranslation=function(e,t){return s.typeOf.object("translation",e),S.fromRotationTranslation(W.IDENTITY,e,t)},S.fromScale=function(e,t){return s.typeOf.object("scale",e),p(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new S(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},S.fromUniformScale=function(e,t){return s.typeOf.number("scale",e),p(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new S(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)},S.fromRotation=function(e,t){return s.typeOf.object("rotation",e),p(t)||(t=new S),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};var Je=new _,Ge=new _,ut=new _;S.fromCamera=function(e,t){s.typeOf.object("camera",e);let r=e.position,n=e.direction,o=e.up;s.typeOf.object("camera.position",r),s.typeOf.object("camera.direction",n),s.typeOf.object("camera.up",o),_.normalize(n,Je),_.normalize(_.cross(Je,o,Ge),Ge),_.normalize(_.cross(Ge,Je,ut),ut);let i=Ge.x,a=Ge.y,u=Ge.z,l=Je.x,c=Je.y,f=Je.z,h=ut.x,d=ut.y,m=ut.z,y=r.x,g=r.y,O=r.z,b=i*-y+a*-g+u*-O,w=h*-y+d*-g+m*-O,v=l*y+c*g+f*O;return p(t)?(t[0]=i,t[1]=h,t[2]=-l,t[3]=0,t[4]=a,t[5]=d,t[6]=-c,t[7]=0,t[8]=u,t[9]=m,t[10]=-f,t[11]=0,t[12]=b,t[13]=w,t[14]=v,t[15]=1,t):new S(i,a,u,b,h,d,m,w,-l,-c,-f,v,0,0,0,1)},S.computePerspectiveFieldOfView=function(e,t,r,n,o){s.typeOf.number.greaterThan("fovY",e,0),s.typeOf.number.lessThan("fovY",e,Math.PI),s.typeOf.number.greaterThan("near",r,0),s.typeOf.number.greaterThan("far",n,0),s.typeOf.object("result",o);let i=1/Math.tan(.5*e),a=i/t,u=(n+r)/(r-n),l=2*n*r/(r-n);return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=i,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=u,o[11]=-1,o[12]=0,o[13]=0,o[14]=l,o[15]=0,o},S.computeOrthographicOffCenter=function(e,t,r,n,o,i,a){s.typeOf.number("left",e),s.typeOf.number("right",t),s.typeOf.number("bottom",r),s.typeOf.number("top",n),s.typeOf.number("near",o),s.typeOf.number("far",i),s.typeOf.object("result",a);let u=1/(t-e),l=1/(n-r),c=1/(i-o),p=-(t+e)*u,f=-(n+r)*l,h=-(i+o)*c;return u*=2,l*=2,c*=-2,a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=c,a[11]=0,a[12]=p,a[13]=f,a[14]=h,a[15]=1,a},S.computePerspectiveOffCenter=function(e,t,r,n,o,i,a){s.typeOf.number("left",e),s.typeOf.number("right",t),s.typeOf.number("bottom",r),s.typeOf.number("top",n),s.typeOf.number("near",o),s.typeOf.number("far",i),s.typeOf.object("result",a);let u=2*o/(t-e),l=2*o/(n-r),c=(t+e)/(t-e),p=(n+r)/(n-r),f=-(i+o)/(i-o),h=-2*i*o/(i-o);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=c,a[9]=p,a[10]=f,a[11]=-1,a[12]=0,a[13]=0,a[14]=h,a[15]=0,a},S.computeInfinitePerspectiveOffCenter=function(e,t,r,n,o,i){s.typeOf.number("left",e),s.typeOf.number("right",t),s.typeOf.number("bottom",r),s.typeOf.number("top",n),s.typeOf.number("near",o),s.typeOf.object("result",i);let a=2*o/(t-e),u=2*o/(n-r),l=(t+e)/(t-e),c=(n+r)/(n-r),p=-2*o;return i[0]=a,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=l,i[9]=c,i[10]=-1,i[11]=-1,i[12]=0,i[13]=0,i[14]=p,i[15]=0,i},S.computeViewportTransformation=function(e,t,r,n){p(n)||(n=new S),e=O(e,O.EMPTY_OBJECT);let o=O(e.x,0),s=O(e.y,0),i=O(e.width,0),a=O(e.height,0);t=O(t,0);let u=.5*i,l=.5*a,c=.5*((r=O(r,1))-t),f=u,h=l,d=c,m=o+u,y=s+l,g=t+c;return n[0]=f,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=h,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=d,n[11]=0,n[12]=m,n[13]=y,n[14]=g,n[15]=1,n},S.computeView=function(e,t,r,n,o){return s.typeOf.object("position",e),s.typeOf.object("direction",t),s.typeOf.object("up",r),s.typeOf.object("right",n),s.typeOf.object("result",o),o[0]=n.x,o[1]=r.x,o[2]=-t.x,o[3]=0,o[4]=n.y,o[5]=r.y,o[6]=-t.y,o[7]=0,o[8]=n.z,o[9]=r.z,o[10]=-t.z,o[11]=0,o[12]=-_.dot(n,e),o[13]=-_.dot(r,e),o[14]=_.dot(t,e),o[15]=1,o},S.toArray=function(e,t){return s.typeOf.object("matrix",e),p(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},S.getElementIndex=function(e,t){return s.typeOf.number.greaterThanOrEquals("row",t,0),s.typeOf.number.lessThanOrEquals("row",t,3),s.typeOf.number.greaterThanOrEquals("column",e,0),s.typeOf.number.lessThanOrEquals("column",e,3),4*e+t},S.getColumn=function(e,t,r){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",t,0),s.typeOf.number.lessThanOrEquals("index",t,3),s.typeOf.object("result",r);let n=4*t,o=e[n],i=e[n+1],a=e[n+2],u=e[n+3];return r.x=o,r.y=i,r.z=a,r.w=u,r},S.setColumn=function(e,t,r,n){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",t,0),s.typeOf.number.lessThanOrEquals("index",t,3),s.typeOf.object("cartesian",r),s.typeOf.object("result",n);let o=4*t;return(n=S.clone(e,n))[o]=r.x,n[o+1]=r.y,n[o+2]=r.z,n[o+3]=r.w,n},S.getRow=function(e,t,r){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",t,0),s.typeOf.number.lessThanOrEquals("index",t,3),s.typeOf.object("result",r);let n=e[t],o=e[t+4],i=e[t+8],a=e[t+12];return r.x=n,r.y=o,r.z=i,r.w=a,r},S.setRow=function(e,t,r,n){return s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",t,0),s.typeOf.number.lessThanOrEquals("index",t,3),s.typeOf.object("cartesian",r),s.typeOf.object("result",n),(n=S.clone(e,n))[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n},S.setTranslation=function(e,t,r){return s.typeOf.object("matrix",e),s.typeOf.object("translation",t),s.typeOf.object("result",r),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r};var xo=new _;S.setScale=function(e,t,r){s.typeOf.object("matrix",e),s.typeOf.object("scale",t),s.typeOf.object("result",r);let n=S.getScale(e,xo),o=t.x/n.x,i=t.y/n.y,a=t.z/n.z;return r[0]=e[0]*o,r[1]=e[1]*o,r[2]=e[2]*o,r[3]=e[3],r[4]=e[4]*i,r[5]=e[5]*i,r[6]=e[6]*i,r[7]=e[7],r[8]=e[8]*a,r[9]=e[9]*a,r[10]=e[10]*a,r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r};var Lo=new _;S.setUniformScale=function(e,t,r){s.typeOf.object("matrix",e),s.typeOf.number("scale",t),s.typeOf.object("result",r);let n=S.getScale(e,Lo),o=t/n.x,i=t/n.y,a=t/n.z;return r[0]=e[0]*o,r[1]=e[1]*o,r[2]=e[2]*o,r[3]=e[3],r[4]=e[4]*i,r[5]=e[5]*i,r[6]=e[6]*i,r[7]=e[7],r[8]=e[8]*a,r[9]=e[9]*a,r[10]=e[10]*a,r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r};var Gt=new _;S.getScale=function(e,t){return s.typeOf.object("matrix",e),s.typeOf.object("result",t),t.x=_.magnitude(_.fromElements(e[0],e[1],e[2],Gt)),t.y=_.magnitude(_.fromElements(e[4],e[5],e[6],Gt)),t.z=_.magnitude(_.fromElements(e[8],e[9],e[10],Gt)),t};var Cn=new _;S.getMaximumScale=function(e){return S.getScale(e,Cn),_.maximumComponent(Cn)};var Bo=new _;S.setRotation=function(e,t,r){s.typeOf.object("matrix",e),s.typeOf.object("result",r);let n=S.getScale(e,Bo);return r[0]=t[0]*n.x,r[1]=t[1]*n.x,r[2]=t[2]*n.x,r[3]=e[3],r[4]=t[3]*n.y,r[5]=t[4]*n.y,r[6]=t[5]*n.y,r[7]=e[7],r[8]=t[6]*n.z,r[9]=t[7]*n.z,r[10]=t[8]*n.z,r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r};var Wo=new _;S.getRotation=function(e,t){s.typeOf.object("matrix",e),s.typeOf.object("result",t);let r=S.getScale(e,Wo);return t[0]=e[0]/r.x,t[1]=e[1]/r.x,t[2]=e[2]/r.x,t[3]=e[4]/r.y,t[4]=e[5]/r.y,t[5]=e[6]/r.y,t[6]=e[8]/r.z,t[7]=e[9]/r.z,t[8]=e[10]/r.z,t},S.multiply=function(e,t,r){s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",r);let n=e[0],o=e[1],i=e[2],a=e[3],u=e[4],l=e[5],c=e[6],p=e[7],f=e[8],h=e[9],d=e[10],m=e[11],y=e[12],g=e[13],O=e[14],b=e[15],w=t[0],v=t[1],_=t[2],x=t[3],E=t[4],S=t[5],A=t[6],R=t[7],I=t[8],j=t[9],T=t[10],M=t[11],q=t[12],U=t[13],P=t[14],C=t[15],D=n*w+u*v+f*_+y*x,z=o*w+l*v+h*_+g*x,N=i*w+c*v+d*_+O*x,k=a*w+p*v+m*_+b*x,L=n*E+u*S+f*A+y*R,F=o*E+l*S+h*A+g*R,W=i*E+c*S+d*A+O*R,$=a*E+p*S+m*A+b*R,B=n*I+u*j+f*T+y*M,V=o*I+l*j+h*T+g*M,Q=i*I+c*j+d*T+O*M,H=a*I+p*j+m*T+b*M,Y=n*q+u*U+f*P+y*C,G=o*q+l*U+h*P+g*C,K=i*q+c*U+d*P+O*C,X=a*q+p*U+m*P+b*C;return r[0]=D,r[1]=z,r[2]=N,r[3]=k,r[4]=L,r[5]=F,r[6]=W,r[7]=$,r[8]=B,r[9]=V,r[10]=Q,r[11]=H,r[12]=Y,r[13]=G,r[14]=K,r[15]=X,r},S.add=function(e,t,r){return s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",r),r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r},S.subtract=function(e,t,r){return s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",r),r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r},S.multiplyTransformation=function(e,t,r){s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",r);let n=e[0],o=e[1],i=e[2],a=e[4],u=e[5],l=e[6],c=e[8],p=e[9],f=e[10],h=e[12],d=e[13],m=e[14],y=t[0],g=t[1],O=t[2],b=t[4],w=t[5],v=t[6],_=t[8],x=t[9],E=t[10],S=t[12],A=t[13],R=t[14],I=n*y+a*g+c*O,j=o*y+u*g+p*O,T=i*y+l*g+f*O,M=n*b+a*w+c*v,q=o*b+u*w+p*v,U=i*b+l*w+f*v,P=n*_+a*x+c*E,C=o*_+u*x+p*E,D=i*_+l*x+f*E,z=n*S+a*A+c*R+h,N=o*S+u*A+p*R+d,k=i*S+l*A+f*R+m;return r[0]=I,r[1]=j,r[2]=T,r[3]=0,r[4]=M,r[5]=q,r[6]=U,r[7]=0,r[8]=P,r[9]=C,r[10]=D,r[11]=0,r[12]=z,r[13]=N,r[14]=k,r[15]=1,r},S.multiplyByMatrix3=function(e,t,r){s.typeOf.object("matrix",e),s.typeOf.object("rotation",t),s.typeOf.object("result",r);let n=e[0],o=e[1],i=e[2],a=e[4],u=e[5],l=e[6],c=e[8],p=e[9],f=e[10],h=t[0],d=t[1],m=t[2],y=t[3],g=t[4],O=t[5],b=t[6],w=t[7],v=t[8],_=n*h+a*d+c*m,x=o*h+u*d+p*m,E=i*h+l*d+f*m,S=n*y+a*g+c*O,A=o*y+u*g+p*O,R=i*y+l*g+f*O,I=n*b+a*w+c*v,j=o*b+u*w+p*v,T=i*b+l*w+f*v;return r[0]=_,r[1]=x,r[2]=E,r[3]=0,r[4]=S,r[5]=A,r[6]=R,r[7]=0,r[8]=I,r[9]=j,r[10]=T,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},S.multiplyByTranslation=function(e,t,r){s.typeOf.object("matrix",e),s.typeOf.object("translation",t),s.typeOf.object("result",r);let n=t.x,o=t.y,i=t.z,a=n*e[0]+o*e[4]+i*e[8]+e[12],u=n*e[1]+o*e[5]+i*e[9]+e[13],l=n*e[2]+o*e[6]+i*e[10]+e[14];return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=a,r[13]=u,r[14]=l,r[15]=e[15],r},S.multiplyByScale=function(e,t,r){s.typeOf.object("matrix",e),s.typeOf.object("scale",t),s.typeOf.object("result",r);let n=t.x,o=t.y,i=t.z;return 1===n&&1===o&&1===i?S.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=e[3],r[4]=o*e[4],r[5]=o*e[5],r[6]=o*e[6],r[7]=e[7],r[8]=i*e[8],r[9]=i*e[9],r[10]=i*e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r)},S.multiplyByUniformScale=function(e,t,r){return s.typeOf.object("matrix",e),s.typeOf.number("scale",t),s.typeOf.object("result",r),r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3],r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7],r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},S.multiplyByVector=function(e,t,r){s.typeOf.object("matrix",e),s.typeOf.object("cartesian",t),s.typeOf.object("result",r);let n=t.x,o=t.y,i=t.z,a=t.w,u=e[0]*n+e[4]*o+e[8]*i+e[12]*a,l=e[1]*n+e[5]*o+e[9]*i+e[13]*a,c=e[2]*n+e[6]*o+e[10]*i+e[14]*a,p=e[3]*n+e[7]*o+e[11]*i+e[15]*a;return r.x=u,r.y=l,r.z=c,r.w=p,r},S.multiplyByPointAsVector=function(e,t,r){s.typeOf.object("matrix",e),s.typeOf.object("cartesian",t),s.typeOf.object("result",r);let n=t.x,o=t.y,i=t.z,a=e[0]*n+e[4]*o+e[8]*i,u=e[1]*n+e[5]*o+e[9]*i,l=e[2]*n+e[6]*o+e[10]*i;return r.x=a,r.y=u,r.z=l,r},S.multiplyByPoint=function(e,t,r){s.typeOf.object("matrix",e),s.typeOf.object("cartesian",t),s.typeOf.object("result",r);let n=t.x,o=t.y,i=t.z,a=e[0]*n+e[4]*o+e[8]*i+e[12],u=e[1]*n+e[5]*o+e[9]*i+e[13],l=e[2]*n+e[6]*o+e[10]*i+e[14];return r.x=a,r.y=u,r.z=l,r},S.multiplyByScalar=function(e,t,r){return s.typeOf.object("matrix",e),s.typeOf.number("scalar",t),s.typeOf.object("result",r),r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r},S.negate=function(e,t){return s.typeOf.object("matrix",e),s.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},S.transpose=function(e,t){s.typeOf.object("matrix",e),s.typeOf.object("result",t);let r=e[1],n=e[2],o=e[3],i=e[6],a=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=o,t[13]=a,t[14]=u,t[15]=e[15],t},S.abs=function(e,t){return s.typeOf.object("matrix",e),s.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},S.equals=function(e,t){return e===t||p(e)&&p(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},S.equalsEpsilon=function(e,t,r){return r=O(r,0),e===t||p(e)&&p(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},S.getTranslation=function(e,t){return s.typeOf.object("matrix",e),s.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t},S.getMatrix3=function(e,t){return s.typeOf.object("matrix",e),s.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var Qo=new W,Ho=new W,$o=new qe,Vo=new qe(0,0,0,1);S.inverse=function(e,t){s.typeOf.object("matrix",e),s.typeOf.object("result",t);let r=e[0],n=e[4],o=e[8],i=e[12],a=e[1],u=e[5],l=e[9],c=e[13],p=e[2],f=e[6],h=e[10],d=e[14],m=e[3],y=e[7],g=e[11],O=e[15],b=h*O,w=d*g,v=f*O,_=d*y,x=f*g,A=h*y,R=p*O,I=d*m,j=p*g,T=h*m,M=p*y,q=f*m,U=b*u+_*l+x*c-(w*u+v*l+A*c),P=w*a+R*l+T*c-(b*a+I*l+j*c),C=v*a+I*u+M*c-(_*a+R*u+q*c),D=A*a+j*u+q*l-(x*a+T*u+M*l),z=w*n+v*o+A*i-(b*n+_*o+x*i),N=b*r+I*o+j*i-(w*r+R*o+T*i),k=_*r+R*n+q*i-(v*r+I*n+M*i),L=x*r+T*n+M*o-(A*r+j*n+q*o);b=o*c,w=i*l,v=n*c,_=i*u,x=n*l,A=o*u,R=r*c,I=i*a,j=r*l,T=o*a,M=r*u,q=n*a;let F=b*y+_*g+x*O-(w*y+v*g+A*O),$=w*m+R*g+T*O-(b*m+I*g+j*O),B=v*m+I*y+M*O-(_*m+R*y+q*O),V=A*m+j*y+q*g-(x*m+T*y+M*g),Q=v*h+A*d+w*f-(x*d+b*f+_*h),H=j*d+b*p+I*h-(R*h+T*d+w*p),Y=R*f+q*d+_*p-(M*d+v*p+I*f),G=M*h+x*p+T*f-(j*f+q*h+A*p),K=r*U+n*P+o*C+i*D;if(Math.abs(K)<E.EPSILON21){if(W.equalsEpsilon(S.getMatrix3(e,Qo),Ho,E.EPSILON7)&&qe.equals(S.getRow(e,3,$o),Vo))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new Se("matrix is not invertible because its determinate is zero.")}return K=1/K,t[0]=U*K,t[1]=P*K,t[2]=C*K,t[3]=D*K,t[4]=z*K,t[5]=N*K,t[6]=k*K,t[7]=L*K,t[8]=F*K,t[9]=$*K,t[10]=B*K,t[11]=V*K,t[12]=Q*K,t[13]=H*K,t[14]=Y*K,t[15]=G*K,t},S.inverseTransformation=function(e,t){s.typeOf.object("matrix",e),s.typeOf.object("result",t);let r=e[0],n=e[1],o=e[2],i=e[4],a=e[5],u=e[6],l=e[8],c=e[9],p=e[10],f=e[12],h=e[13],d=e[14],m=-r*f-n*h-o*d,y=-i*f-a*h-u*d,g=-l*f-c*h-p*d;return t[0]=r,t[1]=i,t[2]=l,t[3]=0,t[4]=n,t[5]=a,t[6]=c,t[7]=0,t[8]=o,t[9]=u,t[10]=p,t[11]=0,t[12]=m,t[13]=y,t[14]=g,t[15]=1,t};var Yo=new S;S.inverseTranspose=function(e,t){return s.typeOf.object("matrix",e),s.typeOf.object("result",t),S.inverse(S.transpose(e,Yo),t)},S.IDENTITY=Object.freeze(new S(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),S.ZERO=Object.freeze(new S(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),S.COLUMN0ROW0=0,S.COLUMN0ROW1=1,S.COLUMN0ROW2=2,S.COLUMN0ROW3=3,S.COLUMN1ROW0=4,S.COLUMN1ROW1=5,S.COLUMN1ROW2=6,S.COLUMN1ROW3=7,S.COLUMN2ROW0=8,S.COLUMN2ROW1=9,S.COLUMN2ROW2=10,S.COLUMN2ROW3=11,S.COLUMN3ROW0=12,S.COLUMN3ROW1=13,S.COLUMN3ROW2=14,S.COLUMN3ROW3=15,Object.defineProperties(S.prototype,{length:{get:function(){return S.packedLength}}}),S.prototype.clone=function(e){return S.clone(this,e)},S.prototype.equals=function(e){return S.equals(this,e)},S.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},S.prototype.equalsEpsilon=function(e,t){return S.equalsEpsilon(this,e,t)},S.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})\n(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})\n(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})\n(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var G=S;function An(e,t,r){r=O(r,!1);let n,o,s,i={},a=p(e),u=p(t);if(a)for(n in e)e.hasOwnProperty(n)&&(o=e[n],u&&r&&"object"==typeof o&&t.hasOwnProperty(n)?(s=t[n],i[n]="object"==typeof s?An(o,s,r):o):i[n]=o);if(u)for(n in t)t.hasOwnProperty(n)&&!i.hasOwnProperty(n)&&(s=t[n],i[n]=s);return i}var De=An;function Xo(e,t,r){s.defined("array",e),s.defined("itemToFind",t),s.defined("comparator",r);let n,o,i=0,a=e.length-1;for(;i<=a;)if(n=~~((i+a)/2),o=r(e[n],t),o<0)i=n+1;else{if(!(o>0))return n;a=n-1}return~(a+1)}var Be=Xo;function Zo(e,t,r,n,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=r,this.yPoleOffset=n,this.ut1MinusUtc=o}var pt=Zo;function Jo(e){if(null===e||isNaN(e))throw new A("year is required and must be a number.");return e%4==0&&e%100!=0||e%400==0}var ht=Jo,jn=[31,28,31,30,31,30,31,31,30,31,30,31];function Go(e,t,r,n,o,i,a,u){e=O(e,1),t=O(t,1),r=O(r,1),n=O(n,0),o=O(o,0),i=O(i,0),a=O(a,0),u=O(u,!1),s.typeOf.number.greaterThanOrEquals("Year",e,1),s.typeOf.number.lessThanOrEquals("Year",e,9999),s.typeOf.number.greaterThanOrEquals("Month",t,1),s.typeOf.number.lessThanOrEquals("Month",t,12),s.typeOf.number.greaterThanOrEquals("Day",r,1),s.typeOf.number.lessThanOrEquals("Day",r,31),s.typeOf.number.greaterThanOrEquals("Hour",n,0),s.typeOf.number.lessThanOrEquals("Hour",n,23),s.typeOf.number.greaterThanOrEquals("Minute",o,0),s.typeOf.number.lessThanOrEquals("Minute",o,59),s.typeOf.bool("IsLeapSecond",u),s.typeOf.number.greaterThanOrEquals("Second",i,0),s.typeOf.number.lessThanOrEquals("Second",i,u?60:59),s.typeOf.number.greaterThanOrEquals("Millisecond",a,0),s.typeOf.number.lessThan("Millisecond",a,1e3),function(){let n=2===t&&ht(e)?jn[t-1]+1:jn[t-1];if(r>n)throw new A("Month and Day represents invalid date")}(),this.year=e,this.month=t,this.day=r,this.hour=n,this.minute=o,this.second=i,this.millisecond=a,this.isLeapSecond=u}var Et=Go;function Ko(e,t){this.julianDate=e,this.offset=t}var ne=Ko,er={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},ce=Object.freeze(er),tr={UTC:0,TAI:1},$=Object.freeze(tr),Pn=new Et,Tt=[31,28,31,30,31,30,31,31,30,31,30,31],vt=29;function Kt(e,t){return I.compare(e.julianDate,t.julianDate)}var Ke=new ne;function At(e){Ke.julianDate=e;let t=I.leapSeconds,r=Be(t,Ke,Kt);r<0&&(r=~r),r>=t.length&&(r=t.length-1);let n=t[r].offset;r>0&&I.secondsDifference(t[r].julianDate,e)>n&&(r--,n=t[r].offset),I.addSeconds(e,n,e)}function Mn(e,t){Ke.julianDate=e;let r=I.leapSeconds,n=Be(r,Ke,Kt);if(n<0&&(n=~n),0===n)return I.addSeconds(e,-r[0].offset,t);if(n>=r.length)return I.addSeconds(e,-r[n-1].offset,t);let o=I.secondsDifference(r[n].julianDate,e);return 0===o?I.addSeconds(e,-r[n].offset,t):o<=1?void 0:I.addSeconds(e,-r[--n].offset,t)}function Ne(e,t,r){let n=t/ce.SECONDS_PER_DAY|0;return e+=n,(t-=ce.SECONDS_PER_DAY*n)<0&&(e--,t+=ce.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function en(e,t,r,n,o,s,i){let a=(t-14)/12|0,u=e+4800+a,l=(1461*u/4|0)+(367*(t-2-12*a)/12|0)-(3*((u+100)/100|0)/4|0)+r-32075;(n-=12)<0&&(n+=24);let c=s+(n*ce.SECONDS_PER_HOUR+o*ce.SECONDS_PER_MINUTE+i*ce.SECONDS_PER_MILLISECOND);return c>=43200&&(l-=1),[l,c]}var nr=/^(\d{4})$/,or=/^(\d{4})-(\d{2})$/,rr=/^(\d{4})-?(\d{3})$/,ir=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,cr=/^(\d{4})-?(\d{2})-?(\d{2})$/,tn=/([Z+\-])?(\d{2})?:?(\d{2})?$/,sr=/^(\d{2})(\.\d+)?/.source+tn.source,ar=/^(\d{2}):?(\d{2})(\.\d+)?/.source+tn.source,fr=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+tn.source,Re="Invalid ISO 8601 date.";function I(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=O(e,0),t=O(t,0),r=O(r,$.UTC);let n=0|e;Ne(n,t+=(e-n)*ce.SECONDS_PER_DAY,this),r===$.UTC&&At(this)}I.fromGregorianDate=function(e,t){if(!(e instanceof Et))throw new A("date must be a valid GregorianDate.");let r=en(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return p(t)?(Ne(r[0],r[1],t),At(t),t):new I(r[0],r[1],$.UTC)},I.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new A("date must be a valid JavaScript Date.");let r=en(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return p(t)?(Ne(r[0],r[1],t),At(t),t):new I(r[0],r[1],$.UTC)},I.fromIso8601=function(e,t){if("string"!=typeof e)throw new A(Re);let r,n,o,s,i,a=(e=e.replace(",",".")).split("T"),u=1,l=1,c=0,f=0,h=0,d=0,m=a[0],y=a[1];if(!p(m))throw new A(Re);if(a=m.match(cr),null!==a){if(s=m.split("-").length-1,s>0&&2!==s)throw new A(Re);r=+a[1],u=+a[2],l=+a[3]}else if(a=m.match(or),null!==a)r=+a[1],u=+a[2];else if(a=m.match(nr),null!==a)r=+a[1];else{let e;if(a=m.match(rr),null!==a){if(r=+a[1],e=+a[2],o=ht(r),e<1||o&&e>366||!o&&e>365)throw new A(Re)}else{if(a=m.match(ir),null===a)throw new A(Re);{r=+a[1];let t=+a[2],n=+a[3]||0;if(s=m.split("-").length-1,s>0&&(!p(a[3])&&1!==s||p(a[3])&&2!==s))throw new A(Re);e=7*t+n-new Date(Date.UTC(r,0,4)).getUTCDay()-3}}n=new Date(Date.UTC(r,0,1)),n.setUTCDate(e),u=n.getUTCMonth()+1,l=n.getUTCDate()}if(o=ht(r),u<1||u>12||l<1||(2!==u||!o)&&l>Tt[u-1]||o&&2===u&&l>vt)throw new A(Re);if(p(y)){if(a=y.match(fr),null!==a){if(s=y.split(":").length-1,s>0&&2!==s&&3!==s)throw new A(Re);c=+a[1],f=+a[2],h=+a[3],d=1e3*+(a[4]||0),i=5}else if(a=y.match(ar),null!==a){if(s=y.split(":").length-1,s>2)throw new A(Re);c=+a[1],f=+a[2],h=60*+(a[3]||0),i=4}else{if(a=y.match(sr),null===a)throw new A(Re);c=+a[1],f=60*+(a[2]||0),i=3}if(f>=60||h>=61||c>24||24===c&&(f>0||h>0||d>0))throw new A(Re);let e=a[i],t=+a[i+1],n=+(a[i+2]||0);switch(e){case"+":c-=t,f-=n;break;case"-":c+=t,f+=n;break;case"Z":break;default:f+=new Date(Date.UTC(r,u-1,l,c,f)).getTimezoneOffset()}}let g=60===h;for(g&&h--;f>=60;)f-=60,c++;for(;c>=24;)c-=24,l++;for(n=o&&2===u?vt:Tt[u-1];l>n;)l-=n,u++,u>12&&(u-=12,r++),n=o&&2===u?vt:Tt[u-1];for(;f<0;)f+=60,c--;for(;c<0;)c+=24,l--;for(;l<1;)u--,u<1&&(u+=12,r--),n=o&&2===u?vt:Tt[u-1],l+=n;let O=en(r,u,l,c,f,h,d);return p(t)?(Ne(O[0],O[1],t),At(t)):t=new I(O[0],O[1],$.UTC),g&&I.addSeconds(t,1,t),t},I.now=function(e){return I.fromDate(new Date,e)};var Ct=new I(0,0,$.TAI);I.toGregorianDate=function(e,t){if(!p(e))throw new A("julianDate is required.");let r=!1,n=Mn(e,Ct);p(n)||(I.addSeconds(e,-1,Ct),n=Mn(Ct,Ct),r=!0);let o=n.dayNumber,s=n.secondsOfDay;s>=43200&&(o+=1);let i=o+68569|0,a=4*i/146097|0;i=i-((146097*a+3)/4|0)|0;let u=4e3*(i+1)/1461001|0;i=i-(1461*u/4|0)+31|0;let l=80*i/2447|0,c=i-(2447*l/80|0)|0;i=l/11|0;let f=l+2-12*i|0,h=100*(a-49)+u+i|0,d=s/ce.SECONDS_PER_HOUR|0,m=s-d*ce.SECONDS_PER_HOUR,y=m/ce.SECONDS_PER_MINUTE|0;m-=y*ce.SECONDS_PER_MINUTE;let g=0|m,O=(m-g)/ce.SECONDS_PER_MILLISECOND;return d+=12,d>23&&(d-=24),r&&(g+=1),p(t)?(t.year=h,t.month=f,t.day=c,t.hour=d,t.minute=y,t.second=g,t.millisecond=O,t.isLeapSecond=r,t):new Et(h,f,c,d,y,g,O,r)},I.toDate=function(e){if(!p(e))throw new A("julianDate is required.");let t=I.toGregorianDate(e,Pn),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))},I.toIso8601=function(e,t){if(!p(e))throw new A("julianDate is required.");let r,n=I.toGregorianDate(e,Pn),o=n.year,s=n.month,i=n.day,a=n.hour,u=n.minute,l=n.second,c=n.millisecond;return 1e4===o&&1===s&&1===i&&0===a&&0===u&&0===l&&0===c&&(o=9999,s=12,i=31,a=24),p(t)||0===c?p(t)&&0!==t?(r=(.01*c).toFixed(t).replace(".","").slice(0,t),`${o.toString().padStart(4,"0")}-${s.toString().padStart(2,"0")}-${i.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}.${r}Z`):`${o.toString().padStart(4,"0")}-${s.toString().padStart(2,"0")}-${i.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}Z`:(r=(.01*c).toString().replace(".",""),`${o.toString().padStart(4,"0")}-${s.toString().padStart(2,"0")}-${i.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}.${r}Z`)},I.clone=function(e,t){if(p(e))return p(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new I(e.dayNumber,e.secondsOfDay,$.TAI)},I.compare=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");let r=e.dayNumber-t.dayNumber;return 0!==r?r:e.secondsOfDay-t.secondsOfDay},I.equals=function(e,t){return e===t||p(e)&&p(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},I.equalsEpsilon=function(e,t,r){return r=O(r,0),e===t||p(e)&&p(t)&&Math.abs(I.secondsDifference(e,t))<=r},I.totalDays=function(e){if(!p(e))throw new A("julianDate is required.");return e.dayNumber+e.secondsOfDay/ce.SECONDS_PER_DAY},I.secondsDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");return(e.dayNumber-t.dayNumber)*ce.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)},I.daysDifference=function(e,t){if(!p(e))throw new A("left is required.");if(!p(t))throw new A("right is required.");return e.dayNumber-t.dayNumber+(e.secondsOfDay-t.secondsOfDay)/ce.SECONDS_PER_DAY},I.computeTaiMinusUtc=function(e){Ke.julianDate=e;let t=I.leapSeconds,r=Be(t,Ke,Kt);return r<0&&(r=~r,--r,r<0&&(r=0)),t[r].offset},I.addSeconds=function(e,t,r){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("seconds is required.");if(!p(r))throw new A("result is required.");return Ne(e.dayNumber,e.secondsOfDay+t,r)},I.addMinutes=function(e,t,r){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("minutes is required.");if(!p(r))throw new A("result is required.");let n=e.secondsOfDay+t*ce.SECONDS_PER_MINUTE;return Ne(e.dayNumber,n,r)},I.addHours=function(e,t,r){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("hours is required.");if(!p(r))throw new A("result is required.");let n=e.secondsOfDay+t*ce.SECONDS_PER_HOUR;return Ne(e.dayNumber,n,r)},I.addDays=function(e,t,r){if(!p(e))throw new A("julianDate is required.");if(!p(t))throw new A("days is required.");if(!p(r))throw new A("result is required.");return Ne(e.dayNumber+t,e.secondsOfDay,r)},I.lessThan=function(e,t){return I.compare(e,t)<0},I.lessThanOrEquals=function(e,t){return I.compare(e,t)<=0},I.greaterThan=function(e,t){return I.compare(e,t)>0},I.greaterThanOrEquals=function(e,t){return I.compare(e,t)>=0},I.prototype.clone=function(e){return I.clone(this,e)},I.prototype.equals=function(e){return I.equals(this,e)},I.prototype.equalsEpsilon=function(e,t){return I.equalsEpsilon(this,e,t)},I.prototype.toString=function(){return I.toIso8601(this)},I.leapSeconds=[new ne(new I(2441317,43210,$.TAI),10),new ne(new I(2441499,43211,$.TAI),11),new ne(new I(2441683,43212,$.TAI),12),new ne(new I(2442048,43213,$.TAI),13),new ne(new I(2442413,43214,$.TAI),14),new ne(new I(2442778,43215,$.TAI),15),new ne(new I(2443144,43216,$.TAI),16),new ne(new I(2443509,43217,$.TAI),17),new ne(new I(2443874,43218,$.TAI),18),new ne(new I(2444239,43219,$.TAI),19),new ne(new I(2444786,43220,$.TAI),20),new ne(new I(2445151,43221,$.TAI),21),new ne(new I(2445516,43222,$.TAI),22),new ne(new I(2446247,43223,$.TAI),23),new ne(new I(2447161,43224,$.TAI),24),new ne(new I(2447892,43225,$.TAI),25),new ne(new I(2448257,43226,$.TAI),26),new ne(new I(2448804,43227,$.TAI),27),new ne(new I(2449169,43228,$.TAI),28),new ne(new I(2449534,43229,$.TAI),29),new ne(new I(2450083,43230,$.TAI),30),new ne(new I(2450630,43231,$.TAI),31),new ne(new I(2451179,43232,$.TAI),32),new ne(new I(2453736,43233,$.TAI),33),new ne(new I(2454832,43234,$.TAI),34),new ne(new I(2456109,43235,$.TAI),35),new ne(new I(2457204,43236,$.TAI),36),new ne(new I(2457754,43237,$.TAI),37)];var pe=I,so=Ze(We(),1);function ur(e){return(0===e.length||"/"!==e[e.length-1])&&(e=`${e}/`),e}var kn=ur;function Fn(e,t){if(null===e||"object"!=typeof e)return e;t=O(t,!1);let r=new e.constructor;for(let n in e)if(e.hasOwnProperty(n)){let o=e[n];t&&(o=Fn(o,t)),r[n]=o}return r}var nt=Fn;function pr(){let e,t,r=new Promise((function(r,n){e=r,t=n}));return{resolve:e,reject:t,promise:r}}var Qe=pr,xn=Ze(We(),1);function nn(e,t){let r;return typeof document<"u"&&(r=document),nn._implementation(e,t,r)}nn._implementation=function(e,t,r){if(!p(e))throw new A("relative uri is required.");if(!p(t)){if(typeof r>"u")return e;t=O(r.baseURI,r.location.href)}let n=new xn.default(e);return""!==n.scheme()?n.toString():n.absoluteTo(t).toString()};var Ut=nn,Ln=Ze(We(),1);function hr(e,t){if(!p(e))throw new A("uri is required.");let r="",n=e.lastIndexOf("/");return-1!==n&&(r=e.substring(0,n+1)),t&&(0!==(e=new Ln.default(e)).query().length&&(r+=`?${e.query()}`),0!==e.fragment().length&&(r+=`#${e.fragment()}`)),r}var Bn=hr,Wn=Ze(We(),1);function dr(e){if(!p(e))throw new A("uri is required.");let t=new Wn.default(e);t.normalize();let r=t.path(),n=r.lastIndexOf("/");return-1!==n&&(r=r.substr(n+1)),n=r.lastIndexOf("."),r=-1===n?"":r.substr(n+1),r}var Qn=dr,Hn={};function mr(e,t,r){p(t)||(t=e.width),p(r)||(r=e.height);let n=Hn[t];p(n)||(n={},Hn[t]=n);let o=n[r];if(!p(o)){let e=document.createElement("canvas");e.width=t,e.height=r,o=e.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",n[r]=o}return o.drawImage(e,0,0,t,r),o.getImageData(0,0,t,r).data}var on=mr,yr=/^blob:/i;function lr(e){return s.typeOf.string("uri",e),yr.test(e)}var ve,It=lr;function wr(e){p(ve)||(ve=document.createElement("a")),ve.href=window.location.href;let t=ve.host,r=ve.protocol;return ve.href=e,ve.href=ve.href,r!==ve.protocol||t!==ve.host}var $n=wr,br=/^data:/i;function Or(e){return s.typeOf.string("uri",e),br.test(e)}var zt=Or;function gr(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise(((e,r)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let n=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,n.removeChild(t),e()},t.onerror=function(e){r(e)},n.appendChild(t)}))}var Vn=gr;function _r(e){if(!p(e))throw new A("obj is required.");let t="";for(let r in e)if(e.hasOwnProperty(r)){let n=e[r],o=`${encodeURIComponent(r)}=`;if(Array.isArray(n))for(let e=0,r=n.length;e<r;++e)t+=`${o+encodeURIComponent(n[e])}&`;else t+=`${o+encodeURIComponent(n)}&`}return t=t.slice(0,-1),t}var Yn=_r;function Sr(e){if(!p(e))throw new A("queryString is required.");let t={};if(""===e)return t;let r=e.replace(/\+/g,"%20").split(/[&;]/);for(let e=0,n=r.length;e<n;++e){let n=r[e].split("="),o=decodeURIComponent(n[0]),s=n[1];s=p(s)?decodeURIComponent(s):"";let i=t[o];"string"==typeof i?t[o]=[i,s]:Array.isArray(i)?i.push(s):t[o]=s}return t}var Xn=Sr,Rr={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},fe=Object.freeze(Rr),Er={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},Zn=Object.freeze(Er);function qt(e){e=O(e,O.EMPTY_OBJECT);let t=O(e.throttleByServer,!1),r=O(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=O(e.priority,0),this.throttle=r,this.throttleByServer=t,this.type=O(e.type,Zn.OTHER),this.serverKey=e.serverKey,this.state=fe.UNISSUED,this.deferred=void 0,this.cancelled=!1}qt.prototype.cancel=function(){this.cancelled=!0},qt.prototype.clone=function(e){return p(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=fe.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new qt(this)};var Jn=qt;function Tr(e){let t={};if(!e)return t;let r=e.split("\r\n");for(let e=0;e<r.length;++e){let n=r[e],o=n.indexOf(": ");if(o>0){let e=n.substring(0,o),r=n.substring(o+2);t[e]=r}}return t}var Gn=Tr;function Kn(e,t,r){this.statusCode=e,this.response=t,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=Gn(this.responseHeaders))}Kn.prototype.toString=function(){let e="Request has failed.";return p(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var dt=Kn,Dt=Ze(We(),1);function mt(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}function vr(e,t){return t-e}Object.defineProperties(mt.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),mt.prototype.addEventListener=function(e,t){s.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);let r=this;return function(){r.removeEventListener(e,t)}},mt.prototype.removeEventListener=function(e,t){s.typeOf.func("listener",e);let r=this._listeners,n=this._scopes,o=-1;for(let s=0;s<r.length;s++)if(r[s]===e&&n[s]===t){o=s;break}return-1!==o&&(this._insideRaiseEvent?(this._toRemove.push(o),r[o]=void 0,n[o]=void 0):(r.splice(o,1),n.splice(o,1)),!0)},mt.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,r=this._scopes,n=t.length;for(e=0;e<n;e++){let n=t[e];p(n)&&t[e].apply(r[e],arguments)}let o=this._toRemove;if(n=o.length,n>0){for(o.sort(vr),e=0;e<n;e++){let n=o[e];t.splice(n,1),r.splice(n,1)}o.length=0}this._insideRaiseEvent=!1};var eo=mt;function He(e){s.typeOf.object("options",e),s.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}function rn(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}Object.defineProperties(He.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){s.typeOf.number.greaterThanOrEquals("maximumLength",e,0);let t=this._length;if(e<t){let r=this._array;for(let n=e;n<t;++n)r[n]=void 0;this._length=e,r.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}}),He.prototype.reserve=function(e){e=O(e,this._length),this._array.length=e},He.prototype.heapify=function(e){e=O(e,0);let t=this._length,r=this._comparator,n=this._array,o=-1,s=!0;for(;s;){let i=2*(e+1),a=i-1;o=a<t&&r(n[a],n[e])<0?a:e,i<t&&r(n[i],n[o])<0&&(o=i),o!==e?(rn(n,o,e),e=o):s=!1}},He.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)},He.prototype.insert=function(e){s.defined("element",e);let t,r=this._array,n=this._comparator,o=this._maximumLength,i=this._length++;for(i<r.length?r[i]=e:r.push(e);0!==i;){let e=Math.floor((i-1)/2);if(!(n(r[i],r[e])<0))break;rn(r,i,e),i=e}return p(o)&&this._length>o&&(t=r[o],this._length=o),t},He.prototype.pop=function(e){if(e=O(e,0),0===this._length)return;s.typeOf.number.lessThan("index",e,this._length);let t=this._array,r=t[e];return rn(t,e,--this._length),this.heapify(e),t[this._length]=void 0,r};var to=He;function Cr(e,t){return e.priority-t.priority}var K={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},ot=20,we=new to({comparator:Cr});we.maximumLength=ot,we.reserve(ot);var Ce=[],Pe={},Ar=typeof document<"u"?new Dt.default(document.location.href):new Dt.default,Nt=new eo;function se(){}function no(e){p(e.priorityFunction)&&(e.priority=e.priorityFunction())}function oo(e){return e.state===fe.UNISSUED&&(e.state=fe.ISSUED,e.deferred=Qe()),e.deferred.promise}function jr(e){return function(t){if(e.state===fe.CANCELLED)return;let r=e.deferred;--K.numberOfActiveRequests,--Pe[e.serverKey],Nt.raiseEvent(),e.state=fe.RECEIVED,e.deferred=void 0,r.resolve(t)}}function Mr(e){return function(t){e.state!==fe.CANCELLED&&(++K.numberOfFailedRequests,--K.numberOfActiveRequests,--Pe[e.serverKey],Nt.raiseEvent(t),e.state=fe.FAILED,e.deferred.reject(t))}}function ro(e){let t=oo(e);return e.state=fe.ACTIVE,Ce.push(e),++K.numberOfActiveRequests,++K.numberOfActiveRequestsEver,++Pe[e.serverKey],e.requestFunction().then(jr(e)).catch(Mr(e)),t}function $e(e){let t=e.state===fe.ACTIVE;if(e.state=fe.CANCELLED,++K.numberOfCancelledRequests,p(e.deferred)){let t=e.deferred;e.deferred=void 0,t.reject()}t&&(--K.numberOfActiveRequests,--Pe[e.serverKey],++K.numberOfCancelledActiveRequests),p(e.cancelFunction)&&e.cancelFunction()}function Pr(){se.debugShowStatistics&&(0===K.numberOfActiveRequests&&K.lastNumberOfActiveRequests>0&&(K.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${K.numberOfAttemptedRequests}`),K.numberOfAttemptedRequests=0),K.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${K.numberOfCancelledRequests}`),K.numberOfCancelledRequests=0),K.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${K.numberOfCancelledActiveRequests}`),K.numberOfCancelledActiveRequests=0),K.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${K.numberOfFailedRequests}`),K.numberOfFailedRequests=0)),K.lastNumberOfActiveRequests=K.numberOfActiveRequests)}se.maximumRequests=50,se.maximumRequestsPerServer=18,se.requestsByServer={},se.throttleRequests=!0,se.debugShowStatistics=!1,se.requestCompletedEvent=Nt,Object.defineProperties(se,{statistics:{get:function(){return K}},priorityHeapLength:{get:function(){return ot},set:function(e){if(e<ot)for(;we.length>e;){$e(we.pop())}ot=e,we.maximumLength=e,we.reserve(e)}}}),se.serverHasOpenSlots=function(e,t){t=O(t,1);let r=O(se.requestsByServer[e],se.maximumRequestsPerServer);return Pe[e]+t<=r},se.heapHasOpenSlots=function(e){return we.length+e<=ot},se.update=function(){let e,t,r=0,n=Ce.length;for(e=0;e<n;++e)t=Ce[e],t.cancelled&&$e(t),t.state===fe.ACTIVE?r>0&&(Ce[e-r]=t):++r;Ce.length-=r;let o=we.internalArray,s=we.length;for(e=0;e<s;++e)no(o[e]);we.resort();let i=Math.max(se.maximumRequests-Ce.length,0),a=0;for(;a<i&&we.length>0;)t=we.pop(),t.cancelled?$e(t):!t.throttleByServer||se.serverHasOpenSlots(t.serverKey)?(ro(t),++a):$e(t);Pr()},se.getServerKey=function(e){s.typeOf.string("url",e);let t=new Dt.default(e);""===t.scheme()&&(t=t.absoluteTo(Ar),t.normalize());let r=t.authority();/:/.test(r)||(r=`${r}:${"https"===t.scheme()?"443":"80"}`);let n=Pe[r];return p(n)||(Pe[r]=0),r},se.request=function(e){if(s.typeOf.object("request",e),s.typeOf.string("request.url",e.url),s.typeOf.func("request.requestFunction",e.requestFunction),zt(e.url)||It(e.url))return Nt.raiseEvent(),e.state=fe.RECEIVED,e.requestFunction();if(++K.numberOfAttemptedRequests,p(e.serverKey)||(e.serverKey=se.getServerKey(e.url)),se.throttleRequests&&e.throttleByServer&&!se.serverHasOpenSlots(e.serverKey))return;if(!se.throttleRequests||!e.throttle)return ro(e);if(Ce.length>=se.maximumRequests)return;no(e);let t=we.insert(e);if(p(t)){if(t===e)return;$e(t)}return oo(e)},se.clearForSpecs=function(){for(;we.length>0;){$e(we.pop())}let e=Ce.length;for(let t=0;t<e;++t)$e(Ce[t]);Ce.length=0,Pe={},K.numberOfAttemptedRequests=0,K.numberOfActiveRequests=0,K.numberOfCancelledRequests=0,K.numberOfCancelledActiveRequests=0,K.numberOfFailedRequests=0,K.numberOfActiveRequestsEver=0,K.lastNumberOfActiveRequests=0},se.numberOfActiveRequestsByServer=function(e){return Pe[e]},se.requestHeap=we;var kt=se,io=Ze(We(),1),yt={},rt={};function Ur(e){let t=new io.default(e);t.normalize();let r=t.authority();if(0!==r.length){if(t.authority(r),-1!==r.indexOf("@")&&(r=r.split("@")[1]),-1===r.indexOf(":")){let e=t.scheme();if(0===e.length&&(e=window.location.protocol,e=e.substring(0,e.length-1)),"http"===e)r+=":80";else{if("https"!==e)return;r+=":443"}}return r}}yt.add=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let r=`${e.toLowerCase()}:${t}`;p(rt[r])||(rt[r]=!0)},yt.remove=function(e,t){if(!p(e))throw new A("host is required.");if(!p(t)||t<=0)throw new A("port is required to be greater than 0.");let r=`${e.toLowerCase()}:${t}`;p(rt[r])&&delete rt[r]},yt.contains=function(e){if(!p(e))throw new A("url is required.");let t=Ur(e);return!(!p(t)||!p(rt[t]))},yt.clear=function(){rt={}};var it,cn=yt,ao=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch{return!1}}();function U(e){"string"==typeof(e=O(e,O.EMPTY_OBJECT))&&(e={url:e}),s.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Ae(e.templateValues,{}),this._queryParameters=Ae(e.queryParameters,{}),this.headers=Ae(e.headers,{}),this.request=O(e.request,new Jn),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=O(e.retryAttempts,0),this._retryCount=0,O(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Ae(e,t){return p(e)?nt(e):t}function Ir(e){return 0===e.length?{}:-1===e.indexOf("=")?{[e]:void 0}:Xn(e)}function xt(e,t,r){if(!r)return De(e,t);let n=nt(e,!0);for(let e in t)if(t.hasOwnProperty(e)){let r=n[e],o=t[e];p(r)?(Array.isArray(r)||(r=n[e]=[r]),n[e]=r.concat(o)):n[e]=Array.isArray(o)?o.slice():o}return n}function zr(e){let t=Object.keys(e);return 0===t.length?"":1!==t.length||p(e[t[0]])?`?${Yn(e)}`:`?${t[0]}`}function sn(e){let t=e.resource,r=e.flipY,n=e.skipColorSpaceConversion,o=e.preferImageBitmap,s=t.request;s.url=t.url,s.requestFunction=function(){let e=!1;!t.isDataUri&&!t.isBlobUri&&(e=t.isCrossOriginUrl);let i=Qe();return U._Implementations.createImage(s,e,i,r,n,o),i.promise};let i=kt.request(s);if(p(i))return i.catch((function(e){return s.state!==fe.FAILED?Promise.reject(e):t.retryOnError(e).then((function(i){return i?(s.state=fe.UNISSUED,s.deferred=void 0,sn({resource:t,flipY:r,skipColorSpaceConversion:n,preferImageBitmap:o})):Promise.reject(e)}))}))}function fo(e,t,r){let n={};n[t]=r,e.setQueryParameters(n);let o=e.request,s=e.url;o.url=s,o.requestFunction=function(){let e=Qe();return window[r]=function(t){e.resolve(t);try{delete window[r]}catch{window[r]=void 0}},U._Implementations.loadAndExecuteScript(s,r,e),e.promise};let i=kt.request(o);if(p(i))return i.catch((function(n){return o.state!==fe.FAILED?Promise.reject(n):e.retryOnError(n).then((function(s){return s?(o.state=fe.UNISSUED,o.deferred=void 0,fo(e,t,r)):Promise.reject(n)}))}))}function an(e){if(e.state===fe.ISSUED||e.state===fe.ACTIVE)throw new Se("The Resource is already being fetched.");e.state=fe.UNISSUED,e.deferred=void 0}U.createIfNeeded=function(e){return e instanceof U?e.getDerivedResource({request:e.request}):"string"!=typeof e?e:new U({url:e})},U.supportsImageBitmapOptions=function(){return p(it)?it:"function"!=typeof createImageBitmap?it=Promise.resolve(!1):it=U.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then((function(e){return Promise.all([createImageBitmap(e,{imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"}),createImageBitmap(e)])})).then((function(e){let t=on(e[0]),r=on(e[1]);return t[1]!==r[1]})).catch((function(){return!1}))},Object.defineProperties(U,{isBlobSupported:{get:function(){return ao}}}),Object.defineProperties(U.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return Qn(this._url)}},isDataUri:{get:function(){return zt(this._url)}},isBlobUri:{get:function(){return It(this._url)}},isCrossOriginUrl:{get:function(){return $n(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}}),U.prototype.toString=function(){return this.getUrlComponent(!0,!0)},U.prototype.parseUrl=function(e,t,r,n){let o=new so.default(e),s=Ir(o.query());this._queryParameters=t?xt(s,this.queryParameters,r):s,o.search(""),o.fragment(""),p(n)&&""===o.scheme()&&(o=o.absoluteTo(Ut(n))),this._url=o.toString()},U.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let r=this._url;e&&(r=`${r}${zr(this.queryParameters)}`),r=r.replace(/%7B/g,"{").replace(/%7D/g,"}");let n=this._templateValues;return Object.keys(n).length>0&&(r=r.replace(/{(.*?)}/g,(function(e,t){let r=n[t];return p(r)?encodeURIComponent(r):e}))),t&&p(this.proxy)&&(r=this.proxy.getURL(r)),r},U.prototype.setQueryParameters=function(e,t){this._queryParameters=t?xt(this._queryParameters,e,!1):xt(e,this._queryParameters,!1)},U.prototype.appendQueryParameters=function(e){this._queryParameters=xt(e,this._queryParameters,!0)},U.prototype.setTemplateValues=function(e,t){this._templateValues=t?De(this._templateValues,e):De(e,this._templateValues)},U.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,p(e.url)){let r=O(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,r,this._url)}return p(e.queryParameters)&&(t._queryParameters=De(e.queryParameters,t.queryParameters)),p(e.templateValues)&&(t._templateValues=De(e.templateValues,t.templateValues)),p(e.headers)&&(t.headers=De(e.headers,t.headers)),p(e.proxy)&&(t.proxy=e.proxy),p(e.request)&&(t.request=e.request),p(e.retryCallback)&&(t.retryCallback=e.retryCallback),p(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t},U.prototype.retryOnError=function(e){let t=this.retryCallback;if("function"!=typeof t||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let r=this;return Promise.resolve(t(this,e)).then((function(e){return++r._retryCount,e}))},U.prototype.clone=function(e){return p(e)?(e._url=this._url,e._queryParameters=nt(this._queryParameters),e._templateValues=nt(this._templateValues),e.headers=nt(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new U({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:p(this.credits)?this.credits.slice():void 0})},U.prototype.getBaseUri=function(e){return Bn(this.getUrlComponent(e),e)},U.prototype.appendForwardSlash=function(){this._url=kn(this._url)},U.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},U.fetchArrayBuffer=function(e){return new U(e).fetchArrayBuffer()},U.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},U.fetchBlob=function(e){return new U(e).fetchBlob()},U.prototype.fetchImage=function(e){e=O(e,O.EMPTY_OBJECT);let t=O(e.preferImageBitmap,!1),r=O(e.preferBlob,!1),n=O(e.flipY,!1),o=O(e.skipColorSpaceConversion,!1);if(an(this.request),!ao||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!r)return sn({resource:this,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:t});let s,i,a,u,l=this.fetchBlob();return p(l)?U.supportsImageBitmapOptions().then((function(e){return s=e,i=s&&t,l})).then((function(e){if(!p(e))return;if(u=e,i)return U.createImageBitmapFromBlob(e,{flipY:n,premultiplyAlpha:!1,skipColorSpaceConversion:o});let t=window.URL.createObjectURL(e);return a=new U({url:t}),sn({resource:a,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:!1})})).then((function(e){if(p(e))return e.blob=u,i||window.URL.revokeObjectURL(a.url),e})).catch((function(e){return p(a)&&window.URL.revokeObjectURL(a.url),e.blob=u,Promise.reject(e)})):void 0},U.fetchImage=function(e){return new U(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})},U.prototype.fetchText=function(){return this.fetch({responseType:"text"})},U.fetchText=function(e){return new U(e).fetchText()},U.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(p(e))return e.then((function(e){if(p(e))return JSON.parse(e)}))},U.fetchJson=function(e){return new U(e).fetchJson()},U.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},U.fetchXML=function(e){return new U(e).fetchXML()},U.prototype.fetchJsonp=function(e){let t;e=O(e,"callback"),an(this.request);do{t=`loadJsonp${E.nextRandomNumber().toString().substring(2,8)}`}while(p(window[t]));return fo(this,e,t)},U.fetchJsonp=function(e){return new U(e).fetchJsonp(e.callbackParameterName)},U.prototype._makeRequest=function(e){let t=this;an(t.request);let r=t.request,n=t.url;r.url=n,r.requestFunction=function(){let o=e.responseType,s=De(e.headers,t.headers),i=e.overrideMimeType,a=e.method,u=e.data,l=Qe(),c=U._Implementations.loadWithXhr(n,o,a,u,s,l,i);return p(c)&&p(c.abort)&&(r.cancelFunction=function(){c.abort()}),l.promise};let o=kt.request(r);if(p(o))return o.then((function(e){return r.cancelFunction=void 0,e})).catch((function(n){return r.cancelFunction=void 0,r.state!==fe.FAILED?Promise.reject(n):t.retryOnError(n).then((function(o){return o?(r.state=fe.UNISSUED,r.deferred=void 0,t.fetch(e)):Promise.reject(n)}))}))};var qr=/^data:(.*?)(;base64)?,(.*)$/;function Ft(e,t){let r=decodeURIComponent(t);return e?atob(r):r}function co(e,t){let r=Ft(e,t),n=new ArrayBuffer(r.length),o=new Uint8Array(n);for(let e=0;e<r.length;e++)o[e]=r.charCodeAt(e);return n}function Dr(e,t){t=O(t,"");let r,n,o=e[1],s=!!e[2],i=e[3];switch(t){case"":case"text":return Ft(s,i);case"arraybuffer":return co(s,i);case"blob":return r=co(s,i),new Blob([r],{type:o});case"document":return n=new DOMParser,n.parseFromString(Ft(s,i),o);case"json":return JSON.parse(Ft(s,i));default:throw new A(`Unhandled responseType: ${t}`)}}function Nr(e,t,r,n,o,s,i){fetch(e,{method:r,headers:o}).then((async e=>{if(!e.ok){let t={};return e.headers.forEach(((e,r)=>{t[r]=e})),void s.reject(new dt(e.status,e,t))}switch(t){case"text":s.resolve(e.text());break;case"json":s.resolve(e.json());break;default:s.resolve(new Uint8Array(await e.arrayBuffer()).buffer)}})).catch((()=>{s.reject(new dt)}))}U.prototype.fetch=function(e){return(e=Ae(e,{})).method="GET",this._makeRequest(e)},U.fetch=function(e){return new U(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},U.prototype.delete=function(e){return(e=Ae(e,{})).method="DELETE",this._makeRequest(e)},U.delete=function(e){return new U(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})},U.prototype.head=function(e){return(e=Ae(e,{})).method="HEAD",this._makeRequest(e)},U.head=function(e){return new U(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},U.prototype.options=function(e){return(e=Ae(e,{})).method="OPTIONS",this._makeRequest(e)},U.options=function(e){return new U(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})},U.prototype.post=function(e,t){return s.defined("data",e),(t=Ae(t,{})).method="POST",t.data=e,this._makeRequest(t)},U.post=function(e){return new U(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},U.prototype.put=function(e,t){return s.defined("data",e),(t=Ae(t,{})).method="PUT",t.data=e,this._makeRequest(t)},U.put=function(e){return new U(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},U.prototype.patch=function(e,t){return s.defined("data",e),(t=Ae(t,{})).method="PATCH",t.data=e,this._makeRequest(t)},U.patch=function(e){return new U(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})},U._Implementations={},U._Implementations.loadImageElement=function(e,t,r){let n=new Image;n.onload=function(){0===n.naturalWidth&&0===n.naturalHeight&&0===n.width&&0===n.height&&(n.width=300,n.height=150),r.resolve(n)},n.onerror=function(e){r.reject(e)},t&&(cn.contains(e)?n.crossOrigin="use-credentials":n.crossOrigin=""),n.src=e},U._Implementations.createImage=function(e,t,r,n,o,s){let i=e.url;U.supportsImageBitmapOptions().then((function(a){if(!a||!s)return void U._Implementations.loadImageElement(i,t,r);let u=Qe(),l=U._Implementations.loadWithXhr(i,"blob","GET",void 0,void 0,u,void 0,void 0,void 0);return p(l)&&p(l.abort)&&(e.cancelFunction=function(){l.abort()}),u.promise.then((function(e){if(p(e))return U.createImageBitmapFromBlob(e,{flipY:n,premultiplyAlpha:!1,skipColorSpaceConversion:o});r.reject(new Se(`Successfully retrieved ${i} but it contained no content.`))})).then((function(e){r.resolve(e)}))})).catch((function(e){r.reject(e)}))},U.createImageBitmapFromBlob=function(e,t){return s.defined("options",t),s.typeOf.bool("options.flipY",t.flipY),s.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),s.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};var kr=typeof XMLHttpRequest>"u";U._Implementations.loadWithXhr=function(e,t,r,n,o,s,i){let a=qr.exec(e);if(null!==a)return void s.resolve(Dr(a,t));if(kr)return void Nr(e,t,r,n,o,s,i);let u=new XMLHttpRequest;if(cn.contains(e)&&(u.withCredentials=!0),u.open(r,e,!0),p(i)&&p(u.overrideMimeType)&&u.overrideMimeType(i),p(o))for(let e in o)o.hasOwnProperty(e)&&u.setRequestHeader(e,o[e]);p(t)&&(u.responseType=t);let l=!1;return"string"==typeof e&&(l=0===e.indexOf("file://")||typeof window<"u"&&"file://"===window.location.origin),u.onload=function(){if((u.status<200||u.status>=300)&&(!l||0!==u.status))return void s.reject(new dt(u.status,u.response,u.getAllResponseHeaders()));let e=u.response,n=u.responseType;if("HEAD"===r||"OPTIONS"===r){let e=u.getAllResponseHeaders().trim().split(/[\r\n]+/),t={};return e.forEach((function(e){let r=e.split(": "),n=r.shift();t[n]=r.join(": ")})),void s.resolve(t)}if(204===u.status)s.resolve(void 0);else if(!p(e)||p(t)&&n!==t)if("json"===t&&"string"==typeof e)try{s.resolve(JSON.parse(e))}catch(e){s.reject(e)}else(""===n||"document"===n)&&p(u.responseXML)&&u.responseXML.hasChildNodes()?s.resolve(u.responseXML):""!==n&&"text"!==n||!p(u.responseText)?s.reject(new Se("Invalid XMLHttpRequest response type.")):s.resolve(u.responseText);else s.resolve(e)},u.onerror=function(e){s.reject(new dt)},u.send(n),u},U._Implementations.loadAndExecuteScript=function(e,t,r){return Vn(e,t).catch((function(e){r.reject(e)}))},U._DefaultImplementations={},U._DefaultImplementations.createImage=U._Implementations.createImage,U._DefaultImplementations.loadWithXhr=U._Implementations.loadWithXhr,U._DefaultImplementations.loadAndExecuteScript=U._Implementations.loadAndExecuteScript,U.DEFAULT=Object.freeze(new U({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var ke=U;function wt(e){e=O(e,O.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=O(e.addNewLeapSeconds,!0),p(e.data)?uo(this,e.data):uo(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function Fr(e,t){return pe.compare(e.julianDate,t)}function uo(e,t){if(!p(t.columnNames))throw new Se("Error in loaded EOP data: The columnNames property is required.");if(!p(t.samples))throw new Se("Error in loaded EOP data: The samples property is required.");let r=t.columnNames.indexOf("modifiedJulianDateUtc"),n=t.columnNames.indexOf("xPoleWanderRadians"),o=t.columnNames.indexOf("yPoleWanderRadians"),s=t.columnNames.indexOf("ut1MinusUtcSeconds"),i=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),u=t.columnNames.indexOf("taiMinusUtcSeconds");if(r<0||n<0||o<0||s<0||i<0||a<0||u<0)throw new Se("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let l=e._samples=t.samples,c=e._dates=[];e._dateColumn=r,e._xPoleWanderRadiansColumn=n,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=s,e._xCelestialPoleOffsetRadiansColumn=i,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=u,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let f,h=e._addNewLeapSeconds;for(let t=0,n=l.length;t<n;t+=e._columnCount){let e=l[t+r],n=l[t+u],o=e+ce.MODIFIED_JULIAN_DATE_DIFFERENCE,s=new pe(o,n,$.TAI);if(c.push(s),h){if(n!==f&&p(f)){let e=pe.leapSeconds,t=Be(e,s,Fr);if(t<0){let r=new ne(s,n);e.splice(~t,0,r)}}f=n}}}function po(e,t,r,n,o){let s=r*n;o.xPoleWander=t[s+e._xPoleWanderRadiansColumn],o.yPoleWander=t[s+e._yPoleWanderRadiansColumn],o.xPoleOffset=t[s+e._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=t[s+e._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=t[s+e._ut1MinusUtcSecondsColumn]}function lt(e,t,r){return t+e*(r-t)}function ho(e,t,r,n,o,s,i){let a=e._columnCount;if(s>t.length-1)return i.xPoleWander=0,i.yPoleWander=0,i.xPoleOffset=0,i.yPoleOffset=0,i.ut1MinusUtc=0,i;let u=t[o],l=t[s];if(u.equals(l)||n.equals(u))return po(e,r,o,a,i),i;if(n.equals(l))return po(e,r,s,a,i),i;let c=pe.secondsDifference(n,u)/pe.secondsDifference(l,u),p=o*a,f=s*a,h=r[p+e._ut1MinusUtcSecondsColumn],d=r[f+e._ut1MinusUtcSecondsColumn],m=d-h;if(m>.5||m<-.5){let t=r[p+e._taiMinusUtcSecondsColumn],o=r[f+e._taiMinusUtcSecondsColumn];t!==o&&(l.equals(n)?h=d:d-=o-t)}return i.xPoleWander=lt(c,r[p+e._xPoleWanderRadiansColumn],r[f+e._xPoleWanderRadiansColumn]),i.yPoleWander=lt(c,r[p+e._yPoleWanderRadiansColumn],r[f+e._yPoleWanderRadiansColumn]),i.xPoleOffset=lt(c,r[p+e._xCelestialPoleOffsetRadiansColumn],r[f+e._xCelestialPoleOffsetRadiansColumn]),i.yPoleOffset=lt(c,r[p+e._yCelestialPoleOffsetRadiansColumn],r[f+e._yCelestialPoleOffsetRadiansColumn]),i.ut1MinusUtc=lt(c,h,d),i}wt.fromUrl=async function(e,t){s.defined("url",e),t=O(t,O.EMPTY_OBJECT);let r,n=ke.createIfNeeded(e);try{r=await n.fetchJson()}catch{throw new Se(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new wt({addNewLeapSeconds:t.addNewLeapSeconds,data:r})},wt.NONE=Object.freeze({compute:function(e,t){return p(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new pt(0,0,0,0,0),t}}),wt.prototype.compute=function(e,t){if(!p(this._samples))return;if(p(t)||(t=new pt(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;let r=this._dates,n=this._lastIndex,o=0,s=0;if(p(n)){let i=r[n],a=r[n+1],u=pe.lessThanOrEquals(i,e),l=!p(a),c=l||pe.greaterThanOrEquals(a,e);if(u&&c)return o=n,!l&&a.equals(e)&&++o,s=o+1,ho(this,r,this._samples,e,o,s,t),t}let i=Be(r,e,pe.compare,this._dateColumn);return i>=0?(i<r.length-1&&r[i+1].equals(e)&&++i,o=i,s=i):(s=~i,o=s-1,o<0&&(o=0)),this._lastIndex=o,ho(this,r,this._samples,e,o,s,t),t};var mo=wt;function be(e,t,r){this.heading=O(e,0),this.pitch=O(t,0),this.roll=O(r,0)}be.fromQuaternion=function(e,t){if(!p(e))throw new A("quaternion is required");p(t)||(t=new be);let r=2*(e.w*e.y-e.z*e.x),n=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),s=1-2*(e.y*e.y+e.z*e.z),i=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(i,s),t.roll=Math.atan2(o,n),t.pitch=-E.asinClamped(r),t},be.fromDegrees=function(e,t,r,n){if(!p(e))throw new A("heading is required");if(!p(t))throw new A("pitch is required");if(!p(r))throw new A("roll is required");return p(n)||(n=new be),n.heading=e*E.RADIANS_PER_DEGREE,n.pitch=t*E.RADIANS_PER_DEGREE,n.roll=r*E.RADIANS_PER_DEGREE,n},be.clone=function(e,t){if(p(e))return p(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new be(e.heading,e.pitch,e.roll)},be.equals=function(e,t){return e===t||p(e)&&p(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll},be.equalsEpsilon=function(e,t,r,n){return e===t||p(e)&&p(t)&&E.equalsEpsilon(e.heading,t.heading,r,n)&&E.equalsEpsilon(e.pitch,t.pitch,r,n)&&E.equalsEpsilon(e.roll,t.roll,r,n)},be.prototype.clone=function(e){return be.clone(this,e)},be.prototype.equals=function(e){return be.equals(this,e)},be.prototype.equalsEpsilon=function(e,t,r){return be.equalsEpsilon(this,e,t,r)},be.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Bt,Ve,Wt,Lt=be,yo=/((?:.*\/)|^)jsmap\.js(?:\?|\#|$)/;function xr(){let e=document.getElementsByTagName("script");for(let t=0,r=e.length;t<r;++t){let r=e[t].getAttribute("src"),n=yo.exec(r);if(null!==n)return n[1]}}function lo(e){return typeof document>"u"?e:(p(Bt)||(Bt=document.createElement("a")),Bt.href=e,Bt.href)}function wo(){if(p(Ve))return Ve;let e;if(e=typeof CESIUM_BASE_URL<"u"?CESIUM_BASE_URL:"object"==typeof define&&p(define.amd)&&!define.amd.toUrlUndefined&&p(_t.toUrl)?Ut("..",Ye("Core/buildModuleUrl.js")):xr(),!p(e))throw new A("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return(Ve=new ke({url:lo(e)})).appendForwardSlash(),Ve}function Lr(e){return lo(_t.toUrl(`../${e}`))}function bo(e){return wo().getDerivedResource({url:e}).url}function Ye(e){return p(Wt)||(Wt="object"==typeof define&&p(define.amd)&&!define.amd.toUrlUndefined&&p(_t.toUrl)?Lr:bo),Wt(e)}Ye._cesiumScriptRegex=yo,Ye._buildModuleUrlFromBaseUrl=bo,Ye._clearBaseResource=function(){Ve=void 0},Ye.setBaseUrl=function(e){Ve=ke.DEFAULT.getDerivedResource({url:e})},Ye.getCesiumBaseUrl=wo;var Oo=Ye;function Br(e,t,r){this.x=e,this.y=t,this.s=r}var Qt=Br;function pn(e){e=O(e,O.EMPTY_OBJECT),this._xysFileUrlTemplate=ke.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=O(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=O(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new pe(this._sampleZeroJulianEphemerisDate,0,$.TAI),this._stepSizeDays=O(e.stepSizeDays,1),this._samplesPerXysFile=O(e.samplesPerXysFile,1e3),this._totalSamples=O(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,r=this._denominators=new Array(t+1),n=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t);for(let e=0;e<=t;++e){r[e]=o,n[e]=e*this._stepSizeDays;for(let n=0;n<=t;++n)n!==e&&(r[e]*=e-n);r[e]=1/r[e]}this._work=new Array(t+1),this._coef=new Array(t+1)}var Wr=new pe(0,0,$.TAI);function fn(e,t,r){let n=Wr;return n.dayNumber=t,n.secondsOfDay=r,pe.daysDifference(n,e._sampleZeroDateTT)}function un(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let r,n=e._xysFileUrlTemplate;r=p(n)?n.getDerivedResource({templateValues:{0:t}}):new ke({url:Oo(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=r.fetchJson().then((function(r){e._chunkDownloadsInProgress[t]=!1;let n=e._samples,o=r.samples,s=t*e._samplesPerXysFile*3;for(let e=0,t=o.length;e<t;++e)n[s+e]=o[e]}));return e._chunkDownloadsInProgress[t]=o,o}pn.prototype.preload=function(e,t,r,n){let o=fn(this,e,t),s=fn(this,r,n),i=o/this._stepSizeDays-this._interpolationOrder/2|0;i<0&&(i=0);let a=s/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let u=i/this._samplesPerXysFile|0,l=a/this._samplesPerXysFile|0,c=[];for(let e=u;e<=l;++e)c.push(un(this,e));return Promise.all(c)},pn.prototype.computeXysRadians=function(e,t,r){let n=fn(this,e,t);if(n<0)return;let o=n/this._stepSizeDays|0;if(o>=this._totalSamples)return;let s=this._interpolationOrder,i=o-(s/2|0);i<0&&(i=0);let a=i+s;a>=this._totalSamples&&(a=this._totalSamples-1,i=a-s,i<0&&(i=0));let u=!1,l=this._samples;if(p(l[3*i])||(un(this,i/this._samplesPerXysFile|0),u=!0),p(l[3*a])||(un(this,a/this._samplesPerXysFile|0),u=!0),u)return;p(r)?(r.x=0,r.y=0,r.s=0):r=new Qt(0,0,0);let c,f,h=n-i*this._stepSizeDays,d=this._work,m=this._denominators,y=this._coef,g=this._xTable;for(c=0;c<=s;++c)d[c]=h-g[c];for(c=0;c<=s;++c){for(y[c]=1,f=0;f<=s;++f)f!==c&&(y[c]*=d[f]);y[c]*=m[c];let e=3*(i+c);r.x+=y[c]*l[e++],r.y+=y[c]*l[e++],r.s+=y[c]*l[e]}return r};var go=pn;function R(e,t,r,n){this.x=O(e,0),this.y=O(t,0),this.z=O(r,0),this.w=O(n,0)}var bt=new _;R.fromAxisAngle=function(e,t,r){s.typeOf.object("axis",e),s.typeOf.number("angle",t);let n=t/2,o=Math.sin(n),i=(bt=_.normalize(e,bt)).x*o,a=bt.y*o,u=bt.z*o,l=Math.cos(n);return p(r)?(r.x=i,r.y=a,r.z=u,r.w=l,r):new R(i,a,u,l)};var Qr=[1,2,0],Hr=new Array(3);R.fromRotationMatrix=function(e,t){s.typeOf.object("matrix",e);let r,n,o,i,a,u=e[W.COLUMN0ROW0],l=e[W.COLUMN1ROW1],c=e[W.COLUMN2ROW2],f=u+l+c;if(f>0)r=Math.sqrt(f+1),a=.5*r,r=.5/r,n=(e[W.COLUMN1ROW2]-e[W.COLUMN2ROW1])*r,o=(e[W.COLUMN2ROW0]-e[W.COLUMN0ROW2])*r,i=(e[W.COLUMN0ROW1]-e[W.COLUMN1ROW0])*r;else{let t=Qr,s=0;l>u&&(s=1),c>u&&c>l&&(s=2);let p=t[s],f=t[p];r=Math.sqrt(e[W.getElementIndex(s,s)]-e[W.getElementIndex(p,p)]-e[W.getElementIndex(f,f)]+1);let h=Hr;h[s]=.5*r,r=.5/r,a=(e[W.getElementIndex(f,p)]-e[W.getElementIndex(p,f)])*r,h[p]=(e[W.getElementIndex(p,s)]+e[W.getElementIndex(s,p)])*r,h[f]=(e[W.getElementIndex(f,s)]+e[W.getElementIndex(s,f)])*r,n=-h[0],o=-h[1],i=-h[2]}return p(t)?(t.x=n,t.y=o,t.z=i,t.w=a,t):new R(n,o,i,a)};var _o=new R,So=new R,hn=new R,Ro=new R;R.fromHeadingPitchRoll=function(e,t){return s.typeOf.object("headingPitchRoll",e),Ro=R.fromAxisAngle(_.UNIT_X,e.roll,_o),hn=R.fromAxisAngle(_.UNIT_Y,-e.pitch,t),t=R.multiply(hn,Ro,hn),So=R.fromAxisAngle(_.UNIT_Z,-e.heading,_o),R.multiply(So,t,t)};var Ht=new _,dn=new _,Ee=new R,Eo=new R,$t=new R;R.packedLength=4,R.pack=function(e,t,r){return s.typeOf.object("value",e),s.defined("array",t),r=O(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},R.unpack=function(e,t,r){return s.defined("array",e),t=O(t,0),p(r)||(r=new R),r.x=e[t],r.y=e[t+1],r.z=e[t+2],r.w=e[t+3],r},R.packedInterpolationLength=3,R.convertPackedArrayForInterpolation=function(e,t,r,n){R.unpack(e,4*r,$t),R.conjugate($t,$t);for(let o=0,s=r-t+1;o<s;o++){let r=3*o;R.unpack(e,4*(t+o),Ee),R.multiply(Ee,$t,Ee),Ee.w<0&&R.negate(Ee,Ee),R.computeAxis(Ee,Ht);let s=R.computeAngle(Ee);p(n)||(n=[]),n[r]=Ht.x*s,n[r+1]=Ht.y*s,n[r+2]=Ht.z*s}},R.unpackInterpolationResult=function(e,t,r,n,o){p(o)||(o=new R),_.fromArray(e,0,dn);let s=_.magnitude(dn);return R.unpack(t,4*n,Eo),0===s?R.clone(R.IDENTITY,Ee):R.fromAxisAngle(dn,s,Ee),R.multiply(Ee,Eo,o)},R.clone=function(e,t){if(p(e))return p(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new R(e.x,e.y,e.z,e.w)},R.conjugate=function(e,t){return s.typeOf.object("quaternion",e),s.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},R.magnitudeSquared=function(e){return s.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},R.magnitude=function(e){return Math.sqrt(R.magnitudeSquared(e))},R.normalize=function(e,t){s.typeOf.object("result",t);let r=1/R.magnitude(e),n=e.x*r,o=e.y*r,i=e.z*r,a=e.w*r;return t.x=n,t.y=o,t.z=i,t.w=a,t},R.inverse=function(e,t){s.typeOf.object("result",t);let r=R.magnitudeSquared(e);return t=R.conjugate(e,t),R.multiplyByScalar(t,1/r,t)},R.add=function(e,t,r){return s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",r),r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},R.subtract=function(e,t,r){return s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",r),r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},R.negate=function(e,t){return s.typeOf.object("quaternion",e),s.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},R.dot=function(e,t){return s.typeOf.object("left",e),s.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},R.multiply=function(e,t,r){s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",r);let n=e.x,o=e.y,i=e.z,a=e.w,u=t.x,l=t.y,c=t.z,p=t.w,f=a*u+n*p+o*c-i*l,h=a*l-n*c+o*p+i*u,d=a*c+n*l-o*u+i*p,m=a*p-n*u-o*l-i*c;return r.x=f,r.y=h,r.z=d,r.w=m,r},R.multiplyByScalar=function(e,t,r){return s.typeOf.object("quaternion",e),s.typeOf.number("scalar",t),s.typeOf.object("result",r),r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},R.divideByScalar=function(e,t,r){return s.typeOf.object("quaternion",e),s.typeOf.number("scalar",t),s.typeOf.object("result",r),r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},R.computeAxis=function(e,t){s.typeOf.object("quaternion",e),s.typeOf.object("result",t);let r=e.w;if(Math.abs(r-1)<E.EPSILON6||Math.abs(r+1)<E.EPSILON6)return t.x=1,t.y=t.z=0,t;let n=1/Math.sqrt(1-r*r);return t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t},R.computeAngle=function(e){return s.typeOf.object("quaternion",e),Math.abs(e.w-1)<E.EPSILON6?0:2*Math.acos(e.w)};var mn=new R;R.lerp=function(e,t,r,n){return s.typeOf.object("start",e),s.typeOf.object("end",t),s.typeOf.number("t",r),s.typeOf.object("result",n),mn=R.multiplyByScalar(t,r,mn),n=R.multiplyByScalar(e,1-r,n),R.add(mn,n,n)};var To=new R,yn=new R,ln=new R;R.slerp=function(e,t,r,n){s.typeOf.object("start",e),s.typeOf.object("end",t),s.typeOf.number("t",r),s.typeOf.object("result",n);let o=R.dot(e,t),i=t;if(o<0&&(o=-o,i=To=R.negate(t,To)),1-o<E.EPSILON6)return R.lerp(e,i,r,n);let a=Math.acos(o);return yn=R.multiplyByScalar(e,Math.sin((1-r)*a),yn),ln=R.multiplyByScalar(i,Math.sin(r*a),ln),n=R.add(yn,ln,n),R.multiplyByScalar(n,1/Math.sin(a),n)},R.log=function(e,t){s.typeOf.object("quaternion",e),s.typeOf.object("result",t);let r=E.acosClamped(e.w),n=0;return 0!==r&&(n=r/Math.sin(r)),_.multiplyByScalar(e,n,t)},R.exp=function(e,t){s.typeOf.object("cartesian",e),s.typeOf.object("result",t);let r=_.magnitude(e),n=0;return 0!==r&&(n=Math.sin(r)/r),t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t.w=Math.cos(r),t};var $r=new _,Vr=new _,Ot=new R,ct=new R;R.computeInnerQuadrangle=function(e,t,r,n){s.typeOf.object("q0",e),s.typeOf.object("q1",t),s.typeOf.object("q2",r),s.typeOf.object("result",n);let o=R.conjugate(t,Ot);R.multiply(o,r,ct);let i=R.log(ct,$r);R.multiply(o,e,ct);let a=R.log(ct,Vr);return _.add(i,a,i),_.multiplyByScalar(i,.25,i),_.negate(i,i),R.exp(i,Ot),R.multiply(t,Ot,n)},R.squad=function(e,t,r,n,o,i){s.typeOf.object("q0",e),s.typeOf.object("q1",t),s.typeOf.object("s0",r),s.typeOf.object("s1",n),s.typeOf.number("t",o),s.typeOf.object("result",i);let a=R.slerp(e,t,o,Ot),u=R.slerp(r,n,o,ct);return R.slerp(a,u,2*o*(1-o),i)};var Yr=new R,vo=1.9011074535173003,Vt=ft.supportsTypedArrays()?new Float32Array(8):[],Yt=ft.supportsTypedArrays()?new Float32Array(8):[],Ue=ft.supportsTypedArrays()?new Float32Array(8):[],Ie=ft.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,r=2*t+1;Vt[e]=1/(t*r),Yt[e]=t/r}Vt[7]=vo/136,Yt[7]=8*vo/17,R.fastSlerp=function(e,t,r,n){s.typeOf.object("start",e),s.typeOf.object("end",t),s.typeOf.number("t",r),s.typeOf.object("result",n);let o,i=R.dot(e,t);i>=0?o=1:(o=-1,i=-i);let a=i-1,u=1-r,l=r*r,c=u*u;for(let e=7;e>=0;--e)Ue[e]=(Vt[e]*l-Yt[e])*a,Ie[e]=(Vt[e]*c-Yt[e])*a;let p=o*r*(1+Ue[0]*(1+Ue[1]*(1+Ue[2]*(1+Ue[3]*(1+Ue[4]*(1+Ue[5]*(1+Ue[6]*(1+Ue[7])))))))),f=u*(1+Ie[0]*(1+Ie[1]*(1+Ie[2]*(1+Ie[3]*(1+Ie[4]*(1+Ie[5]*(1+Ie[6]*(1+Ie[7])))))))),h=R.multiplyByScalar(e,f,Yr);return R.multiplyByScalar(t,p,n),R.add(h,n,n)},R.fastSquad=function(e,t,r,n,o,i){s.typeOf.object("q0",e),s.typeOf.object("q1",t),s.typeOf.object("s0",r),s.typeOf.object("s1",n),s.typeOf.number("t",o),s.typeOf.object("result",i);let a=R.fastSlerp(e,t,o,Ot),u=R.fastSlerp(r,n,o,ct);return R.fastSlerp(a,u,2*o*(1-o),i)},R.equals=function(e,t){return e===t||p(e)&&p(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},R.equalsEpsilon=function(e,t,r){return r=O(r,0),e===t||p(e)&&p(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},R.ZERO=Object.freeze(new R(0,0,0,0)),R.IDENTITY=Object.freeze(new R(0,0,0,1)),R.prototype.clone=function(e){return R.clone(this,e)},R.prototype.equals=function(e){return R.equals(this,e)},R.prototype.equalsEpsilon=function(e,t){return R.equalsEpsilon(this,e,t)},R.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Xe=R,V={},wn={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"}},st={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},bn={},ge={east:new _,north:new _,up:new _,west:new _,south:new _,down:new _},Fe=new _,xe=new _,Le=new _;V.localFrameToFixedFrameGenerator=function(e,t){if(!wn.hasOwnProperty(e)||!wn[e].hasOwnProperty(t))throw new A("firstAxis and secondAxis must be east, north, up, west, south or down.");let r,n=wn[e][t],o=e+t;return p(bn[o])?r=bn[o]:(r=function(r,o,s){if(!p(r))throw new A("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new A("origin has a NaN component");if(p(s)||(s=new G),_.equalsEpsilon(r,_.ZERO,E.EPSILON14))_.unpack(st[e],0,Fe),_.unpack(st[t],0,xe),_.unpack(st[n],0,Le);else if(E.equalsEpsilon(r.x,0,E.EPSILON14)&&E.equalsEpsilon(r.y,0,E.EPSILON14)){let o=E.sign(r.z);_.unpack(st[e],0,Fe),"east"!==e&&"west"!==e&&_.multiplyByScalar(Fe,o,Fe),_.unpack(st[t],0,xe),"east"!==t&&"west"!==t&&_.multiplyByScalar(xe,o,xe),_.unpack(st[n],0,Le),"east"!==n&&"west"!==n&&_.multiplyByScalar(Le,o,Le)}else{(o=O(o,ze.default)).geodeticSurfaceNormal(r,ge.up);let s=ge.up,i=ge.east;i.x=-r.y,i.y=r.x,i.z=0,_.normalize(i,ge.east),_.cross(s,i,ge.north),_.multiplyByScalar(ge.up,-1,ge.down),_.multiplyByScalar(ge.east,-1,ge.west),_.multiplyByScalar(ge.north,-1,ge.south),Fe=ge[e],xe=ge[t],Le=ge[n]}return s[0]=Fe.x,s[1]=Fe.y,s[2]=Fe.z,s[3]=0,s[4]=xe.x,s[5]=xe.y,s[6]=xe.z,s[7]=0,s[8]=Le.x,s[9]=Le.y,s[10]=Le.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},bn[o]=r),r},V.eastNorthUpToFixedFrame=V.localFrameToFixedFrameGenerator("east","north"),V.northEastDownToFixedFrame=V.localFrameToFixedFrameGenerator("north","east"),V.northUpEastToFixedFrame=V.localFrameToFixedFrameGenerator("north","up"),V.northWestUpToFixedFrame=V.localFrameToFixedFrameGenerator("north","west");var Xr=new Xe,Zr=new _(1,1,1),Jr=new G;V.headingPitchRollToFixedFrame=function(e,t,r,n,o){s.typeOf.object("HeadingPitchRoll",t),n=O(n,V.eastNorthUpToFixedFrame);let i=Xe.fromHeadingPitchRoll(t,Xr),a=G.fromTranslationQuaternionRotationScale(_.ZERO,i,Zr,Jr);return o=n(e,r,o),G.multiply(o,a,o)};var Gr=new G,Kr=new W;V.headingPitchRollQuaternion=function(e,t,r,n,o){s.typeOf.object("HeadingPitchRoll",t);let i=V.headingPitchRollToFixedFrame(e,t,r,n,Gr),a=G.getMatrix3(i,Kr);return Xe.fromRotationMatrix(a,o)};var ei=new _(1,1,1),ti=new _,Co=new G,ni=new G,oi=new W,ri=new Xe;V.fixedFrameToHeadingPitchRoll=function(e,t,r,n){s.defined("transform",e),t=O(t,ze.default),r=O(r,V.eastNorthUpToFixedFrame),p(n)||(n=new Lt);let o=G.getTranslation(e,ti);if(_.equals(o,_.ZERO))return n.heading=0,n.pitch=0,n.roll=0,n;let i=G.inverseTransformation(r(o,t,Co),Co),a=G.setScale(e,ei,ni);a=G.setTranslation(a,_.ZERO,a),i=G.multiply(i,a,i);let u=Xe.fromRotationMatrix(G.getMatrix3(i,oi),ri);return u=Xe.normalize(u,u),Lt.fromQuaternion(u,n)};var ii=24110.54841,ci=8640184.812866,si=.093104,ai=-62e-7,fi=11772758384668e-32,ui=72921158553e-15,pi=E.TWO_PI/86400,Xt=new pe;V.computeIcrfToCentralBodyFixedMatrix=function(e,t){let r=V.computeIcrfToFixedMatrix(e,t);return p(r)||(r=V.computeTemeToPseudoFixedMatrix(e,t)),r},V.computeTemeToPseudoFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");let r,n=(Xt=pe.addSeconds(e,-pe.computeTaiMinusUtc(e),Xt)).dayNumber,o=Xt.secondsOfDay,s=n-2451545;r=o>=43200?(s+.5)/ce.DAYS_PER_JULIAN_CENTURY:(s-.5)/ce.DAYS_PER_JULIAN_CENTURY;let i=(ii+r*(ci+r*(si+r*ai)))*pi%E.TWO_PI+(ui+fi*(n-2451545.5))*((o+.5*ce.SECONDS_PER_DAY)%ce.SECONDS_PER_DAY),a=Math.cos(i),u=Math.sin(i);return p(t)?(t[0]=a,t[1]=-u,t[2]=0,t[3]=u,t[4]=a,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new W(a,u,0,-u,a,0,0,0,1)},V.iau2006XysData=new go,V.earthOrientationParameters=mo.NONE;var _n=32.184,hi=2451545;V.preloadIcrfFixed=function(e){let t=e.start.dayNumber,r=e.start.secondsOfDay+_n,n=e.stop.dayNumber,o=e.stop.secondsOfDay+_n;return V.iau2006XysData.preload(t,r,n,o)},V.computeIcrfToFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new W);let r=V.computeFixedToIcrfMatrix(e,t);if(p(r))return W.transpose(r,t)};var di=32.184,mi=2451545,Zt=new Lt,yi=new W,li=new pe;V.computeMoonFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new W);let r=pe.addSeconds(e,di,li),n=pe.totalDays(r)-mi,o=E.toRadians(12.112)-E.toRadians(.052992)*n,s=E.toRadians(24.224)-E.toRadians(.105984)*n,i=E.toRadians(227.645)+E.toRadians(13.012)*n,a=E.toRadians(261.105)+E.toRadians(13.340716)*n,u=E.toRadians(358)+E.toRadians(.9856)*n;return Zt.pitch=E.toRadians(180)-E.toRadians(3.878)*Math.sin(o)-E.toRadians(.12)*Math.sin(s)+E.toRadians(.07)*Math.sin(i)-E.toRadians(.017)*Math.sin(a),Zt.roll=E.toRadians(-23.47)+E.toRadians(1.543)*Math.cos(o)+E.toRadians(.24)*Math.cos(s)-E.toRadians(.028)*Math.cos(i)+E.toRadians(.007)*Math.cos(a),Zt.heading=E.toRadians(154.375)+E.toRadians(13.17635831)*n+E.toRadians(3.558)*Math.sin(o)+E.toRadians(.121)*Math.sin(s)-E.toRadians(.064)*Math.sin(i)+E.toRadians(.016)*Math.sin(a)+E.toRadians(.025)*Math.sin(u),W.fromHeadingPitchRoll(Zt,yi)},V.computeIcrfToMoonFixedMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new W);let r=V.computeMoonFixedToIcrfMatrix(e,t);if(p(r))return W.transpose(r,t)};var wi=new Qt(0,0,0),bi=new pt(0,0,0,0,0,0),On=new W,gn=new W;V.computeFixedToIcrfMatrix=function(e,t){if(!p(e))throw new A("date is required.");p(t)||(t=new W);let r=V.earthOrientationParameters.compute(e,bi);if(!p(r))return;let n=e.dayNumber,o=e.secondsOfDay+_n,s=V.iau2006XysData.computeXysRadians(n,o,wi);if(!p(s))return;let i=s.x+r.xPoleOffset,a=s.y+r.yPoleOffset,u=1/(1+Math.sqrt(1-i*i-a*a)),l=On;l[0]=1-u*i*i,l[3]=-u*i*a,l[6]=i,l[1]=-u*i*a,l[4]=1-u*a*a,l[7]=a,l[2]=-i,l[5]=-a,l[8]=1-u*(i*i+a*a);let c=W.fromRotationZ(-s.s,gn),f=W.multiply(l,c,On),h=e.dayNumber-2451545,d=(e.secondsOfDay-pe.computeTaiMinusUtc(e)+r.ut1MinusUtc)/ce.SECONDS_PER_DAY,m=.779057273264+d+.00273781191135448*(h+d);m=m%1*E.TWO_PI;let y=W.fromRotationZ(m,gn),g=W.multiply(f,y,On),O=Math.cos(r.xPoleWander),b=Math.cos(r.yPoleWander),w=Math.sin(r.xPoleWander),v=Math.sin(r.yPoleWander),_=n-hi+o/ce.SECONDS_PER_DAY;_/=36525;let x=-47e-6*_*E.RADIANS_PER_DEGREE/3600,S=Math.cos(x),R=Math.sin(x),I=gn;return I[0]=O*S,I[1]=O*R,I[2]=w,I[3]=-b*R+v*w*S,I[4]=b*S+v*w*R,I[5]=-v*O,I[6]=-v*R-b*w*S,I[7]=v*S-b*w*R,I[8]=b*O,W.multiply(g,I,t)};var Oi=new qe;V.pointToWindowCoordinates=function(e,t,r,n){return(n=V.pointToGLWindowCoordinates(e,t,r,n)).y=2*t[5]-n.y,n},V.pointToGLWindowCoordinates=function(e,t,r,n){if(!p(e))throw new A("modelViewProjectionMatrix is required.");if(!p(t))throw new A("viewportTransformation is required.");if(!p(r))throw new A("point is required.");p(n)||(n=new Oe);let o=Oi;return G.multiplyByVector(e,qe.fromElements(r.x,r.y,r.z,1,o),o),qe.multiplyByScalar(o,1/o.w,o),G.multiplyByVector(t,o,o),Oe.fromCartesian4(o,n)};var gi=new _,_i=new _,Si=new _;V.rotationMatrixFromPositionVelocity=function(e,t,r,n){if(!p(e))throw new A("position is required.");if(!p(t))throw new A("velocity is required.");let o=O(r,ze.default).geodeticSurfaceNormal(e,gi),s=_.cross(t,o,_i);_.equalsEpsilon(s,_.ZERO,E.EPSILON6)&&(s=_.clone(_.UNIT_X,s));let i=_.cross(s,t,Si);return _.normalize(i,i),_.cross(t,i,s),_.negate(s,s),_.normalize(s,s),p(n)||(n=new W),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=s.x,n[4]=s.y,n[5]=s.z,n[6]=i.x,n[7]=i.y,n[8]=i.z,n};var Ao=new G(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),jo=new Me,Sn=new _,Ri=new _,Ei=new W,Rn=new G,Mo=new G;V.basisTo2D=function(e,t,r){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("matrix is required.");if(!p(r))throw new A("result is required.");let n,o=G.getTranslation(t,Ri),s=e.ellipsoid;if(_.equals(o,_.ZERO))n=_.clone(_.ZERO,Sn);else{let t=s.cartesianToCartographic(o,jo);n=e.project(t,Sn),_.fromElements(n.z,n.x,n.y,n)}let i=V.eastNorthUpToFixedFrame(o,s,Rn),a=G.inverseTransformation(i,Mo),u=G.getMatrix3(t,Ei),l=G.multiplyByMatrix3(a,u,r);return G.multiply(Ao,l,r),G.setTranslation(r,n,r),r},V.ellipsoidTo2DModelMatrix=function(e,t,r){if(!p(e))throw new A("projection is required.");if(!p(t))throw new A("center is required.");if(!p(r))throw new A("result is required.");let n=e.ellipsoid,o=V.eastNorthUpToFixedFrame(t,n,Rn),s=G.inverseTransformation(o,Mo),i=n.cartesianToCartographic(t,jo),a=e.project(i,Sn);_.fromElements(a.z,a.x,a.y,a);let u=G.fromTranslation(a,Rn);return G.multiply(Ao,s,r),G.multiply(u,r,r),r};var Po=V,Uo={};function gt(e,t){if(!p(e))throw new A("identifier is required.");p(Uo[e])||(Uo[e]=!0,console.warn(O(t,e)))}gt.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.",gt.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined.  zIndex will be ignored",gt.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height.  heightReference will be ignored",gt.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight.  extrudedHeightReference will be ignored";var Io=gt;function Ti(e,t){if(!p(e)||!p(t))throw new A("identifier and message are required.");Io(e,t)}var zo=Ti;function L(e,t,r,n){this.west=O(e,0),this.south=O(t,0),this.east=O(r,0),this.north=O(n,0)}Object.defineProperties(L.prototype,{width:{get:function(){return L.computeWidth(this)}},height:{get:function(){return L.computeHeight(this)}}}),L.packedLength=4,L.pack=function(e,t,r){return s.typeOf.object("value",e),s.defined("array",t),r=O(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},L.unpack=function(e,t,r){return s.defined("array",e),t=O(t,0),p(r)||(r=new L),r.west=e[t++],r.south=e[t++],r.east=e[t++],r.north=e[t],r},L.computeWidth=function(e){s.typeOf.object("rectangle",e);let t=e.east,r=e.west;return t<r&&(t+=E.TWO_PI),t-r},L.computeHeight=function(e){return s.typeOf.object("rectangle",e),e.north-e.south},L.fromDegrees=function(e,t,r,n,o){return e=E.toRadians(O(e,0)),t=E.toRadians(O(t,0)),r=E.toRadians(O(r,0)),n=E.toRadians(O(n,0)),p(o)?(o.west=e,o.south=t,o.east=r,o.north=n,o):new L(e,t,r,n)},L.fromRadians=function(e,t,r,n,o){return p(o)?(o.west=O(e,0),o.south=O(t,0),o.east=O(r,0),o.north=O(n,0),o):new L(e,t,r,n)},L.fromCartographicArray=function(e,t){s.defined("cartographics",e);let r=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let t=0,s=e.length;t<s;t++){let s=e[t];r=Math.min(r,s.longitude),n=Math.max(n,s.longitude),a=Math.min(a,s.latitude),u=Math.max(u,s.latitude);let l=s.longitude>=0?s.longitude:s.longitude+E.TWO_PI;o=Math.min(o,l),i=Math.max(i,l)}return n-r>i-o&&(r=o,n=i,n>E.PI&&(n-=E.TWO_PI),r>E.PI&&(r-=E.TWO_PI)),p(t)?(t.west=r,t.south=a,t.east=n,t.north=u,t):new L(r,a,n,u)},L.fromCartesianArray=function(e,t,r){s.defined("cartesians",e),t=O(t,ze.default);let n=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,a=-Number.MAX_VALUE,u=Number.MAX_VALUE,l=-Number.MAX_VALUE;for(let r=0,s=e.length;r<s;r++){let s=t.cartesianToCartographic(e[r]);n=Math.min(n,s.longitude),o=Math.max(o,s.longitude),u=Math.min(u,s.latitude),l=Math.max(l,s.latitude);let c=s.longitude>=0?s.longitude:s.longitude+E.TWO_PI;i=Math.min(i,c),a=Math.max(a,c)}return o-n>a-i&&(n=i,o=a,o>E.PI&&(o-=E.TWO_PI),n>E.PI&&(n-=E.TWO_PI)),p(r)?(r.west=n,r.south=u,r.east=o,r.north=l,r):new L(n,u,o,l)};var vi=new _,Ci=new _,Ai=new _,ji=new _,Mi=new _,En=new Array(5);for(let e=0;e<En.length;++e)En[e]=new _;L.fromBoundingSphere=function(e,t,r){s.typeOf.object("boundingSphere",e);let n=e.center,o=e.radius;if(p(t)||(t=ze.default),p(r)||(r=new L),_.equals(n,_.ZERO))return L.clone(L.MAX_VALUE,r),r;let i=Po.eastNorthUpToFixedFrame(n,t,vi),a=G.multiplyByPointAsVector(i,_.UNIT_X,Ci);_.normalize(a,a);let u=G.multiplyByPointAsVector(i,_.UNIT_Y,Ai);_.normalize(u,u),_.multiplyByScalar(u,o,u),_.multiplyByScalar(a,o,a);let l=_.negate(u,Mi),c=_.negate(a,ji),f=En,h=f[0];return _.add(n,u,h),h=f[1],_.add(n,c,h),h=f[2],_.add(n,l,h),h=f[3],_.add(n,a,h),f[4]=n,L.fromCartesianArray(f,t,r)},L.clone=function(e,t){if(p(e))return p(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new L(e.west,e.south,e.east,e.north)},L.equalsEpsilon=function(e,t,r){return r=O(r,0),e===t||p(e)&&p(t)&&Math.abs(e.west-t.west)<=r&&Math.abs(e.south-t.south)<=r&&Math.abs(e.east-t.east)<=r&&Math.abs(e.north-t.north)<=r},L.prototype.clone=function(e){return L.clone(this,e)},L.prototype.equals=function(e){return L.equals(this,e)},L.equals=function(e,t){return e===t||p(e)&&p(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},L.prototype.equalsEpsilon=function(e,t){return L.equalsEpsilon(this,e,t)},L.validate=function(e){return zo("Rectangle.validate","Rectangle.validate is a no-op and has been deprecated. It will be removed in Cesium 1.124."),L._validate(e)},L._validate=function(e){s.typeOf.object("rectangle",e);let t=e.north;s.typeOf.number.greaterThanOrEquals("north",t,-E.PI_OVER_TWO),s.typeOf.number.lessThanOrEquals("north",t,E.PI_OVER_TWO);let r=e.south;s.typeOf.number.greaterThanOrEquals("south",r,-E.PI_OVER_TWO),s.typeOf.number.lessThanOrEquals("south",r,E.PI_OVER_TWO);let n=e.west;s.typeOf.number.greaterThanOrEquals("west",n,-Math.PI),s.typeOf.number.lessThanOrEquals("west",n,Math.PI);let o=e.east;s.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),s.typeOf.number.lessThanOrEquals("east",o,Math.PI)},L.southwest=function(e,t){return s.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new Me(e.west,e.south)},L.northwest=function(e,t){return s.typeOf.object("rectangle",e),p(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new Me(e.west,e.north)},L.northeast=function(e,t){return s.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new Me(e.east,e.north)},L.southeast=function(e,t){return s.typeOf.object("rectangle",e),p(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new Me(e.east,e.south)},L.center=function(e,t){s.typeOf.object("rectangle",e);let r=e.east,n=e.west;r<n&&(r+=E.TWO_PI);let o=E.negativePiToPi(.5*(n+r)),i=.5*(e.south+e.north);return p(t)?(t.longitude=o,t.latitude=i,t.height=0,t):new Me(o,i)},L.intersection=function(e,t,r){s.typeOf.object("rectangle",e),s.typeOf.object("otherRectangle",t);let n=e.east,o=e.west,i=t.east,a=t.west;n<o&&i>0?n+=E.TWO_PI:i<a&&n>0&&(i+=E.TWO_PI),n<o&&a<0?a+=E.TWO_PI:i<a&&o<0&&(o+=E.TWO_PI);let u=E.negativePiToPi(Math.max(o,a)),l=E.negativePiToPi(Math.min(n,i));if((e.west<e.east||t.west<t.east)&&l<=u)return;let c=Math.max(e.south,t.south),f=Math.min(e.north,t.north);return c>=f?void 0:p(r)?(r.west=u,r.south=c,r.east=l,r.north=f,r):new L(u,c,l,f)},L.simpleIntersection=function(e,t,r){s.typeOf.object("rectangle",e),s.typeOf.object("otherRectangle",t);let n=Math.max(e.west,t.west),o=Math.max(e.south,t.south),i=Math.min(e.east,t.east),a=Math.min(e.north,t.north);if(!(o>=a||n>=i))return p(r)?(r.west=n,r.south=o,r.east=i,r.north=a,r):new L(n,o,i,a)},L.union=function(e,t,r){s.typeOf.object("rectangle",e),s.typeOf.object("otherRectangle",t),p(r)||(r=new L);let n=e.east,o=e.west,i=t.east,a=t.west;n<o&&i>0?n+=E.TWO_PI:i<a&&n>0&&(i+=E.TWO_PI),n<o&&a<0?a+=E.TWO_PI:i<a&&o<0&&(o+=E.TWO_PI);let u=E.negativePiToPi(Math.min(o,a)),l=E.negativePiToPi(Math.max(n,i));return r.west=u,r.south=Math.min(e.south,t.south),r.east=l,r.north=Math.max(e.north,t.north),r},L.expand=function(e,t,r){return s.typeOf.object("rectangle",e),s.typeOf.object("cartographic",t),p(r)||(r=new L),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},L.contains=function(e,t){s.typeOf.object("rectangle",e),s.typeOf.object("cartographic",t);let r=t.longitude,n=t.latitude,o=e.west,i=e.east;return i<o&&(i+=E.TWO_PI,r<0&&(r+=E.TWO_PI)),(r>o||E.equalsEpsilon(r,o,E.EPSILON14))&&(r<i||E.equalsEpsilon(r,i,E.EPSILON14))&&n>=e.south&&n<=e.north};var Pi=new Me;L.subsample=function(e,t,r,n){s.typeOf.object("rectangle",e),t=O(t,ze.default),r=O(r,0),p(n)||(n=[]);let o=0,i=e.north,a=e.south,u=e.east,l=e.west,c=Pi;c.height=r,c.longitude=l,c.latitude=i,n[o]=t.cartographicToCartesian(c,n[o]),o++,c.longitude=u,n[o]=t.cartographicToCartesian(c,n[o]),o++,c.latitude=a,n[o]=t.cartographicToCartesian(c,n[o]),o++,c.longitude=l,n[o]=t.cartographicToCartesian(c,n[o]),o++,c.latitude=i<0?i:a>0?a:0;for(let r=1;r<8;++r)c.longitude=-Math.PI+r*E.PI_OVER_TWO,L.contains(e,c)&&(n[o]=t.cartographicToCartesian(c,n[o]),o++);return 0===c.latitude&&(c.longitude=l,n[o]=t.cartographicToCartesian(c,n[o]),o++,c.longitude=u,n[o]=t.cartographicToCartesian(c,n[o]),o++),n.length=o,n},L.subsection=function(e,t,r,n,o,i){if(s.typeOf.object("rectangle",e),s.typeOf.number.greaterThanOrEquals("westLerp",t,0),s.typeOf.number.lessThanOrEquals("westLerp",t,1),s.typeOf.number.greaterThanOrEquals("southLerp",r,0),s.typeOf.number.lessThanOrEquals("southLerp",r,1),s.typeOf.number.greaterThanOrEquals("eastLerp",n,0),s.typeOf.number.lessThanOrEquals("eastLerp",n,1),s.typeOf.number.greaterThanOrEquals("northLerp",o,0),s.typeOf.number.lessThanOrEquals("northLerp",o,1),s.typeOf.number.lessThanOrEquals("westLerp",t,n),s.typeOf.number.lessThanOrEquals("southLerp",r,o),p(i)||(i=new L),e.west<=e.east){let r=e.east-e.west;i.west=e.west+t*r,i.east=e.west+n*r}else{let r=E.TWO_PI+e.east-e.west;i.west=E.negativePiToPi(e.west+t*r),i.east=E.negativePiToPi(e.west+n*r)}let a=e.north-e.south;return i.south=e.south+r*a,i.north=e.south+o*a,1===t&&(i.west=e.east),1===n&&(i.east=e.east),1===r&&(i.south=e.north),1===o&&(i.north=e.north),i},L.MAX_VALUE=Object.freeze(new L(-Math.PI,-E.PI_OVER_TWO,Math.PI,E.PI_OVER_TWO));var Af=L;function D(e,t,r,n){this[0]=O(e,0),this[1]=O(r,0),this[2]=O(t,0),this[3]=O(n,0)}D.packedLength=4,D.pack=function(e,t,r){return s.typeOf.object("value",e),s.defined("array",t),r=O(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t},D.unpack=function(e,t,r){return s.defined("array",e),t=O(t,0),p(r)||(r=new D),r[0]=e[t++],r[1]=e[t++],r[2]=e[t++],r[3]=e[t++],r},D.packArray=function(e,t){s.defined("array",e);let r=e.length,n=4*r;if(p(t)){if(!Array.isArray(t)&&t.length!==n)throw new A("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==n&&(t.length=n)}else t=new Array(n);for(let n=0;n<r;++n)D.pack(e[n],t,4*n);return t},D.unpackArray=function(e,t){if(s.defined("array",e),s.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!=0)throw new A("array length must be a multiple of 4.");let r=e.length;p(t)?t.length=r/4:t=new Array(r/4);for(let n=0;n<r;n+=4){let r=n/4;t[r]=D.unpack(e,n,t[r])}return t},D.clone=function(e,t){if(p(e))return p(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new D(e[0],e[2],e[1],e[3])},D.fromArray=D.unpack,D.fromColumnMajorArray=function(e,t){return s.defined("values",e),D.clone(e,t)},D.fromRowMajorArray=function(e,t){return s.defined("values",e),p(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new D(e[0],e[1],e[2],e[3])},D.fromScale=function(e,t){return s.typeOf.object("scale",e),p(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new D(e.x,0,0,e.y)},D.fromUniformScale=function(e,t){return s.typeOf.number("scale",e),p(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new D(e,0,0,e)},D.fromRotation=function(e,t){s.typeOf.number("angle",e);let r=Math.cos(e),n=Math.sin(e);return p(t)?(t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t):new D(r,-n,n,r)},D.toArray=function(e,t){return s.typeOf.object("matrix",e),p(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},D.getElementIndex=function(e,t){return s.typeOf.number.greaterThanOrEquals("row",t,0),s.typeOf.number.lessThanOrEquals("row",t,1),s.typeOf.number.greaterThanOrEquals("column",e,0),s.typeOf.number.lessThanOrEquals("column",e,1),2*e+t},D.getColumn=function(e,t,r){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",t,0),s.typeOf.number.lessThanOrEquals("index",t,1),s.typeOf.object("result",r);let n=2*t,o=e[n],i=e[n+1];return r.x=o,r.y=i,r},D.setColumn=function(e,t,r,n){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",t,0),s.typeOf.number.lessThanOrEquals("index",t,1),s.typeOf.object("cartesian",r),s.typeOf.object("result",n);let o=2*t;return(n=D.clone(e,n))[o]=r.x,n[o+1]=r.y,n},D.getRow=function(e,t,r){s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",t,0),s.typeOf.number.lessThanOrEquals("index",t,1),s.typeOf.object("result",r);let n=e[t],o=e[t+2];return r.x=n,r.y=o,r},D.setRow=function(e,t,r,n){return s.typeOf.object("matrix",e),s.typeOf.number.greaterThanOrEquals("index",t,0),s.typeOf.number.lessThanOrEquals("index",t,1),s.typeOf.object("cartesian",r),s.typeOf.object("result",n),(n=D.clone(e,n))[t]=r.x,n[t+2]=r.y,n};var Ui=new Oe;D.setScale=function(e,t,r){s.typeOf.object("matrix",e),s.typeOf.object("scale",t),s.typeOf.object("result",r);let n=D.getScale(e,Ui),o=t.x/n.x,i=t.y/n.y;return r[0]=e[0]*o,r[1]=e[1]*o,r[2]=e[2]*i,r[3]=e[3]*i,r};var Ii=new Oe;D.setUniformScale=function(e,t,r){s.typeOf.object("matrix",e),s.typeOf.number("scale",t),s.typeOf.object("result",r);let n=D.getScale(e,Ii),o=t/n.x,i=t/n.y;return r[0]=e[0]*o,r[1]=e[1]*o,r[2]=e[2]*i,r[3]=e[3]*i,r};var qo=new Oe;D.getScale=function(e,t){return s.typeOf.object("matrix",e),s.typeOf.object("result",t),t.x=Oe.magnitude(Oe.fromElements(e[0],e[1],qo)),t.y=Oe.magnitude(Oe.fromElements(e[2],e[3],qo)),t};var Do=new Oe;D.getMaximumScale=function(e){return D.getScale(e,Do),Oe.maximumComponent(Do)};var zi=new Oe;D.setRotation=function(e,t,r){s.typeOf.object("matrix",e),s.typeOf.object("result",r);let n=D.getScale(e,zi);return r[0]=t[0]*n.x,r[1]=t[1]*n.x,r[2]=t[2]*n.y,r[3]=t[3]*n.y,r};var qi=new Oe;D.getRotation=function(e,t){s.typeOf.object("matrix",e),s.typeOf.object("result",t);let r=D.getScale(e,qi);return t[0]=e[0]/r.x,t[1]=e[1]/r.x,t[2]=e[2]/r.y,t[3]=e[3]/r.y,t},D.multiply=function(e,t,r){s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",r);let n=e[0]*t[0]+e[2]*t[1],o=e[0]*t[2]+e[2]*t[3],i=e[1]*t[0]+e[3]*t[1],a=e[1]*t[2]+e[3]*t[3];return r[0]=n,r[1]=i,r[2]=o,r[3]=a,r},D.add=function(e,t,r){return s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",r),r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r},D.subtract=function(e,t,r){return s.typeOf.object("left",e),s.typeOf.object("right",t),s.typeOf.object("result",r),r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r},D.multiplyByVector=function(e,t,r){s.typeOf.object("matrix",e),s.typeOf.object("cartesian",t),s.typeOf.object("result",r);let n=e[0]*t.x+e[2]*t.y,o=e[1]*t.x+e[3]*t.y;return r.x=n,r.y=o,r},D.multiplyByScalar=function(e,t,r){return s.typeOf.object("matrix",e),s.typeOf.number("scalar",t),s.typeOf.object("result",r),r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r},D.multiplyByScale=function(e,t,r){return s.typeOf.object("matrix",e),s.typeOf.object("scale",t),s.typeOf.object("result",r),r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.y,r[3]=e[3]*t.y,r},D.multiplyByUniformScale=function(e,t,r){return s.typeOf.object("matrix",e),s.typeOf.number("scale",t),s.typeOf.object("result",r),r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r},D.negate=function(e,t){return s.typeOf.object("matrix",e),s.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},D.transpose=function(e,t){s.typeOf.object("matrix",e),s.typeOf.object("result",t);let r=e[0],n=e[2],o=e[1],i=e[3];return t[0]=r,t[1]=n,t[2]=o,t[3]=i,t},D.abs=function(e,t){return s.typeOf.object("matrix",e),s.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t},D.equals=function(e,t){return e===t||p(e)&&p(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},D.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]},D.equalsEpsilon=function(e,t,r){return r=O(r,0),e===t||p(e)&&p(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r},D.IDENTITY=Object.freeze(new D(1,0,0,1)),D.ZERO=Object.freeze(new D(0,0,0,0)),D.COLUMN0ROW0=0,D.COLUMN0ROW1=1,D.COLUMN1ROW0=2,D.COLUMN1ROW1=3,Object.defineProperties(D.prototype,{length:{get:function(){return D.packedLength}}}),D.prototype.clone=function(e){return D.clone(this,e)},D.prototype.equals=function(e){return D.equals(this,e)},D.prototype.equalsEpsilon=function(e,t){return D.equalsEpsilon(this,e,t)},D.prototype.toString=function(){return`(${this[0]}, ${this[2]})\n(${this[1]}, ${this[3]})`};var qf=D;export{qe as a,G as b,De as c,ke as d,Oo as e,Xe as f,Po as g,Io as h,Af as i,qf as j};