Cesium.js 4.9 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027
  1. /**
  2. * @license
  3. * Cesium - https://github.com/CesiumGS/cesium
  4. * Version 1.123
  5. *
  6. * Copyright 2011-2022 Cesium Contributors
  7. *
  8. * Licensed under the Apache License, Version 2.0 (the "License");
  9. * you may not use this file except in compliance with the License.
  10. * You may obtain a copy of the License at
  11. *
  12. * http://www.apache.org/licenses/LICENSE-2.0
  13. *
  14. * Unless required by applicable law or agreed to in writing, software
  15. * distributed under the License is distributed on an "AS IS" BASIS,
  16. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17. * See the License for the specific language governing permissions and
  18. * limitations under the License.
  19. *
  20. * Columbus View (Pat. Pend.)
  21. *
  22. * Portions licensed separately.
  23. * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
  24. */
  25. var Cesium=(()=>{var NCe=Object.create;var U9=Object.defineProperty;var kCe=Object.getOwnPropertyDescriptor;var UCe=Object.getOwnPropertyNames;var DCe=Object.getPrototypeOf,BCe=Object.prototype.hasOwnProperty;var D9=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var bl=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),OCe=(e,t)=>{for(var n in t)U9(e,n,{get:t[n],enumerable:!0})},Tq=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of UCe(t))!BCe.call(e,o)&&o!==n&&U9(e,o,{get:()=>t[o],enumerable:!(i=kCe(t,o))||i.enumerable});return e};var T=(e,t,n)=>(n=e!=null?NCe(DCe(e)):{},Tq(t||!e||!e.__esModule?U9(n,"default",{value:e,enumerable:!0}):n,e)),YCe=e=>Tq(U9({},"__esModule",{value:!0}),e);var S=bl(()=>{globalThis.CESIUM_WORKERS=atob("dmFyIENlc2l1bVdvcmtlcnM9KCgpPT57dmFyIFlTPU9iamVjdC5jcmVhdGU7dmFyIEJsPU9iamVjdC5kZWZpbmVQcm9wZXJ0eTt2YXIgJFM9T2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcjt2YXIgWlM9T2JqZWN0LmdldE93blByb3BlcnR5TmFtZXM7dmFyIFFTPU9iamVjdC5nZXRQcm90b3R5cGVPZixKUz1PYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5O3ZhciBwcj0odD0+dHlwZW9mIHJlcXVpcmU8InUiP3JlcXVpcmU6dHlwZW9mIFByb3h5PCJ1Ij9uZXcgUHJveHkodCx7Z2V0OihlLG4pPT4odHlwZW9mIHJlcXVpcmU8InUiP3JlcXVpcmU6ZSlbbl19KTp0KShmdW5jdGlvbih0KXtpZih0eXBlb2YgcmVxdWlyZTwidSIpcmV0dXJuIHJlcXVpcmUuYXBwbHkodGhpcyxhcmd1bWVudHMpO3Rocm93IEVycm9yKCdEeW5hbWljIHJlcXVpcmUgb2YgIicrdCsnIiBpcyBub3Qgc3VwcG9ydGVkJyl9KSxsMT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SxpPWUueixzPXRbMF0qbyt0WzNdKnIrdFs2XSppLGY9dFsxXSpvK3RbNF0qcit0WzddKmksdT10WzJdKm8rdFs1XSpyK3RbOF0qaTtyZXR1cm4gbi54PXMsbi55PWYsbi56PXUsbn07VHQubXVsdGlwbHlCeVNjYWxhcj1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgibWF0cml4Iix0KSx5LnR5cGVPZi5udW1iZXIoInNjYWxhciIsZSkseS50eXBlT2Yub2JqZWN0KCJyZXN1bHQiLG4pLG5bMF09dFswXSplLG5bMV09dFsxXSplLG5bMl09dFsyXSplLG5bM109dFszXSplLG5bNF09dFs0XSplLG5bNV09dFs1XSplLG5bNl09dFs2XSplLG5bN109dFs3XSplLG5bOF09dFs4XSplLG59O1R0Lm11bHRpcGx5QnlTY2FsZT1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgibWF0cml4Iix0KSx5LnR5cGVPZi5vYmplY3QoInNjYWxlIixlKSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsbiksblswXT10WzBdKmUueCxuWzFdPXRbMV0qZS54LG5bMl09dFsyXSplLngsblszXT10WzNdKmUueSxuWzRdPXRbNF0qZS55LG5bNV09dFs1XSplLnksbls2XT10WzZdKmUueixuWzddPXRbN10qZS56LG5bOF09dFs4XSplLnosbn07VHQubXVsdGlwbHlCeVVuaWZvcm1TY2FsZT1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgibWF0cml4Iix0KSx5LnR5cGVPZi5udW1iZXIoInNjYWxlIixlKSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsbiksblswXT10WzBdKmUsblsxXT10WzFdKmUsblsyXT10WzJdKmUsblszXT10WzNdKmUsbls0XT10WzRdKmUsbls1XT10WzVdKmUsbls2XT10WzZdKmUsbls3XT10WzddKmUsbls4XT10WzhdKmUsbn07VHQubmVnYXRlPWZ1bmN0aW9uK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3VsdCIsbiksbi54PXQueCtlLngsbi55PXQueStlLnksbi56PXQueitlLnosbi53PXQudytlLncsbn07RXQuc3VidHJhY3Q9ZnVuY3Rpb24odCxlLG4pe3JldHVybiB5LnR5cGVPZi5vYmplY3QoImxlZnQiLHQpLHkudHlwZU9mLm9iamVjdCgicmlnaHQiLGUpLHkudHlwZU9mLm9iamVjdCgicmVzdWx0IixuKSxuLng9dC54LWUueCxuLnk9dC55LWUueSxuLno9dC56LWUueixuLnc9dC53LWUudyxufTtFdC5uZWdhdGU9ZnVuY3Rpb24odCxlKXtyZXR1cm4geS50eXBlT2Yub2JqZWN0KCJxdWF0ZXJuaW9uIix0KSx5LnR5cGVPZi5vYmplY3QoInJlc3VsdCIsZSksZS54PS10LngsZS55PS10LnksZS56PS10LnosZS53PS10LncsZX07RXQuZG90PWZ1bmN0aW9uKHQsZSl7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgibGVmdCIsdCkseS50eXBlT2Yub2JqZWN0KCJyaWdodCIsZSksdC54KmUueCt0LnkqZS55K3QueiplLnordC53KmUud307RXQubXVsdGlwbHk9ZnVuY3Rpb24odCxlLG4pe3kudHlwZU9mLm9iamVjdCgibGVmdCIsdCkseS50eXBlT2Yub2JqZWN0KCJyaWdodCIsZSkseS50eXBlT2Yub2JqZWN0KCJyZXN1bHQiLG4pO2xldCBvPXQueCxyPXQueSxpPXQueixzPXQudyxmPWUueCx1PWUueSxjPWUueixsPWUudyxwPXMqZitvKmwrcipjLWkqdSxkPXMqdS1vKmMrcipsK2kqZixtPXMqYytvKnUtcipmK2kqbCxfPXMqbC1vKmYtcip1LWkqYztyZXR1cm4gbi54PXAsbi55PWQsbi56PW0sbi53PV8sbn07RXQubXVsdGlwbHlCeVNjYWxhcj1mdW5jdGlvbih0LGUsbil7cmV0dXJuIHkudHlwZU9mLm9iamVjdCgicXVhdGVybmlvbiIsdCkseS50eXBlT2YubnVtYmVyKCJzY2FsYXIiLGUpLHkudHlwZU9mLm9iamVjdCgicmV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uaW5kaWNlcyk7bGV0IEw9YS5hZGQoRCx2LG1NKTtULnBvc2l0aW9uLnZhbHVlcy5wdXNoKE8ueCxPLnksTy56LE8ueCxPLnksTy56KSxULnBvc2l0aW9uLnZhbHVlcy5wdXNoKEwueCxMLnksTC56KSxULnBvc2l0aW9uLnZhbHVlcy5wdXNoKEwueCxMLnksTC56KSxULnByZXZQb3NpdGlvbi52YWx1ZXMucHVzaChyW2IqM10scltiKjMrMV0scltiKjMrMl0pLFQucHJldlBvc2l0aW9uLnZhbHVlcy5wdXNoKHJbYiozKzNdLHJbYiozKzRdLHJbYiozKzVdKSxULnByZXZQb3NpdGlvbi52YWx1ZXMucHVzaChPLngsTy55LE8ueixPLngsTy55LE8ueiksVC5uZXh0UG9zaXRpb24udmFsdWVzLnB1c2goTC54LEwueSxMLnopLFQubmV4dFBvc2l0aW9uLnZhbHVlcy5wdXNoKEwueCxMLnksTC56KSxULm5leHRQb3NpdGlvbi52YWx1ZXMucHVzaChMLngsTC55LEwueiksVC5uZXh0UG9zaXRpb24udmFsdWVzLnB1c2goTC54LEwueSxMLnopLGEubmVnYXRlKHYsdiksYS5hZGQoRCx2LEwpLE4ucG9zaXRpb24udmFsdWVzLnB1c2goTC54LEwueSxMLnopLE4ucG9zaXRpb24udmFsdWVzLnB1c2goTC54LEwueSxMLnopLE4ucG9zaXRpb24udmFsdWVzLnB1c2goRS54LEUueSxFLnosRS54LEUueSxFLnopLE4ucHJldlBvc2l0aW9uLnZhbHVlcy5wdXNoKEwueCxMLnksTC56KSxOLnByZXZQb3NpdGlvbi52YWx1ZXMucHVzaChMLngsTC55LEwueiksTi5wcmV2UG9zaXRpb24udmFsdWVzLnB1c2goTC54LEwueSxMLnopLE4ucHJldlBvc2l0aW9uLnZhbHVlcy5wdXNoKEwueCxMLnksTC56KSxOLm5leHRQb3NpdGlvbi52YWx1ZXMucHVzaChFLngsRS55LEUueixFLngsRS55LEUueiksTi5uZXh0UG9zaXRpb24udmFsdWVzLnB1c2goaV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ngsc1sxM109ZS55LHNbMTRdPWUueixzWzE1XT1uLngsc1sxNl09ZS55LHNbMTddPWUueixzWzE4XT1uLngsc1sxOV09bi55LHNbMjBdPWUueixzWzIxXT1lLngsc1syMl09bi55LHNbMjNdPWUueixzWzI0XT1uLngsc1syNV09ZS55LHNbMjZdPWUueixzWzI3XT1uLngsc1syOF09bi55LHNbMjldPWUueixzWzMwXT1uLngsc1szMV09bi55LHNbMzJdPW4ueixzWzMzXT1uLngsc1szNF09ZS55LHNbMzVdPW4ueixzWzM2XT1lLngsc1szN109ZS55LHNbMzhdPWUueixzWzM5XT1lLngsc1s0MF09bi55LHNbNDFdPWUueixzWzQyXT1lLngsc1s0M109bi55LHNbNDRdPW4ueixzWzQ1XT1lLngsc1s0Nl09ZS55LHNbNDddPW4ueixzWzQ4XT1lLngsc1s0OV09bi55LHNbNTBdPWUueixzWzUxXT1uLngsc1s1Ml09bi55LHNbNTNdPWUueixzWzU0XT1uLngsc1s1NV09bi55LHNbNTZdPW4ueixzWzU3XT1lLngsc1s1OF09bi55LHNbNTldPW4ueixzWzYwXT1lLngsc1s2MV09ZS55LHNbNjJdPWUueixzWzYzXT1uLngsc1s2NF09ZS55LHNbNjVdPWUueixzWzY2XT1uLngsc1s2N109ZS55LHNbNjhdPW4ueixzWzY5XT1lLngsc1s3MF09ZS55LHNbNzFdPW4ueixyLnBvc2l0aW9uPW5ldyBpdCh7Y29tcG9uZW50RGF0YXR5cGU6bnQuRE9VQkxFLGNvbXBvbmVudHNQZXJBdHRyaWJ1dGU6Myx2YWx1ZXM6c30pKSxvLm5vcm1hbCl7bGV0IGM9bmV3IEZsb2F0MzJBcnJheSg3Mik7Y1swXT0wLGNbMV09MCxjWzJdPTEsY1szXT0wLGNbNF09MCxjWzVdPTEsY1s2XT0wLGNbN109MCxjWzhdPTEsY1s5XT0wLGNbMTBdPTAsY1sxMV09MSxjWzEyXT0wLGNbMTNdPTAsY1sxNF09LTEsY1sxNV09MCxjWzE2XT0wLGNbMTdd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b24odCl7bGV0IGU9dC5fbWluLG49dC5fbWF4O2lmKGEuZXF1YWxzKGUsbikpcmV0dXJuO2xldCBvPW5ldyBpZSxyPW5ldyBVaW50MTZBcnJheSgxMioyKSxpPW5ldyBGbG9hdDY0QXJyYXkoOCozKTtpWzBdPWUueCxpWzFdPWUueSxpWzJdPWUueixpWzNdPW4ueCxpWzRdPWUueSxpWzVdPWUueixpWzZdPW4ueCxpWzddPW4ueSxpWzhdPWUueixpWzldPWUueCxpWzEwXT1uLnksaVsxMV09ZS56LGlbMTJdPWUueCxpWzEzXT1lLnksaVsxNF09bi56LGlbMTVdPW4ueCxpWzE2XT1lLnksaVsxN109bi56LGlbMThdPW4ueCxpWzE5XT1uLnksaVsyMF09bi56LGlbMjFdPWUueCxpWzIyXT1uLnksaVsyM109bi56LG8ucG9zaXRpb249bmV3IGl0KHtjb21wb25lbnREYXRhdHlwZTpudC5ET1VCTEUsY29tcG9uZW50c1BlckF0dHJpYnV0ZTozLHZhbHVlczppfSksclswXT00LHJbMV09NSxyWzJdPTUsclszXT02LHJbNF09NixyWzVdPTcscls2XT03LHJbN109NCxyWzhdPTAscls5XT0xLHJbMTBdPTEsclsxMV09MixyWzEyXT0yLHJbMTNdPTMsclsxNF09MyxyWzE1XT0wLHJbMTZdPTAsclsxN109NCxyWzE4XT0xLHJbMTldPTUsclsyMF09MixyWzIxXT02LHJbMjJdPTMsclsyM109NztsZXQgcz1hLnN1YnRyYWN0KG4sZSxMTSksZj1hLm1hZ25pdHVkZShzKSouNTtpZihoKHQuX29mZnNldEF0dHJpYnV0ZSkpe2xldCB1PWkubGVuZ3RoLGM9dC5fb2Zmc2V0QXR0cmlidXRlPT09ZmUuTk9ORT8wOjEsbD1uZXcgVWludDhBcnJheSh1LzMpLmZpbGwoYyk7by5hcHBseU9mZnNldD1uZXcgaXQoe2NvbXBvbmVudERhdGF0eXBlOm50LlVOU0lHTkVEX0JZVEUsY29tcG9uZW50c1BlckF0dHJpYnV0ZToxLHZhbHVl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ZmlsbChqKX1QLmFwcGx5T2Zmc2V0PW5ldyBpdCh7Y29tcG9uZW50RGF0YXR5cGU6bnQuVU5TSUdORURfQllURSxjb21wb25lbnRzUGVyQXR0cmlidXRlOjEsdmFsdWVzOkJ9KX1yZXR1cm4gUH1mdW5jdGlvbiBJdyh0KXtsZXQgZT1uZXcgQXJyYXkoMTIqKHQqKHQrMSkpLTYpLG49MCxvLHIsaSxzLGY7Zm9yKG89MCxpPTEscz0wO3M8MztzKyspZVtuKytdPWkrKyxlW24rK109byxlW24rK109aTtmb3Iocz0yO3M8dCsxOysrcyl7Zm9yKGk9cyoocysxKS0xLG89KHMtMSkqcy0xLGVbbisrXT1pKyssZVtuKytdPW8sZVtuKytdPWkscj0yKnMsZj0wO2Y8ci0xOysrZillW24rK109aSxlW24rK109bysrLGVbbisrXT1vLGVbbisrXT1pKyssZVtuKytdPW8sZVtuKytdPWk7ZVtuKytdPWkrKyxlW24rK109byxlW24rK109aX1mb3Iocj10KjIsKytpLCsrbyxzPTA7czxyLTE7KytzKWVbbisrXT1pLGVbbisrXT1vKyssZVtuKytdPW8sZVtuKytdPWkrKyxlW24rK109byxlW24rK109aTtmb3IoZVtuKytdPWksZVtuKytdPW8rKyxlW24rK109byxlW24rK109aSsrLGVbbisrXT1vKyssZVtuKytdPW8sKytvLHM9dC0xO3M+MTstLXMpe2ZvcihlW24rK109bysrLGVbbisrXT1vLGVbbisrXT1pLHI9MipzLGY9MDtmPHItMTsrK2YpZVtuKytdPWksZVtuKytdPW8rKyxlW24rK109byxlW24rK109aSsrLGVbbisrXT1vLGVbbisrXT1pO2VbbisrXT1vKyssZVtuKytdPW8rKyxlW24rK109aSsrfWZvcihzPTA7czwzO3MrKyllW24rK109bysrLGVbbisrXT1vLGVbbisrXT1pO3JldHVybiBlfWZ1bmN0aW9uIGpNKHQpe2xldCBlPXQuY2VudGVyO2NjPWEubXVsdGlwbHlCeVNjYWxhcih0LmVsbGlwc29pZC5nZW9kZXRpY1N1cmZhY2VO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PVMqTWF0aC5zaW4oaik7ZyYmKEEueD1ILEEueT1rLEkmJihQPWEubm9ybWFsaXplKGEuY3Jvc3MoYS5VTklUX1osQSxQKSxQKSksci5ub3JtYWwmJihwW0QrK109QS54LHBbRCsrXT1BLnkscFtEKytdPUEueixwW0QrK109QS54LHBbRCsrXT1BLnkscFtEKytdPUEueiksci50YW5nZW50JiYoZFt2KytdPVAueCxkW3YrK109UC55LGRbdisrXT1QLnosZFt2KytdPVAueCxkW3YrK109UC55LGRbdisrXT1QLnopLHIuYml0YW5nZW50JiYoQj1hLm5vcm1hbGl6ZShhLmNyb3NzKEEsUCxCKSxCKSxtW0wrK109Qi54LG1bTCsrXT1CLnksbVtMKytdPUIueixtW0wrK109Qi54LG1bTCsrXT1CLnksbVtMKytdPUIueikpfWZvcihfPTA7XzxpO18rKylyLm5vcm1hbCYmKHBbRCsrXT0wLHBbRCsrXT0wLHBbRCsrXT0tMSksci50YW5nZW50JiYoZFt2KytdPTEsZFt2KytdPTAsZFt2KytdPTApLHIuYml0YW5nZW50JiYobVtMKytdPTAsbVtMKytdPS0xLG1bTCsrXT0wKTtmb3IoXz0wO188aTtfKyspci5ub3JtYWwmJihwW0QrK109MCxwW0QrK109MCxwW0QrK109MSksci50YW5nZW50JiYoZFt2KytdPTEsZFt2KytdPTAsZFt2KytdPTApLHIuYml0YW5nZW50JiYobVtMKytdPTAsbVtMKytdPTEsbVtMKytdPTApfWxldCBiPTEyKmktMTIsdz1EdC5jcmVhdGVUeXBlZEFycmF5KHUsYiksTz0wLEU9MDtmb3IoXz0wO188aS0xO18rKyl3W08rK109RSx3W08rK109RSsyLHdbTysrXT1FKzMsd1tPKytdPUUsd1tPKytdPUUrMyx3W08rK109RSsxLEUrPTI7Zm9yKHdbTysrXT1zLTIsd1tPKytdPTAsd1tPKytdPTEsd1tPKytdPXMtMix3W08rK109MSx3W08rK109cy0xLF89MTtfPGktMTtfKyspd1tPKytdPXMrXysxLHdbTysrXT1zK18sd1tPKytdPXM7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ub3JtYWxpemUoUS5tdWx0aXBseUJ5VmVjdG9yKFMsZGksZGkpLGRpKSxlLmJpdGFuZ2VudCYmKFBhPWEubm9ybWFsaXplKGEuY3Jvc3ModmQsZGksUGEpLFBhKSkpLHY9YS5jcm9zcyhhLlVOSVRfWixELHYpLHY9YS5ub3JtYWxpemUoUS5tdWx0aXBseUJ5VmVjdG9yKFMsdix2KSx2KSxlLmJpdGFuZ2VudCYmKEw9YS5ub3JtYWxpemUoYS5jcm9zcyhELHYsTCksTCkpKTtlLm5vcm1hbCYmKHQud2FsbD8oT1tJK1BdPUQueCxPW2srUF09RC55LE9bSytQXT1ELnopOmMmJihPW0krUF09LUQueCxPW2srUF09LUQueSxPW0srUF09LUQueiksKHUmJiFnfHxmKSYmKE9bSV09RC54LE9ba109RC55LE9bS109RC56KSksbyYmKGYmJihEPW0uZ2VvZGV0aWNTdXJmYWNlTm9ybWFsKEgsRCkpLENbSStQXT0tRC54LENbaytQXT0tRC55LENbSytQXT0tRC56KSxlLnRhbmdlbnQmJih0LndhbGw/KEVbSStQXT12LngsRVtrK1BdPXYueSxFW0srUF09di56KTpjJiYoRVtJK1BdPS12LngsRVtrK1BdPS12LnksRVtLK1BdPS12LnopLHUmJihnPyhFW0ldPWRpLngsRVtrXT1kaS55LEVbS109ZGkueik6KEVbSV09di54LEVba109di55LEVbS109di56KSkpLGUuYml0YW5nZW50JiYoYyYmKFRbSStQXT1MLngsVFtrK1BdPUwueSxUW0srUF09TC56KSx1JiYoZz8oVFtJXT1QYS54LFRba109UGEueSxUW0tdPVBhLnopOihUW0ldPUwueCxUW2tdPUwueSxUW0tdPUwueikpKSxJKz0zfX1lLnN0JiYhaChpKSYmKG4uYXR0cmlidXRlcy5zdD1uZXcgaXQoe2NvbXBvbmVudERhdGF0eXBlOm50LkZMT0FULGNvbXBvbmVudHNQZXJBdHRyaWJ1dGU6Mix2YWx1ZXM6d30pKSxlLm5vcm1hbCYmKG4uYXR0cmlidXRlcy5ub3JtYWw9bmV3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k1t,Cq)=>{var U1t=T(S()),lp=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};lp.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};lp.prototype.init_by_array=function(e,t){var n,i,o;for(this.init_seed(19650218),n=1,i=0,o=this.N>t?this.N:t;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1664525<<16)+(r&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(o=this.N-1;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1566083941<<16)+(r&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};lp.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};lp.prototype.random_int31=function(){return this.random_int()>>>1};lp.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};lp.prototype.random=function(){return this.random_int()*(1/4294967296)};lp.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};lp.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};Cq.exports=lp});var Kq=bl((PS,vS)=>{var RRt=T(S());/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof PS=="object"&&PS&&!PS.nodeType&&PS,n=typeof vS=="object"&&vS&&!vS.nodeType&&vS,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,c=26,d=38,u=700,m=72,p=128,g="-",f=/^xn--/,x=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,C={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},V=s-a,L=Math.floor,Z=String.fromCharCode,G;function I(U){throw new RangeError(C[U])}function v(U,Y){for(var k=U.length,H=[];k--;)H[k]=Y(U[k]);return H}function P(U,Y){var k=U.split("@"),H="";k.length>1&&(H=k[0]+"@",U=k[1]),U=U.replace(_,".");var J=U.split("."),te=v(J,Y).join(".");return H+te}function w(U){for(var Y=[],k=0,H=U.length,J,te;k<H;)J=U.charCodeAt(k++),J>=55296&&J<=56319&&k<H?(te=U.charCodeAt(k++),(te&64512)==56320?Y.push(((J&1023)<<10)+(te&1023)+65536):(Y.push(J),k--)):Y.push(J);return Y}function F(U){return v(U,function(Y){var k="";return Y>65535&&(Y-=65536,k+=Z(Y>>>10&1023|55296),Y=56320|Y&1023),k+=Z(Y),k}).join("")}function b(U){return U-48<10?U-22:U-65<26?U-65:U-97<26?U-97:s}function R(U,Y){return U+22+75*(U<26)-((Y!=0)<<5)}function E(U,Y,k){var H=0;for(U=k?L(U/u):U>>1,U+=L(U/Y);U>V*c>>1;H+=s)U=L(U/V);return L(H+(V+1)*U/(U+d))}function X(U){var Y=[],k=U.length,H,J=0,te=p,z=m,q,ee,fe,_e,le,ye,Te,Xe,Le;for(q=U.lastIndexOf(g),q<0&&(q=0),ee=0;ee<q;++ee)U.charCodeAt(ee)>=128&&I("not-basic"),Y.push(U.charCodeAt(ee));for(fe=q>0?q+1:0;fe<k;){for(_e=J,le=1,ye=s;fe>=k&&I("invalid-input"),Te=b(U.charCodeAt(fe++)),(Te>=s||Te>L((r-J)/le))&&I("overflow"),J+=Te*le,Xe=ye<=z?a:ye>=z+c?c:ye-z,!(Te<Xe);ye+=s)Le=s-Xe,le>L(r/Le)&&I("overflow"),le*=Le;H=Y.length+1,z=E(J-_e,H,_e==0),L(J/H)>r-te&&I("overflow"),te+=L(J/H),J%=H,Y.splice(J++,0,te)}return F(Y)}function A(U){var Y,k,H,J,te,z,q,ee,fe,_e,le,ye=[],Te,Xe,Le,ke;for(U=w(U),Te=U.length,Y=p,k=0,te=m,z=0;z<Te;++z)le=U[z],le<128&&ye.push(Z(le));for(H=J=ye.length,J&&ye.push(g);H<Te;){for(q=r,z=0;z<Te;++z)le=U[z],le>=Y&&le<q&&(q=le);for(Xe=H+1,q-Y>L((r-k)/Xe)&&I("overflow"),k+=(q-Y)*Xe,Y=q,z=0;z<Te;++z)if(le=U[z],le<Y&&++k>r&&I("overflow"),le==Y){for(ee=k,fe=s;_e=fe<=te?a:fe>=te+c?c:fe-te,!(ee<_e);fe+=s)ke=ee-_e,Le=s-_e,ye.push(Z(R(_e+ke%Le,0))),ee=L(ke/Le);ye.push(Z(R(ee,0))),te=E(k,Xe,H==J),k=0,++H}++k,++Y}return ye.join("")}function N(U){return P(U,function(Y){return f.test(Y)?X(Y.slice(4).toLowerCase()):Y})}function O(U){return P(U,function(Y){return x.test(Y)?"xn--"+A(Y):Y})}if(o={version:"1.3.2",ucs2:{decode:w,encode:F},decode:X,encode:A,toASCII:O,toUnicode:N},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(vS.exports==t)n.exports=o;else for(G in o)o.hasOwnProperty(G)&&(t[G]=o[G]);else e.punycode=o})(PS)});var Qq=bl((Jq,lN)=>{var ZRt=T(S());/*!
  26. * URI.js - Mutating URLs
  27. * IPv6 Support
  28. *
  29. * Version: 1.19.11
  30. *
  31. * Author: Rodney Rehm
  32. * Web: http://medialize.github.io/URI.js/
  33. *
  34. * Licensed under
  35. * MIT License http://www.opensource.org/licenses/mit-license
  36. *
  37. */(function(e,t){"use strict";typeof lN=="object"&&lN.exports?lN.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(Jq,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,c=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(c=7);var d;for(d=0;d<a&&s[d]!=="";d++);if(d<c)for(s.splice(d,1,"0000");s.length<c;)s.splice(d,0,"0000");for(var u,m=0;m<c;m++){u=s[m].split("");for(var p=0;p<3&&(u[0]==="0"&&u.length>1);p++)u.splice(0,1);s[m]=u.join("")}var g=-1,f=0,x=0,_=-1,C=!1;for(m=0;m<c;m++)C?s[m]==="0"?x+=1:(C=!1,x>f&&(g=_,f=x)):s[m]==="0"&&(C=!0,_=m,x=1);x>f&&(g=_,f=x),f>1&&s.splice(g,f,""),a=s.length;var V="";for(s[0]===""&&(V=":"),m=0;m<a&&(V+=s[m],m!==a-1);m++)V+=":";return s[a-1]===""&&(V+=":"),V}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var qq=bl((jq,dN)=>{var GRt=T(S());/*!
  38. * URI.js - Mutating URLs
  39. * Second Level Domain (SLD) Support
  40. *
  41. * Version: 1.19.11
  42. *
  43. * Author: Rodney Rehm
  44. * Web: http://medialize.github.io/URI.js/
  45. *
  46. * Licensed under
  47. * MIT License http://www.opensource.org/licenses/mit-license
  48. *
  49. */(function(e,t){"use strict";typeof dN=="object"&&dN.exports?dN.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(jq,function(e){"use strict";var t=e&&e.SecondLevelDomains,n={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(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(r+1,o)+" ")>=0:!1},is:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r>=0)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(0,o)+" ")>=0:!1},get:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return null;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return null;var s=n.list[i.slice(o+1)];return!s||s.indexOf(" "+i.slice(r+1,o)+" ")<0?null:i.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var id=bl(($q,uN)=>{var ERt=T(S());/*!
  50. * URI.js - Mutating URLs
  51. *
  52. * Version: 1.19.11
  53. *
  54. * Author: Rodney Rehm
  55. * Web: http://medialize.github.io/URI.js/
  56. *
  57. * Licensed under
  58. * MIT License http://www.opensource.org/licenses/mit-license
  59. *
  60. */(function(e,t){"use strict";typeof uN=="object"&&uN.exports?uN.exports=t(Kq(),Qq(),qq()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})($q,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(R,E){var X=arguments.length>=1,A=arguments.length>=2;if(!(this instanceof r))return X?A?new r(R,E):new r(R):new r;if(R===void 0){if(X)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?R=location.href+"":R=""}if(R===null&&X)throw new TypeError("null is not a valid argument for URI");return this.href(R),E!==void 0?this.absoluteTo(E):this}function s(R){return/^[0-9]+$/.test(R)}r.version="1.19.11";var a=r.prototype,c=Object.prototype.hasOwnProperty;function d(R){return R.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function u(R){return R===void 0?"Undefined":String(Object.prototype.toString.call(R)).slice(8,-1)}function m(R){return u(R)==="Array"}function p(R,E){var X={},A,N;if(u(E)==="RegExp")X=null;else if(m(E))for(A=0,N=E.length;A<N;A++)X[E[A]]=!0;else X[E]=!0;for(A=0,N=R.length;A<N;A++){var O=X&&X[R[A]]!==void 0||!X&&E.test(R[A]);O&&(R.splice(A,1),N--,A--)}return R}function g(R,E){var X,A;if(m(E)){for(X=0,A=E.length;X<A;X++)if(!g(R,E[X]))return!1;return!0}var N=u(E);for(X=0,A=R.length;X<A;X++)if(N==="RegExp"){if(typeof R[X]=="string"&&R[X].match(E))return!0}else if(R[X]===E)return!0;return!1}function f(R,E){if(!m(R)||!m(E)||R.length!==E.length)return!1;R.sort(),E.sort();for(var X=0,A=R.length;X<A;X++)if(R[X]!==E[X])return!1;return!0}function x(R){var E=/^\/+|\/+$/g;return R.replace(E,"")}r._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:r.preventInvalidHostname,duplicateQueryParameters:r.duplicateQueryParameters,escapeQuerySpace:r.escapeQuerySpace}},r.preventInvalidHostname=!1,r.duplicateQueryParameters=!1,r.escapeQuerySpace=!0,r.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,r.idn_expression=/[^a-z0-9\._-]/i,r.punycode_expression=/(xn--)/i,r.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,r.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*$/,r.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`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.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"},r.getDomAttribute=function(R){if(!(!R||!R.nodeName)){var E=R.nodeName.toLowerCase();if(!(E==="input"&&R.type!=="image"))return r.domAttributes[E]}};function _(R){return escape(R)}function C(R){return encodeURIComponent(R).replace(/[!'()*]/g,_).replace(/\*/g,"%2A")}r.encode=C,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=C,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(R,E){var X=r.encode(R+"");return E===void 0&&(E=r.escapeQuerySpace),E?X.replace(/%20/g,"+"):X},r.decodeQuery=function(R,E){R+="",E===void 0&&(E=r.escapeQuerySpace);try{return r.decode(E?R.replace(/\+/g,"%20"):R)}catch{return R}};var V={encode:"encode",decode:"decode"},L,Z=function(R,E){return function(X){try{return r[E](X+"").replace(r.characters[R][E].expression,function(A){return r.characters[R][E].map[A]})}catch{return X}}};for(L in V)r[L+"PathSegment"]=Z("pathname",V[L]),r[L+"UrnPathSegment"]=Z("urnpath",V[L]);var G=function(R,E,X){return function(A){var N;X?N=function(k){return r[E](r[X](k))}:N=r[E];for(var O=(A+"").split(R),U=0,Y=O.length;U<Y;U++)O[U]=N(O[U]);return O.join(R)}};r.decodePath=G("/","decodePathSegment"),r.decodeUrnPath=G(":","decodeUrnPathSegment"),r.recodePath=G("/","encodePathSegment","decode"),r.recodeUrnPath=G(":","encodeUrnPathSegment","decode"),r.encodeReserved=Z("reserved","encode"),r.parse=function(R,E){var X;return E||(E={preventInvalidHostname:r.preventInvalidHostname}),R=R.replace(r.leading_whitespace_expression,""),R=R.replace(r.ascii_tab_whitespace,""),X=R.indexOf("#"),X>-1&&(E.fragment=R.substring(X+1)||null,R=R.substring(0,X)),X=R.indexOf("?"),X>-1&&(E.query=R.substring(X+1)||null,R=R.substring(0,X)),R=R.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),R=R.replace(/^[/\\]{2,}/i,"//"),R.substring(0,2)==="//"?(E.protocol=null,R=R.substring(2),R=r.parseAuthority(R,E)):(X=R.indexOf(":"),X>-1&&(E.protocol=R.substring(0,X)||null,E.protocol&&!E.protocol.match(r.protocol_expression)?E.protocol=void 0:R.substring(X+1,X+3).replace(/\\/g,"/")==="//"?(R=R.substring(X+3),R=r.parseAuthority(R,E)):(R=R.substring(X+1),E.urn=!0))),E.path=R,E},r.parseHost=function(R,E){R||(R=""),R=R.replace(/\\/g,"/");var X=R.indexOf("/"),A,N;if(X===-1&&(X=R.length),R.charAt(0)==="[")A=R.indexOf("]"),E.hostname=R.substring(1,A)||null,E.port=R.substring(A+2,X)||null,E.port==="/"&&(E.port=null);else{var O=R.indexOf(":"),U=R.indexOf("/"),Y=R.indexOf(":",O+1);Y!==-1&&(U===-1||Y<U)?(E.hostname=R.substring(0,X)||null,E.port=null):(N=R.substring(0,X).split(":"),E.hostname=N[0]||null,E.port=N[1]||null)}return E.hostname&&R.substring(X).charAt(0)!=="/"&&(X++,R="/"+R),E.preventInvalidHostname&&r.ensureValidHostname(E.hostname,E.protocol),E.port&&r.ensureValidPort(E.port),R.substring(X)||"/"},r.parseAuthority=function(R,E){return R=r.parseUserinfo(R,E),r.parseHost(R,E)},r.parseUserinfo=function(R,E){var X=R,A=R.indexOf("\\");A!==-1&&(R=R.replace(/\\/g,"/"));var N=R.indexOf("/"),O=R.lastIndexOf("@",N>-1?N:R.length-1),U;return O>-1&&(N===-1||O<N)?(U=R.substring(0,O).split(":"),E.username=U[0]?r.decode(U[0]):null,U.shift(),E.password=U[0]?r.decode(U.join(":")):null,R=X.substring(O+1)):(E.username=null,E.password=null),R},r.parseQuery=function(R,E){if(!R)return{};if(R=R.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!R)return{};for(var X={},A=R.split("&"),N=A.length,O,U,Y,k=0;k<N;k++)O=A[k].split("="),U=r.decodeQuery(O.shift(),E),Y=O.length?r.decodeQuery(O.join("="),E):null,U!=="__proto__"&&(c.call(X,U)?((typeof X[U]=="string"||X[U]===null)&&(X[U]=[X[U]]),X[U].push(Y)):X[U]=Y);return X},r.build=function(R){var E="",X=!1;return R.protocol&&(E+=R.protocol+":"),!R.urn&&(E||R.hostname)&&(E+="//",X=!0),E+=r.buildAuthority(R)||"",typeof R.path=="string"&&(R.path.charAt(0)!=="/"&&X&&(E+="/"),E+=R.path),typeof R.query=="string"&&R.query&&(E+="?"+R.query),typeof R.fragment=="string"&&R.fragment&&(E+="#"+R.fragment),E},r.buildHost=function(R){var E="";if(R.hostname)r.ip6_expression.test(R.hostname)?E+="["+R.hostname+"]":E+=R.hostname;else return"";return R.port&&(E+=":"+R.port),E},r.buildAuthority=function(R){return r.buildUserinfo(R)+r.buildHost(R)},r.buildUserinfo=function(R){var E="";return R.username&&(E+=r.encode(R.username)),R.password&&(E+=":"+r.encode(R.password)),E&&(E+="@"),E},r.buildQuery=function(R,E,X){var A="",N,O,U,Y;for(O in R)if(O!=="__proto__"&&c.call(R,O))if(m(R[O]))for(N={},U=0,Y=R[O].length;U<Y;U++)R[O][U]!==void 0&&N[R[O][U]+""]===void 0&&(A+="&"+r.buildQueryParameter(O,R[O][U],X),E!==!0&&(N[R[O][U]+""]=!0));else R[O]!==void 0&&(A+="&"+r.buildQueryParameter(O,R[O],X));return A.substring(1)},r.buildQueryParameter=function(R,E,X){return r.encodeQuery(R,X)+(E!==null?"="+r.encodeQuery(E,X):"")},r.addQuery=function(R,E,X){if(typeof E=="object")for(var A in E)c.call(E,A)&&r.addQuery(R,A,E[A]);else if(typeof E=="string"){if(R[E]===void 0){R[E]=X;return}else typeof R[E]=="string"&&(R[E]=[R[E]]);m(X)||(X=[X]),R[E]=(R[E]||[]).concat(X)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(R,E,X){if(typeof E=="object")for(var A in E)c.call(E,A)&&r.setQuery(R,A,E[A]);else if(typeof E=="string")R[E]=X===void 0?null:X;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(R,E,X){var A,N,O;if(m(E))for(A=0,N=E.length;A<N;A++)R[E[A]]=void 0;else if(u(E)==="RegExp")for(O in R)E.test(O)&&(R[O]=void 0);else if(typeof E=="object")for(O in E)c.call(E,O)&&r.removeQuery(R,O,E[O]);else if(typeof E=="string")X!==void 0?u(X)==="RegExp"?!m(R[E])&&X.test(R[E])?R[E]=void 0:R[E]=p(R[E],X):R[E]===String(X)&&(!m(X)||X.length===1)?R[E]=void 0:m(R[E])&&(R[E]=p(R[E],X)):R[E]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(R,E,X,A){switch(u(E)){case"String":break;case"RegExp":for(var N in R)if(c.call(R,N)&&E.test(N)&&(X===void 0||r.hasQuery(R,N,X)))return!0;return!1;case"Object":for(var O in E)if(c.call(E,O)&&!r.hasQuery(R,O,E[O]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(u(X)){case"Undefined":return E in R;case"Boolean":var U=!!(m(R[E])?R[E].length:R[E]);return X===U;case"Function":return!!X(R[E],E,R);case"Array":if(!m(R[E]))return!1;var Y=A?g:f;return Y(R[E],X);case"RegExp":return m(R[E])?A?g(R[E],X):!1:!!(R[E]&&R[E].match(X));case"Number":X=String(X);case"String":return m(R[E])?A?g(R[E],X):!1:R[E]===X;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var R=[],E=[],X=0,A=0;A<arguments.length;A++){var N=new r(arguments[A]);R.push(N);for(var O=N.segment(),U=0;U<O.length;U++)typeof O[U]=="string"&&E.push(O[U]),O[U]&&X++}if(!E.length||!X)return new r("");var Y=new r("").segment(E);return(R[0].path()===""||R[0].path().slice(0,1)==="/")&&Y.path("/"+Y.path()),Y.normalize()},r.commonPath=function(R,E){var X=Math.min(R.length,E.length),A;for(A=0;A<X;A++)if(R.charAt(A)!==E.charAt(A)){A--;break}return A<1?R.charAt(0)===E.charAt(0)&&R.charAt(0)==="/"?"/":"":((R.charAt(A)!=="/"||E.charAt(A)!=="/")&&(A=R.substring(0,A).lastIndexOf("/")),R.substring(0,A+1))},r.withinString=function(R,E,X){X||(X={});var A=X.start||r.findUri.start,N=X.end||r.findUri.end,O=X.trim||r.findUri.trim,U=X.parens||r.findUri.parens,Y=/[a-z0-9-]=["']?$/i;for(A.lastIndex=0;;){var k=A.exec(R);if(!k)break;var H=k.index;if(X.ignoreHtml){var J=R.slice(Math.max(H-3,0),H);if(J&&Y.test(J))continue}for(var te=H+R.slice(H).search(N),z=R.slice(H,te),q=-1;;){var ee=U.exec(z);if(!ee)break;var fe=ee.index+ee[0].length;q=Math.max(q,fe)}if(q>-1?z=z.slice(0,q)+z.slice(q).replace(O,""):z=z.replace(O,""),!(z.length<=k[0].length)&&!(X.ignore&&X.ignore.test(z))){te=H+z.length;var _e=E(z,H,te,R);if(_e===void 0){A.lastIndex=te;continue}_e=String(_e),R=R.slice(0,H)+_e+R.slice(te),A.lastIndex=H+_e.length}}return A.lastIndex=0,R},r.ensureValidHostname=function(R,E){var X=!!R,A=!!E,N=!1;if(A&&(N=g(r.hostProtocols,E)),N&&!X)throw new TypeError("Hostname cannot be empty, if protocol is "+E);if(R&&R.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(R).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(R){if(R){var E=Number(R);if(!(s(E)&&E>0&&E<65536))throw new TypeError('Port "'+R+'" is not a valid port')}},r.noConflict=function(R){if(R){var E={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(E.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(E.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(E.SecondLevelDomains=i.SecondLevelDomains.noConflict()),E}else i.URI===this&&(i.URI=o);return this},a.build=function(R){return R===!0?this._deferred_build=!0:(R===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new r(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function I(R){return function(E,X){return E===void 0?this._parts[R]||"":(this._parts[R]=E||null,this.build(!X),this)}}function v(R,E){return function(X,A){return X===void 0?this._parts[R]||"":(X!==null&&(X=X+"",X.charAt(0)===E&&(X=X.substring(1))),this._parts[R]=X,this.build(!A),this)}}a.protocol=I("protocol"),a.username=I("username"),a.password=I("password"),a.hostname=I("hostname"),a.port=I("port"),a.query=v("query","?"),a.fragment=v("fragment","#"),a.search=function(R,E){var X=this.query(R,E);return typeof X=="string"&&X.length?"?"+X:X},a.hash=function(R,E){var X=this.fragment(R,E);return typeof X=="string"&&X.length?"#"+X:X},a.pathname=function(R,E){if(R===void 0||R===!0){var X=this._parts.path||(this._parts.hostname?"/":"");return R?(this._parts.urn?r.decodeUrnPath:r.decodePath)(X):X}else return this._parts.urn?this._parts.path=R?r.recodeUrnPath(R):"":this._parts.path=R?r.recodePath(R):"/",this.build(!E),this},a.path=a.pathname,a.href=function(R,E){var X;if(R===void 0)return this.toString();this._string="",this._parts=r._parts();var A=R instanceof r,N=typeof R=="object"&&(R.hostname||R.path||R.pathname);if(R.nodeName){var O=r.getDomAttribute(R);R=R[O]||"",N=!1}if(!A&&N&&R.pathname!==void 0&&(R=R.toString()),typeof R=="string"||R instanceof String)this._parts=r.parse(String(R),this._parts);else if(A||N){var U=A?R._parts:R;for(X in U)X!=="query"&&c.call(this._parts,X)&&(this._parts[X]=U[X]);U.query&&this.query(U.query,!1)}else throw new TypeError("invalid input");return this.build(!E),this},a.is=function(R){var E=!1,X=!1,A=!1,N=!1,O=!1,U=!1,Y=!1,k=!this._parts.urn;switch(this._parts.hostname&&(k=!1,X=r.ip4_expression.test(this._parts.hostname),A=r.ip6_expression.test(this._parts.hostname),E=X||A,N=!E,O=N&&n&&n.has(this._parts.hostname),U=N&&r.idn_expression.test(this._parts.hostname),Y=N&&r.punycode_expression.test(this._parts.hostname)),R.toLowerCase()){case"relative":return k;case"absolute":return!k;case"domain":case"name":return N;case"sld":return O;case"ip":return E;case"ip4":case"ipv4":case"inet4":return X;case"ip6":case"ipv6":case"inet6":return A;case"idn":return U;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return Y}return null};var P=a.protocol,w=a.port,F=a.hostname;a.protocol=function(R,E){if(R&&(R=R.replace(/:(\/\/)?$/,""),!R.match(r.protocol_expression)))throw new TypeError('Protocol "'+R+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return P.call(this,R,E)},a.scheme=a.protocol,a.port=function(R,E){return this._parts.urn?R===void 0?"":this:(R!==void 0&&(R===0&&(R=null),R&&(R+="",R.charAt(0)===":"&&(R=R.substring(1)),r.ensureValidPort(R))),w.call(this,R,E))},a.hostname=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R!==void 0){var X={preventInvalidHostname:this._parts.preventInvalidHostname},A=r.parseHost(R,X);if(A!=="/")throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-]');R=X.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(R,this._parts.protocol)}return F.call(this,R,E)},a.origin=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0){var X=this.protocol(),A=this.authority();return A?(X?X+"://":"")+this.authority():""}else{var N=r(R);return this.protocol(N.protocol()).authority(N.authority()).build(!E),this}},a.host=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var X=r.parseHost(R,this._parts);if(X!=="/")throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-]');return this.build(!E),this},a.authority=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var X=r.parseAuthority(R,this._parts);if(X!=="/")throw new TypeError('Hostname "'+R+'" contains characters other than [A-Z0-9.-]');return this.build(!E),this},a.userinfo=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0){var X=r.buildUserinfo(this._parts);return X&&X.substring(0,X.length-1)}else return R[R.length-1]!=="@"&&(R+="@"),r.parseUserinfo(R,this._parts),this.build(!E),this},a.resource=function(R,E){var X;return R===void 0?this.path()+this.search()+this.hash():(X=r.parse(R),this._parts.path=X.path,this._parts.query=X.query,this._parts.fragment=X.fragment,this.build(!E),this)},a.subdomain=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0){if(!this._parts.hostname||this.is("IP"))return"";var X=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,X)||""}else{var A=this._parts.hostname.length-this.domain().length,N=this._parts.hostname.substring(0,A),O=new RegExp("^"+d(N));if(R&&R.charAt(R.length-1)!=="."&&(R+="."),R.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return R&&r.ensureValidHostname(R,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(O,R),this.build(!E),this}},a.domain=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(typeof R=="boolean"&&(E=R,R=void 0),R===void 0){if(!this._parts.hostname||this.is("IP"))return"";var X=this._parts.hostname.match(/\./g);if(X&&X.length<2)return this._parts.hostname;var A=this._parts.hostname.length-this.tld(E).length-1;return A=this._parts.hostname.lastIndexOf(".",A-1)+1,this._parts.hostname.substring(A)||""}else{if(!R)throw new TypeError("cannot set domain empty");if(R.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(R,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=R;else{var N=new RegExp(d(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(N,R)}return this.build(!E),this}},a.tld=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(typeof R=="boolean"&&(E=R,R=void 0),R===void 0){if(!this._parts.hostname||this.is("IP"))return"";var X=this._parts.hostname.lastIndexOf("."),A=this._parts.hostname.substring(X+1);return E!==!0&&n&&n.list[A.toLowerCase()]&&n.get(this._parts.hostname)||A}else{var N;if(R)if(R.match(/[^a-zA-Z0-9-]/))if(n&&n.is(R))N=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(N,R);else throw new TypeError('TLD "'+R+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");N=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(N,R)}else throw new TypeError("cannot set TLD empty");return this.build(!E),this}},a.directory=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0||R===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var X=this._parts.path.length-this.filename().length-1,A=this._parts.path.substring(0,X)||(this._parts.hostname?"/":"");return R?r.decodePath(A):A}else{var N=this._parts.path.length-this.filename().length,O=this._parts.path.substring(0,N),U=new RegExp("^"+d(O));return this.is("relative")||(R||(R="/"),R.charAt(0)!=="/"&&(R="/"+R)),R&&R.charAt(R.length-1)!=="/"&&(R+="/"),R=r.recodePath(R),this._parts.path=this._parts.path.replace(U,R),this.build(!E),this}},a.filename=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(typeof R!="string"){if(!this._parts.path||this._parts.path==="/")return"";var X=this._parts.path.lastIndexOf("/"),A=this._parts.path.substring(X+1);return R?r.decodePathSegment(A):A}else{var N=!1;R.charAt(0)==="/"&&(R=R.substring(1)),R.match(/\.?\//)&&(N=!0);var O=new RegExp(d(this.filename())+"$");return R=r.recodePath(R),this._parts.path=this._parts.path.replace(O,R),N?this.normalizePath(E):this.build(!E),this}},a.suffix=function(R,E){if(this._parts.urn)return R===void 0?"":this;if(R===void 0||R===!0){if(!this._parts.path||this._parts.path==="/")return"";var X=this.filename(),A=X.lastIndexOf("."),N,O;return A===-1?"":(N=X.substring(A+1),O=/^[a-z0-9%]+$/i.test(N)?N:"",R?r.decodePathSegment(O):O)}else{R.charAt(0)==="."&&(R=R.substring(1));var U=this.suffix(),Y;if(U)R?Y=new RegExp(d(U)+"$"):Y=new RegExp(d("."+U)+"$");else{if(!R)return this;this._parts.path+="."+r.recodePath(R)}return Y&&(R=r.recodePath(R),this._parts.path=this._parts.path.replace(Y,R)),this.build(!E),this}},a.segment=function(R,E,X){var A=this._parts.urn?":":"/",N=this.path(),O=N.substring(0,1)==="/",U=N.split(A);if(R!==void 0&&typeof R!="number"&&(X=E,E=R,R=void 0),R!==void 0&&typeof R!="number")throw new Error('Bad segment "'+R+'", must be 0-based integer');if(O&&U.shift(),R<0&&(R=Math.max(U.length+R,0)),E===void 0)return R===void 0?U:U[R];if(R===null||U[R]===void 0)if(m(E)){U=[];for(var Y=0,k=E.length;Y<k;Y++)!E[Y].length&&(!U.length||!U[U.length-1].length)||(U.length&&!U[U.length-1].length&&U.pop(),U.push(x(E[Y])))}else(E||typeof E=="string")&&(E=x(E),U[U.length-1]===""?U[U.length-1]=E:U.push(E));else E?U[R]=x(E):U.splice(R,1);return O&&U.unshift(""),this.path(U.join(A),X)},a.segmentCoded=function(R,E,X){var A,N,O;if(typeof R!="number"&&(X=E,E=R,R=void 0),E===void 0){if(A=this.segment(R,E,X),!m(A))A=A!==void 0?r.decode(A):void 0;else for(N=0,O=A.length;N<O;N++)A[N]=r.decode(A[N]);return A}if(!m(E))E=typeof E=="string"||E instanceof String?r.encode(E):E;else for(N=0,O=E.length;N<O;N++)E[N]=r.encode(E[N]);return this.segment(R,E,X)};var b=a.query;return a.query=function(R,E){if(R===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof R=="function"){var X=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),A=R.call(this,X);return this._parts.query=r.buildQuery(A||X,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!E),this}else return R!==void 0&&typeof R!="string"?(this._parts.query=r.buildQuery(R,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!E),this):b.call(this,R,E)},a.setQuery=function(R,E,X){var A=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof R=="string"||R instanceof String)A[R]=E!==void 0?E:null;else if(typeof R=="object")for(var N in R)c.call(R,N)&&(A[N]=R[N]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(A,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof R!="string"&&(X=E),this.build(!X),this},a.addQuery=function(R,E,X){var A=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(A,R,E===void 0?null:E),this._parts.query=r.buildQuery(A,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof R!="string"&&(X=E),this.build(!X),this},a.removeQuery=function(R,E,X){var A=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(A,R,E),this._parts.query=r.buildQuery(A,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof R!="string"&&(X=E),this.build(!X),this},a.hasQuery=function(R,E,X){var A=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(A,R,E,X)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.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()},a.normalizeProtocol=function(R){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!R)),this},a.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},a.normalizePort=function(R){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!R)),this},a.normalizePath=function(R){var E=this._parts.path;if(!E)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!R),this;if(this._parts.path==="/")return this;E=r.recodePath(E);var X,A="",N,O;for(E.charAt(0)!=="/"&&(X=!0,E="/"+E),(E.slice(-3)==="/.."||E.slice(-2)==="/.")&&(E+="/"),E=E.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),X&&(A=E.substring(1).match(/^(\.\.\/)+/)||"",A&&(A=A[0]));N=E.search(/\/\.\.(\/|$)/),N!==-1;){if(N===0){E=E.substring(3);continue}O=E.substring(0,N).lastIndexOf("/"),O===-1&&(O=N),E=E.substring(0,O)+E.substring(N+3)}return X&&this.is("relative")&&(E=A+E.substring(1)),this._parts.path=E,this.build(!R),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(R){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(r.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!R)),this},a.normalizeFragment=function(R){return this._parts.fragment||(this._parts.fragment=null,this.build(!R)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var R=r.encode,E=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=R,r.decode=E}return this},a.unicode=function(){var R=r.encode,E=r.decode;r.encode=C,r.decode=unescape;try{this.normalize()}finally{r.encode=R,r.decode=E}return this},a.readable=function(){var R=this.clone();R.username("").password("").normalize();var E="";if(R._parts.protocol&&(E+=R._parts.protocol+"://"),R._parts.hostname&&(R.is("punycode")&&e?(E+=e.toUnicode(R._parts.hostname),R._parts.port&&(E+=":"+R._parts.port)):E+=R.host()),R._parts.hostname&&R._parts.path&&R._parts.path.charAt(0)!=="/"&&(E+="/"),E+=R.path(!0),R._parts.query){for(var X="",A=0,N=R._parts.query.split("&"),O=N.length;A<O;A++){var U=(N[A]||"").split("=");X+="&"+r.decodeQuery(U[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),U[1]!==void 0&&(X+="="+r.decodeQuery(U[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}E+="?"+X.substring(1)}return E+=r.decodeQuery(R.hash(),!0),E},a.absoluteTo=function(R){var E=this.clone(),X=["protocol","username","password","hostname","port"],A,N,O;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(R instanceof r||(R=new r(R)),E._parts.protocol||(E._parts.protocol=R._parts.protocol,this._parts.hostname))return E;for(N=0;O=X[N];N++)E._parts[O]=R._parts[O];return E._parts.path?(E._parts.path.substring(-2)===".."&&(E._parts.path+="/"),E.path().charAt(0)!=="/"&&(A=R.directory(),A=A||(R.path().indexOf("/")===0?"/":""),E._parts.path=(A?A+"/":"")+E._parts.path,E.normalizePath())):(E._parts.path=R._parts.path,E._parts.query||(E._parts.query=R._parts.query)),E.build(),E},a.relativeTo=function(R){var E=this.clone().normalize(),X,A,N,O,U;if(E._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(R=new r(R).normalize(),X=E._parts,A=R._parts,O=E.path(),U=R.path(),O.charAt(0)!=="/")throw new Error("URI is already relative");if(U.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(X.protocol===A.protocol&&(X.protocol=null),X.username!==A.username||X.password!==A.password||X.protocol!==null||X.username!==null||X.password!==null)return E.build();if(X.hostname===A.hostname&&X.port===A.port)X.hostname=null,X.port=null;else return E.build();if(O===U)return X.path="",E.build();if(N=r.commonPath(O,U),!N)return E.build();var Y=A.path.substring(N.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return X.path=Y+X.path.substring(N.length)||"./",E.build()},a.equals=function(R){var E=this.clone(),X=new r(R),A={},N={},O={},U,Y,k;if(E.normalize(),X.normalize(),E.toString()===X.toString())return!0;if(U=E.query(),Y=X.query(),E.query(""),X.query(""),E.toString()!==X.toString()||U.length!==Y.length)return!1;A=r.parseQuery(U,this._parts.escapeQuerySpace),N=r.parseQuery(Y,this._parts.escapeQuerySpace);for(k in A)if(c.call(A,k)){if(m(A[k])){if(!f(A[k],N[k]))return!1}else if(A[k]!==N[k])return!1;O[k]=!0}for(k in N)if(c.call(N,k)&&!O[k])return!1;return!0},a.preventInvalidHostname=function(R){return this._parts.preventInvalidHostname=!!R,this},a.duplicateQueryParameters=function(R){return this._parts.duplicateQueryParameters=!!R,this},a.escapeQuerySpace=function(R){return this._parts.escapeQuerySpace=!!R,this},r})});var Jie=bl((sH,aH)=>{var Htn=T(S());/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */(function(e,t){typeof sH=="object"&&typeof aH<"u"?aH.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self,e.DOMPurify=t())})(sH,function(){"use strict";let{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:i,getOwnPropertyDescriptor:o}=Object,{freeze:r,seal:s,create:a}=Object,{apply:c,construct:d}=typeof Reflect<"u"&&Reflect;r||(r=function(je){return je}),s||(s=function(je){return je}),c||(c=function(je,et,He){return je.apply(et,He)}),d||(d=function(je,et){return new je(...et)});let u=I(Array.prototype.forEach),m=I(Array.prototype.pop),p=I(Array.prototype.push),g=I(String.prototype.toLowerCase),f=I(String.prototype.toString),x=I(String.prototype.match),_=I(String.prototype.replace),C=I(String.prototype.indexOf),V=I(String.prototype.trim),L=I(Object.prototype.hasOwnProperty),Z=I(RegExp.prototype.test),G=v(TypeError);function I(Ie){return function(je){for(var et=arguments.length,He=new Array(et>1?et-1:0),Dt=1;Dt<et;Dt++)He[Dt-1]=arguments[Dt];return c(Ie,je,He)}}function v(Ie){return function(){for(var je=arguments.length,et=new Array(je),He=0;He<je;He++)et[He]=arguments[He];return d(Ie,et)}}function P(Ie,je){let et=arguments.length>2&&arguments[2]!==void 0?arguments[2]:g;t&&t(Ie,null);let He=je.length;for(;He--;){let Dt=je[He];if(typeof Dt=="string"){let Ce=et(Dt);Ce!==Dt&&(n(je)||(je[He]=Ce),Dt=Ce)}Ie[Dt]=!0}return Ie}function w(Ie){for(let je=0;je<Ie.length;je++)L(Ie,je)||(Ie[je]=null);return Ie}function F(Ie){let je=a(null);for(let[et,He]of e(Ie))L(Ie,et)&&(Array.isArray(He)?je[et]=w(He):He&&typeof He=="object"&&He.constructor===Object?je[et]=F(He):je[et]=He);return je}function b(Ie,je){for(;Ie!==null;){let He=o(Ie,je);if(He){if(He.get)return I(He.get);if(typeof He.value=="function")return I(He.value)}Ie=i(Ie)}function et(){return null}return et}let R=r(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),E=r(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),X=r(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),A=r(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),N=r(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),O=r(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),U=r(["#text"]),Y=r(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),k=r(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),H=r(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),J=r(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),te=s(/\{\{[\w\W]*|[\w\W]*\}\}/gm),z=s(/<%[\w\W]*|[\w\W]*%>/gm),q=s(/\${[\w\W]*}/gm),ee=s(/^data-[\-\w.\u00B7-\uFFFF]/),fe=s(/^aria-[\-\w]+$/),_e=s(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),le=s(/^(?:\w+script|data):/i),ye=s(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Te=s(/^html$/i),Xe=s(/^[a-z][.\w]*(-[.\w]+)+$/i);var Le=Object.freeze({__proto__:null,MUSTACHE_EXPR:te,ERB_EXPR:z,TMPLIT_EXPR:q,DATA_ATTR:ee,ARIA_ATTR:fe,IS_ALLOWED_URI:_e,IS_SCRIPT_OR_DATA:le,ATTR_WHITESPACE:ye,DOCTYPE_NAME:Te,CUSTOM_ELEMENT:Xe});let ke={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Oe=function(){return typeof window>"u"?null:window},at=function(je,et){if(typeof je!="object"||typeof je.createPolicy!="function")return null;let He=null,Dt="data-tt-policy-suffix";et&&et.hasAttribute(Dt)&&(He=et.getAttribute(Dt));let Ce="dompurify"+(He?"#"+He:"");try{return je.createPolicy(Ce,{createHTML(Ve){return Ve},createScriptURL(Ve){return Ve}})}catch{return console.warn("TrustedTypes policy "+Ce+" could not be created."),null}};function Mt(){let Ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Oe(),je=Rn=>Mt(Rn);if(je.version="3.1.7",je.removed=[],!Ie||!Ie.document||Ie.document.nodeType!==ke.document)return je.isSupported=!1,je;let{document:et}=Ie,He=et,Dt=He.currentScript,{DocumentFragment:Ce,HTMLTemplateElement:Ve,Node:ct,Element:Di,NodeFilter:mt,NamedNodeMap:_o=Ie.NamedNodeMap||Ie.MozNamedAttrMap,HTMLFormElement:fr,DOMParser:Zc,trustedTypes:Zr}=Ie,ss=Di.prototype,Ne=b(ss,"cloneNode"),ut=b(ss,"remove"),Je=b(ss,"nextSibling"),$e=b(ss,"childNodes"),pt=b(ss,"parentNode");if(typeof Ve=="function"){let Rn=et.createElement("template");Rn.content&&Rn.content.ownerDocument&&(et=Rn.content.ownerDocument)}let It,yn="",{implementation:po,createNodeIterator:rr,createDocumentFragment:Oa,getElementsByTagName:Ya}=et,{importNode:as}=He,Qn={};je.isSupported=typeof e=="function"&&typeof pt=="function"&&po&&po.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:xs,ERB_EXPR:Gr,TMPLIT_EXPR:hl,DATA_ATTR:To,ARIA_ATTR:Hr,IS_SCRIPT_OR_DATA:rp,ATTR_WHITESPACE:fl,CUSTOM_ELEMENT:sp}=Le,{IS_ALLOWED_URI:Ha}=Le,Er=null,Ta=P({},[...R,...E,...X,...N,...U]),bo=null,T0=P({},[...Y,...k,...H,...J]),di=Object.seal(a(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Gc=null,nd=null,ru=!0,So=!0,su=!1,TS=!0,By=!1,F3=!0,Oy=!1,A3=!1,M3=!1,SS=!1,F9=!1,A9=!1,eq=!0,tq=!1,XCe="user-content-",N3=!0,AL=!1,CS={},VS=null,nq=P({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),iq=null,oq=P({},["audio","video","img","source","image","track"]),k3=null,rq=P({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),M9="http://www.w3.org/1998/Math/MathML",N9="http://www.w3.org/2000/svg",ap="http://www.w3.org/1999/xhtml",LS=ap,U3=!1,D3=null,WCe=P({},[M9,N9,ap],f),ML=null,PCe=["application/xhtml+xml","text/html"],vCe="text/html",na=null,RS=null,wCe=et.createElement("form"),sq=function(Re){return Re instanceof RegExp||Re instanceof Function},B3=function(){let Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(RS&&RS===Re)){if((!Re||typeof Re!="object")&&(Re={}),Re=F(Re),ML=PCe.indexOf(Re.PARSER_MEDIA_TYPE)===-1?vCe:Re.PARSER_MEDIA_TYPE,na=ML==="application/xhtml+xml"?f:g,Er=L(Re,"ALLOWED_TAGS")?P({},Re.ALLOWED_TAGS,na):Ta,bo=L(Re,"ALLOWED_ATTR")?P({},Re.ALLOWED_ATTR,na):T0,D3=L(Re,"ALLOWED_NAMESPACES")?P({},Re.ALLOWED_NAMESPACES,f):WCe,k3=L(Re,"ADD_URI_SAFE_ATTR")?P(F(rq),Re.ADD_URI_SAFE_ATTR,na):rq,iq=L(Re,"ADD_DATA_URI_TAGS")?P(F(oq),Re.ADD_DATA_URI_TAGS,na):oq,VS=L(Re,"FORBID_CONTENTS")?P({},Re.FORBID_CONTENTS,na):nq,Gc=L(Re,"FORBID_TAGS")?P({},Re.FORBID_TAGS,na):{},nd=L(Re,"FORBID_ATTR")?P({},Re.FORBID_ATTR,na):{},CS=L(Re,"USE_PROFILES")?Re.USE_PROFILES:!1,ru=Re.ALLOW_ARIA_ATTR!==!1,So=Re.ALLOW_DATA_ATTR!==!1,su=Re.ALLOW_UNKNOWN_PROTOCOLS||!1,TS=Re.ALLOW_SELF_CLOSE_IN_ATTR!==!1,By=Re.SAFE_FOR_TEMPLATES||!1,F3=Re.SAFE_FOR_XML!==!1,Oy=Re.WHOLE_DOCUMENT||!1,SS=Re.RETURN_DOM||!1,F9=Re.RETURN_DOM_FRAGMENT||!1,A9=Re.RETURN_TRUSTED_TYPE||!1,M3=Re.FORCE_BODY||!1,eq=Re.SANITIZE_DOM!==!1,tq=Re.SANITIZE_NAMED_PROPS||!1,N3=Re.KEEP_CONTENT!==!1,AL=Re.IN_PLACE||!1,Ha=Re.ALLOWED_URI_REGEXP||_e,LS=Re.NAMESPACE||ap,di=Re.CUSTOM_ELEMENT_HANDLING||{},Re.CUSTOM_ELEMENT_HANDLING&&sq(Re.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(di.tagNameCheck=Re.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Re.CUSTOM_ELEMENT_HANDLING&&sq(Re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(di.attributeNameCheck=Re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Re.CUSTOM_ELEMENT_HANDLING&&typeof Re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(di.allowCustomizedBuiltInElements=Re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),By&&(So=!1),F9&&(SS=!0),CS&&(Er=P({},U),bo=[],CS.html===!0&&(P(Er,R),P(bo,Y)),CS.svg===!0&&(P(Er,E),P(bo,k),P(bo,J)),CS.svgFilters===!0&&(P(Er,X),P(bo,k),P(bo,J)),CS.mathMl===!0&&(P(Er,N),P(bo,H),P(bo,J))),Re.ADD_TAGS&&(Er===Ta&&(Er=F(Er)),P(Er,Re.ADD_TAGS,na)),Re.ADD_ATTR&&(bo===T0&&(bo=F(bo)),P(bo,Re.ADD_ATTR,na)),Re.ADD_URI_SAFE_ATTR&&P(k3,Re.ADD_URI_SAFE_ATTR,na),Re.FORBID_CONTENTS&&(VS===nq&&(VS=F(VS)),P(VS,Re.FORBID_CONTENTS,na)),N3&&(Er["#text"]=!0),Oy&&P(Er,["html","head","body"]),Er.table&&(P(Er,["tbody"]),delete Gc.tbody),Re.TRUSTED_TYPES_POLICY){if(typeof Re.TRUSTED_TYPES_POLICY.createHTML!="function")throw G('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Re.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw G('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');It=Re.TRUSTED_TYPES_POLICY,yn=It.createHTML("")}else It===void 0&&(It=at(Zr,Dt)),It!==null&&typeof yn=="string"&&(yn=It.createHTML(""));r&&r(Re),RS=Re}},aq=P({},["mi","mo","mn","ms","mtext"]),cq=P({},["annotation-xml"]),FCe=P({},["title","style","font","a","script"]),lq=P({},[...E,...X,...A]),dq=P({},[...N,...O]),ACe=function(Re){let wt=pt(Re);(!wt||!wt.tagName)&&(wt={namespaceURI:LS,tagName:"template"});let bn=g(Re.tagName),Yo=g(wt.tagName);return D3[Re.namespaceURI]?Re.namespaceURI===N9?wt.namespaceURI===ap?bn==="svg":wt.namespaceURI===M9?bn==="svg"&&(Yo==="annotation-xml"||aq[Yo]):!!lq[bn]:Re.namespaceURI===M9?wt.namespaceURI===ap?bn==="math":wt.namespaceURI===N9?bn==="math"&&cq[Yo]:!!dq[bn]:Re.namespaceURI===ap?wt.namespaceURI===N9&&!cq[Yo]||wt.namespaceURI===M9&&!aq[Yo]?!1:!dq[bn]&&(FCe[bn]||!lq[bn]):!!(ML==="application/xhtml+xml"&&D3[Re.namespaceURI]):!1},Mh=function(Re){p(je.removed,{element:Re});try{pt(Re).removeChild(Re)}catch{ut(Re)}},k9=function(Re,wt){try{p(je.removed,{attribute:wt.getAttributeNode(Re),from:wt})}catch{p(je.removed,{attribute:null,from:wt})}if(wt.removeAttribute(Re),Re==="is"&&!bo[Re])if(SS||F9)try{Mh(wt)}catch{}else try{wt.setAttribute(Re,"")}catch{}},uq=function(Re){let wt=null,bn=null;if(M3)Re="<remove></remove>"+Re;else{let Sa=x(Re,/^[\r\n\t ]+/);bn=Sa&&Sa[0]}ML==="application/xhtml+xml"&&LS===ap&&(Re='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Re+"</body></html>");let Yo=It?It.createHTML(Re):Re;if(LS===ap)try{wt=new Zc().parseFromString(Yo,ML)}catch{}if(!wt||!wt.documentElement){wt=po.createDocument(LS,"template",null);try{wt.documentElement.innerHTML=U3?yn:Yo}catch{}}let za=wt.body||wt.documentElement;return Re&&bn&&za.insertBefore(et.createTextNode(bn),za.childNodes[0]||null),LS===ap?Ya.call(wt,Oy?"html":"body")[0]:Oy?wt.documentElement:za},mq=function(Re){return rr.call(Re.ownerDocument||Re,Re,mt.SHOW_ELEMENT|mt.SHOW_COMMENT|mt.SHOW_TEXT|mt.SHOW_PROCESSING_INSTRUCTION|mt.SHOW_CDATA_SECTION,null)},hq=function(Re){return Re instanceof fr&&(typeof Re.nodeName!="string"||typeof Re.textContent!="string"||typeof Re.removeChild!="function"||!(Re.attributes instanceof _o)||typeof Re.removeAttribute!="function"||typeof Re.setAttribute!="function"||typeof Re.namespaceURI!="string"||typeof Re.insertBefore!="function"||typeof Re.hasChildNodes!="function")},fq=function(Re){return typeof ct=="function"&&Re instanceof ct},cp=function(Re,wt,bn){Qn[Re]&&u(Qn[Re],Yo=>{Yo.call(je,wt,bn,RS)})},pq=function(Re){let wt=null;if(cp("beforeSanitizeElements",Re,null),hq(Re))return Mh(Re),!0;let bn=na(Re.nodeName);if(cp("uponSanitizeElement",Re,{tagName:bn,allowedTags:Er}),Re.hasChildNodes()&&!fq(Re.firstElementChild)&&Z(/<[/\w]/g,Re.innerHTML)&&Z(/<[/\w]/g,Re.textContent)||Re.nodeType===ke.progressingInstruction||F3&&Re.nodeType===ke.comment&&Z(/<[/\w]/g,Re.data))return Mh(Re),!0;if(!Er[bn]||Gc[bn]){if(!Gc[bn]&&gq(bn)&&(di.tagNameCheck instanceof RegExp&&Z(di.tagNameCheck,bn)||di.tagNameCheck instanceof Function&&di.tagNameCheck(bn)))return!1;if(N3&&!VS[bn]){let Yo=pt(Re)||Re.parentNode,za=$e(Re)||Re.childNodes;if(za&&Yo){let Sa=za.length;for(let pl=Sa-1;pl>=0;--pl){let Nh=Ne(za[pl],!0);Nh.__removalCount=(Re.__removalCount||0)+1,Yo.insertBefore(Nh,Je(Re))}}}return Mh(Re),!0}return Re instanceof Di&&!ACe(Re)||(bn==="noscript"||bn==="noembed"||bn==="noframes")&&Z(/<\/no(script|embed|frames)/i,Re.innerHTML)?(Mh(Re),!0):(By&&Re.nodeType===ke.text&&(wt=Re.textContent,u([xs,Gr,hl],Yo=>{wt=_(wt,Yo," ")}),Re.textContent!==wt&&(p(je.removed,{element:Re.cloneNode()}),Re.textContent=wt)),cp("afterSanitizeElements",Re,null),!1)},bq=function(Re,wt,bn){if(eq&&(wt==="id"||wt==="name")&&(bn in et||bn in wCe))return!1;if(!(So&&!nd[wt]&&Z(To,wt))){if(!(ru&&Z(Hr,wt))){if(!bo[wt]||nd[wt]){if(!(gq(Re)&&(di.tagNameCheck instanceof RegExp&&Z(di.tagNameCheck,Re)||di.tagNameCheck instanceof Function&&di.tagNameCheck(Re))&&(di.attributeNameCheck instanceof RegExp&&Z(di.attributeNameCheck,wt)||di.attributeNameCheck instanceof Function&&di.attributeNameCheck(wt))||wt==="is"&&di.allowCustomizedBuiltInElements&&(di.tagNameCheck instanceof RegExp&&Z(di.tagNameCheck,bn)||di.tagNameCheck instanceof Function&&di.tagNameCheck(bn))))return!1}else if(!k3[wt]){if(!Z(Ha,_(bn,fl,""))){if(!((wt==="src"||wt==="xlink:href"||wt==="href")&&Re!=="script"&&C(bn,"data:")===0&&iq[Re])){if(!(su&&!Z(rp,_(bn,fl,"")))){if(bn)return!1}}}}}}return!0},gq=function(Re){return Re!=="annotation-xml"&&x(Re,sp)},yq=function(Re){cp("beforeSanitizeAttributes",Re,null);let{attributes:wt}=Re;if(!wt)return;let bn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:bo},Yo=wt.length;for(;Yo--;){let za=wt[Yo],{name:Sa,namespaceURI:pl,value:Nh}=za,NL=na(Sa),Ec=Sa==="value"?Nh:V(Nh);if(bn.attrName=NL,bn.attrValue=Ec,bn.keepAttr=!0,bn.forceKeepAttr=void 0,cp("uponSanitizeAttribute",Re,bn),Ec=bn.attrValue,bn.forceKeepAttr||(k9(Sa,Re),!bn.keepAttr))continue;if(!TS&&Z(/\/>/i,Ec)){k9(Sa,Re);continue}By&&u([xs,Gr,hl],_q=>{Ec=_(Ec,_q," ")});let xq=na(Re.nodeName);if(bq(xq,NL,Ec)){if(tq&&(NL==="id"||NL==="name")&&(k9(Sa,Re),Ec=XCe+Ec),F3&&Z(/((--!?|])>)|<\/(style|title)/i,Ec)){k9(Sa,Re);continue}if(It&&typeof Zr=="object"&&typeof Zr.getAttributeType=="function"&&!pl)switch(Zr.getAttributeType(xq,NL)){case"TrustedHTML":{Ec=It.createHTML(Ec);break}case"TrustedScriptURL":{Ec=It.createScriptURL(Ec);break}}try{pl?Re.setAttributeNS(pl,Sa,Ec):Re.setAttribute(Sa,Ec),hq(Re)?Mh(Re):m(je.removed)}catch{}}}cp("afterSanitizeAttributes",Re,null)},MCe=function Rn(Re){let wt=null,bn=mq(Re);for(cp("beforeSanitizeShadowDOM",Re,null);wt=bn.nextNode();)cp("uponSanitizeShadowNode",wt,null),!pq(wt)&&(wt.content instanceof Ce&&Rn(wt.content),yq(wt));cp("afterSanitizeShadowDOM",Re,null)};return je.sanitize=function(Rn){let Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},wt=null,bn=null,Yo=null,za=null;if(U3=!Rn,U3&&(Rn="<!-->"),typeof Rn!="string"&&!fq(Rn))if(typeof Rn.toString=="function"){if(Rn=Rn.toString(),typeof Rn!="string")throw G("dirty is not a string, aborting")}else throw G("toString is not a function");if(!je.isSupported)return Rn;if(A3||B3(Re),je.removed=[],typeof Rn=="string"&&(AL=!1),AL){if(Rn.nodeName){let Nh=na(Rn.nodeName);if(!Er[Nh]||Gc[Nh])throw G("root node is forbidden and cannot be sanitized in-place")}}else if(Rn instanceof ct)wt=uq("<!---->"),bn=wt.ownerDocument.importNode(Rn,!0),bn.nodeType===ke.element&&bn.nodeName==="BODY"||bn.nodeName==="HTML"?wt=bn:wt.appendChild(bn);else{if(!SS&&!By&&!Oy&&Rn.indexOf("<")===-1)return It&&A9?It.createHTML(Rn):Rn;if(wt=uq(Rn),!wt)return SS?null:A9?yn:""}wt&&M3&&Mh(wt.firstChild);let Sa=mq(AL?Rn:wt);for(;Yo=Sa.nextNode();)pq(Yo)||(Yo.content instanceof Ce&&MCe(Yo.content),yq(Yo));if(AL)return Rn;if(SS){if(F9)for(za=Oa.call(wt.ownerDocument);wt.firstChild;)za.appendChild(wt.firstChild);else za=wt;return(bo.shadowroot||bo.shadowrootmode)&&(za=as.call(He,za,!0)),za}let pl=Oy?wt.outerHTML:wt.innerHTML;return Oy&&Er["!doctype"]&&wt.ownerDocument&&wt.ownerDocument.doctype&&wt.ownerDocument.doctype.name&&Z(Te,wt.ownerDocument.doctype.name)&&(pl="<!DOCTYPE "+wt.ownerDocument.doctype.name+`>
  61. `+pl),By&&u([xs,Gr,hl],Nh=>{pl=_(pl,Nh," ")}),It&&A9?It.createHTML(pl):pl},je.setConfig=function(){let Rn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};B3(Rn),A3=!0},je.clearConfig=function(){RS=null,A3=!1},je.isValidAttribute=function(Rn,Re,wt){RS||B3({});let bn=na(Rn),Yo=na(Re);return bq(bn,Yo,wt)},je.addHook=function(Rn,Re){typeof Re=="function"&&(Qn[Rn]=Qn[Rn]||[],p(Qn[Rn],Re))},je.removeHook=function(Rn){if(Qn[Rn])return m(Qn[Rn])},je.removeHooks=function(Rn){Qn[Rn]&&(Qn[Rn]=[])},je.removeAllHooks=function(){Qn={}},je}var Lt=Mt();return Lt})});var Oce=bl((fFn,Bce)=>{"use strict";var pFn=T(S());Bce.exports=fze;var C2=1e20;function fze(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,s,a,c,d,u,m,p,g,f,x;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");r=t.width,s=t.height,c=e,t.stride?u=t.stride:u=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,m=p.getContext("2d"),r=p.width,s=p.height,g=m.getImageData(0,0,r,s),c=g.data,u=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,m=e,r=p.width,s=p.height,g=m.getImageData(0,0,r,s),c=g.data,u=4):window.ImageData&&e instanceof window.ImageData&&(g=e,r=e.width,s=e.height,c=g.data,u=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(d=c,c=Array(r*s),f=0,x=Math.floor(d.length/u);f<x;f++)c[f]=d[f*u+o]/255;else if(u!==1)throw Error("Raw data can have only 1 value per pixel");var _=Array(r*s),C=Array(r*s),V=Array(a),L=Array(a),Z=Array(a+1),G=Array(a);for(f=0,x=r*s;f<x;f++){var I=c[f];_[f]=I===1?0:I===0?C2:Math.pow(Math.max(0,.5-I),2),C[f]=I===1?C2:I===0?0:Math.pow(Math.max(0,I-.5),2)}Uce(_,r,s,V,L,G,Z),Uce(C,r,s,V,L,G,Z);var v=window.Float32Array?new Float32Array(r*s):new Array(r*s);for(f=0,x=r*s;f<x;f++)v[f]=Math.min(Math.max(1-((_[f]-C[f])/i+n),0),1);return v}function Uce(e,t,n,i,o,r,s){for(var a=0;a<t;a++){for(var c=0;c<n;c++)i[c]=e[c*t+a];for(Dce(i,o,r,s,n),c=0;c<n;c++)e[c*t+a]=o[c]}for(c=0;c<n;c++){for(a=0;a<t;a++)i[a]=e[c*t+a];for(Dce(i,o,r,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(o[a])}}function Dce(e,t,n,i,o){n[0]=0,i[0]=-C2,i[1]=+C2;for(var r=1,s=0;r<o;r++){for(var a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);a<=i[s];)s--,a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);s++,n[s]=r,i[s]=a,i[s+1]=+C2}for(r=0,s=0;r<o;r++){for(;i[s+1]<r;)s++;t[r]=(r-n[s])*(r-n[s])+e[n[s]]}}});var Jce=bl((vFn,ek)=>{var wFn=T(S());function Lze(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,c=8,d=9,u=10,m=11,p=12,g=13,f=14,x=15,_=16,C=17,V=0,L=1,Z=2,G=3,I=4;function v(b,R){return 55296<=b.charCodeAt(R)&&b.charCodeAt(R)<=56319&&56320<=b.charCodeAt(R+1)&&b.charCodeAt(R+1)<=57343}function P(b,R){R===void 0&&(R=0);var E=b.charCodeAt(R);if(55296<=E&&E<=56319&&R<b.length-1){var X=E,A=b.charCodeAt(R+1);return 56320<=A&&A<=57343?(X-55296)*1024+(A-56320)+65536:X}if(56320<=E&&E<=57343&&R>=1){var X=b.charCodeAt(R-1),A=E;return 55296<=X&&X<=56319?(X-55296)*1024+(A-56320)+65536:A}return E}function w(b,R,E){var X=[b].concat(R).concat([E]),A=X[X.length-2],N=E,O=X.lastIndexOf(f);if(O>1&&X.slice(1,O).every(function(k){return k==i})&&[i,g,C].indexOf(b)==-1)return Z;var U=X.lastIndexOf(o);if(U>0&&X.slice(1,U).every(function(k){return k==o})&&[p,o].indexOf(A)==-1)return X.filter(function(k){return k==o}).length%2==1?G:I;if(A==e&&N==t)return V;if(A==n||A==e||A==t)return N==f&&R.every(function(k){return k==i})?Z:L;if(N==n||N==e||N==t)return L;if(A==s&&(N==s||N==a||N==d||N==u))return V;if((A==d||A==a)&&(N==a||N==c))return V;if((A==u||A==c)&&N==c)return V;if(N==i||N==x)return V;if(N==r)return V;if(A==p)return V;var Y=X.indexOf(i)!=-1?X.lastIndexOf(i)-1:X.length-2;return[g,C].indexOf(X[Y])!=-1&&X.slice(Y+1,-1).every(function(k){return k==i})&&N==f||A==x&&[_,C].indexOf(N)!=-1?V:R.indexOf(o)!=-1?Z:A==o&&N==o?V:L}this.nextBreak=function(b,R){if(R===void 0&&(R=0),R<0)return 0;if(R>=b.length-1)return b.length;for(var E=F(P(b,R)),X=[],A=R+1;A<b.length;A++)if(!v(b,A-1)){var N=F(P(b,A));if(w(E,X,N))return A;X.push(N)}return b.length},this.splitGraphemes=function(b){for(var R=[],E=0,X;(X=this.nextBreak(b,E))<b.length;)R.push(b.slice(E,X)),E=X;return E<b.length&&R.push(b.slice(E)),R},this.iterateGraphemes=function(b){var R=0,E={next:function(){var X,A;return(A=this.nextBreak(b,R))<b.length?(X=b.slice(R,A),R=A,{value:X,done:!1}):R<b.length?(X=b.slice(R),R=b.length,{value:X,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(E[Symbol.iterator]=function(){return E}),E},this.countGraphemes=function(b){for(var R=0,E=0,X;(X=this.nextBreak(b,E))<b.length;)E=X,R++;return E<b.length&&R++,R};function F(b){return 1536<=b&&b<=1541||b==1757||b==1807||b==2274||b==3406||b==69821||70082<=b&&b<=70083||b==72250||72326<=b&&b<=72329||b==73030?p:b==13?e:b==10?t:0<=b&&b<=9||11<=b&&b<=12||14<=b&&b<=31||127<=b&&b<=159||b==173||b==1564||b==6158||b==8203||8206<=b&&b<=8207||b==8232||b==8233||8234<=b&&b<=8238||8288<=b&&b<=8292||b==8293||8294<=b&&b<=8303||55296<=b&&b<=57343||b==65279||65520<=b&&b<=65528||65529<=b&&b<=65531||113824<=b&&b<=113827||119155<=b&&b<=119162||b==917504||b==917505||917506<=b&&b<=917535||917632<=b&&b<=917759||918e3<=b&&b<=921599?n:768<=b&&b<=879||1155<=b&&b<=1159||1160<=b&&b<=1161||1425<=b&&b<=1469||b==1471||1473<=b&&b<=1474||1476<=b&&b<=1477||b==1479||1552<=b&&b<=1562||1611<=b&&b<=1631||b==1648||1750<=b&&b<=1756||1759<=b&&b<=1764||1767<=b&&b<=1768||1770<=b&&b<=1773||b==1809||1840<=b&&b<=1866||1958<=b&&b<=1968||2027<=b&&b<=2035||2070<=b&&b<=2073||2075<=b&&b<=2083||2085<=b&&b<=2087||2089<=b&&b<=2093||2137<=b&&b<=2139||2260<=b&&b<=2273||2275<=b&&b<=2306||b==2362||b==2364||2369<=b&&b<=2376||b==2381||2385<=b&&b<=2391||2402<=b&&b<=2403||b==2433||b==2492||b==2494||2497<=b&&b<=2500||b==2509||b==2519||2530<=b&&b<=2531||2561<=b&&b<=2562||b==2620||2625<=b&&b<=2626||2631<=b&&b<=2632||2635<=b&&b<=2637||b==2641||2672<=b&&b<=2673||b==2677||2689<=b&&b<=2690||b==2748||2753<=b&&b<=2757||2759<=b&&b<=2760||b==2765||2786<=b&&b<=2787||2810<=b&&b<=2815||b==2817||b==2876||b==2878||b==2879||2881<=b&&b<=2884||b==2893||b==2902||b==2903||2914<=b&&b<=2915||b==2946||b==3006||b==3008||b==3021||b==3031||b==3072||3134<=b&&b<=3136||3142<=b&&b<=3144||3146<=b&&b<=3149||3157<=b&&b<=3158||3170<=b&&b<=3171||b==3201||b==3260||b==3263||b==3266||b==3270||3276<=b&&b<=3277||3285<=b&&b<=3286||3298<=b&&b<=3299||3328<=b&&b<=3329||3387<=b&&b<=3388||b==3390||3393<=b&&b<=3396||b==3405||b==3415||3426<=b&&b<=3427||b==3530||b==3535||3538<=b&&b<=3540||b==3542||b==3551||b==3633||3636<=b&&b<=3642||3655<=b&&b<=3662||b==3761||3764<=b&&b<=3769||3771<=b&&b<=3772||3784<=b&&b<=3789||3864<=b&&b<=3865||b==3893||b==3895||b==3897||3953<=b&&b<=3966||3968<=b&&b<=3972||3974<=b&&b<=3975||3981<=b&&b<=3991||3993<=b&&b<=4028||b==4038||4141<=b&&b<=4144||4146<=b&&b<=4151||4153<=b&&b<=4154||4157<=b&&b<=4158||4184<=b&&b<=4185||4190<=b&&b<=4192||4209<=b&&b<=4212||b==4226||4229<=b&&b<=4230||b==4237||b==4253||4957<=b&&b<=4959||5906<=b&&b<=5908||5938<=b&&b<=5940||5970<=b&&b<=5971||6002<=b&&b<=6003||6068<=b&&b<=6069||6071<=b&&b<=6077||b==6086||6089<=b&&b<=6099||b==6109||6155<=b&&b<=6157||6277<=b&&b<=6278||b==6313||6432<=b&&b<=6434||6439<=b&&b<=6440||b==6450||6457<=b&&b<=6459||6679<=b&&b<=6680||b==6683||b==6742||6744<=b&&b<=6750||b==6752||b==6754||6757<=b&&b<=6764||6771<=b&&b<=6780||b==6783||6832<=b&&b<=6845||b==6846||6912<=b&&b<=6915||b==6964||6966<=b&&b<=6970||b==6972||b==6978||7019<=b&&b<=7027||7040<=b&&b<=7041||7074<=b&&b<=7077||7080<=b&&b<=7081||7083<=b&&b<=7085||b==7142||7144<=b&&b<=7145||b==7149||7151<=b&&b<=7153||7212<=b&&b<=7219||7222<=b&&b<=7223||7376<=b&&b<=7378||7380<=b&&b<=7392||7394<=b&&b<=7400||b==7405||b==7412||7416<=b&&b<=7417||7616<=b&&b<=7673||7675<=b&&b<=7679||b==8204||8400<=b&&b<=8412||8413<=b&&b<=8416||b==8417||8418<=b&&b<=8420||8421<=b&&b<=8432||11503<=b&&b<=11505||b==11647||11744<=b&&b<=11775||12330<=b&&b<=12333||12334<=b&&b<=12335||12441<=b&&b<=12442||b==42607||42608<=b&&b<=42610||42612<=b&&b<=42621||42654<=b&&b<=42655||42736<=b&&b<=42737||b==43010||b==43014||b==43019||43045<=b&&b<=43046||43204<=b&&b<=43205||43232<=b&&b<=43249||43302<=b&&b<=43309||43335<=b&&b<=43345||43392<=b&&b<=43394||b==43443||43446<=b&&b<=43449||b==43452||b==43493||43561<=b&&b<=43566||43569<=b&&b<=43570||43573<=b&&b<=43574||b==43587||b==43596||b==43644||b==43696||43698<=b&&b<=43700||43703<=b&&b<=43704||43710<=b&&b<=43711||b==43713||43756<=b&&b<=43757||b==43766||b==44005||b==44008||b==44013||b==64286||65024<=b&&b<=65039||65056<=b&&b<=65071||65438<=b&&b<=65439||b==66045||b==66272||66422<=b&&b<=66426||68097<=b&&b<=68099||68101<=b&&b<=68102||68108<=b&&b<=68111||68152<=b&&b<=68154||b==68159||68325<=b&&b<=68326||b==69633||69688<=b&&b<=69702||69759<=b&&b<=69761||69811<=b&&b<=69814||69817<=b&&b<=69818||69888<=b&&b<=69890||69927<=b&&b<=69931||69933<=b&&b<=69940||b==70003||70016<=b&&b<=70017||70070<=b&&b<=70078||70090<=b&&b<=70092||70191<=b&&b<=70193||b==70196||70198<=b&&b<=70199||b==70206||b==70367||70371<=b&&b<=70378||70400<=b&&b<=70401||b==70460||b==70462||b==70464||b==70487||70502<=b&&b<=70508||70512<=b&&b<=70516||70712<=b&&b<=70719||70722<=b&&b<=70724||b==70726||b==70832||70835<=b&&b<=70840||b==70842||b==70845||70847<=b&&b<=70848||70850<=b&&b<=70851||b==71087||71090<=b&&b<=71093||71100<=b&&b<=71101||71103<=b&&b<=71104||71132<=b&&b<=71133||71219<=b&&b<=71226||b==71229||71231<=b&&b<=71232||b==71339||b==71341||71344<=b&&b<=71349||b==71351||71453<=b&&b<=71455||71458<=b&&b<=71461||71463<=b&&b<=71467||72193<=b&&b<=72198||72201<=b&&b<=72202||72243<=b&&b<=72248||72251<=b&&b<=72254||b==72263||72273<=b&&b<=72278||72281<=b&&b<=72283||72330<=b&&b<=72342||72344<=b&&b<=72345||72752<=b&&b<=72758||72760<=b&&b<=72765||b==72767||72850<=b&&b<=72871||72874<=b&&b<=72880||72882<=b&&b<=72883||72885<=b&&b<=72886||73009<=b&&b<=73014||b==73018||73020<=b&&b<=73021||73023<=b&&b<=73029||b==73031||92912<=b&&b<=92916||92976<=b&&b<=92982||94095<=b&&b<=94098||113821<=b&&b<=113822||b==119141||119143<=b&&b<=119145||119150<=b&&b<=119154||119163<=b&&b<=119170||119173<=b&&b<=119179||119210<=b&&b<=119213||119362<=b&&b<=119364||121344<=b&&b<=121398||121403<=b&&b<=121452||b==121461||b==121476||121499<=b&&b<=121503||121505<=b&&b<=121519||122880<=b&&b<=122886||122888<=b&&b<=122904||122907<=b&&b<=122913||122915<=b&&b<=122916||122918<=b&&b<=122922||125136<=b&&b<=125142||125252<=b&&b<=125258||917536<=b&&b<=917631||917760<=b&&b<=917999?i:127462<=b&&b<=127487?o:b==2307||b==2363||2366<=b&&b<=2368||2377<=b&&b<=2380||2382<=b&&b<=2383||2434<=b&&b<=2435||2495<=b&&b<=2496||2503<=b&&b<=2504||2507<=b&&b<=2508||b==2563||2622<=b&&b<=2624||b==2691||2750<=b&&b<=2752||b==2761||2763<=b&&b<=2764||2818<=b&&b<=2819||b==2880||2887<=b&&b<=2888||2891<=b&&b<=2892||b==3007||3009<=b&&b<=3010||3014<=b&&b<=3016||3018<=b&&b<=3020||3073<=b&&b<=3075||3137<=b&&b<=3140||3202<=b&&b<=3203||b==3262||3264<=b&&b<=3265||3267<=b&&b<=3268||3271<=b&&b<=3272||3274<=b&&b<=3275||3330<=b&&b<=3331||3391<=b&&b<=3392||3398<=b&&b<=3400||3402<=b&&b<=3404||3458<=b&&b<=3459||3536<=b&&b<=3537||3544<=b&&b<=3550||3570<=b&&b<=3571||b==3635||b==3763||3902<=b&&b<=3903||b==3967||b==4145||4155<=b&&b<=4156||4182<=b&&b<=4183||b==4228||b==6070||6078<=b&&b<=6085||6087<=b&&b<=6088||6435<=b&&b<=6438||6441<=b&&b<=6443||6448<=b&&b<=6449||6451<=b&&b<=6456||6681<=b&&b<=6682||b==6741||b==6743||6765<=b&&b<=6770||b==6916||b==6965||b==6971||6973<=b&&b<=6977||6979<=b&&b<=6980||b==7042||b==7073||7078<=b&&b<=7079||b==7082||b==7143||7146<=b&&b<=7148||b==7150||7154<=b&&b<=7155||7204<=b&&b<=7211||7220<=b&&b<=7221||b==7393||7410<=b&&b<=7411||b==7415||43043<=b&&b<=43044||b==43047||43136<=b&&b<=43137||43188<=b&&b<=43203||43346<=b&&b<=43347||b==43395||43444<=b&&b<=43445||43450<=b&&b<=43451||43453<=b&&b<=43456||43567<=b&&b<=43568||43571<=b&&b<=43572||b==43597||b==43755||43758<=b&&b<=43759||b==43765||44003<=b&&b<=44004||44006<=b&&b<=44007||44009<=b&&b<=44010||b==44012||b==69632||b==69634||b==69762||69808<=b&&b<=69810||69815<=b&&b<=69816||b==69932||b==70018||70067<=b&&b<=70069||70079<=b&&b<=70080||70188<=b&&b<=70190||70194<=b&&b<=70195||b==70197||70368<=b&&b<=70370||70402<=b&&b<=70403||b==70463||70465<=b&&b<=70468||70471<=b&&b<=70472||70475<=b&&b<=70477||70498<=b&&b<=70499||70709<=b&&b<=70711||70720<=b&&b<=70721||b==70725||70833<=b&&b<=70834||b==70841||70843<=b&&b<=70844||b==70846||b==70849||71088<=b&&b<=71089||71096<=b&&b<=71099||b==71102||71216<=b&&b<=71218||71227<=b&&b<=71228||b==71230||b==71340||71342<=b&&b<=71343||b==71350||71456<=b&&b<=71457||b==71462||72199<=b&&b<=72200||b==72249||72279<=b&&b<=72280||b==72343||b==72751||b==72766||b==72873||b==72881||b==72884||94033<=b&&b<=94078||b==119142||b==119149?r:4352<=b&&b<=4447||43360<=b&&b<=43388?s:4448<=b&&b<=4519||55216<=b&&b<=55238?a:4520<=b&&b<=4607||55243<=b&&b<=55291?c:b==44032||b==44060||b==44088||b==44116||b==44144||b==44172||b==44200||b==44228||b==44256||b==44284||b==44312||b==44340||b==44368||b==44396||b==44424||b==44452||b==44480||b==44508||b==44536||b==44564||b==44592||b==44620||b==44648||b==44676||b==44704||b==44732||b==44760||b==44788||b==44816||b==44844||b==44872||b==44900||b==44928||b==44956||b==44984||b==45012||b==45040||b==45068||b==45096||b==45124||b==45152||b==45180||b==45208||b==45236||b==45264||b==45292||b==45320||b==45348||b==45376||b==45404||b==45432||b==45460||b==45488||b==45516||b==45544||b==45572||b==45600||b==45628||b==45656||b==45684||b==45712||b==45740||b==45768||b==45796||b==45824||b==45852||b==45880||b==45908||b==45936||b==45964||b==45992||b==46020||b==46048||b==46076||b==46104||b==46132||b==46160||b==46188||b==46216||b==46244||b==46272||b==46300||b==46328||b==46356||b==46384||b==46412||b==46440||b==46468||b==46496||b==46524||b==46552||b==46580||b==46608||b==46636||b==46664||b==46692||b==46720||b==46748||b==46776||b==46804||b==46832||b==46860||b==46888||b==46916||b==46944||b==46972||b==47e3||b==47028||b==47056||b==47084||b==47112||b==47140||b==47168||b==47196||b==47224||b==47252||b==47280||b==47308||b==47336||b==47364||b==47392||b==47420||b==47448||b==47476||b==47504||b==47532||b==47560||b==47588||b==47616||b==47644||b==47672||b==47700||b==47728||b==47756||b==47784||b==47812||b==47840||b==47868||b==47896||b==47924||b==47952||b==47980||b==48008||b==48036||b==48064||b==48092||b==48120||b==48148||b==48176||b==48204||b==48232||b==48260||b==48288||b==48316||b==48344||b==48372||b==48400||b==48428||b==48456||b==48484||b==48512||b==48540||b==48568||b==48596||b==48624||b==48652||b==48680||b==48708||b==48736||b==48764||b==48792||b==48820||b==48848||b==48876||b==48904||b==48932||b==48960||b==48988||b==49016||b==49044||b==49072||b==49100||b==49128||b==49156||b==49184||b==49212||b==49240||b==49268||b==49296||b==49324||b==49352||b==49380||b==49408||b==49436||b==49464||b==49492||b==49520||b==49548||b==49576||b==49604||b==49632||b==49660||b==49688||b==49716||b==49744||b==49772||b==49800||b==49828||b==49856||b==49884||b==49912||b==49940||b==49968||b==49996||b==50024||b==50052||b==50080||b==50108||b==50136||b==50164||b==50192||b==50220||b==50248||b==50276||b==50304||b==50332||b==50360||b==50388||b==50416||b==50444||b==50472||b==50500||b==50528||b==50556||b==50584||b==50612||b==50640||b==50668||b==50696||b==50724||b==50752||b==50780||b==50808||b==50836||b==50864||b==50892||b==50920||b==50948||b==50976||b==51004||b==51032||b==51060||b==51088||b==51116||b==51144||b==51172||b==51200||b==51228||b==51256||b==51284||b==51312||b==51340||b==51368||b==51396||b==51424||b==51452||b==51480||b==51508||b==51536||b==51564||b==51592||b==51620||b==51648||b==51676||b==51704||b==51732||b==51760||b==51788||b==51816||b==51844||b==51872||b==51900||b==51928||b==51956||b==51984||b==52012||b==52040||b==52068||b==52096||b==52124||b==52152||b==52180||b==52208||b==52236||b==52264||b==52292||b==52320||b==52348||b==52376||b==52404||b==52432||b==52460||b==52488||b==52516||b==52544||b==52572||b==52600||b==52628||b==52656||b==52684||b==52712||b==52740||b==52768||b==52796||b==52824||b==52852||b==52880||b==52908||b==52936||b==52964||b==52992||b==53020||b==53048||b==53076||b==53104||b==53132||b==53160||b==53188||b==53216||b==53244||b==53272||b==53300||b==53328||b==53356||b==53384||b==53412||b==53440||b==53468||b==53496||b==53524||b==53552||b==53580||b==53608||b==53636||b==53664||b==53692||b==53720||b==53748||b==53776||b==53804||b==53832||b==53860||b==53888||b==53916||b==53944||b==53972||b==54e3||b==54028||b==54056||b==54084||b==54112||b==54140||b==54168||b==54196||b==54224||b==54252||b==54280||b==54308||b==54336||b==54364||b==54392||b==54420||b==54448||b==54476||b==54504||b==54532||b==54560||b==54588||b==54616||b==54644||b==54672||b==54700||b==54728||b==54756||b==54784||b==54812||b==54840||b==54868||b==54896||b==54924||b==54952||b==54980||b==55008||b==55036||b==55064||b==55092||b==55120||b==55148||b==55176?d:44033<=b&&b<=44059||44061<=b&&b<=44087||44089<=b&&b<=44115||44117<=b&&b<=44143||44145<=b&&b<=44171||44173<=b&&b<=44199||44201<=b&&b<=44227||44229<=b&&b<=44255||44257<=b&&b<=44283||44285<=b&&b<=44311||44313<=b&&b<=44339||44341<=b&&b<=44367||44369<=b&&b<=44395||44397<=b&&b<=44423||44425<=b&&b<=44451||44453<=b&&b<=44479||44481<=b&&b<=44507||44509<=b&&b<=44535||44537<=b&&b<=44563||44565<=b&&b<=44591||44593<=b&&b<=44619||44621<=b&&b<=44647||44649<=b&&b<=44675||44677<=b&&b<=44703||44705<=b&&b<=44731||44733<=b&&b<=44759||44761<=b&&b<=44787||44789<=b&&b<=44815||44817<=b&&b<=44843||44845<=b&&b<=44871||44873<=b&&b<=44899||44901<=b&&b<=44927||44929<=b&&b<=44955||44957<=b&&b<=44983||44985<=b&&b<=45011||45013<=b&&b<=45039||45041<=b&&b<=45067||45069<=b&&b<=45095||45097<=b&&b<=45123||45125<=b&&b<=45151||45153<=b&&b<=45179||45181<=b&&b<=45207||45209<=b&&b<=45235||45237<=b&&b<=45263||45265<=b&&b<=45291||45293<=b&&b<=45319||45321<=b&&b<=45347||45349<=b&&b<=45375||45377<=b&&b<=45403||45405<=b&&b<=45431||45433<=b&&b<=45459||45461<=b&&b<=45487||45489<=b&&b<=45515||45517<=b&&b<=45543||45545<=b&&b<=45571||45573<=b&&b<=45599||45601<=b&&b<=45627||45629<=b&&b<=45655||45657<=b&&b<=45683||45685<=b&&b<=45711||45713<=b&&b<=45739||45741<=b&&b<=45767||45769<=b&&b<=45795||45797<=b&&b<=45823||45825<=b&&b<=45851||45853<=b&&b<=45879||45881<=b&&b<=45907||45909<=b&&b<=45935||45937<=b&&b<=45963||45965<=b&&b<=45991||45993<=b&&b<=46019||46021<=b&&b<=46047||46049<=b&&b<=46075||46077<=b&&b<=46103||46105<=b&&b<=46131||46133<=b&&b<=46159||46161<=b&&b<=46187||46189<=b&&b<=46215||46217<=b&&b<=46243||46245<=b&&b<=46271||46273<=b&&b<=46299||46301<=b&&b<=46327||46329<=b&&b<=46355||46357<=b&&b<=46383||46385<=b&&b<=46411||46413<=b&&b<=46439||46441<=b&&b<=46467||46469<=b&&b<=46495||46497<=b&&b<=46523||46525<=b&&b<=46551||46553<=b&&b<=46579||46581<=b&&b<=46607||46609<=b&&b<=46635||46637<=b&&b<=46663||46665<=b&&b<=46691||46693<=b&&b<=46719||46721<=b&&b<=46747||46749<=b&&b<=46775||46777<=b&&b<=46803||46805<=b&&b<=46831||46833<=b&&b<=46859||46861<=b&&b<=46887||46889<=b&&b<=46915||46917<=b&&b<=46943||46945<=b&&b<=46971||46973<=b&&b<=46999||47001<=b&&b<=47027||47029<=b&&b<=47055||47057<=b&&b<=47083||47085<=b&&b<=47111||47113<=b&&b<=47139||47141<=b&&b<=47167||47169<=b&&b<=47195||47197<=b&&b<=47223||47225<=b&&b<=47251||47253<=b&&b<=47279||47281<=b&&b<=47307||47309<=b&&b<=47335||47337<=b&&b<=47363||47365<=b&&b<=47391||47393<=b&&b<=47419||47421<=b&&b<=47447||47449<=b&&b<=47475||47477<=b&&b<=47503||47505<=b&&b<=47531||47533<=b&&b<=47559||47561<=b&&b<=47587||47589<=b&&b<=47615||47617<=b&&b<=47643||47645<=b&&b<=47671||47673<=b&&b<=47699||47701<=b&&b<=47727||47729<=b&&b<=47755||47757<=b&&b<=47783||47785<=b&&b<=47811||47813<=b&&b<=47839||47841<=b&&b<=47867||47869<=b&&b<=47895||47897<=b&&b<=47923||47925<=b&&b<=47951||47953<=b&&b<=47979||47981<=b&&b<=48007||48009<=b&&b<=48035||48037<=b&&b<=48063||48065<=b&&b<=48091||48093<=b&&b<=48119||48121<=b&&b<=48147||48149<=b&&b<=48175||48177<=b&&b<=48203||48205<=b&&b<=48231||48233<=b&&b<=48259||48261<=b&&b<=48287||48289<=b&&b<=48315||48317<=b&&b<=48343||48345<=b&&b<=48371||48373<=b&&b<=48399||48401<=b&&b<=48427||48429<=b&&b<=48455||48457<=b&&b<=48483||48485<=b&&b<=48511||48513<=b&&b<=48539||48541<=b&&b<=48567||48569<=b&&b<=48595||48597<=b&&b<=48623||48625<=b&&b<=48651||48653<=b&&b<=48679||48681<=b&&b<=48707||48709<=b&&b<=48735||48737<=b&&b<=48763||48765<=b&&b<=48791||48793<=b&&b<=48819||48821<=b&&b<=48847||48849<=b&&b<=48875||48877<=b&&b<=48903||48905<=b&&b<=48931||48933<=b&&b<=48959||48961<=b&&b<=48987||48989<=b&&b<=49015||49017<=b&&b<=49043||49045<=b&&b<=49071||49073<=b&&b<=49099||49101<=b&&b<=49127||49129<=b&&b<=49155||49157<=b&&b<=49183||49185<=b&&b<=49211||49213<=b&&b<=49239||49241<=b&&b<=49267||49269<=b&&b<=49295||49297<=b&&b<=49323||49325<=b&&b<=49351||49353<=b&&b<=49379||49381<=b&&b<=49407||49409<=b&&b<=49435||49437<=b&&b<=49463||49465<=b&&b<=49491||49493<=b&&b<=49519||49521<=b&&b<=49547||49549<=b&&b<=49575||49577<=b&&b<=49603||49605<=b&&b<=49631||49633<=b&&b<=49659||49661<=b&&b<=49687||49689<=b&&b<=49715||49717<=b&&b<=49743||49745<=b&&b<=49771||49773<=b&&b<=49799||49801<=b&&b<=49827||49829<=b&&b<=49855||49857<=b&&b<=49883||49885<=b&&b<=49911||49913<=b&&b<=49939||49941<=b&&b<=49967||49969<=b&&b<=49995||49997<=b&&b<=50023||50025<=b&&b<=50051||50053<=b&&b<=50079||50081<=b&&b<=50107||50109<=b&&b<=50135||50137<=b&&b<=50163||50165<=b&&b<=50191||50193<=b&&b<=50219||50221<=b&&b<=50247||50249<=b&&b<=50275||50277<=b&&b<=50303||50305<=b&&b<=50331||50333<=b&&b<=50359||50361<=b&&b<=50387||50389<=b&&b<=50415||50417<=b&&b<=50443||50445<=b&&b<=50471||50473<=b&&b<=50499||50501<=b&&b<=50527||50529<=b&&b<=50555||50557<=b&&b<=50583||50585<=b&&b<=50611||50613<=b&&b<=50639||50641<=b&&b<=50667||50669<=b&&b<=50695||50697<=b&&b<=50723||50725<=b&&b<=50751||50753<=b&&b<=50779||50781<=b&&b<=50807||50809<=b&&b<=50835||50837<=b&&b<=50863||50865<=b&&b<=50891||50893<=b&&b<=50919||50921<=b&&b<=50947||50949<=b&&b<=50975||50977<=b&&b<=51003||51005<=b&&b<=51031||51033<=b&&b<=51059||51061<=b&&b<=51087||51089<=b&&b<=51115||51117<=b&&b<=51143||51145<=b&&b<=51171||51173<=b&&b<=51199||51201<=b&&b<=51227||51229<=b&&b<=51255||51257<=b&&b<=51283||51285<=b&&b<=51311||51313<=b&&b<=51339||51341<=b&&b<=51367||51369<=b&&b<=51395||51397<=b&&b<=51423||51425<=b&&b<=51451||51453<=b&&b<=51479||51481<=b&&b<=51507||51509<=b&&b<=51535||51537<=b&&b<=51563||51565<=b&&b<=51591||51593<=b&&b<=51619||51621<=b&&b<=51647||51649<=b&&b<=51675||51677<=b&&b<=51703||51705<=b&&b<=51731||51733<=b&&b<=51759||51761<=b&&b<=51787||51789<=b&&b<=51815||51817<=b&&b<=51843||51845<=b&&b<=51871||51873<=b&&b<=51899||51901<=b&&b<=51927||51929<=b&&b<=51955||51957<=b&&b<=51983||51985<=b&&b<=52011||52013<=b&&b<=52039||52041<=b&&b<=52067||52069<=b&&b<=52095||52097<=b&&b<=52123||52125<=b&&b<=52151||52153<=b&&b<=52179||52181<=b&&b<=52207||52209<=b&&b<=52235||52237<=b&&b<=52263||52265<=b&&b<=52291||52293<=b&&b<=52319||52321<=b&&b<=52347||52349<=b&&b<=52375||52377<=b&&b<=52403||52405<=b&&b<=52431||52433<=b&&b<=52459||52461<=b&&b<=52487||52489<=b&&b<=52515||52517<=b&&b<=52543||52545<=b&&b<=52571||52573<=b&&b<=52599||52601<=b&&b<=52627||52629<=b&&b<=52655||52657<=b&&b<=52683||52685<=b&&b<=52711||52713<=b&&b<=52739||52741<=b&&b<=52767||52769<=b&&b<=52795||52797<=b&&b<=52823||52825<=b&&b<=52851||52853<=b&&b<=52879||52881<=b&&b<=52907||52909<=b&&b<=52935||52937<=b&&b<=52963||52965<=b&&b<=52991||52993<=b&&b<=53019||53021<=b&&b<=53047||53049<=b&&b<=53075||53077<=b&&b<=53103||53105<=b&&b<=53131||53133<=b&&b<=53159||53161<=b&&b<=53187||53189<=b&&b<=53215||53217<=b&&b<=53243||53245<=b&&b<=53271||53273<=b&&b<=53299||53301<=b&&b<=53327||53329<=b&&b<=53355||53357<=b&&b<=53383||53385<=b&&b<=53411||53413<=b&&b<=53439||53441<=b&&b<=53467||53469<=b&&b<=53495||53497<=b&&b<=53523||53525<=b&&b<=53551||53553<=b&&b<=53579||53581<=b&&b<=53607||53609<=b&&b<=53635||53637<=b&&b<=53663||53665<=b&&b<=53691||53693<=b&&b<=53719||53721<=b&&b<=53747||53749<=b&&b<=53775||53777<=b&&b<=53803||53805<=b&&b<=53831||53833<=b&&b<=53859||53861<=b&&b<=53887||53889<=b&&b<=53915||53917<=b&&b<=53943||53945<=b&&b<=53971||53973<=b&&b<=53999||54001<=b&&b<=54027||54029<=b&&b<=54055||54057<=b&&b<=54083||54085<=b&&b<=54111||54113<=b&&b<=54139||54141<=b&&b<=54167||54169<=b&&b<=54195||54197<=b&&b<=54223||54225<=b&&b<=54251||54253<=b&&b<=54279||54281<=b&&b<=54307||54309<=b&&b<=54335||54337<=b&&b<=54363||54365<=b&&b<=54391||54393<=b&&b<=54419||54421<=b&&b<=54447||54449<=b&&b<=54475||54477<=b&&b<=54503||54505<=b&&b<=54531||54533<=b&&b<=54559||54561<=b&&b<=54587||54589<=b&&b<=54615||54617<=b&&b<=54643||54645<=b&&b<=54671||54673<=b&&b<=54699||54701<=b&&b<=54727||54729<=b&&b<=54755||54757<=b&&b<=54783||54785<=b&&b<=54811||54813<=b&&b<=54839||54841<=b&&b<=54867||54869<=b&&b<=54895||54897<=b&&b<=54923||54925<=b&&b<=54951||54953<=b&&b<=54979||54981<=b&&b<=55007||55009<=b&&b<=55035||55037<=b&&b<=55063||55065<=b&&b<=55091||55093<=b&&b<=55119||55121<=b&&b<=55147||55149<=b&&b<=55175||55177<=b&&b<=55203?u:b==9757||b==9977||9994<=b&&b<=9997||b==127877||127938<=b&&b<=127940||b==127943||127946<=b&&b<=127948||128066<=b&&b<=128067||128070<=b&&b<=128080||b==128110||128112<=b&&b<=128120||b==128124||128129<=b&&b<=128131||128133<=b&&b<=128135||b==128170||128372<=b&&b<=128373||b==128378||b==128400||128405<=b&&b<=128406||128581<=b&&b<=128583||128587<=b&&b<=128591||b==128675||128692<=b&&b<=128694||b==128704||b==128716||129304<=b&&b<=129308||129310<=b&&b<=129311||b==129318||129328<=b&&b<=129337||129341<=b&&b<=129342||129489<=b&&b<=129501?g:127995<=b&&b<=127999?f:b==8205?x:b==9792||b==9794||9877<=b&&b<=9878||b==9992||b==10084||b==127752||b==127806||b==127859||b==127891||b==127908||b==127912||b==127979||b==127981||b==128139||128187<=b&&b<=128188||b==128295||b==128300||b==128488||b==128640||b==128658?_:128102<=b&&b<=128105?C:m}return this}typeof ek<"u"&&ek.exports&&(ek.exports=Lze)});var Fhe=bl((ZJ,GJ)=>{var Ksi=T(S());(function(e,t){typeof ZJ=="object"&&typeof GJ<"u"?GJ.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(ZJ,function(){"use strict";function e(_,C,V,L,Z){(function G(I,v,P,w,F){for(;w>P;){if(w-P>600){var b=w-P+1,R=v-P+1,E=Math.log(b),X=.5*Math.exp(2*E/3),A=.5*Math.sqrt(E*X*(b-X)/b)*(R-b/2<0?-1:1),N=Math.max(P,Math.floor(v-R*X/b+A)),O=Math.min(w,Math.floor(v+(b-R)*X/b+A));G(I,v,N,O,F)}var U=I[v],Y=P,k=w;for(t(I,P,v),F(I[w],U)>0&&t(I,P,w);Y<k;){for(t(I,Y,k),Y++,k--;F(I[Y],U)<0;)Y++;for(;F(I[k],U)>0;)k--}F(I[P],U)===0?t(I,P,k):t(I,++k,w),k<=v&&(P=k+1),v<=k&&(w=k-1)}})(_,C,V||0,L||_.length-1,Z||n)}function t(_,C,V){var L=_[C];_[C]=_[V],_[V]=L}function n(_,C){return _<C?-1:_>C?1:0}var i=function(_){_===void 0&&(_=9),this._maxEntries=Math.max(4,_),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(_,C,V){if(!V)return C.indexOf(_);for(var L=0;L<C.length;L++)if(V(_,C[L]))return L;return-1}function r(_,C){s(_,0,_.children.length,C,_)}function s(_,C,V,L,Z){Z||(Z=f(null)),Z.minX=1/0,Z.minY=1/0,Z.maxX=-1/0,Z.maxY=-1/0;for(var G=C;G<V;G++){var I=_.children[G];a(Z,_.leaf?L(I):I)}return Z}function a(_,C){return _.minX=Math.min(_.minX,C.minX),_.minY=Math.min(_.minY,C.minY),_.maxX=Math.max(_.maxX,C.maxX),_.maxY=Math.max(_.maxY,C.maxY),_}function c(_,C){return _.minX-C.minX}function d(_,C){return _.minY-C.minY}function u(_){return(_.maxX-_.minX)*(_.maxY-_.minY)}function m(_){return _.maxX-_.minX+(_.maxY-_.minY)}function p(_,C){return _.minX<=C.minX&&_.minY<=C.minY&&C.maxX<=_.maxX&&C.maxY<=_.maxY}function g(_,C){return C.minX<=_.maxX&&C.minY<=_.maxY&&C.maxX>=_.minX&&C.maxY>=_.minY}function f(_){return{children:_,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function x(_,C,V,L,Z){for(var G=[C,V];G.length;)if(!((V=G.pop())-(C=G.pop())<=L)){var I=C+Math.ceil((V-C)/L/2)*L;e(_,I,C,V,Z),G.push(C,I,I,V)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(_){var C=this.data,V=[];if(!g(_,C))return V;for(var L=this.toBBox,Z=[];C;){for(var G=0;G<C.children.length;G++){var I=C.children[G],v=C.leaf?L(I):I;g(_,v)&&(C.leaf?V.push(I):p(_,v)?this._all(I,V):Z.push(I))}C=Z.pop()}return V},i.prototype.collides=function(_){var C=this.data;if(!g(_,C))return!1;for(var V=[];C;){for(var L=0;L<C.children.length;L++){var Z=C.children[L],G=C.leaf?this.toBBox(Z):Z;if(g(_,G)){if(C.leaf||p(_,G))return!0;V.push(Z)}}C=V.pop()}return!1},i.prototype.load=function(_){if(!_||!_.length)return this;if(_.length<this._minEntries){for(var C=0;C<_.length;C++)this.insert(_[C]);return this}var V=this._build(_.slice(),0,_.length-1,0);if(this.data.children.length)if(this.data.height===V.height)this._splitRoot(this.data,V);else{if(this.data.height<V.height){var L=this.data;this.data=V,V=L}this._insert(V,this.data.height-V.height-1,!0)}else this.data=V;return this},i.prototype.insert=function(_){return _&&this._insert(_,this.data.height-1),this},i.prototype.clear=function(){return this.data=f([]),this},i.prototype.remove=function(_,C){if(!_)return this;for(var V,L,Z,G=this.data,I=this.toBBox(_),v=[],P=[];G||v.length;){if(G||(G=v.pop(),L=v[v.length-1],V=P.pop(),Z=!0),G.leaf){var w=o(_,G.children,C);if(w!==-1)return G.children.splice(w,1),v.push(G),this._condense(v),this}Z||G.leaf||!p(G,I)?L?(V++,G=L.children[V],Z=!1):G=null:(v.push(G),P.push(V),V=0,L=G,G=G.children[0])}return this},i.prototype.toBBox=function(_){return _},i.prototype.compareMinX=function(_,C){return _.minX-C.minX},i.prototype.compareMinY=function(_,C){return _.minY-C.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(_){return this.data=_,this},i.prototype._all=function(_,C){for(var V=[];_;)_.leaf?C.push.apply(C,_.children):V.push.apply(V,_.children),_=V.pop();return C},i.prototype._build=function(_,C,V,L){var Z,G=V-C+1,I=this._maxEntries;if(G<=I)return r(Z=f(_.slice(C,V+1)),this.toBBox),Z;L||(L=Math.ceil(Math.log(G)/Math.log(I)),I=Math.ceil(G/Math.pow(I,L-1))),(Z=f([])).leaf=!1,Z.height=L;var v=Math.ceil(G/I),P=v*Math.ceil(Math.sqrt(I));x(_,C,V,P,this.compareMinX);for(var w=C;w<=V;w+=P){var F=Math.min(w+P-1,V);x(_,w,F,v,this.compareMinY);for(var b=w;b<=F;b+=v){var R=Math.min(b+v-1,F);Z.children.push(this._build(_,b,R,L-1))}}return r(Z,this.toBBox),Z},i.prototype._chooseSubtree=function(_,C,V,L){for(;L.push(C),!C.leaf&&L.length-1!==V;){for(var Z=1/0,G=1/0,I=void 0,v=0;v<C.children.length;v++){var P=C.children[v],w=u(P),F=(b=_,R=P,(Math.max(R.maxX,b.maxX)-Math.min(R.minX,b.minX))*(Math.max(R.maxY,b.maxY)-Math.min(R.minY,b.minY))-w);F<G?(G=F,Z=w<Z?w:Z,I=P):F===G&&w<Z&&(Z=w,I=P)}C=I||C.children[0]}var b,R;return C},i.prototype._insert=function(_,C,V){var L=V?_:this.toBBox(_),Z=[],G=this._chooseSubtree(L,this.data,C,Z);for(G.children.push(_),a(G,L);C>=0&&Z[C].children.length>this._maxEntries;)this._split(Z,C),C--;this._adjustParentBBoxes(L,Z,C)},i.prototype._split=function(_,C){var V=_[C],L=V.children.length,Z=this._minEntries;this._chooseSplitAxis(V,Z,L);var G=this._chooseSplitIndex(V,Z,L),I=f(V.children.splice(G,V.children.length-G));I.height=V.height,I.leaf=V.leaf,r(V,this.toBBox),r(I,this.toBBox),C?_[C-1].children.push(I):this._splitRoot(V,I)},i.prototype._splitRoot=function(_,C){this.data=f([_,C]),this.data.height=_.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(_,C,V){for(var L,Z,G,I,v,P,w,F=1/0,b=1/0,R=C;R<=V-C;R++){var E=s(_,0,R,this.toBBox),X=s(_,R,V,this.toBBox),A=(Z=E,G=X,I=void 0,v=void 0,P=void 0,w=void 0,I=Math.max(Z.minX,G.minX),v=Math.max(Z.minY,G.minY),P=Math.min(Z.maxX,G.maxX),w=Math.min(Z.maxY,G.maxY),Math.max(0,P-I)*Math.max(0,w-v)),N=u(E)+u(X);A<F?(F=A,L=R,b=N<b?N:b):A===F&&N<b&&(b=N,L=R)}return L||V-C},i.prototype._chooseSplitAxis=function(_,C,V){var L=_.leaf?this.compareMinX:c,Z=_.leaf?this.compareMinY:d;this._allDistMargin(_,C,V,L)<this._allDistMargin(_,C,V,Z)&&_.children.sort(L)},i.prototype._allDistMargin=function(_,C,V,L){_.children.sort(L);for(var Z=this.toBBox,G=s(_,0,C,Z),I=s(_,V-C,V,Z),v=m(G)+m(I),P=C;P<V-C;P++){var w=_.children[P];a(G,_.leaf?Z(w):w),v+=m(G)}for(var F=V-C-1;F>=C;F--){var b=_.children[F];a(I,_.leaf?Z(b):b),v+=m(I)}return v},i.prototype._adjustParentBBoxes=function(_,C,V){for(var L=V;L>=0;L--)a(C[L],_)},i.prototype._condense=function(_){for(var C=_.length-1,V=void 0;C>=0;C--)_[C].children.length===0?C>0?(V=_[C-1].children).splice(V.indexOf(_[C]),1):this.clear():r(_[C],this.toBBox)},i})});var o7=bl((exports,module)=>{var a4i=T(S());/*!
  62. * protobuf.js v7.4.0 (c) 2016, daniel wirtz
  63. * compiled thu, 22 aug 2024 20:30:39 utc
  64. * licensed under the bsd-3-clause license
  65. * see: https://github.com/dcodeio/protobuf.js for details
  66. */(function(undefined){"use strict";(function(t,n,i){function o(s){var a=n[s];return a||t[s][0].call(a=n[s]={exports:{}},o,a,a.exports),a.exports}var r=o(i[0]);r.util.global.protobuf=r,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(r.util.Long=s,r.configure()),r}),typeof module=="object"&&module&&module.exports&&(module.exports=r)})({1:[function(e,t,n){"use strict";t.exports=i;function i(o,r){for(var s=new Array(arguments.length-1),a=0,c=2,d=!0;c<arguments.length;)s[a++]=arguments[c++];return new Promise(function(m,p){s[a]=function(f){if(d)if(d=!1,f)p(f);else{for(var x=new Array(arguments.length-1),_=0;_<x.length;)x[_++]=arguments[_];m.apply(null,x)}};try{o.apply(r||null,s)}catch(g){d&&(d=!1,p(g))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(d){var u=d.length;if(!u)return 0;for(var m=0;--u%4>1&&d.charAt(u)==="=";)++m;return Math.ceil(d.length*3)/4-m};for(var o=new Array(64),r=new Array(123),s=0;s<64;)r[o[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(d,u,m){for(var p=null,g=[],f=0,x=0,_;u<m;){var C=d[u++];switch(x){case 0:g[f++]=o[C>>2],_=(C&3)<<4,x=1;break;case 1:g[f++]=o[_|C>>4],_=(C&15)<<2,x=2;break;case 2:g[f++]=o[_|C>>6],g[f++]=o[C&63],x=0;break}f>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,g)),f=0)}return x&&(g[f++]=o[_],g[f++]=61,x===1&&(g[f++]=61)),p?(f&&p.push(String.fromCharCode.apply(String,g.slice(0,f))),p.join("")):String.fromCharCode.apply(String,g.slice(0,f))};var a="invalid encoding";i.decode=function(d,u,m){for(var p=m,g=0,f,x=0;x<d.length;){var _=d.charCodeAt(x++);if(_===61&&g>1)break;if((_=r[_])===undefined)throw Error(a);switch(g){case 0:f=_,g=1;break;case 1:u[m++]=f<<2|(_&48)>>4,f=_,g=2;break;case 2:u[m++]=(f&15)<<4|(_&60)>>2,f=_,g=3;break;case 3:u[m++]=(f&3)<<6|_,g=0;break}}if(g===1)throw Error(a);return m-p},i.test=function(d){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(d)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(r,s,a){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(r,s){if(r===undefined)this._listeners={};else if(s===undefined)this._listeners[r]=[];else for(var a=this._listeners[r],c=0;c<a.length;)a[c].fn===s?a.splice(c,1):++c;return this},i.prototype.emit=function(r){var s=this._listeners[r];if(s){for(var a=[],c=1;c<arguments.length;)a.push(arguments[c++]);for(c=0;c<s.length;)s[c].fn.apply(s[c++].ctx,a)}return this}},{}],4:[function(e,t,n){"use strict";t.exports=i(i);function i(c){return typeof Float32Array<"u"?function(){var d=new Float32Array([-0]),u=new Uint8Array(d.buffer),m=u[3]===128;function p(_,C,V){d[0]=_,C[V]=u[0],C[V+1]=u[1],C[V+2]=u[2],C[V+3]=u[3]}function g(_,C,V){d[0]=_,C[V]=u[3],C[V+1]=u[2],C[V+2]=u[1],C[V+3]=u[0]}c.writeFloatLE=m?p:g,c.writeFloatBE=m?g:p;function f(_,C){return u[0]=_[C],u[1]=_[C+1],u[2]=_[C+2],u[3]=_[C+3],d[0]}function x(_,C){return u[3]=_[C],u[2]=_[C+1],u[1]=_[C+2],u[0]=_[C+3],d[0]}c.readFloatLE=m?f:x,c.readFloatBE=m?x:f}():function(){function d(m,p,g,f){var x=p<0?1:0;if(x&&(p=-p),p===0)m(1/p>0?0:2147483648,g,f);else if(isNaN(p))m(2143289344,g,f);else if(p>34028234663852886e22)m((x<<31|2139095040)>>>0,g,f);else if(p<11754943508222875e-54)m((x<<31|Math.round(p/1401298464324817e-60))>>>0,g,f);else{var _=Math.floor(Math.log(p)/Math.LN2),C=Math.round(p*Math.pow(2,-_)*8388608)&8388607;m((x<<31|_+127<<23|C)>>>0,g,f)}}c.writeFloatLE=d.bind(null,o),c.writeFloatBE=d.bind(null,r);function u(m,p,g){var f=m(p,g),x=(f>>31)*2+1,_=f>>>23&255,C=f&8388607;return _===255?C?NaN:x*(1/0):_===0?x*1401298464324817e-60*C:x*Math.pow(2,_-150)*(C+8388608)}c.readFloatLE=u.bind(null,s),c.readFloatBE=u.bind(null,a)}(),typeof Float64Array<"u"?function(){var d=new Float64Array([-0]),u=new Uint8Array(d.buffer),m=u[7]===128;function p(_,C,V){d[0]=_,C[V]=u[0],C[V+1]=u[1],C[V+2]=u[2],C[V+3]=u[3],C[V+4]=u[4],C[V+5]=u[5],C[V+6]=u[6],C[V+7]=u[7]}function g(_,C,V){d[0]=_,C[V]=u[7],C[V+1]=u[6],C[V+2]=u[5],C[V+3]=u[4],C[V+4]=u[3],C[V+5]=u[2],C[V+6]=u[1],C[V+7]=u[0]}c.writeDoubleLE=m?p:g,c.writeDoubleBE=m?g:p;function f(_,C){return u[0]=_[C],u[1]=_[C+1],u[2]=_[C+2],u[3]=_[C+3],u[4]=_[C+4],u[5]=_[C+5],u[6]=_[C+6],u[7]=_[C+7],d[0]}function x(_,C){return u[7]=_[C],u[6]=_[C+1],u[5]=_[C+2],u[4]=_[C+3],u[3]=_[C+4],u[2]=_[C+5],u[1]=_[C+6],u[0]=_[C+7],d[0]}c.readDoubleLE=m?f:x,c.readDoubleBE=m?x:f}():function(){function d(m,p,g,f,x,_){var C=f<0?1:0;if(C&&(f=-f),f===0)m(0,x,_+p),m(1/f>0?0:2147483648,x,_+g);else if(isNaN(f))m(0,x,_+p),m(2146959360,x,_+g);else if(f>17976931348623157e292)m(0,x,_+p),m((C<<31|2146435072)>>>0,x,_+g);else{var V;if(f<22250738585072014e-324)V=f/5e-324,m(V>>>0,x,_+p),m((C<<31|V/4294967296)>>>0,x,_+g);else{var L=Math.floor(Math.log(f)/Math.LN2);L===1024&&(L=1023),V=f*Math.pow(2,-L),m(V*4503599627370496>>>0,x,_+p),m((C<<31|L+1023<<20|V*1048576&1048575)>>>0,x,_+g)}}}c.writeDoubleLE=d.bind(null,o,0,4),c.writeDoubleBE=d.bind(null,r,4,0);function u(m,p,g,f,x){var _=m(f,x+p),C=m(f,x+g),V=(C>>31)*2+1,L=C>>>20&2047,Z=4294967296*(C&1048575)+_;return L===2047?Z?NaN:V*(1/0):L===0?V*5e-324*Z:V*Math.pow(2,L-1075)*(Z+4503599627370496)}c.readDoubleLE=u.bind(null,s,0,4),c.readDoubleBE=u.bind(null,a,4,0)}(),c}function o(c,d,u){d[u]=c&255,d[u+1]=c>>>8&255,d[u+2]=c>>>16&255,d[u+3]=c>>>24}function r(c,d,u){d[u]=c>>>24,d[u+1]=c>>>16&255,d[u+2]=c>>>8&255,d[u+3]=c&255}function s(c,d){return(c[d]|c[d+1]<<8|c[d+2]<<16|c[d+3]<<24)>>>0}function a(c,d){return(c[d]<<24|c[d+1]<<16|c[d+2]<<8|c[d+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(o,r,s){var a=s||8192,c=a>>>1,d=null,u=a;return function(p){if(p<1||p>c)return o(p);u+p>a&&(d=o(a),u=0);var g=r.call(d,u,u+=p);return u&7&&(u=(u|7)+1),g}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var s=0,a=0,c=0;c<r.length;++c)a=r.charCodeAt(c),a<128?s+=1:a<2048?s+=2:(a&64512)===55296&&(r.charCodeAt(c+1)&64512)===56320?(++c,s+=4):s+=3;return s},i.read=function(r,s,a){var c=a-s;if(c<1)return"";for(var d=null,u=[],m=0,p;s<a;)p=r[s++],p<128?u[m++]=p:p>191&&p<224?u[m++]=(p&31)<<6|r[s++]&63:p>239&&p<365?(p=((p&7)<<18|(r[s++]&63)<<12|(r[s++]&63)<<6|r[s++]&63)-65536,u[m++]=55296+(p>>10),u[m++]=56320+(p&1023)):u[m++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&63,m>8191&&((d||(d=[])).push(String.fromCharCode.apply(String,u)),m=0);return d?(m&&d.push(String.fromCharCode.apply(String,u.slice(0,m))),d.join("")):String.fromCharCode.apply(String,u.slice(0,m))},i.write=function(r,s,a){for(var c=a,d,u,m=0;m<r.length;++m)d=r.charCodeAt(m),d<128?s[a++]=d:d<2048?(s[a++]=d>>6|192,s[a++]=d&63|128):(d&64512)===55296&&((u=r.charCodeAt(m+1))&64512)===56320?(d=65536+((d&1023)<<10)+(u&1023),++m,s[a++]=d>>18|240,s[a++]=d>>12&63|128,s[a++]=d>>6&63|128,s[a++]=d&63|128):(s[a++]=d>>12|224,s[a++]=d>>6&63|128,s[a++]=d&63|128);return a-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=o;function o(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}o()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(f,x){return RangeError("index out of range: "+f.pos+" + "+(x||1)+" > "+f.len)}function c(f){this.buf=f,this.pos=0,this.len=f.length}var d=typeof Uint8Array<"u"?function(x){if(x instanceof Uint8Array||Array.isArray(x))return new c(x);throw Error("illegal buffer")}:function(x){if(Array.isArray(x))return new c(x);throw Error("illegal buffer")},u=function(){return i.Buffer?function(_){return(c.create=function(V){return i.Buffer.isBuffer(V)?new o(V):d(V)})(_)}:d};c.create=u(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=function(){var x=4294967295;return function(){if(x=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(x=(x|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(x=(x|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return x;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return x}}(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var x=this.uint32();return x>>>1^-(x&1)|0};function m(){var f=new r(0,0),x=0;if(this.len-this.pos>4){for(;x<4;++x)if(f.lo=(f.lo|(this.buf[this.pos]&127)<<x*7)>>>0,this.buf[this.pos++]<128)return f;if(f.lo=(f.lo|(this.buf[this.pos]&127)<<28)>>>0,f.hi=(f.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return f;x=0}else{for(;x<3;++x){if(this.pos>=this.len)throw a(this);if(f.lo=(f.lo|(this.buf[this.pos]&127)<<x*7)>>>0,this.buf[this.pos++]<128)return f}return f.lo=(f.lo|(this.buf[this.pos++]&127)<<x*7)>>>0,f}if(this.len-this.pos>4){for(;x<5;++x)if(f.hi=(f.hi|(this.buf[this.pos]&127)<<x*7+3)>>>0,this.buf[this.pos++]<128)return f}else for(;x<5;++x){if(this.pos>=this.len)throw a(this);if(f.hi=(f.hi|(this.buf[this.pos]&127)<<x*7+3)>>>0,this.buf[this.pos++]<128)return f}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(f,x){return(f[x-4]|f[x-3]<<8|f[x-2]<<16|f[x-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function g(){if(this.pos+8>this.len)throw a(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var x=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,x},c.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var x=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,x},c.prototype.bytes=function(){var x=this.uint32(),_=this.pos,C=this.pos+x;if(C>this.len)throw a(this,x);if(this.pos+=x,Array.isArray(this.buf))return this.buf.slice(_,C);if(_===C){var V=i.Buffer;return V?V.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,_,C)},c.prototype.string=function(){var x=this.bytes();return s.read(x,0,x.length)},c.prototype.skip=function(x){if(typeof x=="number"){if(this.pos+x>this.len)throw a(this,x);this.pos+=x}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(f){switch(f){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(f=this.uint32()&7)!==4;)this.skipType(f);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+f+" at offset "+this.pos)}return this},c._configure=function(f){o=f,c.create=u(),o._configure();var x=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return m.call(this)[x](!1)},uint64:function(){return m.call(this)[x](!0)},sint64:function(){return m.call(this).zzDecode()[x](!1)},fixed64:function(){return g.call(this)[x](!0)},sfixed64:function(){return g.call(this)[x](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=r;var i=e(9);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(s){i.call(this,s)}r._configure=function(){o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice)},r.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},r._configure()},{15:15,9:9}],11:[function(e,t,n){"use strict";t.exports={}},{}],12:[function(e,t,n){"use strict";var i=n;i.Service=e(13)},{13:13}],13:[function(e,t,n){"use strict";t.exports=o;var i=e(15);(o.prototype=Object.create(i.EventEmitter.prototype)).constructor=o;function o(r,s,a){if(typeof r!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!s,this.responseDelimited=!!a}o.prototype.rpcCall=function r(s,a,c,d,u){if(!d)throw TypeError("request must be specified");var m=this;if(!u)return i.asPromise(r,m,s,a,c,d);if(!m.rpcImpl)return setTimeout(function(){u(Error("already ended"))},0),undefined;try{return m.rpcImpl(s,a[m.requestDelimited?"encodeDelimited":"encode"](d).finish(),function(g,f){if(g)return m.emit("error",g,s),u(g);if(f===null)return m.end(!0),undefined;if(!(f instanceof c))try{f=c[m.responseDelimited?"decodeDelimited":"decode"](f)}catch(x){return m.emit("error",x,s),u(x)}return m.emit("data",f,s),u(null,f)})}catch(p){return m.emit("error",p,s),setTimeout(function(){u(p)},0),undefined}},o.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(e,t,n){"use strict";t.exports=o;var i=e(15);function o(c,d){this.lo=c>>>0,this.hi=d>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(d){if(d===0)return r;var u=d<0;u&&(d=-d);var m=d>>>0,p=(d-m)/4294967296>>>0;return u&&(p=~p>>>0,m=~m>>>0,++m>4294967295&&(m=0,++p>4294967295&&(p=0))),new o(m,p)},o.from=function(d){if(typeof d=="number")return o.fromNumber(d);if(i.isString(d))if(i.Long)d=i.Long.fromString(d);else return o.fromNumber(parseInt(d,10));return d.low||d.high?new o(d.low>>>0,d.high>>>0):r},o.prototype.toNumber=function(d){if(!d&&this.hi>>>31){var u=~this.lo+1>>>0,m=~this.hi>>>0;return u||(m=m+1>>>0),-(u+m*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(d){return i.Long?new i.Long(this.lo|0,this.hi|0,!!d):{low:this.lo|0,high:this.hi|0,unsigned:!!d}};var a=String.prototype.charCodeAt;o.fromHash=function(d){return d===s?r:new o((a.call(d,0)|a.call(d,1)<<8|a.call(d,2)<<16|a.call(d,3)<<24)>>>0,(a.call(d,4)|a.call(d,5)<<8|a.call(d,6)<<16|a.call(d,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var d=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^d)>>>0,this.lo=(this.lo<<1^d)>>>0,this},o.prototype.zzDecode=function(){var d=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^d)>>>0,this.hi=(this.hi>>>1^d)>>>0,this},o.prototype.length=function(){var d=this.lo,u=(this.lo>>>28|this.hi<<4)>>>0,m=this.hi>>>24;return m===0?u===0?d<16384?d<128?1:2:d<2097152?3:4:u<16384?u<128?5:6:u<2097152?7:8:m<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,c){var d=a[c];return d!=null&&a.hasOwnProperty(c)?typeof d!="object"||(Array.isArray(d)?d.length:Object.keys(d).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,c){var d=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(d.lo,d.hi,c):d.toNumber(!!c)};function o(s,a,c){for(var d=Object.keys(a),u=0;u<d.length;++u)(s[d[u]]===undefined||!c)&&(s[d[u]]=a[d[u]]);return s}i.merge=o,i.lcFirst=function(a){return a.charAt(0).toLowerCase()+a.substring(1)};function r(s){function a(c,d){if(!(this instanceof a))return new a(c,d);Object.defineProperty(this,"message",{get:function(){return c}}),Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:new Error().stack||""}),d&&o(this,d)}return a.prototype=Object.create(Error.prototype,{constructor:{value:a,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return s},set:undefined,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),a}i.newError=r,i.ProtocolError=r("ProtocolError"),i.oneOfGetter=function(a){for(var c={},d=0;d<a.length;++d)c[a[d]]=1;return function(){for(var u=Object.keys(this),m=u.length-1;m>-1;--m)if(c[u[m]]===1&&this[u[m]]!==undefined&&this[u[m]]!==null)return u[m]}},i.oneOfSetter=function(a){return function(c){for(var d=0;d<a.length;++d)a[d]!==c&&delete this[a[d]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var s=i.Buffer;if(!s){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=s.from!==Uint8Array.from&&s.from||function(c,d){return new s(c,d)},i._Buffer_allocUnsafe=s.allocUnsafe||function(c){return new s(c)}}},{1:1,14:14,2:2,3:3,4:4,5:5,6:6,7:7}],16:[function(e,t,n){"use strict";t.exports=m;var i=e(15),o,r=i.LongBits,s=i.base64,a=i.utf8;function c(L,Z,G){this.fn=L,this.len=Z,this.next=undefined,this.val=G}function d(){}function u(L){this.head=L.head,this.tail=L.tail,this.len=L.len,this.next=L.states}function m(){this.len=0,this.head=new c(d,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(m.create=function(){return new o})()}:function(){return new m}};m.create=p(),m.alloc=function(Z){return new i.Array(Z)},i.Array!==Array&&(m.alloc=i.pool(m.alloc,i.Array.prototype.subarray)),m.prototype._push=function(Z,G,I){return this.tail=this.tail.next=new c(Z,G,I),this.len+=G,this};function g(L,Z,G){Z[G]=L&255}function f(L,Z,G){for(;L>127;)Z[G++]=L&127|128,L>>>=7;Z[G]=L}function x(L,Z){this.len=L,this.next=undefined,this.val=Z}x.prototype=Object.create(c.prototype),x.prototype.fn=f,m.prototype.uint32=function(Z){return this.len+=(this.tail=this.tail.next=new x((Z=Z>>>0)<128?1:Z<16384?2:Z<2097152?3:Z<268435456?4:5,Z)).len,this},m.prototype.int32=function(Z){return Z<0?this._push(_,10,r.fromNumber(Z)):this.uint32(Z)},m.prototype.sint32=function(Z){return this.uint32((Z<<1^Z>>31)>>>0)};function _(L,Z,G){for(;L.hi;)Z[G++]=L.lo&127|128,L.lo=(L.lo>>>7|L.hi<<25)>>>0,L.hi>>>=7;for(;L.lo>127;)Z[G++]=L.lo&127|128,L.lo=L.lo>>>7;Z[G++]=L.lo}m.prototype.uint64=function(Z){var G=r.from(Z);return this._push(_,G.length(),G)},m.prototype.int64=m.prototype.uint64,m.prototype.sint64=function(Z){var G=r.from(Z).zzEncode();return this._push(_,G.length(),G)},m.prototype.bool=function(Z){return this._push(g,1,Z?1:0)};function C(L,Z,G){Z[G]=L&255,Z[G+1]=L>>>8&255,Z[G+2]=L>>>16&255,Z[G+3]=L>>>24}m.prototype.fixed32=function(Z){return this._push(C,4,Z>>>0)},m.prototype.sfixed32=m.prototype.fixed32,m.prototype.fixed64=function(Z){var G=r.from(Z);return this._push(C,4,G.lo)._push(C,4,G.hi)},m.prototype.sfixed64=m.prototype.fixed64,m.prototype.float=function(Z){return this._push(i.float.writeFloatLE,4,Z)},m.prototype.double=function(Z){return this._push(i.float.writeDoubleLE,8,Z)};var V=i.Array.prototype.set?function(Z,G,I){G.set(Z,I)}:function(Z,G,I){for(var v=0;v<Z.length;++v)G[I+v]=Z[v]};m.prototype.bytes=function(Z){var G=Z.length>>>0;if(!G)return this._push(g,1,0);if(i.isString(Z)){var I=m.alloc(G=s.length(Z));s.decode(Z,I,0),Z=I}return this.uint32(G)._push(V,G,Z)},m.prototype.string=function(Z){var G=a.length(Z);return G?this.uint32(G)._push(a.write,G,Z):this._push(g,1,0)},m.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new c(d,0,0),this.len=0,this},m.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(d,0,0),this.len=0),this},m.prototype.ldelim=function(){var Z=this.head,G=this.tail,I=this.len;return this.reset().uint32(I),I&&(this.tail.next=Z.next,this.tail=G,this.len+=I),this},m.prototype.finish=function(){for(var Z=this.head.next,G=this.constructor.alloc(this.len),I=0;Z;)Z.fn(Z.val,G,I),I+=Z.len,Z=Z.next;return G},m._configure=function(L){o=L,m.create=p(),o._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=r;var i=e(16);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(){i.call(this)}r._configure=function(){r.alloc=o._Buffer_allocUnsafe,r.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&o.Buffer.prototype.set.name==="set"?function(c,d,u){d.set(c,u)}:function(c,d,u){if(c.copy)c.copy(d,u,0,c.length);else for(var m=0;m<c.length;)d[u++]=c[m++]}},r.prototype.bytes=function(c){o.isString(c)&&(c=o._Buffer_from(c,"base64"));var d=c.length>>>0;return this.uint32(d),d&&this._push(r.writeBytesBuffer,d,c),this};function s(a,c,d){a.length<40?o.utf8.write(a,c,d):c.utf8Write?c.utf8Write(a,d):c.write(a,d)}r.prototype.string=function(c){var d=o.Buffer.byteLength(c);return this.uint32(d),d&&this._push(s,d,c),this},r._configure()},{15:15,16:16}]},{},[8])})()});var XSe=bl((tto,s3)=>{var nto=T(S());/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var o={};o.defaultNoDataValue=-34027999387901484e22,o.decode=function(u,m){m=m||{};var p=m.encodedMaskData||m.encodedMaskData===null,g=c(u,m.inputOffset||0,p),f=m.noDataValue!==null?m.noDataValue:o.defaultNoDataValue,x=r(g,m.pixelType||Float32Array,m.encodedMaskData,f,m.returnMask),_={width:g.width,height:g.height,pixelData:x.resultPixels,minValue:x.minValue,maxValue:g.pixels.maxValue,noDataValue:f};return x.resultMask&&(_.maskData=x.resultMask),m.returnEncodedMask&&g.mask&&(_.encodedMaskData=g.mask.bitset?g.mask.bitset:null),m.returnFileInfo&&(_.fileInfo=s(g),m.computeUsedBitDepths&&(_.fileInfo.bitDepths=a(g))),_};var r=function(u,m,p,g,f){var x=0,_=u.pixels.numBlocksX,C=u.pixels.numBlocksY,V=Math.floor(u.width/_),L=Math.floor(u.height/C),Z=2*u.maxZError,G=Number.MAX_VALUE,I;p=p||(u.mask?u.mask.bitset:null);var v,P;v=new m(u.width*u.height),f&&p&&(P=new Uint8Array(u.width*u.height));for(var w=new Float32Array(V*L),F,b,R=0;R<=C;R++){var E=R!==C?L:u.height%C;if(E!==0)for(var X=0;X<=_;X++){var A=X!==_?V:u.width%_;if(A!==0){var N=R*u.width*L+X*V,O=u.width-A,U=u.pixels.blocks[x],Y,k,H;U.encoding<2?(U.encoding===0?Y=U.rawData:(d(U.stuffedData,U.bitsPerPixel,U.numValidPixels,U.offset,Z,w,u.pixels.maxValue),Y=w),k=0):U.encoding===2?H=0:H=U.offset;var J;if(p)for(b=0;b<E;b++){for(N&7&&(J=p[N>>3],J<<=N&7),F=0;F<A;F++)N&7||(J=p[N>>3]),J&128?(P&&(P[N]=1),I=U.encoding<2?Y[k++]:H,G=G>I?I:G,v[N++]=I):(P&&(P[N]=0),v[N++]=g),J<<=1;N+=O}else if(U.encoding<2)for(b=0;b<E;b++){for(F=0;F<A;F++)I=Y[k++],G=G>I?I:G,v[N++]=I;N+=O}else for(G=G>H?H:G,b=0;b<E;b++){for(F=0;F<A;F++)v[N++]=H;N+=O}if(U.encoding===1&&k!==U.numValidPixels)throw"Block and Mask do not match";x++}}}return{resultPixels:v,resultMask:P,minValue:G}},s=function(u){return{fileIdentifierString:u.fileIdentifierString,fileVersion:u.fileVersion,imageType:u.imageType,height:u.height,width:u.width,maxZError:u.maxZError,eofOffset:u.eofOffset,mask:u.mask?{numBlocksX:u.mask.numBlocksX,numBlocksY:u.mask.numBlocksY,numBytes:u.mask.numBytes,maxValue:u.mask.maxValue}:null,pixels:{numBlocksX:u.pixels.numBlocksX,numBlocksY:u.pixels.numBlocksY,numBytes:u.pixels.numBytes,maxValue:u.pixels.maxValue,noDataValue:u.noDataValue}}},a=function(u){for(var m=u.pixels.numBlocksX*u.pixels.numBlocksY,p={},g=0;g<m;g++){var f=u.pixels.blocks[g];f.encoding===0?p.float32=!0:f.encoding===1?p[f.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(u,m,p){var g={},f=new Uint8Array(u,m,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,f),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;m+=10;var x=new DataView(u,m,24);if(g.fileVersion=x.getInt32(0,!0),g.imageType=x.getInt32(4,!0),g.height=x.getUint32(8,!0),g.width=x.getUint32(12,!0),g.maxZError=x.getFloat64(16,!0),m+=24,!p)if(x=new DataView(u,m,16),g.mask={},g.mask.numBlocksY=x.getUint32(0,!0),g.mask.numBlocksX=x.getUint32(4,!0),g.mask.numBytes=x.getUint32(8,!0),g.mask.maxValue=x.getFloat32(12,!0),m+=16,g.mask.numBytes>0){var _=new Uint8Array(Math.ceil(g.width*g.height/8));x=new DataView(u,m,g.mask.numBytes);var C=x.getInt16(0,!0),V=2,L=0;do{if(C>0)for(;C--;)_[L++]=x.getUint8(V++);else{var Z=x.getUint8(V++);for(C=-C;C--;)_[L++]=Z}C=x.getInt16(V,!0),V+=2}while(V<g.mask.numBytes);if(C!==-32768||L<_.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=_,m+=g.mask.numBytes}else g.mask.numBytes|g.mask.numBlocksY|g.mask.maxValue||(g.mask.bitset=new Uint8Array(Math.ceil(g.width*g.height/8)));x=new DataView(u,m,16),g.pixels={},g.pixels.numBlocksY=x.getUint32(0,!0),g.pixels.numBlocksX=x.getUint32(4,!0),g.pixels.numBytes=x.getUint32(8,!0),g.pixels.maxValue=x.getFloat32(12,!0),m+=16;var G=g.pixels.numBlocksX,I=g.pixels.numBlocksY,v=G+(g.width%G>0?1:0),P=I+(g.height%I>0?1:0);g.pixels.blocks=new Array(v*P);for(var w=0,F=0;F<P;F++)for(var b=0;b<v;b++){var R=0,E=u.byteLength-m;x=new DataView(u,m,Math.min(10,E));var X={};g.pixels.blocks[w++]=X;var A=x.getUint8(0);if(R++,X.encoding=A&63,X.encoding>3)throw"Invalid block encoding ("+X.encoding+")";if(X.encoding===2){m++;continue}if(A!==0&&A!==2){if(A>>=6,X.offsetType=A,A===2)X.offset=x.getInt8(1),R++;else if(A===1)X.offset=x.getInt16(1,!0),R+=2;else if(A===0)X.offset=x.getFloat32(1,!0),R+=4;else throw"Invalid block offset type";if(X.encoding===1)if(A=x.getUint8(R),R++,X.bitsPerPixel=A&63,A>>=6,X.numValidPixelsType=A,A===2)X.numValidPixels=x.getUint8(R),R++;else if(A===1)X.numValidPixels=x.getUint16(R,!0),R+=2;else if(A===0)X.numValidPixels=x.getUint32(R,!0),R+=4;else throw"Invalid valid pixel count type"}if(m+=R,X.encoding!==3){var N,O;if(X.encoding===0){var U=(g.pixels.numBytes-1)/4;if(U!==Math.floor(U))throw"uncompressed block has invalid length";N=new ArrayBuffer(U*4),O=new Uint8Array(N),O.set(new Uint8Array(u,m,U*4));var Y=new Float32Array(N);X.rawData=Y,m+=U*4}else if(X.encoding===1){var k=Math.ceil(X.numValidPixels*X.bitsPerPixel/8),H=Math.ceil(k/4);N=new ArrayBuffer(H*4),O=new Uint8Array(N),O.set(new Uint8Array(u,m,k)),X.stuffedData=new Uint32Array(N),m+=k}}}return g.eofOffset=m,g},d=function(u,m,p,g,f,x,_){var C=(1<<m)-1,V=0,L,Z=0,G,I,v=Math.ceil((_-g)/f),P=u.length*4-Math.ceil(m*p/8);for(u[u.length-1]<<=8*P,L=0;L<p;L++){if(Z===0&&(I=u[V++],Z=32),Z>=m)G=I>>>Z-m&C,Z-=m;else{var w=m-Z;G=(I&C)<<w&C,I=u[V++],Z=32-w,G+=I>>>Z}x[L]=G<v?g+G*f:_}return x};return o}(),t=function(){"use strict";var o={unstuff:function(c,d,u,m,p,g,f,x){var _=(1<<u)-1,C=0,V,L=0,Z,G,I,v,P=c.length*4-Math.ceil(u*m/8);if(c[c.length-1]<<=8*P,p)for(V=0;V<m;V++)L===0&&(G=c[C++],L=32),L>=u?(Z=G>>>L-u&_,L-=u):(I=u-L,Z=(G&_)<<I&_,G=c[C++],L=32-I,Z+=G>>>L),d[V]=p[Z];else for(v=Math.ceil((x-g)/f),V=0;V<m;V++)L===0&&(G=c[C++],L=32),L>=u?(Z=G>>>L-u&_,L-=u):(I=u-L,Z=(G&_)<<I&_,G=c[C++],L=32-I,Z+=G>>>L),d[V]=Z<v?g+Z*f:x},unstuffLUT:function(c,d,u,m,p,g){var f=(1<<d)-1,x=0,_=0,C=0,V=0,L=0,Z,G=[],I=c.length*4-Math.ceil(d*u/8);c[c.length-1]<<=8*I;var v=Math.ceil((g-m)/p);for(_=0;_<u;_++)V===0&&(Z=c[x++],V=32),V>=d?(L=Z>>>V-d&f,V-=d):(C=d-V,L=(Z&f)<<C&f,Z=c[x++],V=32-C,L+=Z>>>V),G[_]=L<v?m+L*p:g;return G.unshift(m),G},unstuff2:function(c,d,u,m,p,g,f,x){var _=(1<<u)-1,C=0,V,L=0,Z=0,G,I,v;if(p)for(V=0;V<m;V++)L===0&&(I=c[C++],L=32,Z=0),L>=u?(G=I>>>Z&_,L-=u,Z+=u):(v=u-L,G=I>>>Z&_,I=c[C++],L=32-v,G|=(I&(1<<v)-1)<<u-v,Z=v),d[V]=p[G];else{var P=Math.ceil((x-g)/f);for(V=0;V<m;V++)L===0&&(I=c[C++],L=32,Z=0),L>=u?(G=I>>>Z&_,L-=u,Z+=u):(v=u-L,G=I>>>Z&_,I=c[C++],L=32-v,G|=(I&(1<<v)-1)<<u-v,Z=v),d[V]=G<P?g+G*f:x}return d},unstuffLUT2:function(c,d,u,m,p,g){var f=(1<<d)-1,x=0,_=0,C=0,V=0,L=0,Z=0,G,I=[],v=Math.ceil((g-m)/p);for(_=0;_<u;_++)V===0&&(G=c[x++],V=32,Z=0),V>=d?(L=G>>>Z&f,V-=d,Z+=d):(C=d-V,L=G>>>Z&f,G=c[x++],V=32-C,L|=(G&(1<<C)-1)<<d-C,Z=C),I[_]=L<v?m+L*p:g;return I.unshift(m),I},originalUnstuff:function(c,d,u,m){var p=(1<<u)-1,g=0,f,x=0,_,C,V,L=c.length*4-Math.ceil(u*m/8);for(c[c.length-1]<<=8*L,f=0;f<m;f++)x===0&&(C=c[g++],x=32),x>=u?(_=C>>>x-u&p,x-=u):(V=u-x,_=(C&p)<<V&p,C=c[g++],x=32-V,_+=C>>>x),d[f]=_;return d},originalUnstuff2:function(c,d,u,m){var p=(1<<u)-1,g=0,f,x=0,_=0,C,V,L;for(f=0;f<m;f++)x===0&&(V=c[g++],x=32,_=0),x>=u?(C=V>>>_&p,x-=u,_+=u):(L=u-x,C=V>>>_&p,V=c[g++],x=32-L,C|=(V&(1<<L)-1)<<u-L,_=L),d[f]=C;return d}},r={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var d=65535,u=65535,m=c.length,p=Math.floor(m/2),g=0;p;){var f=p>=359?359:p;p-=f;do d+=c[g++]<<8,u+=d+=c[g++];while(--f);d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16)}return m&1&&(u+=d+=c[g]<<8),d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16),(u<<16|d)>>>0},readHeaderInfo:function(c,d){var u=d.ptr,m=new Uint8Array(c,u,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,m),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;u+=6;var g=new DataView(c,u,8),f=g.getInt32(0,!0);p.fileVersion=f,u+=4,f>=3&&(p.checksum=g.getUint32(4,!0),u+=4),g=new DataView(c,u,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),u+=8,f>=4?(p.numDims=g.getUint32(8,!0),u+=4):p.numDims=1,g=new DataView(c,u,40),p.numValidPixel=g.getUint32(0,!0),p.microBlockSize=g.getInt32(4,!0),p.blobSize=g.getInt32(8,!0),p.imageType=g.getInt32(12,!0),p.maxZError=g.getFloat64(16,!0),p.zMin=g.getFloat64(24,!0),p.zMax=g.getFloat64(32,!0),u+=40,d.headerInfo=p,d.ptr=u;var x,_;if(f>=3&&(_=f>=4?52:48,x=this.computeChecksumFletcher32(new Uint8Array(c,u-_,p.blobSize-14)),x!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,d){var u=d.headerInfo,m=this.getDataTypeArray(u.imageType),p=u.numDims*this.getDataTypeSize(u.imageType),g=this.readSubArray(c,d.ptr,m,p),f=this.readSubArray(c,d.ptr+p,m,p);d.ptr+=2*p;var x,_=!0;for(x=0;x<u.numDims;x++)if(g[x]!==f[x]){_=!1;break}return u.minValues=g,u.maxValues=f,_},readSubArray:function(c,d,u,m){var p;if(u===Uint8Array)p=new Uint8Array(c,d,m);else{var g=new ArrayBuffer(m),f=new Uint8Array(g);f.set(new Uint8Array(c,d,m)),p=new u(g)}return p},readMask:function(c,d){var u=d.ptr,m=d.headerInfo,p=m.width*m.height,g=m.numValidPixel,f=new DataView(c,u,4),x={};if(x.numBytes=f.getUint32(0,!0),u+=4,(g===0||p===g)&&x.numBytes!==0)throw"invalid mask";var _,C;if(g===0)_=new Uint8Array(Math.ceil(p/8)),x.bitset=_,C=new Uint8Array(p),d.pixels.resultMask=C,u+=x.numBytes;else if(x.numBytes>0){_=new Uint8Array(Math.ceil(p/8)),f=new DataView(c,u,x.numBytes);var V=f.getInt16(0,!0),L=2,Z=0,G=0;do{if(V>0)for(;V--;)_[Z++]=f.getUint8(L++);else for(G=f.getUint8(L++),V=-V;V--;)_[Z++]=G;V=f.getInt16(L,!0),L+=2}while(L<x.numBytes);if(V!==-32768||Z<_.length)throw"Unexpected end of mask RLE encoding";C=new Uint8Array(p);var I=0,v=0;for(v=0;v<p;v++)v&7?(I=_[v>>3],I<<=v&7):I=_[v>>3],I&128&&(C[v]=1);d.pixels.resultMask=C,x.bitset=_,u+=x.numBytes}return d.ptr=u,d.mask=x,!0},readDataOneSweep:function(c,d,u){var m=d.ptr,p=d.headerInfo,g=p.numDims,f=p.width*p.height,x=p.imageType,_=p.numValidPixel*r.getDataTypeSize(x)*g,C,V=d.pixels.resultMask;if(u===Uint8Array)C=new Uint8Array(c,m,_);else{var L=new ArrayBuffer(_),Z=new Uint8Array(L);Z.set(new Uint8Array(c,m,_)),C=new u(L)}if(C.length===f*g)d.pixels.resultPixels=C;else{d.pixels.resultPixels=new u(f*g);var G=0,I=0,v=0,P=0;if(g>1)for(v=0;v<g;v++)for(P=v*f,I=0;I<f;I++)V[I]&&(d.pixels.resultPixels[P+I]=C[G++]);else for(I=0;I<f;I++)V[I]&&(d.pixels.resultPixels[I]=C[G++])}return m+=_,d.ptr=m,!0},readHuffmanTree:function(c,d){var u=this.HUFFMAN_LUT_BITS_MAX,m=new DataView(c,d.ptr,16);d.ptr+=16;var p=m.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var g=m.getInt32(4,!0),f=m.getInt32(8,!0),x=m.getInt32(12,!0);if(f>=x)return!1;var _=new Uint32Array(x-f);r.decodeBits(c,d,_);var C=[],V,L,Z,G;for(V=f;V<x;V++)L=V-(V<g?0:g),C[L]={first:_[V-f],second:null};var I=c.byteLength-d.ptr,v=Math.ceil(I/4),P=new ArrayBuffer(v*4),w=new Uint8Array(P);w.set(new Uint8Array(c,d.ptr,I));var F=new Uint32Array(P),b=0,R,E=0;for(R=F[0],V=f;V<x;V++)L=V-(V<g?0:g),G=C[L].first,G>0&&(C[L].second=R<<b>>>32-G,32-b>=G?(b+=G,b===32&&(b=0,E++,R=F[E])):(b+=G-32,E++,R=F[E],C[L].second|=R>>>32-b));var X=0,A=0,N=new s;for(V=0;V<C.length;V++)C[V]!==void 0&&(X=Math.max(X,C[V].first));X>=u?A=u:A=X,X>=30&&console.log("WARning, large NUM LUT BITS IS "+X);var O=[],U,Y,k,H,J,te;for(V=f;V<x;V++)if(L=V-(V<g?0:g),G=C[L].first,G>0)if(U=[G,L],G<=A)for(Y=C[L].second<<A-G,k=1<<A-G,Z=0;Z<k;Z++)O[Y|Z]=U;else for(Y=C[L].second,te=N,H=G-1;H>=0;H--)J=Y>>>H&1,J?(te.right||(te.right=new s),te=te.right):(te.left||(te.left=new s),te=te.left),H===0&&!te.val&&(te.val=U[1]);return{decodeLut:O,numBitsLUTQick:A,numBitsLUT:X,tree:N,stuffedData:F,srcPtr:E,bitPos:b}},readHuffman:function(c,d,u){var m=d.headerInfo,p=m.numDims,g=d.headerInfo.height,f=d.headerInfo.width,x=f*g,_=this.readHuffmanTree(c,d),C=_.decodeLut,V=_.tree,L=_.stuffedData,Z=_.srcPtr,G=_.bitPos,I=_.numBitsLUTQick,v=_.numBitsLUT,P=d.headerInfo.imageType===0?128:0,w,F,b,R=d.pixels.resultMask,E,X,A,N,O,U,Y,k=0;G>0&&(Z++,G=0);var H=L[Z],J=d.encodeMode===1,te=new u(x*p),z=te,q;for(q=0;q<m.numDims;q++){if(p>1&&(z=new u(te.buffer,x*q,x),k=0),d.headerInfo.numValidPixel===f*g)for(U=0,N=0;N<g;N++)for(O=0;O<f;O++,U++){if(F=0,E=H<<G>>>32-I,X=E,32-G<I&&(E|=L[Z+1]>>>64-G-I,X=E),C[X])F=C[X][1],G+=C[X][0];else for(E=H<<G>>>32-v,X=E,32-G<v&&(E|=L[Z+1]>>>64-G-v,X=E),w=V,Y=0;Y<v;Y++)if(A=E>>>v-Y-1&1,w=A?w.right:w.left,!(w.left||w.right)){F=w.val,G=G+Y+1;break}G>=32&&(G-=32,Z++,H=L[Z]),b=F-P,J?(O>0?b+=k:N>0?b+=z[U-f]:b+=k,b&=255,z[U]=b,k=b):z[U]=b}else for(U=0,N=0;N<g;N++)for(O=0;O<f;O++,U++)if(R[U]){if(F=0,E=H<<G>>>32-I,X=E,32-G<I&&(E|=L[Z+1]>>>64-G-I,X=E),C[X])F=C[X][1],G+=C[X][0];else for(E=H<<G>>>32-v,X=E,32-G<v&&(E|=L[Z+1]>>>64-G-v,X=E),w=V,Y=0;Y<v;Y++)if(A=E>>>v-Y-1&1,w=A?w.right:w.left,!(w.left||w.right)){F=w.val,G=G+Y+1;break}G>=32&&(G-=32,Z++,H=L[Z]),b=F-P,J?(O>0&&R[U-1]?b+=k:N>0&&R[U-f]?b+=z[U-f]:b+=k,b&=255,z[U]=b,k=b):z[U]=b}d.ptr=d.ptr+(Z+1)*4+(G>0?4:0)}d.pixels.resultPixels=te},decodeBits:function(c,d,u,m,p){{var g=d.headerInfo,f=g.fileVersion,x=0,_=new DataView(c,d.ptr,5),C=_.getUint8(0);x++;var V=C>>6,L=V===0?4:3-V,Z=(C&32)>0,G=C&31,I=0;if(L===1)I=_.getUint8(x),x++;else if(L===2)I=_.getUint16(x,!0),x+=2;else if(L===4)I=_.getUint32(x,!0),x+=4;else throw"Invalid valid pixel count type";var v=2*g.maxZError,P,w,F,b,R,E,X,A,N,O,U=g.numDims>1?g.maxValues[p]:g.zMax;if(Z){for(d.counter.lut++,A=_.getUint8(x),N=G,x++,b=Math.ceil((A-1)*G/8),R=Math.ceil(b/4),w=new ArrayBuffer(R*4),F=new Uint8Array(w),d.ptr+=x,F.set(new Uint8Array(c,d.ptr,b)),X=new Uint32Array(w),d.ptr+=b,O=0;A-1>>>O;)O++;b=Math.ceil(I*O/8),R=Math.ceil(b/4),w=new ArrayBuffer(R*4),F=new Uint8Array(w),F.set(new Uint8Array(c,d.ptr,b)),P=new Uint32Array(w),d.ptr+=b,f>=3?E=o.unstuffLUT2(X,G,A-1,m,v,U):E=o.unstuffLUT(X,G,A-1,m,v,U),f>=3?o.unstuff2(P,u,O,I,E):o.unstuff(P,u,O,I,E)}else d.counter.bitstuffer++,O=G,d.ptr+=x,O>0&&(b=Math.ceil(I*O/8),R=Math.ceil(b/4),w=new ArrayBuffer(R*4),F=new Uint8Array(w),F.set(new Uint8Array(c,d.ptr,b)),P=new Uint32Array(w),d.ptr+=b,f>=3?m==null?o.originalUnstuff2(P,u,O,I):o.unstuff2(P,u,O,I,!1,m,v,U):m==null?o.originalUnstuff(P,u,O,I):o.unstuff(P,u,O,I,!1,m,v,U))}},readTiles:function(c,d,u){var m=d.headerInfo,p=m.width,g=m.height,f=m.microBlockSize,x=m.imageType,_=r.getDataTypeSize(x),C=Math.ceil(p/f),V=Math.ceil(g/f);d.pixels.numBlocksY=V,d.pixels.numBlocksX=C,d.pixels.ptr=0;var L=0,Z=0,G=0,I=0,v=0,P=0,w=0,F=0,b=0,R=0,E=0,X=0,A=0,N=0,O=0,U=0,Y,k,H,J,te,z,q=new u(f*f),ee=g%f||f,fe=p%f||f,_e,le,ye=m.numDims,Te,Xe=d.pixels.resultMask,Le=d.pixels.resultPixels;for(G=0;G<V;G++)for(v=G!==V-1?f:ee,I=0;I<C;I++)for(P=I!==C-1?f:fe,E=G*p*f+I*f,X=p-P,Te=0;Te<ye;Te++){if(ye>1&&(Le=new u(d.pixels.resultPixels.buffer,p*g*Te*_,p*g)),w=c.byteLength-d.ptr,Y=new DataView(c,d.ptr,Math.min(10,w)),k={},U=0,F=Y.getUint8(0),U++,b=F>>6&255,R=F>>2&15,R!==(I*f>>3&15))throw"integrity issue";if(z=F&3,z>3)throw d.ptr+=U,"Invalid block encoding ("+z+")";if(z===2){d.counter.constant++,d.ptr+=U;continue}else if(z===0){if(d.counter.uncompressed++,d.ptr+=U,A=v*P*_,N=c.byteLength-d.ptr,A=A<N?A:N,H=new ArrayBuffer(A%_===0?A:A+_-A%_),J=new Uint8Array(H),J.set(new Uint8Array(c,d.ptr,A)),te=new u(H),O=0,Xe)for(L=0;L<v;L++){for(Z=0;Z<P;Z++)Xe[E]&&(Le[E]=te[O++]),E++;E+=X}else for(L=0;L<v;L++){for(Z=0;Z<P;Z++)Le[E++]=te[O++];E+=X}d.ptr+=O*_}else if(_e=r.getDataTypeUsed(x,b),le=r.getOnePixel(k,U,_e,Y),U+=r.getDataTypeSize(_e),z===3)if(d.ptr+=U,d.counter.constantoffset++,Xe)for(L=0;L<v;L++){for(Z=0;Z<P;Z++)Xe[E]&&(Le[E]=le),E++;E+=X}else for(L=0;L<v;L++){for(Z=0;Z<P;Z++)Le[E++]=le;E+=X}else if(d.ptr+=U,r.decodeBits(c,d,q,le,Te),U=0,Xe)for(L=0;L<v;L++){for(Z=0;Z<P;Z++)Xe[E]&&(Le[E]=q[U++]),E++;E+=X}else for(L=0;L<v;L++){for(Z=0;Z<P;Z++)Le[E++]=q[U++];E+=X}}},formatFileInfo:function(c){return{fileIdentifierString:c.headerInfo.fileIdentifierString,fileVersion:c.headerInfo.fileVersion,imageType:c.headerInfo.imageType,height:c.headerInfo.height,width:c.headerInfo.width,numValidPixel:c.headerInfo.numValidPixel,microBlockSize:c.headerInfo.microBlockSize,blobSize:c.headerInfo.blobSize,maxZError:c.headerInfo.maxZError,pixelType:r.getPixelType(c.headerInfo.imageType),eofOffset:c.eofOffset,mask:c.mask?{numBytes:c.mask.numBytes}:null,pixels:{numBlocksX:c.pixels.numBlocksX,numBlocksY:c.pixels.numBlocksY,maxValue:c.headerInfo.zMax,minValue:c.headerInfo.zMin,noDataValue:c.noDataValue}}},constructConstantSurface:function(c){var d=c.headerInfo.zMax,u=c.headerInfo.numDims,m=c.headerInfo.height*c.headerInfo.width,p=m*u,g=0,f=0,x=0,_=c.pixels.resultMask;if(_)if(u>1)for(g=0;g<u;g++)for(x=g*m,f=0;f<m;f++)_[f]&&(c.pixels.resultPixels[x+f]=d);else for(f=0;f<m;f++)_[f]&&(c.pixels.resultPixels[f]=d);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(d);else for(f=0;f<p;f++)c.pixels.resultPixels[f]=d},getDataTypeArray:function(c){var d;switch(c){case 0:d=Int8Array;break;case 1:d=Uint8Array;break;case 2:d=Int16Array;break;case 3:d=Uint16Array;break;case 4:d=Int32Array;break;case 5:d=Uint32Array;break;case 6:d=Float32Array;break;case 7:d=Float64Array;break;default:d=Float32Array}return d},getPixelType:function(c){var d;switch(c){case 0:d="S8";break;case 1:d="U8";break;case 2:d="S16";break;case 3:d="U16";break;case 4:d="S32";break;case 5:d="U32";break;case 6:d="F32";break;case 7:d="F64";break;default:d="F32"}return d},isValidPixelValue:function(c,d){if(d==null)return!1;var u;switch(c){case 0:u=d>=-128&&d<=127;break;case 1:u=d>=0&&d<=255;break;case 2:u=d>=-32768&&d<=32767;break;case 3:u=d>=0&&d<=65536;break;case 4:u=d>=-2147483648&&d<=2147483647;break;case 5:u=d>=0&&d<=4294967296;break;case 6:u=d>=-34027999387901484e22&&d<=34027999387901484e22;break;case 7:u=d>=5e-324&&d<=17976931348623157e292;break;default:u=!1}return u},getDataTypeSize:function(c){var d=0;switch(c){case 0:case 1:d=1;break;case 2:case 3:d=2;break;case 4:case 5:case 6:d=4;break;case 7:d=8;break;default:d=c}return d},getDataTypeUsed:function(c,d){var u=c;switch(c){case 2:case 4:u=c-d;break;case 3:case 5:u=c-2*d;break;case 6:d===0?u=c:d===1?u=2:u=1;break;case 7:d===0?u=c:u=c-2*d+1;break;default:u=c;break}return u},getOnePixel:function(c,d,u,m){var p=0;switch(u){case 0:p=m.getInt8(d);break;case 1:p=m.getUint8(d);break;case 2:p=m.getInt16(d,!0);break;case 3:p=m.getUint16(d,!0);break;case 4:p=m.getInt32(d,!0);break;case 5:p=m.getUInt32(d,!0);break;case 6:p=m.getFloat32(d,!0);break;case 7:p=m.getFloat64(d,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,d,u){this.val=c,this.left=d,this.right=u},a={decode:function(c,d){d=d||{};var u=d.noDataValue,m=0,p={};if(p.ptr=d.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var g=p.headerInfo,f=g.fileVersion,x=r.getDataTypeArray(g.imageType);r.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=d.maskData);var _=g.width*g.height;if(p.pixels.resultPixels=new x(_*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)r.constructConstantSurface(p);else if(f>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var C=new DataView(c,p.ptr,2),V=C.getUint8(0);if(p.ptr++,V)r.readDataOneSweep(c,p,x);else if(f>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var L=C.getUint8(1);if(p.ptr++,p.encodeMode=L,L>2||f<4&&L>1)throw"Invalid Huffman flag "+L;L?r.readHuffman(c,p,x):r.readTiles(c,p,x)}else r.readTiles(c,p,x)}p.eofOffset=p.ptr;var Z;d.inputOffset?(Z=p.headerInfo.blobSize+d.inputOffset-p.ptr,Math.abs(Z)>=1&&(p.eofOffset=d.inputOffset+p.headerInfo.blobSize)):(Z=p.headerInfo.blobSize-p.ptr,Math.abs(Z)>=1&&(p.eofOffset=p.headerInfo.blobSize));var G={width:g.width,height:g.height,pixelData:p.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(g.imageType,u)){var I=p.pixels.resultMask;for(m=0;m<_;m++)I[m]||(G.pixelData[m]=u);G.noDataValue=u}return p.noDataValue=u,d.returnFileInfo&&(G.fileInfo=r.formatFileInfo(p)),G}},getBandCount:function(c){var d=0,u=0,m={};for(m.ptr=0,m.pixels={};u<c.byteLength-58;)r.readHeaderInfo(c,m),u+=m.headerInfo.blobSize,d++,m.ptr=u;return d}};return a}(),n=function(){var o=new ArrayBuffer(4),r=new Uint8Array(o),s=new Uint32Array(o);return s[0]=1,r[0]===1}(),i={decode:function(o,r){if(!n)throw"Big endian system is not supported.";r=r||{};var s=r.inputOffset||0,a=new Uint8Array(o,s,10),c=String.fromCharCode.apply(null,a),d,u;if(c.trim()==="CntZImage")d=e,u=1;else if(c.substring(0,5)==="Lerc2")d=t,u=2;else throw"Unexpected file identifier string: "+c;for(var m=0,p=o.byteLength-10,g,f=[],x,_,C={width:0,height:0,pixels:[],pixelType:r.pixelType,mask:null,statistics:[]};s<p;){var V=d.decode(o,{inputOffset:s,encodedMaskData:g,maskData:_,returnMask:m===0,returnEncodedMask:m===0,returnFileInfo:!0,pixelType:r.pixelType||null,noDataValue:r.noDataValue||null});s=V.fileInfo.eofOffset,m===0&&(g=V.encodedMaskData,_=V.maskData,C.width=V.width,C.height=V.height,C.dimCount=V.dimCount||1,C.pixelType=V.pixelType||V.fileInfo.pixelType,C.mask=V.maskData),u>1&&V.fileInfo.mask&&V.fileInfo.mask.numBytes>0&&f.push(V.maskData),m++,C.pixels.push(V.pixelData),C.statistics.push({minValue:V.minValue,maxValue:V.maxValue,noDataValue:V.noDataValue,dimStats:V.dimStats})}var L,Z,G;if(u>1&&f.length>1){for(G=C.width*C.height,C.bandMasks=f,_=new Uint8Array(G),_.set(f[0]),L=1;L<f.length;L++)for(x=f[L],Z=0;Z<G;Z++)_[Z]=_[Z]&x[Z];C.maskData=_}return C}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof s3<"u"&&s3.exports?s3.exports=i:this.Lerc=i})()});var _Ce=bl((SGo,xCe)=>{var CGo=T(S());xCe.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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EhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkK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3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var SCe=bl((VGo,TCe)=>{var LGo=T(S()),{webm:t1t,mp4:n1t}=_Ce(),B6=()=>typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,O6=()=>"wakeLock"in navigator,Y6=class{constructor(){if(this.enabled=!1,O6()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else B6()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",t1t),this._addSourceToVideo(this.noSleepVideo,"mp4",n1t),this.noSleepVideo.addEventListener("loadedmetadata",()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())})}))}_addSourceToVideo(t,n,i){var o=document.createElement("source");o.src=i,o.type=`video/${n}`,t.appendChild(o)}get isEnabled(){return this.enabled}enable(){return O6()?navigator.wakeLock.request("screen").then(t=>{this._wakeLock=t,this.enabled=!0,console.log("Wake Lock active."),this._wakeLock.addEventListener("release",()=>{console.log("Wake Lock released.")})}).catch(t=>{throw this.enabled=!1,console.error(`${t.name}, ${t.message}`),t}):B6()?(this.disable(),console.warn(`
  67. NoSleep enabled for older iOS devices. This can interrupt
  68. active or long-running network requests from completing successfully.
  69. See https://github.com/richtr/NoSleep.js/issues/15 for more details.
  70. `),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(n=>(this.enabled=!0,n)).catch(n=>{throw this.enabled=!1,n})}disable(){O6()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):B6()?this.noSleepTimer&&(console.warn(`
  71. NoSleep now disabled for older iOS devices.
  72. `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};TCe.exports=Y6});var L1t={};OCe(L1t,{AlphaMode:()=>af,AlphaPipelineStage:()=>dW,AnchorPointDirect:()=>fX,AnchorPointIndirect:()=>pX,Animation:()=>QM,AnimationViewModel:()=>jM,Appearance:()=>eo,ApproximateTerrainHeights:()=>li,ArcGISTiledElevationTerrainProvider:()=>D8,ArcGisBaseMapType:()=>Ch,ArcGisMapServerImageryProvider:()=>$b,ArcGisMapService:()=>Od,ArcType:()=>nn,ArticulationStageType:()=>dc,AssociativeArray:()=>Zt,Atmosphere:()=>u_,AtmospherePipelineStage:()=>OX,AttributeCompression:()=>wn,AttributeType:()=>sn,AutoExposure:()=>jF,AutomaticUniforms:()=>dp,Axis:()=>Xo,AxisAlignedBoundingBox:()=>M0,B3dmLoader:()=>GX,B3dmParser:()=>LX,BaseLayerPicker:()=>$M,BaseLayerPickerViewModel:()=>qM,BatchTable:()=>_x,BatchTableHierarchy:()=>Bx,BatchTexture:()=>Bc,BatchTexturePipelineStage:()=>uW,Billboard:()=>so,BillboardCollection:()=>Sd,BillboardGraphics:()=>tc,BillboardVisualizer:()=>sE,BingMapsGeocoderService:()=>O8,BingMapsImageryProvider:()=>gw,BingMapsStyle:()=>IV,BlendEquation:()=>Ga,BlendFunction:()=>Co,BlendOption:()=>Lo,BlendingState:()=>un,BoundingRectangle:()=>Ke,BoundingSphere:()=>ce,BoundingSphereState:()=>ft,BoundingVolumeSemantics:()=>s_,BoxEmitter:()=>W7,BoxGeometry:()=>Ra,BoxGeometryUpdater:()=>gI,BoxGraphics:()=>Gx,BoxOutlineGeometry:()=>Lm,BrdfLutGenerator:()=>Qw,Buffer:()=>xt,BufferLoader:()=>Jx,BufferUsage:()=>Me,CPUStylingPipelineStage:()=>pW,CallbackPositionProperty:()=>yI,CallbackProperty:()=>Xm,Camera:()=>io,CameraEventAggregator:()=>oA,CameraEventType:()=>Pi,CameraFlightPath:()=>qw,Cartesian2:()=>D,Cartesian3:()=>h,Cartesian4:()=>se,Cartographic:()=>he,CartographicGeocoderService:()=>H8,CatmullRomSpline:()=>z8,Cesium3DContentGroup:()=>Dx,Cesium3DTile:()=>ku,Cesium3DTileBatchTable:()=>Ap,Cesium3DTileColorBlendMode:()=>Gl,Cesium3DTileContent:()=>P7,Cesium3DTileContentFactory:()=>L_,Cesium3DTileContentState:()=>Do,Cesium3DTileContentType:()=>Vs,Cesium3DTileFeature:()=>Ns,Cesium3DTileFeatureTable:()=>Om,Cesium3DTileOptimizationHint:()=>vu,Cesium3DTileOptimizations:()=>q2,Cesium3DTilePass:()=>wo,Cesium3DTilePassState:()=>rm,Cesium3DTilePointFeature:()=>ub,Cesium3DTileRefine:()=>No,Cesium3DTileStyle:()=>dS,Cesium3DTileStyleEngine:()=>oP,Cesium3DTilesInspector:()=>r9,Cesium3DTilesInspectorViewModel:()=>o9,Cesium3DTilesVoxelProvider:()=>v7,Cesium3DTileset:()=>ua,Cesium3DTilesetBaseTraversal:()=>dP,Cesium3DTilesetCache:()=>tP,Cesium3DTilesetGraphics:()=>wx,Cesium3DTilesetHeatmap:()=>nP,Cesium3DTilesetMetadata:()=>w_,Cesium3DTilesetMostDetailedTraversal:()=>aP,Cesium3DTilesetSkipTraversal:()=>hP,Cesium3DTilesetStatistics:()=>Lb,Cesium3DTilesetTraversal:()=>Ys,Cesium3DTilesetVisualizer:()=>fP,CesiumInspector:()=>c9,CesiumInspectorViewModel:()=>a9,CesiumTerrainProvider:()=>oS,CesiumWidget:()=>nM,Check:()=>go,CheckerboardMaterialProperty:()=>b1,CircleEmitter:()=>SM,CircleGeometry:()=>$8,CircleOutlineGeometry:()=>e7,ClassificationModelDrawCommand:()=>a2,ClassificationPipelineStage:()=>mW,ClassificationPrimitive:()=>nC,ClassificationType:()=>kn,ClearCommand:()=>ei,ClippingPlane:()=>a_,ClippingPlaneCollection:()=>hs,ClippingPolygon:()=>XC,ClippingPolygonCollection:()=>km,Clock:()=>oh,ClockRange:()=>Br,ClockStep:()=>mo,ClockViewModel:()=>HM,CloudCollection:()=>k7,CloudType:()=>RL,Color:()=>B,ColorBlendMode:()=>lc,ColorGeometryInstanceAttribute:()=>Kt,ColorMaterialProperty:()=>Yt,Command:()=>E6,ComponentDatatype:()=>Q,Composite3DTileContent:()=>SI,CompositeEntityCollection:()=>LK,CompositeMaterialProperty:()=>y1,CompositePositionProperty:()=>ma,CompositeProperty:()=>pc,CompressedTextureBuffer:()=>aR,ComputeCommand:()=>Xc,ComputeEngine:()=>sR,ConditionsExpression:()=>yM,ConeEmitter:()=>D7,ConstantPositionProperty:()=>Nc,ConstantProperty:()=>Jn,ConstantSpline:()=>WX,ContentMetadata:()=>B2,Context:()=>$G,ContextLimits:()=>Bt,CoplanarPolygonGeometry:()=>qP,CoplanarPolygonGeometryLibrary:()=>xb,CoplanarPolygonOutlineGeometry:()=>Nu,CornerType:()=>Ei,CorrelationGroup:()=>bX,CorridorGeometry:()=>U_,CorridorGeometryLibrary:()=>ki,CorridorGeometryUpdater:()=>CP,CorridorGraphics:()=>Ix,CorridorOutlineGeometry:()=>SP,Credit:()=>Et,CreditDisplay:()=>nF,CubeMap:()=>yr,CubeMapFace:()=>gR,CubicRealPolynomial:()=>sx,CullFace:()=>yi,CullingVolume:()=>ms,CumulusCloud:()=>nu,CustomDataSource:()=>EP,CustomHeightmapTerrainProvider:()=>t7,CustomShader:()=>QT,CustomShaderMode:()=>cb,CustomShaderPipelineStage:()=>SW,CustomShaderTranslucencyMode:()=>Tg,CylinderGeometry:()=>IP,CylinderGeometryLibrary:()=>D_,CylinderGeometryUpdater:()=>WP,CylinderGraphics:()=>Xx,CylinderOutlineGeometry:()=>XP,CzmlDataSource:()=>DP,DataSource:()=>Dr,DataSourceClock:()=>rh,DataSourceCollection:()=>BP,DataSourceDisplay:()=>Zv,DebugAppearance:()=>B7,DebugCameraPrimitive:()=>Of,DebugInspector:()=>mA,DebugModelMatrixPrimitive:()=>VM,DefaultProxy:()=>n7,DepthFunction:()=>nc,DepthPlane:()=>dF,DequantizationPipelineStage:()=>VW,DerivedCommand:()=>Yf,DeveloperError:()=>pe,DeviceOrientationCameraController:()=>uF,DirectionalLight:()=>O7,DiscardEmptyTileImagePolicy:()=>XV,DiscardMissingTileImagePolicy:()=>pw,DistanceDisplayCondition:()=>At,DistanceDisplayConditionGeometryInstanceAttribute:()=>Nn,DoubleEndedPriorityQueue:()=>KT,DoublyLinkedList:()=>eP,DracoLoader:()=>Op,DrawCommand:()=>tt,DynamicAtmosphereLightingType:()=>Jp,DynamicEnvironmentMapManager:()=>jp,DynamicGeometryBatch:()=>Q_,DynamicGeometryUpdater:()=>ni,EarthOrientationParameters:()=>jL,EarthOrientationParametersSample:()=>C0,EasingFunction:()=>Yr,EllipseGeometry:()=>$c,EllipseGeometryLibrary:()=>Ul,EllipseGeometryUpdater:()=>YP,EllipseGraphics:()=>Wx,EllipseOutlineGeometry:()=>Pd,Ellipsoid:()=>ne,EllipsoidGeodesic:()=>Rp,EllipsoidGeometry:()=>zs,EllipsoidGeometryUpdater:()=>zP,EllipsoidGraphics:()=>Px,EllipsoidOutlineGeometry:()=>Vd,EllipsoidPrimitive:()=>Ow,EllipsoidRhumbLine:()=>Ea,EllipsoidSurfaceAppearance:()=>Y7,EllipsoidTangentPlane:()=>Kr,EllipsoidTerrainProvider:()=>kf,EllipsoidalOccluder:()=>Xb,Empty3DTileContent:()=>i1,EncodedCartesian3:()=>On,Entity:()=>jo,EntityCluster:()=>Zd,EntityCollection:()=>Hs,EntityView:()=>Ev,Event:()=>be,EventHelper:()=>lr,Expression:()=>Tu,ExpressionNodeType:()=>gt,ExtrapolationType:()=>Ed,FeatureDetection:()=>zt,FeatureIdPipelineStage:()=>_g,Fog:()=>mF,ForEach:()=>Pe,FrameRateMonitor:()=>ZM,FrameState:()=>hF,Framebuffer:()=>Wr,FramebufferManager:()=>fi,FrustumCommands:()=>yF,FrustumGeometry:()=>ZT,FrustumOutlineGeometry:()=>rF,Fullscreen:()=>pr,FullscreenButton:()=>d9,FullscreenButtonViewModel:()=>l9,GeoJsonDataSource:()=>Wv,GeoJsonLoader:()=>EX,GeocodeType:()=>Py,Geocoder:()=>m9,GeocoderService:()=>TL,GeocoderViewModel:()=>u9,GeographicProjection:()=>Ri,GeographicTilingScheme:()=>Yi,Geometry:()=>ht,Geometry3DTileContent:()=>VI,GeometryAttribute:()=>Ze,GeometryAttributes:()=>mn,GeometryFactory:()=>i7,GeometryInstance:()=>Gt,GeometryInstanceAttribute:()=>ic,GeometryOffsetAttribute:()=>cn,GeometryPipeline:()=>Fn,GeometryPipelineStage:()=>GW,GeometryType:()=>du,GeometryUpdater:()=>ii,GeometryUpdaterSet:()=>aT,GeometryVisualizer:()=>pv,GetFeatureInfoFormat:()=>CT,Globe:()=>kw,GlobeDepth:()=>xF,GlobeSurfaceShaderSet:()=>fw,GlobeSurfaceTile:()=>nm,GlobeSurfaceTileProvider:()=>Iw,GlobeTranslucency:()=>Xw,GlobeTranslucencyFramebuffer:()=>_F,GlobeTranslucencyState:()=>fF,GltfBufferViewLoader:()=>pC,GltfDracoLoader:()=>bC,GltfGpmLoader:()=>yX,GltfGpmLocal:()=>PC,GltfImageLoader:()=>gC,GltfIndexBufferLoader:()=>yC,GltfJsonLoader:()=>_C,GltfLoader:()=>eb,GltfLoaderUtil:()=>Wl,GltfMeshPrimitiveGpmLoader:()=>SX,GltfStructuralMetadataLoader:()=>mX,GltfTextureLoader:()=>TC,GltfVertexBufferLoader:()=>SC,GoogleEarthEnterpriseImageryProvider:()=>z7,GoogleEarthEnterpriseMapsProvider:()=>_w,GoogleEarthEnterpriseMetadata:()=>g0,GoogleEarthEnterpriseTerrainData:()=>SL,GoogleEarthEnterpriseTerrainProvider:()=>u7,GoogleEarthEnterpriseTileInformation:()=>dM,GoogleMaps:()=>sS,GpxDataSource:()=>Fv,GregorianDate:()=>mp,GridImageryProvider:()=>K7,GridMaterialProperty:()=>G1,GroundGeometryUpdater:()=>Yn,GroundPolylineGeometry:()=>Vx,GroundPolylinePrimitive:()=>Rm,GroundPrimitive:()=>Ac,GroupMetadata:()=>h1,HeadingPitchRange:()=>Qu,HeadingPitchRoll:()=>Ca,Heap:()=>zL,HeightReference:()=>Qe,HeightmapEncoding:()=>$u,HeightmapTerrainData:()=>Ma,HeightmapTessellator:()=>LV,HermitePolynomialApproximation:()=>PP,HermiteSpline:()=>gg,HilbertOrder:()=>uC,HomeButton:()=>f9,HomeButtonViewModel:()=>h9,HorizontalOrigin:()=>gi,I3SBuildingSceneLayerExplorer:()=>M6,I3SBuildingSceneLayerExplorerViewModel:()=>p9,I3SDataProvider:()=>Fh,I3SDecoder:()=>GM,I3SFeature:()=>EM,I3SField:()=>IM,I3SGeometry:()=>ZL,I3SLayer:()=>pS,I3SNode:()=>GL,I3SStatistics:()=>PM,I3SSublayer:()=>wM,I3SSymbology:()=>WM,I3dmLoader:()=>XX,I3dmParser:()=>IX,Iau2000Orientation:()=>Dw,Iau2006XysData:()=>qL,Iau2006XysSample:()=>nx,IauOrientationAxes:()=>Bw,IauOrientationParameters:()=>Uw,ImageBasedLighting:()=>Ux,ImageBasedLightingPipelineStage:()=>HX,ImageMaterialProperty:()=>D0,Imagery:()=>AV,ImageryLayer:()=>ka,ImageryLayerCollection:()=>Ww,ImageryLayerFeatureInfo:()=>Sh,ImageryProvider:()=>ol,ImageryState:()=>ai,Implicit3DTileContent:()=>LC,ImplicitAvailabilityBitstream:()=>hC,ImplicitMetadataView:()=>fC,ImplicitSubdivisionScheme:()=>jr,ImplicitSubtree:()=>o_,ImplicitSubtreeCache:()=>_M,ImplicitSubtreeMetadata:()=>LI,ImplicitTileCoordinates:()=>M_,ImplicitTileset:()=>A_,IndexDatatype:()=>Ae,InfoBox:()=>g9,InfoBoxViewModel:()=>b9,InspectorShared:()=>Ba,InstanceAttributeSemantic:()=>$r,InstancingPipelineStage:()=>sW,InterpolationAlgorithm:()=>m7,InterpolationType:()=>Dm,Intersect:()=>Jt,IntersectionTests:()=>qn,Intersections2D:()=>p0,Interval:()=>La,InvertClassification:()=>QV,Ion:()=>Pm,IonGeocoderService:()=>hM,IonImageryProvider:()=>e0,IonResource:()=>fd,IonWorldImageryStyle:()=>t0,Iso8601:()=>Be,JobScheduler:()=>pF,JobType:()=>Wa,JsonMetadataTable:()=>qp,JulianDate:()=>j,KTX2Transcoder:()=>cR,KeyboardEventModifier:()=>ea,KeyframeNode:()=>ji,KmlCamera:()=>Av,KmlDataSource:()=>lw,KmlLookAt:()=>nw,KmlTour:()=>iw,KmlTourFlyTo:()=>rw,KmlTourWait:()=>sw,Label:()=>Zg,LabelCollection:()=>ff,LabelGraphics:()=>Gm,LabelStyle:()=>Uo,LabelVisualizer:()=>bv,LagrangePolynomialApproximation:()=>vP,LeapSecond:()=>Bi,Light:()=>q7,LightingModel:()=>df,LightingPipelineStage:()=>IW,LinearApproximation:()=>O_,LinearSpline:()=>bg,ManagedArray:()=>Dc,MapMode2D:()=>Ql,MapProjection:()=>p7,MapboxImageryProvider:()=>Tw,MapboxStyleImageryProvider:()=>$7,Material:()=>Oi,MaterialAppearance:()=>oo,MaterialPipelineStage:()=>WW,MaterialProperty:()=>Qo,Math:()=>W,Matrix2:()=>wi,Matrix3:()=>$,Matrix4:()=>M,Megatexture:()=>iL,MeshPrimitiveGpmLocal:()=>TX,MetadataClass:()=>Am,MetadataClassProperty:()=>j0,MetadataComponentType:()=>Ht,MetadataEntity:()=>Mn,MetadataEnum:()=>YI,MetadataEnumValue:()=>OI,MetadataPicking:()=>bF,MetadataPickingPipelineStage:()=>_d,MetadataPipelineStage:()=>Lu,MetadataSchema:()=>yd,MetadataSchemaLoader:()=>CC,MetadataSemantic:()=>r_,MetadataTable:()=>Il,MetadataTableProperty:()=>ZI,MetadataType:()=>Rt,MipmapHint:()=>Qh,Model:()=>zm,Model3DTileContent:()=>uf,ModelAlphaOptions:()=>QW,ModelAnimation:()=>FX,ModelAnimationChannel:()=>wX,ModelAnimationCollection:()=>AX,ModelAnimationLoop:()=>vl,ModelAnimationState:()=>Ym,ModelArticulation:()=>KX,ModelArticulationStage:()=>zX,ModelClippingPlanesPipelineStage:()=>jX,ModelClippingPolygonsPipelineStage:()=>eW,ModelColorPipelineStage:()=>xg,ModelComponents:()=>Tn,ModelDrawCommand:()=>c2,ModelDrawCommands:()=>u2,ModelFeature:()=>MX,ModelFeatureTable:()=>kX,ModelGraphics:()=>Xp,ModelLightingOptions:()=>o2,ModelMatrixUpdateStage:()=>aW,ModelNode:()=>tW,ModelRenderResources:()=>jW,ModelRuntimeNode:()=>lW,ModelRuntimePrimitive:()=>KW,ModelSceneGraph:()=>m2,ModelSilhouettePipelineStage:()=>e2,ModelSkin:()=>JW,ModelSplitterPipelineStage:()=>n2,ModelStatistics:()=>h2,ModelType:()=>ar,ModelUtility:()=>qt,ModelVisualizer:()=>gv,Moon:()=>Hw,MorphTargetsPipelineStage:()=>vW,MorphWeightSpline:()=>b7,MortonOrder:()=>Pg,Multiple3DTileContent:()=>H2,MultisampleFramebuffer:()=>eE,NavigationHelpButton:()=>x9,NavigationHelpButtonViewModel:()=>y9,NearFarScalar:()=>Ut,NeverTileDiscardPolicy:()=>t6,NodeRenderResources:()=>i2,NodeStatisticsPipelineStage:()=>cW,NodeTransformationProperty:()=>vx,OIT:()=>SF,Occluder:()=>zw,OffsetGeometryInstanceAttribute:()=>Qi,OpenCageGeocoderService:()=>y7,OpenStreetMapImageryProvider:()=>x0,OrderedGroundPrimitiveCollection:()=>OP,OrientedBoundingBox:()=>En,OrthographicFrustum:()=>an,OrthographicOffCenterFrustum:()=>Pr,Packable:()=>x7,PackableForInterpolation:()=>_7,Particle:()=>XL,ParticleBurst:()=>i6,ParticleEmitter:()=>o6,ParticleSystem:()=>r6,Pass:()=>Ge,PassState:()=>ec,PathGraphics:()=>Wp,PathVisualizer:()=>xv,PeliasGeocoderService:()=>mM,PerInstanceColorAppearance:()=>dn,PerformanceDisplay:()=>r0,PerformanceWatchdog:()=>T9,PerformanceWatchdogViewModel:()=>_9,PerspectiveFrustum:()=>Li,PerspectiveOffCenterFrustum:()=>sl,PickDepth:()=>gF,PickDepthFramebuffer:()=>VF,PickFramebuffer:()=>RF,PickedMetadataInfo:()=>MA,Picking:()=>XF,PickingPipelineStage:()=>wW,PinBuilder:()=>Yb,PixelDatatype:()=>qe,PixelFormat:()=>ot,Plane:()=>ln,PlaneGeometry:()=>KP,PlaneGeometryUpdater:()=>QP,PlaneGraphics:()=>dI,PlaneOutlineGeometry:()=>JP,PntsLoader:()=>p2,PntsParser:()=>x_,PointCloud:()=>eM,PointCloudEyeDomeLighting:()=>tb,PointCloudShading:()=>lf,PointCloudStylingPipelineStage:()=>AW,PointGraphics:()=>Fx,PointPrimitive:()=>Rs,PointPrimitiveCollection:()=>C1,PointVisualizer:()=>Tv,PolygonGeometry:()=>Kp,PolygonGeometryLibrary:()=>Dn,PolygonGeometryUpdater:()=>ev,PolygonGraphics:()=>Em,PolygonHierarchy:()=>Ia,PolygonOutlineGeometry:()=>$P,PolygonPipeline:()=>si,Polyline:()=>Xu,PolylineArrowMaterialProperty:()=>I1,PolylineCollection:()=>Jm,PolylineColorAppearance:()=>Jr,PolylineDashMaterialProperty:()=>W1,PolylineGeometry:()=>Ob,PolylineGeometryUpdater:()=>Vv,PolylineGlowMaterialProperty:()=>v1,PolylineGraphics:()=>oc,PolylineMaterialAppearance:()=>sa,PolylineOutlineMaterialProperty:()=>Ug,PolylinePipeline:()=>Gi,PolylineVisualizer:()=>Rv,PolylineVolumeGeometry:()=>iv,PolylineVolumeGeometryLibrary:()=>eh,PolylineVolumeGeometryUpdater:()=>av,PolylineVolumeGraphics:()=>Ax,PolylineVolumeOutlineGeometry:()=>sv,PositionProperty:()=>Zm,PositionPropertyArray:()=>wb,PostProcessStage:()=>lo,PostProcessStageCollection:()=>eA,PostProcessStageComposite:()=>cl,PostProcessStageLibrary:()=>Kd,PostProcessStageSampleMode:()=>zd,PostProcessStageTextureCache:()=>NT,PpeMetadata:()=>_X,PpeSource:()=>L6,PpeTexture:()=>xX,Primitive:()=>In,PrimitiveCollection:()=>kl,PrimitiveLoadPlan:()=>f_,PrimitiveOutlineGenerator:()=>h_,PrimitiveOutlinePipelineStage:()=>kW,PrimitivePipeline:()=>Tx,PrimitiveRenderResources:()=>r2,PrimitiveState:()=>Tr,PrimitiveStatisticsPipelineStage:()=>UW,PrimitiveType:()=>Fe,ProjectionPicker:()=>C9,ProjectionPickerViewModel:()=>S9,Property:()=>K,PropertyArray:()=>F1,PropertyAttribute:()=>m_,PropertyAttributeProperty:()=>cX,PropertyBag:()=>Rl,PropertyTable:()=>Yc,PropertyTexture:()=>$p,PropertyTextureProperty:()=>aX,ProviderViewModel:()=>rs,Proxy:()=>T7,QuadraticRealPolynomial:()=>Wc,QuadtreeOccluders:()=>Pw,QuadtreePrimitive:()=>Nw,QuadtreeTile:()=>vw,QuadtreeTileLoadState:()=>js,QuadtreeTileProvider:()=>s6,QuantizedMeshTerrainData:()=>iS,QuarticRealPolynomial:()=>uR,Quaternion:()=>we,QuaternionSpline:()=>vX,Queue:()=>lg,Ray:()=>pn,Rectangle:()=>ae,RectangleCollisionChecker:()=>lT,RectangleGeometry:()=>tT,RectangleGeometryLibrary:()=>Ls,RectangleGeometryUpdater:()=>cv,RectangleGraphics:()=>Im,RectangleOutlineGeometry:()=>G_,ReferenceFrame:()=>Ai,ReferenceProperty:()=>Fb,RenderState:()=>Ue,Renderbuffer:()=>cd,RenderbufferFormat:()=>vc,Request:()=>Ho,RequestErrorEvent:()=>Dh,RequestScheduler:()=>ja,RequestState:()=>jn,RequestType:()=>cs,Resource:()=>Ee,ResourceCache:()=>Ci,ResourceCacheKey:()=>Pl,ResourceCacheStatistics:()=>KI,ResourceLoader:()=>Hi,ResourceLoaderState:()=>yt,Rotation:()=>Ou,RuntimeError:()=>de,S2Cell:()=>kp,SDFSettings:()=>Bs,SampledPositionProperty:()=>fa,SampledProperty:()=>Xd,Sampler:()=>en,ScaledPositionProperty:()=>Lf,Scene:()=>NA,SceneFramebuffer:()=>WT,SceneMode:()=>oe,SceneMode2DPipelineStage:()=>DW,SceneModePicker:()=>L9,SceneModePickerViewModel:()=>V9,SceneTransforms:()=>Mi,SceneTransitioner:()=>iA,ScreenSpaceCameraController:()=>aA,ScreenSpaceEventHandler:()=>Qd,ScreenSpaceEventType:()=>Sn,SelectedFeatureIdPipelineStage:()=>Sg,SelectionIndicator:()=>G9,SelectionIndicatorViewModel:()=>Z9,SensorVolumePortionToDisplay:()=>k1,ShaderBuilder:()=>px,ShaderCache:()=>KG,ShaderDestination:()=>ge,ShaderFunction:()=>iE,ShaderProgram:()=>tn,ShaderSource:()=>De,ShaderStruct:()=>nE,ShadowMap:()=>c0,ShadowMapShader:()=>Kf,ShadowMode:()=>_n,ShadowVolumeAppearance:()=>ud,ShowGeometryInstanceAttribute:()=>xn,Simon1994PlanetaryPositions:()=>v0,SimplePolylineGeometry:()=>S7,SingleTileImageryProvider:()=>Sw,SkinningPipelineStage:()=>OW,SkyAtmosphere:()=>DA,SkyBox:()=>YA,SpatialNode:()=>PA,Spdcf:()=>gX,SpecularEnvironmentCubeMap:()=>Wm,SphereEmitter:()=>c6,SphereGeometry:()=>C7,SphereOutlineGeometry:()=>Tb,Spherical:()=>wP,Spline:()=>to,SplitDirection:()=>vr,Splitter:()=>uL,StaticGeometryColorBatch:()=>zu,StaticGeometryPerMaterialBatch:()=>Ku,StaticGroundGeometryColorBatch:()=>oV,StaticGroundGeometryPerMaterialBatch:()=>fv,StaticGroundPolylinePerMaterialBatch:()=>Lv,StaticOutlineGeometryBatch:()=>aV,StencilConstants:()=>Ot,StencilFunction:()=>Un,StencilOperation:()=>bt,SteppedSpline:()=>PX,Stereographic:()=>cc,StorageType:()=>mg,StripeMaterialProperty:()=>M1,StripeOrientation:()=>ah,StructuralMetadata:()=>Us,StyleCommandsNeeded:()=>Hm,StyleExpression:()=>l6,Sun:()=>jA,SunLight:()=>Tp,SunPostProcess:()=>dA,SupportedImageFormats:()=>hX,SvgPathBindingHandler:()=>OM,TaskProcessor:()=>bi,Terrain:()=>MM,TerrainData:()=>Th,TerrainEncoding:()=>_c,TerrainFillMesh:()=>UV,TerrainMesh:()=>tm,TerrainOffsetProperty:()=>Mx,TerrainProvider:()=>ts,TerrainQuantization:()=>Qs,TerrainState:()=>co,Texture:()=>Pt,TextureAtlas:()=>Rg,TextureCache:()=>JG,TextureMagnificationFilter:()=>hi,TextureManager:()=>wA,TextureMinificationFilter:()=>$t,TextureUniform:()=>C6,TextureWrap:()=>Cn,TileAvailability:()=>Xh,TileBoundingRegion:()=>Mu,TileBoundingS2Cell:()=>Q2,TileBoundingSphere:()=>Sb,TileBoundingVolume:()=>d6,TileCoordinatesImageryProvider:()=>kM,TileDiscardPolicy:()=>m6,TileEdge:()=>gn,TileImagery:()=>MV,TileMapServiceImageryProvider:()=>gy,TileMetadata:()=>O2,TileOrientedBoundingBox:()=>Ld,TileProviderError:()=>Zo,TileReplacementQueue:()=>ww,TileSelectionResult:()=>Kn,TileState:()=>h6,Tileset3DTileContent:()=>y2,TilesetMetadata:()=>j2,TilesetPipelineStage:()=>UX,TilingScheme:()=>V7,TimeConstants:()=>zn,TimeDynamicImagery:()=>VT,TimeDynamicPointCloud:()=>hL,TimeInterval:()=>Vn,TimeIntervalCollection:()=>Ur,TimeIntervalCollectionPositionProperty:()=>Ab,TimeIntervalCollectionProperty:()=>Mb,TimeStandard:()=>Hn,Timeline:()=>X9,TimelineHighlightRange:()=>E9,TimelineTrack:()=>I9,Tipsify:()=>mR,ToggleButtonViewModel:()=>Ny,Tonemapper:()=>d0,Transforms:()=>Ft,TranslationRotationScale:()=>B0,TranslucentTileClassification:()=>GF,TridiagonalSystemSolver:()=>kC,TrustedServers:()=>AS,TweenCollection:()=>BT,UniformState:()=>qG,UniformType:()=>rL,UrlTemplateImageryProvider:()=>Na,VERSION:()=>V1t,VRButton:()=>P9,VRButtonViewModel:()=>W9,VRTheWorldTerrainProvider:()=>L7,VaryingType:()=>V6,Vector3DTileBatch:()=>nf,Vector3DTileClampedPolylines:()=>k2,Vector3DTileContent:()=>D2,Vector3DTileGeometry:()=>Np,Vector3DTilePoints:()=>P2,Vector3DTilePolygons:()=>v2,Vector3DTilePolylines:()=>V_,Vector3DTilePrimitive:()=>Hx,VelocityOrientationProperty:()=>AP,VelocityVectorProperty:()=>K_,VertexArray:()=>ti,VertexArrayFacade:()=>Sp,VertexAttributeSemantic:()=>Vt,VertexFormat:()=>We,VerticalExaggeration:()=>_r,VerticalExaggerationPipelineStage:()=>HW,VerticalOrigin:()=>Pn,VideoSynchronizer:()=>R7,View:()=>wT,Viewer:()=>z6,ViewportQuad:()=>f6,Visibility:()=>mr,Visualizer:()=>R4,VoxelBoxShape:()=>qf,VoxelCell:()=>hA,VoxelContent:()=>TM,VoxelCylinderShape:()=>$f,VoxelEllipsoidShape:()=>zT,VoxelInspector:()=>w9,VoxelInspectorViewModel:()=>v9,VoxelPrimitive:()=>Gy,VoxelProvider:()=>b6,VoxelRenderResources:()=>GA,VoxelShape:()=>g6,VoxelShapeType:()=>vi,VoxelTraversal:()=>oL,VulkanConstants:()=>Z7,WallGeometry:()=>dv,WallGeometryLibrary:()=>nT,WallGeometryUpdater:()=>hv,WallGraphics:()=>Pp,WallOutlineGeometry:()=>mv,WebGLConstants:()=>ie,WebMapServiceImageryProvider:()=>Vw,WebMapTileServiceImageryProvider:()=>Rw,WebMercatorProjection:()=>Zi,WebMercatorTilingScheme:()=>ns,WindingOrder:()=>ds,WireframeIndexGenerator:()=>KC,WireframePipelineStage:()=>zW,_shadersAcesTonemappingStage:()=>WF,_shadersAdditiveBlend:()=>cA,_shadersAdjustTranslucentFS:()=>jV,_shadersAllMaterialAppearanceFS:()=>lE,_shadersAllMaterialAppearanceVS:()=>dE,_shadersAmbientOcclusionGenerate:()=>PF,_shadersAmbientOcclusionModulate:()=>vF,_shadersAspectRampMaterial:()=>pE,_shadersAtmosphereCommon:()=>Um,_shadersAtmosphereStageFS:()=>DX,_shadersAtmosphereStageVS:()=>BX,_shadersBasicMaterialAppearanceFS:()=>uE,_shadersBasicMaterialAppearanceVS:()=>mE,_shadersBillboardCollectionFS:()=>x2,_shadersBillboardCollectionVS:()=>_2,_shadersBlackAndWhite:()=>wF,_shadersBloomComposite:()=>FF,_shadersBrdfLutGeneratorFS:()=>Kw,_shadersBrightPass:()=>lA,_shadersBrightness:()=>AF,_shadersBumpMapMaterial:()=>bE,_shadersCPUStylingStageFS:()=>fW,_shadersCPUStylingStageVS:()=>hW,_shadersCheckerboardMaterial:()=>gE,_shadersCloudCollectionFS:()=>iM,_shadersCloudCollectionVS:()=>oM,_shadersCloudNoiseFS:()=>rM,_shadersCloudNoiseVS:()=>sM,_shadersCompareAndPackTranslucentDepth:()=>ZF,_shadersCompositeOITFS:()=>TF,_shadersCompositeTranslucentClassification:()=>vT,_shadersComputeIrradianceFS:()=>eX,_shadersComputeRadianceMapFS:()=>tX,_shadersContrastBias:()=>MF,_shadersConvolveSpecularMapFS:()=>nX,_shadersConvolveSpecularMapVS:()=>iX,_shadersCustomShaderStageFS:()=>gW,_shadersCustomShaderStageVS:()=>bW,_shadersCzmBuiltins:()=>mx,_shadersDepthOfField:()=>NF,_shadersDepthPlaneFS:()=>sF,_shadersDepthPlaneVS:()=>aF,_shadersDepthView:()=>kF,_shadersDepthViewPacked:()=>S6,_shadersDotMaterial:()=>yE,_shadersEdgeDetection:()=>UF,_shadersElevationBandMaterial:()=>xE,_shadersElevationContourMaterial:()=>_E,_shadersElevationRampMaterial:()=>TE,_shadersEllipsoidFS:()=>BV,_shadersEllipsoidSurfaceAppearanceFS:()=>LM,_shadersEllipsoidSurfaceAppearanceVS:()=>RM,_shadersEllipsoidVS:()=>OV,_shadersFXAA:()=>OF,_shadersFXAA3_11:()=>QF,_shadersFadeMaterial:()=>SE,_shadersFeatureIdStageFS:()=>yW,_shadersFeatureIdStageVS:()=>xW,_shadersFilmicTonemapping:()=>DF,_shadersGaussianBlur1D:()=>Ly,_shadersGeometryStageFS:()=>LW,_shadersGeometryStageVS:()=>RW,_shadersGlobeFS:()=>mw,_shadersGlobeVS:()=>hw,_shadersGridMaterial:()=>CE,_shadersGroundAtmosphere:()=>ZV,_shadersHSBToRGB:()=>uZ,_shadersHSLToRGB:()=>mZ,_shadersImageBasedLightingStageFS:()=>YX,_shadersInstancingStageCommon:()=>nW,_shadersInstancingStageVS:()=>iW,_shadersIntersectBox:()=>_A,_shadersIntersectClippingPlanes:()=>xA,_shadersIntersectCylinder:()=>TA,_shadersIntersectDepth:()=>yA,_shadersIntersectEllipsoid:()=>SA,_shadersIntersectLongitude:()=>nL,_shadersIntersection:()=>HT,_shadersIntersectionUtils:()=>gA,_shadersLegacyInstancingStageVS:()=>oW,_shadersLensFlare:()=>YF,_shadersLightingStageFS:()=>EW,_shadersMaterialStageFS:()=>XW,_shadersMegatexture:()=>ZA,_shadersMetadataStageFS:()=>_W,_shadersMetadataStageVS:()=>TW,_shadersModelClippingPlanesStageFS:()=>QX,_shadersModelClippingPolygonsStageFS:()=>$X,_shadersModelClippingPolygonsStageVS:()=>qX,_shadersModelColorStageFS:()=>JX,_shadersModelFS:()=>d2,_shadersModelSilhouetteStageFS:()=>qW,_shadersModelSilhouetteStageVS:()=>$W,_shadersModelSplitterStageFS:()=>t2,_shadersModelVS:()=>l2,_shadersModifiedReinhardTonemapping:()=>HF,_shadersMorphTargetsStageVS:()=>PW,_shadersNightVision:()=>zF,_shadersNormalMapMaterial:()=>VE,_shadersOctree:()=>RA,_shadersPassThrough:()=>jl,_shadersPassThroughDepth:()=>Sy,_shadersPbrNeutralTonemapping:()=>BF,_shadersPerInstanceColorAppearanceFS:()=>wE,_shadersPerInstanceColorAppearanceVS:()=>FE,_shadersPerInstanceFlatColorAppearanceFS:()=>xx,_shadersPerInstanceFlatColorAppearanceVS:()=>AE,_shadersPointCloudEyeDomeLighting:()=>CX,_shadersPointCloudStylingStageVS:()=>FW,_shadersPointPrimitiveCollectionFS:()=>kg,_shadersPointPrimitiveCollectionVS:()=>VP,_shadersPolygonSignedDistanceFS:()=>qI,_shadersPolylineArrowMaterial:()=>LE,_shadersPolylineColorAppearanceVS:()=>jE,_shadersPolylineCommon:()=>md,_shadersPolylineDashMaterial:()=>RE,_shadersPolylineFS:()=>Rx,_shadersPolylineGlowMaterial:()=>ZE,_shadersPolylineMaterialAppearanceVS:()=>qE,_shadersPolylineOutlineMaterial:()=>GE,_shadersPolylineShadowVolumeFS:()=>zE,_shadersPolylineShadowVolumeMorphFS:()=>KE,_shadersPolylineShadowVolumeMorphVS:()=>JE,_shadersPolylineShadowVolumeVS:()=>QE,_shadersPolylineVS:()=>Z2,_shadersPrimitiveOutlineStageFS:()=>NW,_shadersPrimitiveOutlineStageVS:()=>MW,_shadersRGBToHSB:()=>hZ,_shadersRGBToHSL:()=>fZ,_shadersRGBToXYZ:()=>pZ,_shadersReinhardTonemapping:()=>KF,_shadersReprojectWebMercatorFS:()=>Zw,_shadersReprojectWebMercatorVS:()=>Gw,_shadersRimLightingMaterial:()=>EE,_shadersSelectedFeatureIdStageCommon:()=>zC,_shadersShadowVolumeAppearanceFS:()=>eC,_shadersShadowVolumeAppearanceVS:()=>kE,_shadersShadowVolumeFS:()=>N0,_shadersSilhouette:()=>JF,_shadersSkinningStageVS:()=>BW,_shadersSkyAtmosphereCommon:()=>aL,_shadersSkyAtmosphereFS:()=>kA,_shadersSkyAtmosphereVS:()=>UA,_shadersSkyBoxFS:()=>BA,_shadersSkyBoxVS:()=>OA,_shadersSlopeRampMaterial:()=>IE,_shadersStripeMaterial:()=>XE,_shadersSunFS:()=>HA,_shadersSunTextureFS:()=>zA,_shadersSunVS:()=>KA,_shadersTexturedMaterialAppearanceFS:()=>hE,_shadersTexturedMaterialAppearanceVS:()=>fE,_shadersVector3DTileClampedPolylinesFS:()=>M2,_shadersVector3DTileClampedPolylinesVS:()=>A2,_shadersVector3DTilePolylinesVS:()=>w2,_shadersVectorTileVS:()=>dC,_shadersVerticalExaggerationStageVS:()=>YW,_shadersViewportQuadFS:()=>aM,_shadersViewportQuadVS:()=>ix,_shadersVoxelFS:()=>pA,_shadersVoxelUtils:()=>fA,_shadersVoxelVS:()=>bA,_shadersWater:()=>PE,_shadersWaterMaskMaterial:()=>WE,_shadersXYZToRGB:()=>bZ,_shadersacesTonemapping:()=>gZ,_shadersalphaWeight:()=>yZ,_shadersantialias:()=>xZ,_shadersapplyHSBShift:()=>_Z,_shadersapproximateSphericalCoordinates:()=>TZ,_shadersapproximateTanh:()=>SZ,_shadersbackFacing:()=>CZ,_shadersbranchFreeTernary:()=>VZ,_shaderscascadeColor:()=>LZ,_shaderscascadeDistance:()=>RZ,_shaderscascadeMatrix:()=>ZZ,_shaderscascadeWeights:()=>GZ,_shadersclipPolygons:()=>EZ,_shaderscolumbusViewMorph:()=>IZ,_shaderscomputeAtmosphereColor:()=>XZ,_shaderscomputeGroundAtmosphereScattering:()=>WZ,_shaderscomputePosition:()=>PZ,_shaderscomputeScattering:()=>vZ,_shadersconvertUvToBox:()=>CA,_shadersconvertUvToCylinder:()=>VA,_shadersconvertUvToEllipsoid:()=>LA,_shaderscosineAndSine:()=>wZ,_shadersdecompressTextureCoordinates:()=>FZ,_shadersdegreesPerRadian:()=>xR,_shadersdepthClamp:()=>AZ,_shadersdepthRange:()=>_R,_shadersdepthRangeStruct:()=>iZ,_shaderseastNorthUpToEyeCoordinates:()=>MZ,_shadersellipsoidContainsPoint:()=>NZ,_shadersellipsoidTextureCoordinates:()=>kZ,_shadersepsilon1:()=>TR,_shadersepsilon2:()=>SR,_shadersepsilon3:()=>CR,_shadersepsilon4:()=>VR,_shadersepsilon5:()=>LR,_shadersepsilon6:()=>RR,_shadersepsilon7:()=>ZR,_shadersequalsEpsilon:()=>UZ,_shaderseyeOffset:()=>DZ,_shaderseyeToWindowCoordinates:()=>BZ,_shadersfastApproximateAtan:()=>OZ,_shadersfog:()=>YZ,_shadersgammaCorrect:()=>HZ,_shadersgeodeticSurfaceNormal:()=>zZ,_shadersgetDefaultMaterial:()=>KZ,_shadersgetDynamicAtmosphereLightDirection:()=>JZ,_shadersgetLambertDiffuse:()=>QZ,_shadersgetSpecular:()=>jZ,_shadersgetWaterNoise:()=>qZ,_shadershue:()=>$Z,_shadersinfinity:()=>GR,_shadersinverseGamma:()=>eG,_shadersisEmpty:()=>tG,_shadersisFull:()=>nG,_shaderslatitudeToWebMercatorFraction:()=>iG,_shaderslineDistance:()=>oG,_shaderslinearToSrgb:()=>rG,_shadersluminance:()=>sG,_shadersmaterial:()=>oZ,_shadersmaterialInput:()=>rZ,_shadersmaximumComponent:()=>aG,_shadersmetersPerPixel:()=>cG,_shadersmodelMaterial:()=>sZ,_shadersmodelToWindowCoordinates:()=>lG,_shadersmodelVertexOutput:()=>aZ,_shadersmultiplyWithColorBalance:()=>dG,_shadersnearFarScalar:()=>uG,_shadersoctDecode:()=>mG,_shadersoneOverPi:()=>ER,_shadersoneOverTwoPi:()=>IR,_shaderspackDepth:()=>hG,_shaderspassCesium3DTile:()=>XR,_shaderspassCesium3DTileClassification:()=>WR,_shaderspassCesium3DTileClassificationIgnoreShow:()=>PR,_shaderspassClassification:()=>vR,_shaderspassCompute:()=>wR,_shaderspassEnvironment:()=>FR,_shaderspassGlobe:()=>AR,_shaderspassOpaque:()=>MR,_shaderspassOverlay:()=>NR,_shaderspassTerrainClassification:()=>kR,_shaderspassTranslucent:()=>UR,_shaderspassVoxels:()=>DR,_shaderspbrLighting:()=>fG,_shaderspbrNeutralTonemapping:()=>pG,_shadersphong:()=>bG,_shaderspi:()=>BR,_shaderspiOverFour:()=>OR,_shaderspiOverSix:()=>YR,_shaderspiOverThree:()=>HR,_shaderspiOverTwo:()=>zR,_shadersplaneDistance:()=>gG,_shaderspointAlongRay:()=>yG,_shadersradiansPerDegree:()=>KR,_shadersray:()=>cZ,_shadersrayEllipsoidIntersectionInterval:()=>xG,_shadersraySegment:()=>lZ,_shadersraySphereIntersectionInterval:()=>_G,_shadersreadDepth:()=>TG,_shadersreadNonPerspective:()=>SG,_shadersreverseLogDepth:()=>CG,_shadersround:()=>VG,_shaderssaturation:()=>LG,_shaderssceneMode2D:()=>JR,_shaderssceneMode3D:()=>QR,_shaderssceneModeColumbusView:()=>jR,_shaderssceneModeMorphing:()=>qR,_shadersshadowDepthCompare:()=>RG,_shadersshadowParameters:()=>dZ,_shadersshadowVisibility:()=>ZG,_shaderssignNotZero:()=>GG,_shaderssolarRadius:()=>$R,_shaderssphericalHarmonics:()=>EG,_shaderssrgbToLinear:()=>IG,_shaderstangentToEyeSpaceMatrix:()=>XG,_shaderstextureCube:()=>WG,_shadersthreePiOver2:()=>eZ,_shaderstransformPlane:()=>PG,_shaderstranslateRelativeToEye:()=>vG,_shaderstranslucentPhong:()=>wG,_shaderstranspose:()=>FG,_shaderstwoPi:()=>tZ,_shadersunpackClippingExtents:()=>AG,_shadersunpackDepth:()=>MG,_shadersunpackFloat:()=>NG,_shadersunpackUint:()=>kG,_shadersvalueTransform:()=>UG,_shadersvertexLogDepth:()=>DG,_shaderswebMercatorMaxLatitude:()=>nZ,_shaderswindowToEyeCoordinates:()=>BG,_shaderswriteDepthClamp:()=>OG,_shaderswriteLogDepth:()=>YG,_shaderswriteNonPerspective:()=>HG,addBuffer:()=>FI,addDefaults:()=>GI,addExtensionsRequired:()=>PI,addExtensionsUsed:()=>Su,addPipelineExtras:()=>tg,addToArray:()=>Ss,appendForwardSlash:()=>BL,arrayRemoveDuplicates:()=>xo,barycentricCoordinates:()=>rx,binarySearch:()=>Eo,buildModuleUrl:()=>rn,buildVoxelDrawCommands:()=>IA,clone:()=>Ye,combine:()=>Tt,computeFlyToLocationForRectangle:()=>_T,createBillboardPointCallback:()=>__,createCommand:()=>Ln,createDefaultImageryProviderViewModels:()=>e9,createDefaultTerrainProviderViewModels:()=>t9,createElevationBandMaterial:()=>y6,createGooglePhotorealistic3DTileset:()=>x6,createGuid:()=>Bn,createMaterialPropertyDescriptor:()=>Io,createOsmBuildingsAsync:()=>_6,createPropertyDescriptor:()=>ue,createRawPropertyDescriptor:()=>Ll,createTangentSpaceDebugPrimitive:()=>T6,createTaskProcessorWorker:()=>R6,createUniform:()=>iR,createUniformArray:()=>oR,createWorldBathymetryAsync:()=>pM,createWorldImageryAsync:()=>n0,createWorldTerrainAsync:()=>cS,decodeGoogleEarthEnterpriseData:()=>bM,decodeVectorPolylinePositions:()=>U2,defaultValue:()=>y,defer:()=>yl,defined:()=>l,demodernizeShader:()=>zG,deprecationWarning:()=>ls,destroyObject:()=>me,exportKml:()=>X4,findAccessorMinMax:()=>e_,findContentMetadata:()=>R_,findGroupMetadata:()=>Z_,findTileMetadata:()=>Y2,forEachTextureInMaterial:()=>xC,formatError:()=>Mf,freezeRenderState:()=>PO,getAbsoluteUri:()=>kh,getAccessorByteStride:()=>Xl,getBaseUri:()=>OL,getBinaryAccessor:()=>pd,getClipAndStyleCode:()=>qA,getClippingFunction:()=>qb,getComponentReader:()=>Hp,getElement:()=>Xn,getExtensionFromUri:()=>Ky,getFilenameFromUri:()=>Pb,getImageFromTypedArray:()=>vA,getImagePixels:()=>bm,getJsonFromTypedArray:()=>Wo,getMagic:()=>vm,getMetadataClassProperty:()=>AA,getStringFromTypedArray:()=>Zl,getTimestamp:()=>_i,hasExtension:()=>oi,heightReferenceOnEntityPropertyChanged:()=>vp,isBitSet:()=>Lc,isBlobUri:()=>Jy,isCrossOriginUrl:()=>L0,isDataUri:()=>hp,isLeapYear:()=>pm,knockout:()=>Se,knockout_3_5_1:()=>gS,knockout_es5:()=>BM,loadAndExecuteScript:()=>Qy,loadCubeMap:()=>oE,loadImageFromTypedArray:()=>jx,loadKTX2:()=>_l,mergeSort:()=>o0,moveTechniqueRenderStates:()=>WI,moveTechniquesToExtension:()=>vI,numberOfComponentsForType:()=>gd,objectToQuery:()=>jy,oneTimeWarning:()=>St,parseBatchTable:()=>ob,parseFeatureMetadataLegacy:()=>uX,parseGlb:()=>II,parseResponseHeaders:()=>YL,parseStructuralMetadata:()=>dX,pickModel:()=>qC,pointInsideTriangle:()=>E7,preprocess3DTileContent:()=>gf,processVoxelProperties:()=>EA,queryToObject:()=>od,readAccessorPacked:()=>AI,removeExtension:()=>t_,removeExtensionsRequired:()=>EI,removeExtensionsUsed:()=>$x,removePipelineExtras:()=>XI,removeUnusedElements:()=>wI,resizeImageToNextPowerOfTwo:()=>og,sampleTerrain:()=>uw,sampleTerrainMostDetailed:()=>xT,scaleToGeodeticSurface:()=>zy,srgbToLinear:()=>lS,subdivideArray:()=>UE,subscribeAndEvaluate:()=>xa,updateAccessorComponentTypes:()=>MI,updateVersion:()=>NI,usesExtension:()=>sr,viewerCesium3DTilesInspectorMixin:()=>K6,viewerCesiumInspectorMixin:()=>J6,viewerDragDropMixin:()=>j6,viewerPerformanceWatchdogMixin:()=>q6,viewerVoxelInspectorMixin:()=>$6,webGLConstantToGlslType:()=>I7,wrapFunction:()=>gM,writeTextToCanvas:()=>S_});var NIo=T(S(),1);var hoo=T(S(),1);var LVt=T(S(),1);var J1t=T(S(),1);var A1t=T(S(),1);var I1t=T(S(),1);function HCe(e){return e!=null}var l=HCe;var P1t=T(S(),1);function Yy(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(Yy.prototype=Object.create(Error.prototype),Yy.prototype.constructor=Yy);Yy.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
  73. ${this.stack.toString()}`),e};Yy.throwInstantiationError=function(){throw new Yy("This function defines an interface and should not be called directly.")};var pe=Yy;var _s={};_s.typeOf={};function zCe(e){return`${e} is required, actual value was undefined`}function ZS(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}_s.defined=function(e,t){if(!l(t))throw new pe(zCe(e))};_s.typeOf.func=function(e,t){if(typeof t!="function")throw new pe(ZS(typeof t,"function",e))};_s.typeOf.string=function(e,t){if(typeof t!="string")throw new pe(ZS(typeof t,"string",e))};_s.typeOf.number=function(e,t){if(typeof t!="number")throw new pe(ZS(typeof t,"number",e))};_s.typeOf.number.lessThan=function(e,t,n){if(_s.typeOf.number(e,t),t>=n)throw new pe(`Expected ${e} to be less than ${n}, actual value was ${t}`)};_s.typeOf.number.lessThanOrEquals=function(e,t,n){if(_s.typeOf.number(e,t),t>n)throw new pe(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};_s.typeOf.number.greaterThan=function(e,t,n){if(_s.typeOf.number(e,t),t<=n)throw new pe(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};_s.typeOf.number.greaterThanOrEquals=function(e,t,n){if(_s.typeOf.number(e,t),t<n)throw new pe(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};_s.typeOf.object=function(e,t){if(typeof t!="object")throw new pe(ZS(typeof t,"object",e))};_s.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new pe(ZS(typeof t,"boolean",e))};_s.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new pe(ZS(typeof t,"bigint",e))};_s.typeOf.number.equals=function(e,t,n,i){if(_s.typeOf.number(e,n),_s.typeOf.number(t,i),n!==i)throw new pe(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var go=_s;var N1t=T(S(),1);function Sq(e,t){return e??t}Sq.EMPTY_OBJECT=Object.freeze({});var y=Sq;var O1t=T(S(),1),O3=T(B9(),1);var dt={};dt.EPSILON1=.1;dt.EPSILON2=.01;dt.EPSILON3=.001;dt.EPSILON4=1e-4;dt.EPSILON5=1e-5;dt.EPSILON6=1e-6;dt.EPSILON7=1e-7;dt.EPSILON8=1e-8;dt.EPSILON9=1e-9;dt.EPSILON10=1e-10;dt.EPSILON11=1e-11;dt.EPSILON12=1e-12;dt.EPSILON13=1e-13;dt.EPSILON14=1e-14;dt.EPSILON15=1e-15;dt.EPSILON16=1e-16;dt.EPSILON17=1e-17;dt.EPSILON18=1e-18;dt.EPSILON19=1e-19;dt.EPSILON20=1e-20;dt.EPSILON21=1e-21;dt.GRAVITATIONALPARAMETER=3986004418e5;dt.SOLAR_RADIUS=6955e5;dt.LUNAR_RADIUS=1737400;dt.SIXTY_FOUR_KILOBYTES=64*1024;dt.FOUR_GIGABYTES=4*1024*1024*1024;dt.sign=y(Math.sign,function(t){return t=+t,t===0||t!==t?t:t>0?1:-1});dt.signNotZero=function(e){return e<0?-1:1};dt.toSNorm=function(e,t){return t=y(t,255),Math.round((dt.clamp(e,-1,1)*.5+.5)*t)};dt.fromSNorm=function(e,t){return t=y(t,255),dt.clamp(e,0,t)/t*2-1};dt.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:dt.clamp((e-t)/n,0,1)};dt.sinh=y(Math.sinh,function(t){return(Math.exp(t)-Math.exp(-t))/2});dt.cosh=y(Math.cosh,function(t){return(Math.exp(t)+Math.exp(-t))/2});dt.lerp=function(e,t,n){return(1-n)*e+n*t};dt.PI=Math.PI;dt.ONE_OVER_PI=1/Math.PI;dt.PI_OVER_TWO=Math.PI/2;dt.PI_OVER_THREE=Math.PI/3;dt.PI_OVER_FOUR=Math.PI/4;dt.PI_OVER_SIX=Math.PI/6;dt.THREE_PI_OVER_TWO=3*Math.PI/2;dt.TWO_PI=2*Math.PI;dt.ONE_OVER_TWO_PI=1/(2*Math.PI);dt.RADIANS_PER_DEGREE=Math.PI/180;dt.DEGREES_PER_RADIAN=180/Math.PI;dt.RADIANS_PER_ARCSECOND=dt.RADIANS_PER_DEGREE/3600;dt.toRadians=function(e){return e*dt.RADIANS_PER_DEGREE};dt.toDegrees=function(e){return e*dt.DEGREES_PER_RADIAN};dt.convertLongitudeRange=function(e){let t=dt.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};dt.clampToLatitudeRange=function(e){return dt.clamp(e,-1*dt.PI_OVER_TWO,dt.PI_OVER_TWO)};dt.negativePiToPi=function(e){return e>=-dt.PI&&e<=dt.PI?e:dt.zeroToTwoPi(e+dt.PI)-dt.PI};dt.zeroToTwoPi=function(e){if(e>=0&&e<=dt.TWO_PI)return e;let t=dt.mod(e,dt.TWO_PI);return Math.abs(t)<dt.EPSILON14&&Math.abs(e)>dt.EPSILON14?dt.TWO_PI:t};dt.mod=function(e,t){return dt.sign(e)===dt.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};dt.equalsEpsilon=function(e,t,n,i){n=y(n,0),i=y(i,n);let o=Math.abs(e-t);return o<=i||o<=n*Math.max(Math.abs(e),Math.abs(t))};dt.lessThan=function(e,t,n){return e-t<-n};dt.lessThanOrEquals=function(e,t,n){return e-t<n};dt.greaterThan=function(e,t,n){return e-t>n};dt.greaterThanOrEquals=function(e,t,n){return e-t>-n};var O9=[1];dt.factorial=function(e){let t=O9.length;if(e>=t){let n=O9[t-1];for(let i=t;i<=e;i++){let o=n*i;O9.push(o),n=o}}return O9[e]};dt.incrementWrap=function(e,t,n){return n=y(n,0),++e,e>t&&(e=n),e};dt.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};dt.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};dt.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};dt.clamp=function(e,t,n){return e<t?t:e>n?n:e};var Vq=new O3.default;dt.setRandomNumberSeed=function(e){Vq=new O3.default(e)};dt.nextRandomNumber=function(){return Vq.random()};dt.randomBetween=function(e,t){return dt.nextRandomNumber()*(t-e)+e};dt.acosClamped=function(e){return Math.acos(dt.clamp(e,-1,1))};dt.asinClamped=function(e){return Math.asin(dt.clamp(e,-1,1))};dt.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};dt.logBase=function(e,t){return Math.log(e)/Math.log(t)};dt.cbrt=y(Math.cbrt,function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n});dt.log2=y(Math.log2,function(t){return Math.log(t)*Math.LOG2E});dt.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};dt.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};dt.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let o=Math.max(i,n);n=Math.min(i,n);let r=n/o;return i=dt.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?dt.PI_OVER_TWO-i:i,i=e<0?dt.PI-i:i,i=t<0?-i:i,i};var W=dt;function nt(e,t,n){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0)}nt.fromSpherical=function(e,t){l(t)||(t=new nt);let n=e.clock,i=e.cone,o=y(e.magnitude,1),r=o*Math.sin(i);return t.x=r*Math.cos(n),t.y=r*Math.sin(n),t.z=o*Math.cos(i),t};nt.fromElements=function(e,t,n,i){return l(i)?(i.x=e,i.y=t,i.z=n,i):new nt(e,t,n)};nt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new nt(e.x,e.y,e.z)};nt.fromCartesian4=nt.clone;nt.packedLength=3;nt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};nt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new nt),n.x=e[t++],n.y=e[t++],n.z=e[t],n};nt.packArray=function(e,t){let n=e.length,i=n*3;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)nt.pack(e[o],t,o*3);return t};nt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/3:t=new Array(n/3);for(let i=0;i<n;i+=3){let o=i/3;t[o]=nt.unpack(e,i,t[o])}return t};nt.fromArray=nt.unpack;nt.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)};nt.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)};nt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n};nt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n};nt.clamp=function(e,t,n,i){let o=W.clamp(e.x,t.x,n.x),r=W.clamp(e.y,t.y,n.y),s=W.clamp(e.z,t.z,n.z);return i.x=o,i.y=r,i.z=s,i};nt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z};nt.magnitude=function(e){return Math.sqrt(nt.magnitudeSquared(e))};var H9=new nt;nt.distance=function(e,t){return nt.subtract(e,t,H9),nt.magnitude(H9)};nt.distanceSquared=function(e,t){return nt.subtract(e,t,H9),nt.magnitudeSquared(H9)};nt.normalize=function(e,t){let n=nt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t};nt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z};nt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n};nt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n};nt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n};nt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n};nt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};nt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};nt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t};nt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var Lq=new nt;nt.lerp=function(e,t,n,i){return nt.multiplyByScalar(t,n,Lq),i=nt.multiplyByScalar(e,1-n,i),nt.add(Lq,i,i)};var Y9=new nt,Y3=new nt;nt.angleBetween=function(e,t){nt.normalize(e,Y9),nt.normalize(t,Y3);let n=nt.dot(Y9,Y3),i=nt.magnitude(nt.cross(Y9,Y3,Y9));return Math.atan2(i,n)};var KCe=new nt;nt.mostOrthogonalAxis=function(e,t){let n=nt.normalize(e,KCe);return nt.abs(n,n),n.x<=n.y?n.x<=n.z?t=nt.clone(nt.UNIT_X,t):t=nt.clone(nt.UNIT_Z,t):n.y<=n.z?t=nt.clone(nt.UNIT_Y,t):t=nt.clone(nt.UNIT_Z,t),t};nt.projectVector=function(e,t,n){let i=nt.dot(e,t)/nt.dot(t,t);return nt.multiplyByScalar(t,i,n)};nt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};nt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]};nt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&W.equalsEpsilon(e.x,t.x,n,i)&&W.equalsEpsilon(e.y,t.y,n,i)&&W.equalsEpsilon(e.z,t.z,n,i)};nt.cross=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=t.x,a=t.y,c=t.z,d=o*c-r*a,u=r*s-i*c,m=i*a-o*s;return n.x=d,n.y=u,n.z=m,n};nt.midpoint=function(e,t,n){return n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n};nt.fromDegrees=function(e,t,n,i,o){return e=W.toRadians(e),t=W.toRadians(t),nt.fromRadians(e,t,n,i,o)};var au=new nt,GS=new nt;nt._ellipsoidRadiiSquared=new nt(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);nt.fromRadians=function(e,t,n,i,o){n=y(n,0);let r=l(i)?i.radiiSquared:nt._ellipsoidRadiiSquared,s=Math.cos(t);au.x=s*Math.cos(e),au.y=s*Math.sin(e),au.z=Math.sin(t),au=nt.normalize(au,au),nt.multiplyComponents(r,au,GS);let a=Math.sqrt(nt.dot(au,GS));return GS=nt.divideByScalar(GS,a,GS),au=nt.multiplyByScalar(au,n,au),l(o)||(o=new nt),nt.add(GS,au,o)};nt.fromDegreesArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=nt.fromDegrees(r,s,0,t,n[a])}return n};nt.fromRadiansArray=function(e,t,n){let i=e.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=nt.fromRadians(r,s,0,t,n[a])}return n};nt.fromDegreesArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],c=o/3;n[c]=nt.fromDegrees(r,s,a,t,n[c])}return n};nt.fromRadiansArrayHeights=function(e,t,n){let i=e.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],c=o/3;n[c]=nt.fromRadians(r,s,a,t,n[c])}return n};nt.ZERO=Object.freeze(new nt(0,0,0));nt.ONE=Object.freeze(new nt(1,1,1));nt.UNIT_X=Object.freeze(new nt(1,0,0));nt.UNIT_Y=Object.freeze(new nt(0,1,0));nt.UNIT_Z=Object.freeze(new nt(0,0,1));nt.prototype.clone=function(e){return nt.clone(this,e)};nt.prototype.equals=function(e){return nt.equals(this,e)};nt.prototype.equalsEpsilon=function(e,t,n){return nt.equalsEpsilon(this,e,t,n)};nt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var h=nt;var yVt=T(S(),1);var eVt=T(S(),1);function _t(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}_t.fromElements=function(e,t,n,i,o){return l(o)?(o.x=e,o.y=t,o.z=n,o.w=i,o):new _t(e,t,n,i)};_t.fromColor=function(e,t){return l(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new _t(e.red,e.green,e.blue,e.alpha)};_t.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new _t(e.x,e.y,e.z,e.w)};_t.packedLength=4;_t.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};_t.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new _t),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};_t.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)_t.pack(e[o],t,o*4);return t};_t.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=_t.unpack(e,i,t[o])}return t};_t.fromArray=_t.unpack;_t.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)};_t.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)};_t.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};_t.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};_t.clamp=function(e,t,n,i){let o=W.clamp(e.x,t.x,n.x),r=W.clamp(e.y,t.y,n.y),s=W.clamp(e.z,t.z,n.z),a=W.clamp(e.w,t.w,n.w);return i.x=o,i.y=r,i.z=s,i.w=a,i};_t.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};_t.magnitude=function(e){return Math.sqrt(_t.magnitudeSquared(e))};var z9=new _t;_t.distance=function(e,t){return _t.subtract(e,t,z9),_t.magnitude(z9)};_t.distanceSquared=function(e,t){return _t.subtract(e,t,z9),_t.magnitudeSquared(z9)};_t.normalize=function(e,t){let n=_t.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t};_t.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};_t.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};_t.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};_t.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};_t.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};_t.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};_t.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};_t.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};_t.abs=function(e,t){return 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 Rq=new _t;_t.lerp=function(e,t,n,i){return _t.multiplyByScalar(t,n,Rq),i=_t.multiplyByScalar(e,1-n,i),_t.add(Rq,i,i)};var JCe=new _t;_t.mostOrthogonalAxis=function(e,t){let n=_t.normalize(e,JCe);return _t.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=_t.clone(_t.UNIT_X,t):t=_t.clone(_t.UNIT_W,t):n.z<=n.w?t=_t.clone(_t.UNIT_Z,t):t=_t.clone(_t.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=_t.clone(_t.UNIT_Y,t):t=_t.clone(_t.UNIT_W,t):n.z<=n.w?t=_t.clone(_t.UNIT_Z,t):t=_t.clone(_t.UNIT_W,t),t};_t.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};_t.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]};_t.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&W.equalsEpsilon(e.x,t.x,n,i)&&W.equalsEpsilon(e.y,t.y,n,i)&&W.equalsEpsilon(e.z,t.z,n,i)&&W.equalsEpsilon(e.w,t.w,n,i)};_t.ZERO=Object.freeze(new _t(0,0,0,0));_t.ONE=Object.freeze(new _t(1,1,1,1));_t.UNIT_X=Object.freeze(new _t(1,0,0,0));_t.UNIT_Y=Object.freeze(new _t(0,1,0,0));_t.UNIT_Z=Object.freeze(new _t(0,0,1,0));_t.UNIT_W=Object.freeze(new _t(0,0,0,1));_t.prototype.clone=function(e){return _t.clone(this,e)};_t.prototype.equals=function(e){return _t.equals(this,e)};_t.prototype.equalsEpsilon=function(e,t,n){return _t.equalsEpsilon(this,e,t,n)};_t.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var H3=new Float32Array(1),Ka=new Uint8Array(H3.buffer),QCe=new Uint32Array([287454020]),jCe=new Uint8Array(QCe.buffer),Zq=jCe[0]===68;_t.packFloat=function(e,t){return l(t)||(t=new _t),H3[0]=e,Zq?(t.x=Ka[0],t.y=Ka[1],t.z=Ka[2],t.w=Ka[3]):(t.x=Ka[3],t.y=Ka[2],t.z=Ka[1],t.w=Ka[0]),t};_t.unpackFloat=function(e){return Zq?(Ka[0]=e.x,Ka[1]=e.y,Ka[2]=e.z,Ka[3]=e.w):(Ka[0]=e.w,Ka[1]=e.z,Ka[2]=e.y,Ka[3]=e.x),H3[0]};var se=_t;var sVt=T(S(),1);function rt(e,t,n,i,o,r,s,a,c){this[0]=y(e,0),this[1]=y(i,0),this[2]=y(s,0),this[3]=y(t,0),this[4]=y(o,0),this[5]=y(a,0),this[6]=y(n,0),this[7]=y(r,0),this[8]=y(c,0)}rt.packedLength=9;rt.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t};rt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new rt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n};rt.packArray=function(e,t){let n=e.length,i=n*9;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)rt.pack(e[o],t,o*9);return t};rt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){let o=i/9;t[o]=rt.unpack(e,i,t[o])}return t};rt.clone=function(e,t){if(l(e))return l(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):new rt(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};rt.fromArray=rt.unpack;rt.fromColumnMajorArray=function(e,t){return rt.clone(e,t)};rt.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new rt(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};rt.fromQuaternion=function(e,t){let n=e.x*e.x,i=e.x*e.y,o=e.x*e.z,r=e.x*e.w,s=e.y*e.y,a=e.y*e.z,c=e.y*e.w,d=e.z*e.z,u=e.z*e.w,m=e.w*e.w,p=n-s-d+m,g=2*(i-u),f=2*(o+c),x=2*(i+u),_=-n+s-d+m,C=2*(a-r),V=2*(o-c),L=2*(a+r),Z=-n-s+d+m;return l(t)?(t[0]=p,t[1]=x,t[2]=V,t[3]=g,t[4]=_,t[5]=L,t[6]=f,t[7]=C,t[8]=Z,t):new rt(p,g,f,x,_,C,V,L,Z)};rt.fromHeadingPitchRoll=function(e,t){let n=Math.cos(-e.pitch),i=Math.cos(-e.heading),o=Math.cos(e.roll),r=Math.sin(-e.pitch),s=Math.sin(-e.heading),a=Math.sin(e.roll),c=n*i,d=-o*s+a*r*i,u=a*s+o*r*i,m=n*s,p=o*i+a*r*s,g=-a*i+o*r*s,f=-r,x=a*n,_=o*n;return l(t)?(t[0]=c,t[1]=m,t[2]=f,t[3]=d,t[4]=p,t[5]=x,t[6]=u,t[7]=g,t[8]=_,t):new rt(c,d,u,m,p,g,f,x,_)};rt.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new rt(e.x,0,0,0,e.y,0,0,0,e.z)};rt.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new rt(e,0,0,0,e,0,0,0,e)};rt.fromCrossProduct=function(e,t){return l(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new rt(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};rt.fromRotationX=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new rt(1,0,0,0,n,-i,0,i,n)};rt.fromRotationY=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new rt(n,0,i,0,1,0,-i,0,n)};rt.fromRotationZ=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new rt(n,-i,0,i,n,0,0,0,1)};rt.toArray=function(e,t){return l(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):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]};rt.getElementIndex=function(e,t){return e*3+t};rt.getColumn=function(e,t,n){let i=t*3,o=e[i],r=e[i+1],s=e[i+2];return n.x=o,n.y=r,n.z=s,n};rt.setColumn=function(e,t,n,i){i=rt.clone(e,i);let o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i};rt.getRow=function(e,t,n){let i=e[t],o=e[t+3],r=e[t+6];return n.x=i,n.y=o,n.z=r,n};rt.setRow=function(e,t,n,i){return i=rt.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var qCe=new h;rt.setScale=function(e,t,n){let i=rt.getScale(e,qCe),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var $Ce=new h;rt.setUniformScale=function(e,t,n){let i=rt.getScale(e,$Ce),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var z3=new h;rt.getScale=function(e,t){return t.x=h.magnitude(h.fromElements(e[0],e[1],e[2],z3)),t.y=h.magnitude(h.fromElements(e[3],e[4],e[5],z3)),t.z=h.magnitude(h.fromElements(e[6],e[7],e[8],z3)),t};var Gq=new h;rt.getMaximumScale=function(e){return rt.getScale(e,Gq),h.maximumComponent(Gq)};var e1e=new h;rt.setRotation=function(e,t,n){let i=rt.getScale(e,e1e);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=t[3]*i.y,n[4]=t[4]*i.y,n[5]=t[5]*i.y,n[6]=t[6]*i.z,n[7]=t[7]*i.z,n[8]=t[8]*i.z,n};var t1e=new h;rt.getRotation=function(e,t){let n=rt.getScale(e,t1e);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t};rt.multiply=function(e,t,n){let i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],r=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],s=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],a=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],d=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],u=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],m=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=o,n[2]=r,n[3]=s,n[4]=a,n[5]=c,n[6]=d,n[7]=u,n[8]=m,n};rt.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n};rt.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n};rt.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[3]*o+e[6]*r,a=e[1]*i+e[4]*o+e[7]*r,c=e[2]*i+e[5]*o+e[8]*r;return n.x=s,n.y=a,n.z=c,n};rt.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};rt.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n};rt.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};rt.negate=function(e,t){return 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};rt.transpose=function(e,t){let n=e[0],i=e[3],o=e[6],r=e[1],s=e[4],a=e[7],c=e[2],d=e[5],u=e[8];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t[4]=s,t[5]=a,t[6]=c,t[7]=d,t[8]=u,t};function n1e(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var K3=[1,0,0],J3=[2,2,1];function i1e(e){let t=0;for(let n=0;n<3;++n){let i=e[rt.getElementIndex(J3[n],K3[n])];t+=2*i*i}return Math.sqrt(t)}function o1e(e,t){let n=W.EPSILON15,i=0,o=1;for(let d=0;d<3;++d){let u=Math.abs(e[rt.getElementIndex(J3[d],K3[d])]);u>i&&(o=d,i=u)}let r=1,s=0,a=K3[o],c=J3[o];if(Math.abs(e[rt.getElementIndex(c,a)])>n){let d=e[rt.getElementIndex(c,c)],u=e[rt.getElementIndex(a,a)],m=e[rt.getElementIndex(c,a)],p=(d-u)/2/m,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+g*g),s=g*r}return t=rt.clone(rt.IDENTITY,t),t[rt.getElementIndex(a,a)]=t[rt.getElementIndex(c,c)]=r,t[rt.getElementIndex(c,a)]=s,t[rt.getElementIndex(a,c)]=-s,t}var K9=new rt,Eq=new rt;rt.computeEigenDecomposition=function(e,t){let n=W.EPSILON20,i=10,o=0,r=0;l(t)||(t={});let s=t.unitary=rt.clone(rt.IDENTITY,t.unitary),a=t.diagonal=rt.clone(e,t.diagonal),c=n*n1e(a);for(;r<i&&i1e(a)>c;)o1e(a,K9),rt.transpose(K9,Eq),rt.multiply(a,K9,a),rt.multiply(Eq,a,a),rt.multiply(s,K9,s),++o>2&&(++r,o=0);return t};rt.abs=function(e,t){return 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};rt.determinant=function(e){let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],c=e[5],d=e[8];return t*(r*d-c*s)+o*(c*i-n*d)+a*(n*s-r*i)};rt.inverse=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],c=e[6],d=e[7],u=e[8],m=rt.determinant(e);t[0]=s*u-d*a,t[1]=d*o-i*u,t[2]=i*a-s*o,t[3]=c*a-r*u,t[4]=n*u-c*o,t[5]=r*o-n*a,t[6]=r*d-c*s,t[7]=c*i-n*d,t[8]=n*s-r*i;let p=1/m;return rt.multiplyByScalar(t,p,t)};var r1e=new rt;rt.inverseTranspose=function(e,t){return rt.inverse(rt.transpose(e,r1e),t)};rt.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]};rt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};rt.IDENTITY=Object.freeze(new rt(1,0,0,0,1,0,0,0,1));rt.ZERO=Object.freeze(new rt(0,0,0,0,0,0,0,0,0));rt.COLUMN0ROW0=0;rt.COLUMN0ROW1=1;rt.COLUMN0ROW2=2;rt.COLUMN1ROW0=3;rt.COLUMN1ROW1=4;rt.COLUMN1ROW2=5;rt.COLUMN2ROW0=6;rt.COLUMN2ROW1=7;rt.COLUMN2ROW2=8;Object.defineProperties(rt.prototype,{length:{get:function(){return rt.packedLength}}});rt.prototype.clone=function(e){return rt.clone(this,e)};rt.prototype.equals=function(e){return rt.equals(this,e)};rt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]};rt.prototype.equalsEpsilon=function(e,t){return rt.equalsEpsilon(this,e,t)};rt.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
  74. (${this[1]}, ${this[4]}, ${this[7]})
  75. (${this[2]}, ${this[5]}, ${this[8]})`};var $=rt;var lVt=T(S(),1);function kL(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(kL.prototype=Object.create(Error.prototype),kL.prototype.constructor=kL);kL.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
  76. ${this.stack.toString()}`),e};var de=kL;function it(e,t,n,i,o,r,s,a,c,d,u,m,p,g,f,x){this[0]=y(e,0),this[1]=y(o,0),this[2]=y(c,0),this[3]=y(p,0),this[4]=y(t,0),this[5]=y(r,0),this[6]=y(d,0),this[7]=y(g,0),this[8]=y(n,0),this[9]=y(s,0),this[10]=y(u,0),this[11]=y(f,0),this[12]=y(i,0),this[13]=y(a,0),this[14]=y(m,0),this[15]=y(x,0)}it.packedLength=16;it.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};it.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new it),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n};it.packArray=function(e,t){let n=e.length,i=n*16;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)it.pack(e[o],t,o*16);return t};it.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/16:t=new Array(n/16);for(let i=0;i<n;i+=16){let o=i/16;t[o]=it.unpack(e,i,t[o])}return t};it.clone=function(e,t){if(l(e))return l(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 it(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])};it.fromArray=it.unpack;it.fromColumnMajorArray=function(e,t){return it.clone(e,t)};it.fromRowMajorArray=function(e,t){return l(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 it(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])};it.fromRotationTranslation=function(e,t,n){return t=y(t,h.ZERO),l(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new it(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)};it.fromTranslationQuaternionRotationScale=function(e,t,n,i){l(i)||(i=new it);let o=n.x,r=n.y,s=n.z,a=t.x*t.x,c=t.x*t.y,d=t.x*t.z,u=t.x*t.w,m=t.y*t.y,p=t.y*t.z,g=t.y*t.w,f=t.z*t.z,x=t.z*t.w,_=t.w*t.w,C=a-m-f+_,V=2*(c-x),L=2*(d+g),Z=2*(c+x),G=-a+m-f+_,I=2*(p-u),v=2*(d-g),P=2*(p+u),w=-a-m+f+_;return i[0]=C*o,i[1]=Z*o,i[2]=v*o,i[3]=0,i[4]=V*r,i[5]=G*r,i[6]=P*r,i[7]=0,i[8]=L*s,i[9]=I*s,i[10]=w*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};it.fromTranslationRotationScale=function(e,t){return it.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};it.fromTranslation=function(e,t){return it.fromRotationTranslation($.IDENTITY,e,t)};it.fromScale=function(e,t){return l(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 it(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};it.fromUniformScale=function(e,t){return l(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 it(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};it.fromRotation=function(e,t){return l(t)||(t=new it),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 ES=new h,IS=new h,UL=new h;it.fromCamera=function(e,t){let n=e.position,i=e.direction,o=e.up;h.normalize(i,ES),h.normalize(h.cross(ES,o,IS),IS),h.normalize(h.cross(IS,ES,UL),UL);let r=IS.x,s=IS.y,a=IS.z,c=ES.x,d=ES.y,u=ES.z,m=UL.x,p=UL.y,g=UL.z,f=n.x,x=n.y,_=n.z,C=r*-f+s*-x+a*-_,V=m*-f+p*-x+g*-_,L=c*f+d*x+u*_;return l(t)?(t[0]=r,t[1]=m,t[2]=-c,t[3]=0,t[4]=s,t[5]=p,t[6]=-d,t[7]=0,t[8]=a,t[9]=g,t[10]=-u,t[11]=0,t[12]=C,t[13]=V,t[14]=L,t[15]=1,t):new it(r,s,a,C,m,p,g,V,-c,-d,-u,L,0,0,0,1)};it.computePerspectiveFieldOfView=function(e,t,n,i,o){let s=1/Math.tan(e*.5),a=s/t,c=(i+n)/(n-i),d=2*i*n/(n-i);return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=-1,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o};it.computeOrthographicOffCenter=function(e,t,n,i,o,r,s){let a=1/(t-e),c=1/(i-n),d=1/(r-o),u=-(t+e)*a,m=-(i+n)*c,p=-(r+o)*d;return a*=2,c*=2,d*=-2,s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=d,s[11]=0,s[12]=u,s[13]=m,s[14]=p,s[15]=1,s};it.computePerspectiveOffCenter=function(e,t,n,i,o,r,s){let a=2*o/(t-e),c=2*o/(i-n),d=(t+e)/(t-e),u=(i+n)/(i-n),m=-(r+o)/(r-o),p=-1,g=-2*r*o/(r-o);return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=d,s[9]=u,s[10]=m,s[11]=p,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s};it.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,r){let s=2*o/(t-e),a=2*o/(i-n),c=(t+e)/(t-e),d=(i+n)/(i-n),u=-1,m=-1,p=-2*o;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=c,r[9]=d,r[10]=u,r[11]=m,r[12]=0,r[13]=0,r[14]=p,r[15]=0,r};it.computeViewportTransformation=function(e,t,n,i){l(i)||(i=new it),e=y(e,y.EMPTY_OBJECT);let o=y(e.x,0),r=y(e.y,0),s=y(e.width,0),a=y(e.height,0);t=y(t,0),n=y(n,1);let c=s*.5,d=a*.5,u=(n-t)*.5,m=c,p=d,g=u,f=o+c,x=r+d,_=t+u,C=1;return i[0]=m,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=g,i[11]=0,i[12]=f,i[13]=x,i[14]=_,i[15]=C,i};it.computeView=function(e,t,n,i,o){return o[0]=i.x,o[1]=n.x,o[2]=-t.x,o[3]=0,o[4]=i.y,o[5]=n.y,o[6]=-t.y,o[7]=0,o[8]=i.z,o[9]=n.z,o[10]=-t.z,o[11]=0,o[12]=-h.dot(i,e),o[13]=-h.dot(n,e),o[14]=h.dot(t,e),o[15]=1,o};it.toArray=function(e,t){return l(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]]};it.getElementIndex=function(e,t){return e*4+t};it.getColumn=function(e,t,n){let i=t*4,o=e[i],r=e[i+1],s=e[i+2],a=e[i+3];return n.x=o,n.y=r,n.z=s,n.w=a,n};it.setColumn=function(e,t,n,i){i=it.clone(e,i);let o=t*4;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i[o+3]=n.w,i};it.getRow=function(e,t,n){let i=e[t],o=e[t+4],r=e[t+8],s=e[t+12];return n.x=i,n.y=o,n.z=r,n.w=s,n};it.setRow=function(e,t,n,i){return i=it.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};it.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var s1e=new h;it.setScale=function(e,t,n){let i=it.getScale(e,s1e),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var a1e=new h;it.setUniformScale=function(e,t,n){let i=it.getScale(e,a1e),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var Q3=new h;it.getScale=function(e,t){return t.x=h.magnitude(h.fromElements(e[0],e[1],e[2],Q3)),t.y=h.magnitude(h.fromElements(e[4],e[5],e[6],Q3)),t.z=h.magnitude(h.fromElements(e[8],e[9],e[10],Q3)),t};var Iq=new h;it.getMaximumScale=function(e){return it.getScale(e,Iq),h.maximumComponent(Iq)};var c1e=new h;it.setRotation=function(e,t,n){let i=it.getScale(e,c1e);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=e[3],n[4]=t[3]*i.y,n[5]=t[4]*i.y,n[6]=t[5]*i.y,n[7]=e[7],n[8]=t[6]*i.z,n[9]=t[7]*i.z,n[10]=t[8]*i.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var l1e=new h;it.getRotation=function(e,t){let n=it.getScale(e,l1e);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[4]/n.y,t[4]=e[5]/n.y,t[5]=e[6]/n.y,t[6]=e[8]/n.z,t[7]=e[9]/n.z,t[8]=e[10]/n.z,t};it.multiply=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[3],a=e[4],c=e[5],d=e[6],u=e[7],m=e[8],p=e[9],g=e[10],f=e[11],x=e[12],_=e[13],C=e[14],V=e[15],L=t[0],Z=t[1],G=t[2],I=t[3],v=t[4],P=t[5],w=t[6],F=t[7],b=t[8],R=t[9],E=t[10],X=t[11],A=t[12],N=t[13],O=t[14],U=t[15],Y=i*L+a*Z+m*G+x*I,k=o*L+c*Z+p*G+_*I,H=r*L+d*Z+g*G+C*I,J=s*L+u*Z+f*G+V*I,te=i*v+a*P+m*w+x*F,z=o*v+c*P+p*w+_*F,q=r*v+d*P+g*w+C*F,ee=s*v+u*P+f*w+V*F,fe=i*b+a*R+m*E+x*X,_e=o*b+c*R+p*E+_*X,le=r*b+d*R+g*E+C*X,ye=s*b+u*R+f*E+V*X,Te=i*A+a*N+m*O+x*U,Xe=o*A+c*N+p*O+_*U,Le=r*A+d*N+g*O+C*U,ke=s*A+u*N+f*O+V*U;return n[0]=Y,n[1]=k,n[2]=H,n[3]=J,n[4]=te,n[5]=z,n[6]=q,n[7]=ee,n[8]=fe,n[9]=_e,n[10]=le,n[11]=ye,n[12]=Te,n[13]=Xe,n[14]=Le,n[15]=ke,n};it.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};it.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};it.multiplyTransformation=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],d=e[8],u=e[9],m=e[10],p=e[12],g=e[13],f=e[14],x=t[0],_=t[1],C=t[2],V=t[4],L=t[5],Z=t[6],G=t[8],I=t[9],v=t[10],P=t[12],w=t[13],F=t[14],b=i*x+s*_+d*C,R=o*x+a*_+u*C,E=r*x+c*_+m*C,X=i*V+s*L+d*Z,A=o*V+a*L+u*Z,N=r*V+c*L+m*Z,O=i*G+s*I+d*v,U=o*G+a*I+u*v,Y=r*G+c*I+m*v,k=i*P+s*w+d*F+p,H=o*P+a*w+u*F+g,J=r*P+c*w+m*F+f;return n[0]=b,n[1]=R,n[2]=E,n[3]=0,n[4]=X,n[5]=A,n[6]=N,n[7]=0,n[8]=O,n[9]=U,n[10]=Y,n[11]=0,n[12]=k,n[13]=H,n[14]=J,n[15]=1,n};it.multiplyByMatrix3=function(e,t,n){let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],c=e[6],d=e[8],u=e[9],m=e[10],p=t[0],g=t[1],f=t[2],x=t[3],_=t[4],C=t[5],V=t[6],L=t[7],Z=t[8],G=i*p+s*g+d*f,I=o*p+a*g+u*f,v=r*p+c*g+m*f,P=i*x+s*_+d*C,w=o*x+a*_+u*C,F=r*x+c*_+m*C,b=i*V+s*L+d*Z,R=o*V+a*L+u*Z,E=r*V+c*L+m*Z;return n[0]=G,n[1]=I,n[2]=v,n[3]=0,n[4]=P,n[5]=w,n[6]=F,n[7]=0,n[8]=b,n[9]=R,n[10]=E,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};it.multiplyByTranslation=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=i*e[0]+o*e[4]+r*e[8]+e[12],a=i*e[1]+o*e[5]+r*e[9]+e[13],c=i*e[2]+o*e[6]+r*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=s,n[13]=a,n[14]=c,n[15]=e[15],n};it.multiplyByScale=function(e,t,n){let i=t.x,o=t.y,r=t.z;return i===1&&o===1&&r===1?it.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=e[3],n[4]=o*e[4],n[5]=o*e[5],n[6]=o*e[6],n[7]=e[7],n[8]=r*e[8],n[9]=r*e[9],n[10]=r*e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n)};it.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};it.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=t.w,a=e[0]*i+e[4]*o+e[8]*r+e[12]*s,c=e[1]*i+e[5]*o+e[9]*r+e[13]*s,d=e[2]*i+e[6]*o+e[10]*r+e[14]*s,u=e[3]*i+e[7]*o+e[11]*r+e[15]*s;return n.x=a,n.y=c,n.z=d,n.w=u,n};it.multiplyByPointAsVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r,a=e[1]*i+e[5]*o+e[9]*r,c=e[2]*i+e[6]*o+e[10]*r;return n.x=s,n.y=a,n.z=c,n};it.multiplyByPoint=function(e,t,n){let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r+e[12],a=e[1]*i+e[5]*o+e[9]*r+e[13],c=e[2]*i+e[6]*o+e[10]*r+e[14];return n.x=s,n.y=a,n.z=c,n};it.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};it.negate=function(e,t){return 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};it.transpose=function(e,t){let n=e[1],i=e[2],o=e[3],r=e[6],s=e[7],a=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=o,t[13]=s,t[14]=a,t[15]=e[15],t};it.abs=function(e,t){return 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};it.equals=function(e,t){return e===t||l(e)&&l(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]};it.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n};it.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t};it.getMatrix3=function(e,t){return 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 d1e=new $,u1e=new $,m1e=new se,h1e=new se(0,0,0,1);it.inverse=function(e,t){let n=e[0],i=e[4],o=e[8],r=e[12],s=e[1],a=e[5],c=e[9],d=e[13],u=e[2],m=e[6],p=e[10],g=e[14],f=e[3],x=e[7],_=e[11],C=e[15],V=p*C,L=g*_,Z=m*C,G=g*x,I=m*_,v=p*x,P=u*C,w=g*f,F=u*_,b=p*f,R=u*x,E=m*f,X=V*a+G*c+I*d-(L*a+Z*c+v*d),A=L*s+P*c+b*d-(V*s+w*c+F*d),N=Z*s+w*a+R*d-(G*s+P*a+E*d),O=v*s+F*a+E*c-(I*s+b*a+R*c),U=L*i+Z*o+v*r-(V*i+G*o+I*r),Y=V*n+w*o+F*r-(L*n+P*o+b*r),k=G*n+P*i+E*r-(Z*n+w*i+R*r),H=I*n+b*i+R*o-(v*n+F*i+E*o);V=o*d,L=r*c,Z=i*d,G=r*a,I=i*c,v=o*a,P=n*d,w=r*s,F=n*c,b=o*s,R=n*a,E=i*s;let J=V*x+G*_+I*C-(L*x+Z*_+v*C),te=L*f+P*_+b*C-(V*f+w*_+F*C),z=Z*f+w*x+R*C-(G*f+P*x+E*C),q=v*f+F*x+E*_-(I*f+b*x+R*_),ee=Z*p+v*g+L*m-(I*g+V*m+G*p),fe=F*g+V*u+w*p-(P*p+b*g+L*u),_e=P*m+E*g+G*u-(R*g+Z*u+w*m),le=R*p+I*u+b*m-(F*m+E*p+v*u),ye=n*X+i*A+o*N+r*O;if(Math.abs(ye)<W.EPSILON21){if($.equalsEpsilon(it.getMatrix3(e,d1e),u1e,W.EPSILON7)&&se.equals(it.getRow(e,3,m1e),h1e))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 de("matrix is not invertible because its determinate is zero.")}return ye=1/ye,t[0]=X*ye,t[1]=A*ye,t[2]=N*ye,t[3]=O*ye,t[4]=U*ye,t[5]=Y*ye,t[6]=k*ye,t[7]=H*ye,t[8]=J*ye,t[9]=te*ye,t[10]=z*ye,t[11]=q*ye,t[12]=ee*ye,t[13]=fe*ye,t[14]=_e*ye,t[15]=le*ye,t};it.inverseTransformation=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[4],s=e[5],a=e[6],c=e[8],d=e[9],u=e[10],m=e[12],p=e[13],g=e[14],f=-n*m-i*p-o*g,x=-r*m-s*p-a*g,_=-c*m-d*p-u*g;return t[0]=n,t[1]=r,t[2]=c,t[3]=0,t[4]=i,t[5]=s,t[6]=d,t[7]=0,t[8]=o,t[9]=a,t[10]=u,t[11]=0,t[12]=f,t[13]=x,t[14]=_,t[15]=1,t};var f1e=new it;it.inverseTranspose=function(e,t){return it.inverse(it.transpose(e,f1e),t)};it.IDENTITY=Object.freeze(new it(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));it.ZERO=Object.freeze(new it(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));it.COLUMN0ROW0=0;it.COLUMN0ROW1=1;it.COLUMN0ROW2=2;it.COLUMN0ROW3=3;it.COLUMN1ROW0=4;it.COLUMN1ROW1=5;it.COLUMN1ROW2=6;it.COLUMN1ROW3=7;it.COLUMN2ROW0=8;it.COLUMN2ROW1=9;it.COLUMN2ROW2=10;it.COLUMN2ROW3=11;it.COLUMN3ROW0=12;it.COLUMN3ROW1=13;it.COLUMN3ROW2=14;it.COLUMN3ROW3=15;Object.defineProperties(it.prototype,{length:{get:function(){return it.packedLength}}});it.prototype.clone=function(e){return it.clone(this,e)};it.prototype.equals=function(e){return it.equals(this,e)};it.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]};it.prototype.equalsEpsilon=function(e,t){return it.equalsEpsilon(this,e,t)};it.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})
  77. (${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})
  78. (${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})
  79. (${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var M=it;var _Vt=T(S(),1),p1e={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047},ie=Object.freeze(p1e);var b1e=new h;function Xt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var ia={};ia[ie.FLOAT]="float";ia[ie.FLOAT_VEC2]="vec2";ia[ie.FLOAT_VEC3]="vec3";ia[ie.FLOAT_VEC4]="vec4";ia[ie.INT]="int";ia[ie.INT_VEC2]="ivec2";ia[ie.INT_VEC3]="ivec3";ia[ie.INT_VEC4]="ivec4";ia[ie.BOOL]="bool";ia[ie.BOOL_VEC2]="bvec2";ia[ie.BOOL_VEC3]="bvec3";ia[ie.BOOL_VEC4]="bvec4";ia[ie.FLOAT_MAT2]="mat2";ia[ie.FLOAT_MAT3]="mat3";ia[ie.FLOAT_MAT4]="mat4";ia[ie.SAMPLER_2D]="sampler2D";ia[ie.SAMPLER_CUBE]="samplerCube";Xt.prototype.getDeclaration=function(e){let t=`uniform ${ia[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var g1e={czm_viewport:new Xt({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Xt({size:1,datatype:ie.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Xt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Xt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Xt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Xt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Xt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Xt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Xt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Xt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new Xt({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Xt({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Xt({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Xt({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Xt({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return M.getTranslation(e.inverseView,b1e)}}),czm_frameNumber:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Xt({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Xt({size:1,datatype:ie.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Xt({size:1,datatype:ie.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Xt({size:1,datatype:ie.SAMPLER_2D,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Xt({size:9,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Xt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Xt({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},dp=g1e;var HVt=T(S(),1);var ZVt=T(S(),1);function y1e(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Bn=y1e;var IVt=T(S(),1);function x1e(){return!0}function _1e(e,t){t=y(t,"This object was destroyed, i.e., destroy() was called.");function n(){}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=x1e}var me=_1e;var wVt=T(S(),1);var vs={UNSIGNED_BYTE:ie.UNSIGNED_BYTE,UNSIGNED_SHORT:ie.UNSIGNED_SHORT,UNSIGNED_INT:ie.UNSIGNED_INT};vs.getSizeInBytes=function(e){switch(e){case vs.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case vs.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case vs.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};vs.fromSizeInBytes=function(e){switch(e){case 2:return vs.UNSIGNED_SHORT;case 4:return vs.UNSIGNED_INT;case 1:return vs.UNSIGNED_BYTE}};vs.validate=function(e){return l(e)&&(e===vs.UNSIGNED_BYTE||e===vs.UNSIGNED_SHORT||e===vs.UNSIGNED_INT)};vs.createTypedArray=function(e,t){return e>=W.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};vs.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=W.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};vs.fromTypedArray=function(e){if(e instanceof Uint8Array)return vs.UNSIGNED_BYTE;if(e instanceof Uint16Array)return vs.UNSIGNED_SHORT;if(e instanceof Uint32Array)return vs.UNSIGNED_INT};var Ae=Object.freeze(vs);var MVt=T(S(),1);var J9={STREAM_DRAW:ie.STREAM_DRAW,STATIC_DRAW:ie.STATIC_DRAW,DYNAMIC_DRAW:ie.DYNAMIC_DRAW,validate:function(e){return e===J9.STREAM_DRAW||e===J9.STATIC_DRAW||e===J9.DYNAMIC_DRAW}},Me=Object.freeze(J9);function cu(e){e=y(e,y.EMPTY_OBJECT);let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=l(i);s&&(o=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:o,r),t.bindBuffer(n,null),this._id=Bn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}cu.createVertexBuffer=function(e){return new cu({context:e.context,bufferTarget:ie.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};cu.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Ae.getSizeInBytes(n),o=new cu({context:t,bufferTarget:ie.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),r=o.sizeInBytes/i;return Object.defineProperties(o,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return r}}}),o};Object.defineProperties(cu.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});cu.prototype._getBuffer=function(){return this._buffer};cu.prototype.copyFromArrayView=function(e,t){t=y(t,0);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};cu.prototype.copyFromBuffer=function(e,t,n,i){let o=ie.COPY_READ_BUFFER,r=ie.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(r,this._buffer),s.bindBuffer(o,e._buffer),s.copyBufferSubData(o,r,t,n,i),s.bindBuffer(r,null),s.bindBuffer(o,null)};cu.prototype.getBufferData=function(e,t,n,i){t=y(t,0),n=y(n,0);let o=this._gl,r=ie.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};cu.prototype.isDestroyed=function(){return!1};cu.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),me(this)};var xt=cu;var dLt=T(S(),1);var sLt=T(S(),1);var eLt=T(S(),1);var JVt=T(S(),1);var S0,Ir={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},gl={};Object.defineProperties(gl,{element:{get:function(){if(gl.supportsFullscreen())return document[Ir.fullscreenElement]}},changeEventName:{get:function(){if(gl.supportsFullscreen())return Ir.fullscreenchange}},errorEventName:{get:function(){if(gl.supportsFullscreen())return Ir.fullscreenerror}},enabled:{get:function(){if(gl.supportsFullscreen())return document[Ir.fullscreenEnabled]}},fullscreen:{get:function(){if(gl.supportsFullscreen())return gl.element!==null}}});gl.supportsFullscreen=function(){if(l(S0))return S0;S0=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return Ir.requestFullscreen="requestFullscreen",Ir.exitFullscreen="exitFullscreen",Ir.fullscreenEnabled="fullscreenEnabled",Ir.fullscreenElement="fullscreenElement",Ir.fullscreenchange="fullscreenchange",Ir.fullscreenerror="fullscreenerror",S0=!0,S0;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,o=t.length;i<o;++i){let r=t[i];n=`${r}RequestFullscreen`,typeof e[n]=="function"?(Ir.requestFullscreen=n,S0=!0):(n=`${r}RequestFullScreen`,typeof e[n]=="function"&&(Ir.requestFullscreen=n,S0=!0)),n=`${r}ExitFullscreen`,typeof document[n]=="function"?Ir.exitFullscreen=n:(n=`${r}CancelFullScreen`,typeof document[n]=="function"&&(Ir.exitFullscreen=n)),n=`${r}FullscreenEnabled`,document[n]!==void 0?Ir.fullscreenEnabled=n:(n=`${r}FullScreenEnabled`,document[n]!==void 0&&(Ir.fullscreenEnabled=n)),n=`${r}FullscreenElement`,document[n]!==void 0?Ir.fullscreenElement=n:(n=`${r}FullScreenElement`,document[n]!==void 0&&(Ir.fullscreenElement=n)),n=`${r}fullscreenchange`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenChange"),Ir.fullscreenchange=n),n=`${r}fullscreenerror`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenError"),Ir.fullscreenerror=n)}return S0};gl.requestFullscreen=function(e,t){gl.supportsFullscreen()&&e[Ir.requestFullscreen]({vrDisplay:t})};gl.exitFullscreen=function(){gl.supportsFullscreen()&&document[Ir.exitFullscreen]()};gl._names=Ir;var pr=gl;var Ja;typeof navigator<"u"?Ja=navigator:Ja={};function Hy(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var Q9,Xq;function nO(){if(!l(Q9)&&(Q9=!1,!nN())){let e=/ Chrome\/([\.0-9]+)/.exec(Ja.userAgent);e!==null&&(Q9=!0,Xq=Hy(e[1]))}return Q9}function T1e(){return nO()&&Xq}var j9,Wq;function Pq(){if(!l(j9)&&(j9=!1,!nO()&&!nN()&&/ Safari\/[\.0-9]+/.test(Ja.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Ja.userAgent);e!==null&&(j9=!0,Wq=Hy(e[1]))}return j9}function S1e(){return Pq()&&Wq}var q9,eO;function vq(){if(!l(q9)){q9=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Ja.userAgent);e!==null&&(q9=!0,eO=Hy(e[1]),eO.isNightly=!!e[2])}return q9}function C1e(){return vq()&&eO}var DL,tO;function wq(){if(!l(DL)){DL=!1;let e;Ja.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Ja.userAgent),e!==null&&(DL=!0,tO=Hy(e[1]))):Ja.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Ja.userAgent),e!==null&&(DL=!0,tO=Hy(e[1])))}return DL}function V1e(){return wq()&&tO}var $9,Fq;function nN(){if(!l($9)){$9=!1;let e=/ Edg\/([\.0-9]+)/.exec(Ja.userAgent);e!==null&&($9=!0,Fq=Hy(e[1]))}return $9}function L1e(){return nN()&&Fq}var eN,iO;function iN(){if(!l(eN)){eN=!1;let e=/Firefox\/([\.0-9]+)/.exec(Ja.userAgent);e!==null&&(eN=!0,iO=Hy(e[1]))}return eN}var j3;function R1e(){return l(j3)||(j3=/Windows/i.test(Ja.appVersion)),j3}var q3;function Z1e(){return l(q3)||(q3=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),q3}function G1e(){return iN()&&iO}var $3;function E1e(){return l($3)||($3=!iN()&&typeof PointerEvent<"u"&&(!l(Ja.pointerEnabled)||Ja.pointerEnabled)),$3}var Aq,tN;function Mq(){if(!l(tN)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;tN=l(t)&&t!=="",tN&&(Aq=t)}return tN}function I1e(){return Mq()?Aq:void 0}function Ic(){return Ic._result}Ic._promise=void 0;Ic._result=void 0;Ic.initialize=function(){return l(Ic._promise)||(Ic._promise=new Promise(e=>{let t=new Image;t.onload=function(){Ic._result=t.width>0&&t.height>0,e(Ic._result)},t.onerror=function(){Ic._result=!1,e(Ic._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),Ic._promise};Object.defineProperties(Ic,{initialized:{get:function(){return l(Ic._result)}}});var XS=[];typeof ArrayBuffer<"u"&&(XS.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&XS.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&XS.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&XS.push(BigInt64Array),typeof BigUint64Array<"u"&&XS.push(BigUint64Array));var lu={isChrome:nO,chromeVersion:T1e,isSafari:Pq,safariVersion:S1e,isWebkit:vq,webkitVersion:C1e,isInternetExplorer:wq,internetExplorerVersion:V1e,isEdge:nN,edgeVersion:L1e,isFirefox:iN,firefoxVersion:G1e,isWindows:R1e,isIPadOrIOS:Z1e,hardwareConcurrency:y(Ja.hardwareConcurrency,3),supportsPointerEvents:E1e,supportsImageRenderingPixelated:Mq,supportsWebP:Ic,imageRenderingValue:I1e,typedArrayTypes:XS};lu.supportsBasis=function(e){return lu.supportsWebAssembly()&&e.context.supportsBasis};lu.supportsFullscreen=function(){return pr.supportsFullscreen()};lu.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};lu.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};lu.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};lu.supportsBigInt=function(){return typeof BigInt<"u"};lu.supportsWebWorkers=function(){return typeof Worker<"u"};lu.supportsWebAssembly=function(){return typeof WebAssembly<"u"};lu.supportsWebgl2=function(e){return e.context.webgl2};lu.supportsEsmWebWorkers=function(){return!iN()||parseInt(iO)>=114};var zt=lu;function oO(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function re(e,t,n,i){this.red=y(e,1),this.green=y(t,1),this.blue=y(n,1),this.alpha=y(i,1)}re.fromCartesian4=function(e,t){return l(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new re(e.x,e.y,e.z,e.w)};re.fromBytes=function(e,t,n,i,o){return e=re.byteToFloat(y(e,255)),t=re.byteToFloat(y(t,255)),n=re.byteToFloat(y(n,255)),i=re.byteToFloat(y(i,255)),l(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new re(e,t,n,i)};re.fromAlpha=function(e,t,n){return l(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new re(e.red,e.green,e.blue,t)};var rO,sO,up;zt.supportsTypedArrays()&&(rO=new ArrayBuffer(4),sO=new Uint32Array(rO),up=new Uint8Array(rO));re.fromRgba=function(e,t){return sO[0]=e,re.fromBytes(up[0],up[1],up[2],up[3],t)};re.fromHsl=function(e,t,n,i,o){e=y(e,0)%1,t=y(t,0),n=y(n,0),i=y(i,1);let r=n,s=n,a=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let d=2*n-c;r=oO(d,c,e+1/3),s=oO(d,c,e),a=oO(d,c,e-1/3)}return l(o)?(o.red=r,o.green=s,o.blue=a,o.alpha=i,o):new re(r,s,a,i)};re.fromRandom=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.red;if(!l(n)){let s=y(e.minimumRed,0),a=y(e.maximumRed,1);n=s+W.nextRandomNumber()*(a-s)}let i=e.green;if(!l(i)){let s=y(e.minimumGreen,0),a=y(e.maximumGreen,1);i=s+W.nextRandomNumber()*(a-s)}let o=e.blue;if(!l(o)){let s=y(e.minimumBlue,0),a=y(e.maximumBlue,1);o=s+W.nextRandomNumber()*(a-s)}let r=e.alpha;if(!l(r)){let s=y(e.minimumAlpha,0),a=y(e.maximumAlpha,1);r=s+W.nextRandomNumber()*(a-s)}return l(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new re(n,i,o,r)};var X1e=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,W1e=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,P1e=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,v1e=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;re.fromCssColorString=function(e,t){l(t)||(t=new re),e=e.trim();let n=re[e.toUpperCase()];if(l(n))return re.clone(n,t),t;let i=X1e.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(y(i[4],"f"),16)/15,t):(i=W1e.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(y(i[4],"ff"),16)/255,t):(i=P1e.exec(e),i!==null?(t.red=parseFloat(i[1])/(i[1].substr(-1)==="%"?100:255),t.green=parseFloat(i[2])/(i[2].substr(-1)==="%"?100:255),t.blue=parseFloat(i[3])/(i[3].substr(-1)==="%"?100:255),t.alpha=parseFloat(y(i[4],"1.0")),t):(i=v1e.exec(e),i!==null?re.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(y(i[4],"1.0")),t):(t=void 0,t))))};re.packedLength=4;re.pack=function(e,t,n){return n=y(n,0),t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};re.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new re),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};re.byteToFloat=function(e){return e/255};re.floatToByte=function(e){return e===1?255:e*256|0};re.clone=function(e,t){if(l(e))return l(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new re(e.red,e.green,e.blue,e.alpha)};re.equals=function(e,t){return e===t||l(e)&&l(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha};re.equalsArray=function(e,t,n){return e.red===t[n]&&e.green===t[n+1]&&e.blue===t[n+2]&&e.alpha===t[n+3]};re.prototype.clone=function(e){return re.clone(this,e)};re.prototype.equals=function(e){return re.equals(this,e)};re.prototype.equalsEpsilon=function(e,t){return this===e||l(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t};re.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};re.prototype.toCssColorString=function(){let e=re.floatToByte(this.red),t=re.floatToByte(this.green),n=re.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};re.prototype.toCssHexString=function(){let e=re.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=re.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=re.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=re.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};re.prototype.toBytes=function(e){let t=re.floatToByte(this.red),n=re.floatToByte(this.green),i=re.floatToByte(this.blue),o=re.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};re.prototype.toRgba=function(){return up[0]=re.floatToByte(this.red),up[1]=re.floatToByte(this.green),up[2]=re.floatToByte(this.blue),up[3]=re.floatToByte(this.alpha),sO[0]};re.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t};re.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t};re.prototype.withAlpha=function(e,t){return re.fromAlpha(this,e,t)};re.add=function(e,t,n){return n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n};re.subtract=function(e,t,n){return n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n};re.multiply=function(e,t,n){return n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n};re.divide=function(e,t,n){return n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n};re.mod=function(e,t,n){return n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n};re.lerp=function(e,t,n,i){return i.red=W.lerp(e.red,t.red,n),i.green=W.lerp(e.green,t.green,n),i.blue=W.lerp(e.blue,t.blue,n),i.alpha=W.lerp(e.alpha,t.alpha,n),i};re.multiplyByScalar=function(e,t,n){return n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n};re.divideByScalar=function(e,t,n){return n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n};re.ALICEBLUE=Object.freeze(re.fromCssColorString("#F0F8FF"));re.ANTIQUEWHITE=Object.freeze(re.fromCssColorString("#FAEBD7"));re.AQUA=Object.freeze(re.fromCssColorString("#00FFFF"));re.AQUAMARINE=Object.freeze(re.fromCssColorString("#7FFFD4"));re.AZURE=Object.freeze(re.fromCssColorString("#F0FFFF"));re.BEIGE=Object.freeze(re.fromCssColorString("#F5F5DC"));re.BISQUE=Object.freeze(re.fromCssColorString("#FFE4C4"));re.BLACK=Object.freeze(re.fromCssColorString("#000000"));re.BLANCHEDALMOND=Object.freeze(re.fromCssColorString("#FFEBCD"));re.BLUE=Object.freeze(re.fromCssColorString("#0000FF"));re.BLUEVIOLET=Object.freeze(re.fromCssColorString("#8A2BE2"));re.BROWN=Object.freeze(re.fromCssColorString("#A52A2A"));re.BURLYWOOD=Object.freeze(re.fromCssColorString("#DEB887"));re.CADETBLUE=Object.freeze(re.fromCssColorString("#5F9EA0"));re.CHARTREUSE=Object.freeze(re.fromCssColorString("#7FFF00"));re.CHOCOLATE=Object.freeze(re.fromCssColorString("#D2691E"));re.CORAL=Object.freeze(re.fromCssColorString("#FF7F50"));re.CORNFLOWERBLUE=Object.freeze(re.fromCssColorString("#6495ED"));re.CORNSILK=Object.freeze(re.fromCssColorString("#FFF8DC"));re.CRIMSON=Object.freeze(re.fromCssColorString("#DC143C"));re.CYAN=Object.freeze(re.fromCssColorString("#00FFFF"));re.DARKBLUE=Object.freeze(re.fromCssColorString("#00008B"));re.DARKCYAN=Object.freeze(re.fromCssColorString("#008B8B"));re.DARKGOLDENROD=Object.freeze(re.fromCssColorString("#B8860B"));re.DARKGRAY=Object.freeze(re.fromCssColorString("#A9A9A9"));re.DARKGREEN=Object.freeze(re.fromCssColorString("#006400"));re.DARKGREY=re.DARKGRAY;re.DARKKHAKI=Object.freeze(re.fromCssColorString("#BDB76B"));re.DARKMAGENTA=Object.freeze(re.fromCssColorString("#8B008B"));re.DARKOLIVEGREEN=Object.freeze(re.fromCssColorString("#556B2F"));re.DARKORANGE=Object.freeze(re.fromCssColorString("#FF8C00"));re.DARKORCHID=Object.freeze(re.fromCssColorString("#9932CC"));re.DARKRED=Object.freeze(re.fromCssColorString("#8B0000"));re.DARKSALMON=Object.freeze(re.fromCssColorString("#E9967A"));re.DARKSEAGREEN=Object.freeze(re.fromCssColorString("#8FBC8F"));re.DARKSLATEBLUE=Object.freeze(re.fromCssColorString("#483D8B"));re.DARKSLATEGRAY=Object.freeze(re.fromCssColorString("#2F4F4F"));re.DARKSLATEGREY=re.DARKSLATEGRAY;re.DARKTURQUOISE=Object.freeze(re.fromCssColorString("#00CED1"));re.DARKVIOLET=Object.freeze(re.fromCssColorString("#9400D3"));re.DEEPPINK=Object.freeze(re.fromCssColorString("#FF1493"));re.DEEPSKYBLUE=Object.freeze(re.fromCssColorString("#00BFFF"));re.DIMGRAY=Object.freeze(re.fromCssColorString("#696969"));re.DIMGREY=re.DIMGRAY;re.DODGERBLUE=Object.freeze(re.fromCssColorString("#1E90FF"));re.FIREBRICK=Object.freeze(re.fromCssColorString("#B22222"));re.FLORALWHITE=Object.freeze(re.fromCssColorString("#FFFAF0"));re.FORESTGREEN=Object.freeze(re.fromCssColorString("#228B22"));re.FUCHSIA=Object.freeze(re.fromCssColorString("#FF00FF"));re.GAINSBORO=Object.freeze(re.fromCssColorString("#DCDCDC"));re.GHOSTWHITE=Object.freeze(re.fromCssColorString("#F8F8FF"));re.GOLD=Object.freeze(re.fromCssColorString("#FFD700"));re.GOLDENROD=Object.freeze(re.fromCssColorString("#DAA520"));re.GRAY=Object.freeze(re.fromCssColorString("#808080"));re.GREEN=Object.freeze(re.fromCssColorString("#008000"));re.GREENYELLOW=Object.freeze(re.fromCssColorString("#ADFF2F"));re.GREY=re.GRAY;re.HONEYDEW=Object.freeze(re.fromCssColorString("#F0FFF0"));re.HOTPINK=Object.freeze(re.fromCssColorString("#FF69B4"));re.INDIANRED=Object.freeze(re.fromCssColorString("#CD5C5C"));re.INDIGO=Object.freeze(re.fromCssColorString("#4B0082"));re.IVORY=Object.freeze(re.fromCssColorString("#FFFFF0"));re.KHAKI=Object.freeze(re.fromCssColorString("#F0E68C"));re.LAVENDER=Object.freeze(re.fromCssColorString("#E6E6FA"));re.LAVENDAR_BLUSH=Object.freeze(re.fromCssColorString("#FFF0F5"));re.LAWNGREEN=Object.freeze(re.fromCssColorString("#7CFC00"));re.LEMONCHIFFON=Object.freeze(re.fromCssColorString("#FFFACD"));re.LIGHTBLUE=Object.freeze(re.fromCssColorString("#ADD8E6"));re.LIGHTCORAL=Object.freeze(re.fromCssColorString("#F08080"));re.LIGHTCYAN=Object.freeze(re.fromCssColorString("#E0FFFF"));re.LIGHTGOLDENRODYELLOW=Object.freeze(re.fromCssColorString("#FAFAD2"));re.LIGHTGRAY=Object.freeze(re.fromCssColorString("#D3D3D3"));re.LIGHTGREEN=Object.freeze(re.fromCssColorString("#90EE90"));re.LIGHTGREY=re.LIGHTGRAY;re.LIGHTPINK=Object.freeze(re.fromCssColorString("#FFB6C1"));re.LIGHTSEAGREEN=Object.freeze(re.fromCssColorString("#20B2AA"));re.LIGHTSKYBLUE=Object.freeze(re.fromCssColorString("#87CEFA"));re.LIGHTSLATEGRAY=Object.freeze(re.fromCssColorString("#778899"));re.LIGHTSLATEGREY=re.LIGHTSLATEGRAY;re.LIGHTSTEELBLUE=Object.freeze(re.fromCssColorString("#B0C4DE"));re.LIGHTYELLOW=Object.freeze(re.fromCssColorString("#FFFFE0"));re.LIME=Object.freeze(re.fromCssColorString("#00FF00"));re.LIMEGREEN=Object.freeze(re.fromCssColorString("#32CD32"));re.LINEN=Object.freeze(re.fromCssColorString("#FAF0E6"));re.MAGENTA=Object.freeze(re.fromCssColorString("#FF00FF"));re.MAROON=Object.freeze(re.fromCssColorString("#800000"));re.MEDIUMAQUAMARINE=Object.freeze(re.fromCssColorString("#66CDAA"));re.MEDIUMBLUE=Object.freeze(re.fromCssColorString("#0000CD"));re.MEDIUMORCHID=Object.freeze(re.fromCssColorString("#BA55D3"));re.MEDIUMPURPLE=Object.freeze(re.fromCssColorString("#9370DB"));re.MEDIUMSEAGREEN=Object.freeze(re.fromCssColorString("#3CB371"));re.MEDIUMSLATEBLUE=Object.freeze(re.fromCssColorString("#7B68EE"));re.MEDIUMSPRINGGREEN=Object.freeze(re.fromCssColorString("#00FA9A"));re.MEDIUMTURQUOISE=Object.freeze(re.fromCssColorString("#48D1CC"));re.MEDIUMVIOLETRED=Object.freeze(re.fromCssColorString("#C71585"));re.MIDNIGHTBLUE=Object.freeze(re.fromCssColorString("#191970"));re.MINTCREAM=Object.freeze(re.fromCssColorString("#F5FFFA"));re.MISTYROSE=Object.freeze(re.fromCssColorString("#FFE4E1"));re.MOCCASIN=Object.freeze(re.fromCssColorString("#FFE4B5"));re.NAVAJOWHITE=Object.freeze(re.fromCssColorString("#FFDEAD"));re.NAVY=Object.freeze(re.fromCssColorString("#000080"));re.OLDLACE=Object.freeze(re.fromCssColorString("#FDF5E6"));re.OLIVE=Object.freeze(re.fromCssColorString("#808000"));re.OLIVEDRAB=Object.freeze(re.fromCssColorString("#6B8E23"));re.ORANGE=Object.freeze(re.fromCssColorString("#FFA500"));re.ORANGERED=Object.freeze(re.fromCssColorString("#FF4500"));re.ORCHID=Object.freeze(re.fromCssColorString("#DA70D6"));re.PALEGOLDENROD=Object.freeze(re.fromCssColorString("#EEE8AA"));re.PALEGREEN=Object.freeze(re.fromCssColorString("#98FB98"));re.PALETURQUOISE=Object.freeze(re.fromCssColorString("#AFEEEE"));re.PALEVIOLETRED=Object.freeze(re.fromCssColorString("#DB7093"));re.PAPAYAWHIP=Object.freeze(re.fromCssColorString("#FFEFD5"));re.PEACHPUFF=Object.freeze(re.fromCssColorString("#FFDAB9"));re.PERU=Object.freeze(re.fromCssColorString("#CD853F"));re.PINK=Object.freeze(re.fromCssColorString("#FFC0CB"));re.PLUM=Object.freeze(re.fromCssColorString("#DDA0DD"));re.POWDERBLUE=Object.freeze(re.fromCssColorString("#B0E0E6"));re.PURPLE=Object.freeze(re.fromCssColorString("#800080"));re.RED=Object.freeze(re.fromCssColorString("#FF0000"));re.ROSYBROWN=Object.freeze(re.fromCssColorString("#BC8F8F"));re.ROYALBLUE=Object.freeze(re.fromCssColorString("#4169E1"));re.SADDLEBROWN=Object.freeze(re.fromCssColorString("#8B4513"));re.SALMON=Object.freeze(re.fromCssColorString("#FA8072"));re.SANDYBROWN=Object.freeze(re.fromCssColorString("#F4A460"));re.SEAGREEN=Object.freeze(re.fromCssColorString("#2E8B57"));re.SEASHELL=Object.freeze(re.fromCssColorString("#FFF5EE"));re.SIENNA=Object.freeze(re.fromCssColorString("#A0522D"));re.SILVER=Object.freeze(re.fromCssColorString("#C0C0C0"));re.SKYBLUE=Object.freeze(re.fromCssColorString("#87CEEB"));re.SLATEBLUE=Object.freeze(re.fromCssColorString("#6A5ACD"));re.SLATEGRAY=Object.freeze(re.fromCssColorString("#708090"));re.SLATEGREY=re.SLATEGRAY;re.SNOW=Object.freeze(re.fromCssColorString("#FFFAFA"));re.SPRINGGREEN=Object.freeze(re.fromCssColorString("#00FF7F"));re.STEELBLUE=Object.freeze(re.fromCssColorString("#4682B4"));re.TAN=Object.freeze(re.fromCssColorString("#D2B48C"));re.TEAL=Object.freeze(re.fromCssColorString("#008080"));re.THISTLE=Object.freeze(re.fromCssColorString("#D8BFD8"));re.TOMATO=Object.freeze(re.fromCssColorString("#FF6347"));re.TURQUOISE=Object.freeze(re.fromCssColorString("#40E0D0"));re.VIOLET=Object.freeze(re.fromCssColorString("#EE82EE"));re.WHEAT=Object.freeze(re.fromCssColorString("#F5DEB3"));re.WHITE=Object.freeze(re.fromCssColorString("#FFFFFF"));re.WHITESMOKE=Object.freeze(re.fromCssColorString("#F5F5F5"));re.YELLOW=Object.freeze(re.fromCssColorString("#FFFF00"));re.YELLOWGREEN=Object.freeze(re.fromCssColorString("#9ACD32"));re.TRANSPARENT=Object.freeze(new re(0,0,0,0));var B=re;function oN(e){e=y(e,y.EMPTY_OBJECT),this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}oN.ALL=Object.freeze(new oN({color:new B(0,0,0,0),depth:1,stencil:0}));oN.prototype.execute=function(e,t){e.clear(this,t)};var ei=oN;var bLt=T(S(),1);var mLt=T(S(),1),w1e={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11},Ge=Object.freeze(w1e);function Nq(e){e=y(e,y.EMPTY_OBJECT),this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=y(e.persists,!1),this.pass=Ge.COMPUTE,this.owner=e.owner}Nq.prototype.execute=function(e){e.execute(this)};var Xc=Nq;var FXt=T(S(),1);var nIt=T(S(),1);var TLt=T(S(),1);function kt(e,t){this.x=y(e,0),this.y=y(t,0)}kt.fromElements=function(e,t,n){return l(n)?(n.x=e,n.y=t,n):new kt(e,t)};kt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t):new kt(e.x,e.y)};kt.fromCartesian3=kt.clone;kt.fromCartesian4=kt.clone;kt.packedLength=2;kt.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n]=e.y,t};kt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new kt),n.x=e[t++],n.y=e[t],n};kt.packArray=function(e,t){let n=e.length,i=n*2;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)kt.pack(e[o],t,o*2);return t};kt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){let o=i/2;t[o]=kt.unpack(e,i,t[o])}return t};kt.fromArray=kt.unpack;kt.maximumComponent=function(e){return Math.max(e.x,e.y)};kt.minimumComponent=function(e){return Math.min(e.x,e.y)};kt.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n};kt.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n};kt.clamp=function(e,t,n,i){let o=W.clamp(e.x,t.x,n.x),r=W.clamp(e.y,t.y,n.y);return i.x=o,i.y=r,i};kt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y};kt.magnitude=function(e){return Math.sqrt(kt.magnitudeSquared(e))};var rN=new kt;kt.distance=function(e,t){return kt.subtract(e,t,rN),kt.magnitude(rN)};kt.distanceSquared=function(e,t){return kt.subtract(e,t,rN),kt.magnitudeSquared(rN)};kt.normalize=function(e,t){let n=kt.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t};kt.dot=function(e,t){return e.x*t.x+e.y*t.y};kt.cross=function(e,t){return e.x*t.y-e.y*t.x};kt.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n};kt.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n};kt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n};kt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n};kt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n};kt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n};kt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t};kt.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var kq=new kt;kt.lerp=function(e,t,n,i){return kt.multiplyByScalar(t,n,kq),i=kt.multiplyByScalar(e,1-n,i),kt.add(kq,i,i)};var Uq=new kt,Dq=new kt;kt.angleBetween=function(e,t){return kt.normalize(e,Uq),kt.normalize(t,Dq),W.acosClamped(kt.dot(Uq,Dq))};var F1e=new kt;kt.mostOrthogonalAxis=function(e,t){let n=kt.normalize(e,F1e);return kt.abs(n,n),n.x<=n.y?t=kt.clone(kt.UNIT_X,t):t=kt.clone(kt.UNIT_Y,t),t};kt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y};kt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]};kt.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&W.equalsEpsilon(e.x,t.x,n,i)&&W.equalsEpsilon(e.y,t.y,n,i)};kt.ZERO=Object.freeze(new kt(0,0));kt.ONE=Object.freeze(new kt(1,1));kt.UNIT_X=Object.freeze(new kt(1,0));kt.UNIT_Y=Object.freeze(new kt(0,1));kt.prototype.clone=function(e){return kt.clone(this,e)};kt.prototype.equals=function(e){return kt.equals(this,e)};kt.prototype.equalsEpsilon=function(e,t,n){return kt.equalsEpsilon(this,e,t,n)};kt.prototype.toString=function(){return`(${this.x}, ${this.y})`};var D=kt;var PLt=T(S(),1);var RLt=T(S(),1);var A1e=new h,M1e=new h;function N1e(e,t,n,i,o){let r=e.x,s=e.y,a=e.z,c=t.x,d=t.y,u=t.z,m=r*r*c*c,p=s*s*d*d,g=a*a*u*u,f=m+p+g,x=Math.sqrt(1/f),_=h.multiplyByScalar(e,x,A1e);if(f<i)return isFinite(x)?h.clone(_,o):void 0;let C=n.x,V=n.y,L=n.z,Z=M1e;Z.x=_.x*C*2,Z.y=_.y*V*2,Z.z=_.z*L*2;let G=(1-x)*h.magnitude(e)/(.5*h.magnitude(Z)),I=0,v,P,w,F,b,R,E,X,A,N,O;do{G-=I,w=1/(1+G*C),F=1/(1+G*V),b=1/(1+G*L),R=w*w,E=F*F,X=b*b,A=R*w,N=E*F,O=X*b,v=m*R+p*E+g*X-1,P=m*A*C+p*N*V+g*O*L;let U=-2*P;I=v/U}while(Math.abs(v)>W.EPSILON12);return l(o)?(o.x=r*w,o.y=s*F,o.z=a*b,o):new h(r*w,s*F,a*b)}var zy=N1e;function Fo(e,t,n){this.longitude=y(e,0),this.latitude=y(t,0),this.height=y(n,0)}Fo.fromRadians=function(e,t,n,i){return n=y(n,0),l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new Fo(e,t,n)};Fo.fromDegrees=function(e,t,n,i){return e=W.toRadians(e),t=W.toRadians(t),Fo.fromRadians(e,t,n,i)};var k1e=new h,U1e=new h,D1e=new h;Fo._ellipsoidOneOverRadii=new h(1/6378137,1/6378137,1/6356752314245179e-9);Fo._ellipsoidOneOverRadiiSquared=new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));Fo._ellipsoidCenterToleranceSquared=W.EPSILON1;Fo.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:Fo._ellipsoidOneOverRadii,o=l(t)?t.oneOverRadiiSquared:Fo._ellipsoidOneOverRadiiSquared,r=l(t)?t._centerToleranceSquared:Fo._ellipsoidCenterToleranceSquared,s=zy(e,i,o,r,U1e);if(!l(s))return;let a=h.multiplyComponents(s,o,k1e);a=h.normalize(a,a);let c=h.subtract(e,s,D1e),d=Math.atan2(a.y,a.x),u=Math.asin(a.z),m=W.sign(h.dot(c,e))*h.magnitude(c);return l(n)?(n.longitude=d,n.latitude=u,n.height=m,n):new Fo(d,u,m)};Fo.toCartesian=function(e,t,n){return h.fromRadians(e.longitude,e.latitude,e.height,t,n)};Fo.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Fo(e.longitude,e.latitude,e.height)};Fo.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};Fo.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};Fo.ZERO=Object.freeze(new Fo(0,0,0));Fo.prototype.clone=function(e){return Fo.clone(this,e)};Fo.prototype.equals=function(e){return Fo.equals(this,e)};Fo.prototype.equalsEpsilon=function(e,t){return Fo.equalsEpsilon(this,e,t)};Fo.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var he=Fo;var DLt=T(S(),1);function Oq(e,t,n,i){t=y(t,0),n=y(n,0),i=y(i,0),e._radii=new h(t,n,i),e._radiiSquared=new h(t*t,n*n,i*i),e._radiiToTheFourth=new h(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new h(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new h(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=W.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function pi(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,Oq(this,e,t,n)}Object.defineProperties(pi.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}});pi.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(h.clone(n,t._radii),h.clone(e._radiiSquared,t._radiiSquared),h.clone(e._radiiToTheFourth,t._radiiToTheFourth),h.clone(e._oneOverRadii,t._oneOverRadii),h.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new pi(n.x,n.y,n.z)};pi.fromCartesian3=function(e,t){return l(t)||(t=new pi),l(e)&&Oq(t,e.x,e.y,e.z),t};pi.WGS84=Object.freeze(new pi(6378137,6378137,6356752314245179e-9));pi.UNIT_SPHERE=Object.freeze(new pi(1,1,1));pi.MOON=Object.freeze(new pi(W.LUNAR_RADIUS,W.LUNAR_RADIUS,W.LUNAR_RADIUS));pi._default=pi.WGS84;Object.defineProperties(pi,{default:{get:function(){return pi._default},set:function(e){pi._default=e,h._ellipsoidRadiiSquared=e.radiiSquared,he._ellipsoidOneOverRadii=e.oneOverRadii,he._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,he._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}});pi.prototype.clone=function(e){return pi.clone(this,e)};pi.packedLength=h.packedLength;pi.pack=function(e,t,n){return n=y(n,0),h.pack(e._radii,t,n),t};pi.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t);return pi.fromCartesian3(i,n)};pi.prototype.geocentricSurfaceNormal=h.normalize;pi.prototype.geodeticSurfaceNormalCartographic=function(e,t){let n=e.longitude,i=e.latitude,o=Math.cos(i),r=o*Math.cos(n),s=o*Math.sin(n),a=Math.sin(i);return l(t)||(t=new h),t.x=r,t.y=s,t.z=a,h.normalize(t,t)};pi.prototype.geodeticSurfaceNormal=function(e,t){if(!h.equalsEpsilon(e,h.ZERO,W.EPSILON14))return l(t)||(t=new h),t=h.multiplyComponents(e,this._oneOverRadiiSquared,t),h.normalize(t,t)};var B1e=new h,O1e=new h;pi.prototype.cartographicToCartesian=function(e,t){let n=B1e,i=O1e;this.geodeticSurfaceNormalCartographic(e,n),h.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(h.dot(n,i));return h.divideByScalar(i,o,i),h.multiplyByScalar(n,e.height,n),l(t)||(t=new h),h.add(i,n,t)};pi.prototype.cartographicArrayToCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var Y1e=new h,H1e=new h,z1e=new h;pi.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,H1e);if(!l(n))return;let i=this.geodeticSurfaceNormal(n,Y1e),o=h.subtract(e,n,z1e),r=Math.atan2(i.y,i.x),s=Math.asin(i.z),a=W.sign(h.dot(o,e))*h.magnitude(o);return l(t)?(t.longitude=r,t.latitude=s,t.height=a,t):new he(r,s,a)};pi.prototype.cartesianArrayToCartographicArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t};pi.prototype.scaleToGeodeticSurface=function(e,t){return zy(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};pi.prototype.scaleToGeocentricSurface=function(e,t){l(t)||(t=new h);let n=e.x,i=e.y,o=e.z,r=this._oneOverRadiiSquared,s=1/Math.sqrt(n*n*r.x+i*i*r.y+o*o*r.z);return h.multiplyByScalar(e,s,t)};pi.prototype.transformPositionToScaledSpace=function(e,t){return l(t)||(t=new h),h.multiplyComponents(e,this._oneOverRadii,t)};pi.prototype.transformPositionFromScaledSpace=function(e,t){return l(t)||(t=new h),h.multiplyComponents(e,this._radii,t)};pi.prototype.equals=function(e){return this===e||l(e)&&h.equals(this._radii,e._radii)};pi.prototype.toString=function(){return this._radii.toString()};pi.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=y(t,0);let i=this._squaredXOverSquaredZ;if(l(n)||(n=new h),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var K1e=new h;pi.prototype.getLocalCurvature=function(e,t){l(t)||(t=new D);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,K1e),i=h.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return D.fromElements(1/i,1/r,t)};var J1e=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],Q1e=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Bq(e,t,n){let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*J1e[s];r+=Q1e[s]*(n(i+a)+n(i-a))}return r*=o,r}pi.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,o=e.north;for(;n<t;)n+=W.TWO_PI;let r=this._radiiSquared,s=r.x,a=r.y,c=r.z,d=s*a;return Bq(i,o,function(u){let m=Math.cos(u),p=Math.sin(u);return Math.cos(u)*Bq(t,n,function(g){let f=Math.cos(g),x=Math.sin(g);return Math.sqrt(d*p*p+c*(a*f*f+s*x*x)*m*m)})})};var ne=pi;var JLt=T(S(),1);function sN(e){this._ellipsoid=y(e,ne.default),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(sN.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});sN.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=e.latitude*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new h(i,o,r)};sN.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=e.y*n,r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new he(i,o,r)};var Ri=sN;var jLt=T(S(),1),j1e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},Jt=Object.freeze(j1e);var HEt=T(S(),1);var GEt=T(S(),1);var XGt=T(S(),1);var $Lt=T(S(),1);function q1e(e,t,n){let i=0,o=e.length-1,r,s;for(;i<=o;){if(r=~~((i+o)/2),s=n(e[r],t),s<0){i=r+1;continue}if(s>0){o=r-1;continue}return r}return~(o+1)}var Eo=q1e;var tRt=T(S(),1);function $1e(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var C0=$1e;var LRt=T(S(),1);var lRt=T(S(),1);var iRt=T(S(),1);function eVe(e){return e%4===0&&e%100!==0||e%400===0}var pm=eVe;var Yq=[31,28,31,30,31,30,31,31,30,31,30,31];function tVe(e,t,n,i,o,r,s,a){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,0),o=y(o,0),r=y(r,0),s=y(s,0),a=y(a,!1),this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=r,this.millisecond=s,this.isLeapSecond=a;function x(){go.typeOf.number.greaterThanOrEquals("Year",e,1),go.typeOf.number.lessThanOrEquals("Year",e,9999),go.typeOf.number.greaterThanOrEquals("Month",t,1),go.typeOf.number.lessThanOrEquals("Month",t,12),go.typeOf.number.greaterThanOrEquals("Day",n,1),go.typeOf.number.lessThanOrEquals("Day",n,31),go.typeOf.number.greaterThanOrEquals("Hour",i,0),go.typeOf.number.lessThanOrEquals("Hour",i,23),go.typeOf.number.greaterThanOrEquals("Minute",o,0),go.typeOf.number.lessThanOrEquals("Minute",o,59),go.typeOf.bool("IsLeapSecond",a),go.typeOf.number.greaterThanOrEquals("Second",r,0),go.typeOf.number.lessThanOrEquals("Second",r,a?60:59),go.typeOf.number.greaterThanOrEquals("Millisecond",s,0),go.typeOf.number.lessThan("Millisecond",s,1e3)}function _(){let C=t===2&&pm(e)?Yq[t-1]+1:Yq[t-1];if(n>C)throw new pe("Month and Day represents invalid date")}}var mp=tVe;var uRt=T(S(),1);function nVe(e,t){this.julianDate=e,this.offset=t}var Bi=nVe;var hRt=T(S(),1),iVe={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},zn=Object.freeze(iVe);var pRt=T(S(),1),oVe={UTC:0,TAI:1},Hn=Object.freeze(oVe);var zq=new mp,aO=[31,28,31,30,31,30,31,31,30,31,30,31],cO=29;function lO(e,t){return vt.compare(e.julianDate,t.julianDate)}var WS=new Bi;function cN(e){WS.julianDate=e;let t=vt.leapSeconds,n=Eo(t,WS,lO);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&vt.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),vt.addSeconds(e,i,e)}function Hq(e,t){WS.julianDate=e;let n=vt.leapSeconds,i=Eo(n,WS,lO);if(i<0&&(i=~i),i===0)return vt.addSeconds(e,-n[0].offset,t);if(i>=n.length)return vt.addSeconds(e,-n[i-1].offset,t);let o=vt.secondsDifference(n[i].julianDate,e);if(o===0)return vt.addSeconds(e,-n[i].offset,t);if(!(o<=1))return vt.addSeconds(e,-n[--i].offset,t)}function V0(e,t,n){let i=t/zn.SECONDS_PER_DAY|0;return e+=i,t-=zn.SECONDS_PER_DAY*i,t<0&&(e--,t+=zn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function dO(e,t,n,i,o,r,s){let a=(t-14)/12|0,c=e+4800+a,d=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let u=r+(i*zn.SECONDS_PER_HOUR+o*zn.SECONDS_PER_MINUTE+s*zn.SECONDS_PER_MILLISECOND);return u>=43200&&(d-=1),[d,u]}var rVe=/^(\d{4})$/,sVe=/^(\d{4})-(\d{2})$/,aVe=/^(\d{4})-?(\d{3})$/,cVe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,lVe=/^(\d{4})-?(\d{2})-?(\d{2})$/,uO=/([Z+\-])?(\d{2})?:?(\d{2})?$/,dVe=/^(\d{2})(\.\d+)?/.source+uO.source,uVe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+uO.source,mVe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+uO.source;function vt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=y(e,0),t=y(t,0),n=y(n,Hn.UTC);let i=e|0;t=t+(e-i)*zn.SECONDS_PER_DAY,V0(i,t,this),n===Hn.UTC&&cN(this)}vt.fromGregorianDate=function(e,t){let n=dO(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(V0(n[0],n[1],t),cN(t),t):new vt(n[0],n[1],Hn.UTC)};vt.fromDate=function(e,t){let n=dO(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(V0(n[0],n[1],t),cN(t),t):new vt(n[0],n[1],Hn.UTC)};vt.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,c=0,d=0,u=n[0],m=n[1],p,g;if(n=u.match(lVe),n!==null)i=+n[1],o=+n[2],r=+n[3];else if(n=u.match(sVe),n!==null)i=+n[1],o=+n[2];else if(n=u.match(rVe),n!==null)i=+n[1];else{let C;if(n=u.match(aVe),n!==null)i=+n[1],C=+n[2],g=pm(i);else if(n=u.match(cVe),n!==null){i=+n[1];let V=+n[2],L=+n[3]||0,Z=new Date(Date.UTC(i,0,4));C=V*7+L-Z.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(C),o=p.getUTCMonth()+1,r=p.getUTCDate()}g=pm(i);let f;if(l(m)){n=m.match(mVe),n!==null?(s=+n[1],a=+n[2],c=+n[3],d=+(n[4]||0)*1e3,f=5):(n=m.match(uVe),n!==null?(s=+n[1],a=+n[2],c=+(n[3]||0)*60,f=4):(n=m.match(dVe),n!==null&&(s=+n[1],a=+(n[2]||0)*60,f=3)));let C=n[f],V=+n[f+1],L=+(n[f+2]||0);switch(C){case"+":s=s-V,a=a-L;break;case"-":s=s+V,a=a+L;break;case"Z":break;default:a=a+new Date(Date.UTC(i,o-1,r,s,a)).getTimezoneOffset();break}}let x=c===60;for(x&&c--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(p=g&&o===2?cO:aO[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=g&&o===2?cO:aO[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=g&&o===2?cO:aO[o-1],r+=p;let _=dO(i,o,r,s,a,c,d);return l(t)?(V0(_[0],_[1],t),cN(t)):t=new vt(_[0],_[1],Hn.UTC),x&&vt.addSeconds(t,1,t),t};vt.now=function(e){return vt.fromDate(new Date,e)};var aN=new vt(0,0,Hn.TAI);vt.toGregorianDate=function(e,t){let n=!1,i=Hq(e,aN);l(i)||(vt.addSeconds(e,-1,aN),i=Hq(aN,aN),n=!0);let o=i.dayNumber,r=i.secondsOfDay;r>=43200&&(o+=1);let s=o+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let c=4e3*(s+1)/1461001|0;s=s-(1461*c/4|0)+31|0;let d=80*s/2447|0,u=s-(2447*d/80|0)|0;s=d/11|0;let m=d+2-12*s|0,p=100*(a-49)+c+s|0,g=r/zn.SECONDS_PER_HOUR|0,f=r-g*zn.SECONDS_PER_HOUR,x=f/zn.SECONDS_PER_MINUTE|0;f=f-x*zn.SECONDS_PER_MINUTE;let _=f|0,C=(f-_)/zn.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),n&&(_+=1),l(t)?(t.year=p,t.month=m,t.day=u,t.hour=g,t.minute=x,t.second=_,t.millisecond=C,t.isLeapSecond=n,t):new mp(p,m,u,g,x,_,C,n)};vt.toDate=function(e){let t=vt.toGregorianDate(e,zq),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};vt.toIso8601=function(e,t){let n=vt.toGregorianDate(e,zq),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,c=n.second,d=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&c===0&&d===0&&(i=9999,o=12,r=31,s=24);let u;return!l(t)&&d!==0?(u=(d*.01).toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${u}Z`):!l(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(u=(d*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${u}Z`)};vt.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new vt(e.dayNumber,e.secondsOfDay,Hn.TAI)};vt.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};vt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};vt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(vt.secondsDifference(e,t))<=n};vt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/zn.SECONDS_PER_DAY};vt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*zn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};vt.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/zn.SECONDS_PER_DAY;return n+i};vt.computeTaiMinusUtc=function(e){WS.julianDate=e;let t=vt.leapSeconds,n=Eo(t,WS,lO);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};vt.addSeconds=function(e,t,n){return V0(e.dayNumber,e.secondsOfDay+t,n)};vt.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*zn.SECONDS_PER_MINUTE;return V0(e.dayNumber,i,n)};vt.addHours=function(e,t,n){let i=e.secondsOfDay+t*zn.SECONDS_PER_HOUR;return V0(e.dayNumber,i,n)};vt.addDays=function(e,t,n){let i=e.dayNumber+t;return V0(i,e.secondsOfDay,n)};vt.lessThan=function(e,t){return vt.compare(e,t)<0};vt.lessThanOrEquals=function(e,t){return vt.compare(e,t)<=0};vt.greaterThan=function(e,t){return vt.compare(e,t)>0};vt.greaterThanOrEquals=function(e,t){return vt.compare(e,t)>=0};vt.prototype.clone=function(e){return vt.clone(this,e)};vt.prototype.equals=function(e){return vt.equals(this,e)};vt.prototype.equalsEpsilon=function(e,t){return vt.equalsEpsilon(this,e,t)};vt.prototype.toString=function(){return vt.toIso8601(this)};vt.leapSeconds=[new Bi(new vt(2441317,43210,Hn.TAI),10),new Bi(new vt(2441499,43211,Hn.TAI),11),new Bi(new vt(2441683,43212,Hn.TAI),12),new Bi(new vt(2442048,43213,Hn.TAI),13),new Bi(new vt(2442413,43214,Hn.TAI),14),new Bi(new vt(2442778,43215,Hn.TAI),15),new Bi(new vt(2443144,43216,Hn.TAI),16),new Bi(new vt(2443509,43217,Hn.TAI),17),new Bi(new vt(2443874,43218,Hn.TAI),18),new Bi(new vt(2444239,43219,Hn.TAI),19),new Bi(new vt(2444786,43220,Hn.TAI),20),new Bi(new vt(2445151,43221,Hn.TAI),21),new Bi(new vt(2445516,43222,Hn.TAI),22),new Bi(new vt(2446247,43223,Hn.TAI),23),new Bi(new vt(2447161,43224,Hn.TAI),24),new Bi(new vt(2447892,43225,Hn.TAI),25),new Bi(new vt(2448257,43226,Hn.TAI),26),new Bi(new vt(2448804,43227,Hn.TAI),27),new Bi(new vt(2449169,43228,Hn.TAI),28),new Bi(new vt(2449534,43229,Hn.TAI),29),new Bi(new vt(2450083,43230,Hn.TAI),30),new Bi(new vt(2450630,43231,Hn.TAI),31),new Bi(new vt(2451179,43232,Hn.TAI),32),new Bi(new vt(2453736,43233,Hn.TAI),33),new Bi(new vt(2454832,43234,Hn.TAI),34),new Bi(new vt(2456109,43235,Hn.TAI),35),new Bi(new vt(2457204,43236,Hn.TAI),36),new Bi(new vt(2457754,43237,Hn.TAI),37)];var j=vt;var xGt=T(S(),1),m$=T(id(),1);var XRt=T(S(),1);function hVe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var BL=hVe;var vRt=T(S(),1);function e$(e,t){if(e===null||typeof e!="object")return e;t=y(t,!1);let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=e$(o,t)),n[i]=o}return n}var Ye=e$;var MRt=T(S(),1);function t$(e,t,n){n=y(n,!1);let i={},o=l(e),r=l(t),s,a,c;if(o)for(s in e)e.hasOwnProperty(s)&&(a=e[s],r&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=t$(a,c,n):i[s]=a):i[s]=a);if(r)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var Tt=t$;var kRt=T(S(),1);function fVe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var yl=fVe;var ORt=T(S(),1),n$=T(id(),1);function mO(e,t){let n;return typeof document<"u"&&(n=document),mO._implementation(e,t,n)}mO._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=y(n.baseURI,n.location.href)}let i=new n$.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var kh=mO;var HRt=T(S(),1),i$=T(id(),1);function pVe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new i$.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var OL=pVe;var KRt=T(S(),1),o$=T(id(),1);function bVe(e){let t=new o$.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var Ky=bVe;var jRt=T(S(),1);var r$={};function gVe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=r$[t];l(i)||(i={},r$[t]=i);let o=i[n];if(!l(o)){let r=document.createElement("canvas");r.width=t,r.height=n,o=r.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[n]=o}return o.drawImage(e,0,0,t,n),o.getImageData(0,0,t,n).data}var bm=gVe;var $Rt=T(S(),1);var yVe=/^blob:/i;function xVe(e){return yVe.test(e)}var Jy=xVe;var nZt=T(S(),1);var Uh;function _Ve(e){l(Uh)||(Uh=document.createElement("a")),Uh.href=window.location.href;let t=Uh.host,n=Uh.protocol;return Uh.href=e,Uh.href=Uh.href,n!==Uh.protocol||t!==Uh.host}var L0=_Ve;var oZt=T(S(),1);var TVe=/^data:/i;function SVe(e){return TVe.test(e)}var hp=SVe;var sZt=T(S(),1);function CVe(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let o=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,o.removeChild(t),n()},t.onerror=function(r){i(r)},o.appendChild(t)})}var Qy=CVe;var cZt=T(S(),1);function VVe(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r)t+=`${o+encodeURIComponent(i[r])}&`;else t+=`${o+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var jy=VVe;var uZt=T(S(),1);function LVe(e){let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,o=n.length;i<o;++i){let r=n[i].split("="),s=decodeURIComponent(r[0]),a=r[1];l(a)?a=decodeURIComponent(a):a="";let c=t[s];typeof c=="string"?t[s]=[c,a]:Array.isArray(c)?c.push(a):t[s]=a}return t}var od=LVe;var TZt=T(S(),1);var hZt=T(S(),1),RVe={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},jn=Object.freeze(RVe);var pZt=T(S(),1),ZVe={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},cs=Object.freeze(ZVe);function mN(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.throttleByServer,!1),n=y(e.throttle,!1);this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=y(e.priority,0),this.throttle=n,this.throttleByServer=t,this.type=y(e.type,cs.OTHER),this.serverKey=e.serverKey,this.state=jn.UNISSUED,this.deferred=void 0,this.cancelled=!1}mN.prototype.cancel=function(){this.cancelled=!0};mN.prototype.clone=function(e){return l(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=jn.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new mN(this)};var Ho=mN;var ZZt=T(S(),1);var CZt=T(S(),1);function GVe(e){let t={};if(!e)return t;let n=e.split(`\r
  80. `);for(let i=0;i<n.length;++i){let o=n[i],r=o.indexOf(": ");if(r>0){let s=o.substring(0,r),a=o.substring(r+2);t[s]=a}}return t}var YL=GVe;function s$(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=YL(this.responseHeaders))}s$.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var Dh=s$;var OZt=T(S(),1),hN=T(id(),1);var IZt=T(S(),1);function HL(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(HL.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});HL.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};HL.prototype.removeEventListener=function(e,t){let n=this._listeners,i=this._scopes,o=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&i[r]===t){o=r;break}return o!==-1?(this._insideRaiseEvent?(this._toRemove.push(o),n[o]=void 0,i[o]=void 0):(n.splice(o,1),i.splice(o,1)),!0):!1};function EVe(e,t){return t-e}HL.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,i=t.length;for(e=0;e<i;e++){let r=t[e];l(r)&&t[e].apply(n[e],arguments)}let o=this._toRemove;if(i=o.length,i>0){for(o.sort(EVe),e=0;e<i;e++){let r=o[e];t.splice(r,1),n.splice(r,1)}o.length=0}this._insideRaiseEvent=!1};var be=HL;var vZt=T(S(),1);function qy(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(qy.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){let t=this._length;if(e<t){let n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function hO(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}qy.prototype.reserve=function(e){e=y(e,this._length),this._array.length=e};qy.prototype.heapify=function(e){e=y(e,0);let t=this._length,n=this._comparator,i=this._array,o=-1,r=!0;for(;r;){let s=2*(e+1),a=s-1;a<t&&n(i[a],i[e])<0?o=a:o=e,s<t&&n(i[s],i[o])<0&&(o=s),o!==e?(hO(i,o,e),e=o):r=!1}};qy.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};qy.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,o=this._length++;for(o<t.length?t[o]=e:t.push(e);o!==0;){let s=Math.floor((o-1)/2);if(n(t[o],t[s])<0)hO(t,o,s),o=s;else break}let r;return l(i)&&this._length>i&&(r=t[i],this._length=i),r};qy.prototype.pop=function(e){if(e=y(e,0),this._length===0)return;let t=this._array,n=t[e];return hO(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var zL=qy;function IVe(e,t){return e.priority-t.priority}var qi={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},wS=20,Qa=new zL({comparator:IVe});Qa.maximumLength=wS;Qa.reserve(wS);var Bh=[],fp={},XVe=typeof document<"u"?new hN.default(document.location.href):new hN.default,fN=new be;function zo(){}zo.maximumRequests=50;zo.maximumRequestsPerServer=18;zo.requestsByServer={};zo.throttleRequests=!0;zo.debugShowStatistics=!1;zo.requestCompletedEvent=fN;Object.defineProperties(zo,{statistics:{get:function(){return qi}},priorityHeapLength:{get:function(){return wS},set:function(e){if(e<wS)for(;Qa.length>e;){let t=Qa.pop();$y(t)}wS=e,Qa.maximumLength=e,Qa.reserve(e)}}});function a$(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}zo.serverHasOpenSlots=function(e,t){t=y(t,1);let n=y(zo.requestsByServer[e],zo.maximumRequestsPerServer);return fp[e]+t<=n};zo.heapHasOpenSlots=function(e){return Qa.length+e<=wS};function c$(e){return e.state===jn.UNISSUED&&(e.state=jn.ISSUED,e.deferred=yl()),e.deferred.promise}function WVe(e){return function(t){if(e.state===jn.CANCELLED)return;let n=e.deferred;--qi.numberOfActiveRequests,--fp[e.serverKey],fN.raiseEvent(),e.state=jn.RECEIVED,e.deferred=void 0,n.resolve(t)}}function PVe(e){return function(t){e.state!==jn.CANCELLED&&(++qi.numberOfFailedRequests,--qi.numberOfActiveRequests,--fp[e.serverKey],fN.raiseEvent(t),e.state=jn.FAILED,e.deferred.reject(t))}}function l$(e){let t=c$(e);return e.state=jn.ACTIVE,Bh.push(e),++qi.numberOfActiveRequests,++qi.numberOfActiveRequestsEver,++fp[e.serverKey],e.requestFunction().then(WVe(e)).catch(PVe(e)),t}function $y(e){let t=e.state===jn.ACTIVE;if(e.state=jn.CANCELLED,++qi.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--qi.numberOfActiveRequests,--fp[e.serverKey],++qi.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}zo.update=function(){let e,t,n=0,i=Bh.length;for(e=0;e<i;++e){if(t=Bh[e],t.cancelled&&$y(t),t.state!==jn.ACTIVE){++n;continue}n>0&&(Bh[e-n]=t)}Bh.length-=n;let o=Qa.internalArray,r=Qa.length;for(e=0;e<r;++e)a$(o[e]);Qa.resort();let s=Math.max(zo.maximumRequests-Bh.length,0),a=0;for(;a<s&&Qa.length>0;){if(t=Qa.pop(),t.cancelled){$y(t);continue}if(t.throttleByServer&&!zo.serverHasOpenSlots(t.serverKey)){$y(t);continue}l$(t),++a}vVe()};zo.getServerKey=function(e){let t=new hN.default(e);t.scheme()===""&&(t=t.absoluteTo(XVe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=fp[n];return l(i)||(fp[n]=0),n};zo.request=function(e){if(hp(e.url)||Jy(e.url))return fN.raiseEvent(),e.state=jn.RECEIVED,e.requestFunction();if(++qi.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=zo.getServerKey(e.url)),zo.throttleRequests&&e.throttleByServer&&!zo.serverHasOpenSlots(e.serverKey))return;if(!zo.throttleRequests||!e.throttle)return l$(e);if(Bh.length>=zo.maximumRequests)return;a$(e);let t=Qa.insert(e);if(l(t)){if(t===e)return;$y(t)}return c$(e)};function vVe(){zo.debugShowStatistics&&(qi.numberOfActiveRequests===0&&qi.lastNumberOfActiveRequests>0&&(qi.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${qi.numberOfAttemptedRequests}`),qi.numberOfAttemptedRequests=0),qi.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${qi.numberOfCancelledRequests}`),qi.numberOfCancelledRequests=0),qi.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${qi.numberOfCancelledActiveRequests}`),qi.numberOfCancelledActiveRequests=0),qi.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${qi.numberOfFailedRequests}`),qi.numberOfFailedRequests=0)),qi.lastNumberOfActiveRequests=qi.numberOfActiveRequests)}zo.clearForSpecs=function(){for(;Qa.length>0;){let t=Qa.pop();$y(t)}let e=Bh.length;for(let t=0;t<e;++t)$y(Bh[t]);Bh.length=0,fp={},qi.numberOfAttemptedRequests=0,qi.numberOfActiveRequests=0,qi.numberOfCancelledRequests=0,qi.numberOfCancelledActiveRequests=0,qi.numberOfFailedRequests=0,qi.numberOfActiveRequestsEver=0,qi.lastNumberOfActiveRequests=0};zo.numberOfActiveRequestsByServer=function(e){return fp[e]};zo.requestHeap=Qa;var ja=zo;var zZt=T(S(),1),d$=T(id(),1);var KL={},FS={};KL.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(FS[n])||(FS[n]=!0)};KL.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(FS[n])&&delete FS[n]};function wVe(e){let t=new d$.default(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}KL.contains=function(e){let t=wVe(e);return!!(l(t)&&l(FS[t]))};KL.clear=function(){FS={}};var AS=KL;var h$=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function Wt(e){e=y(e,y.EMPTY_OBJECT),typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=Oh(e.templateValues,{}),this._queryParameters=Oh(e.queryParameters,{}),this.headers=Oh(e.headers,{}),this.request=y(e.request,new Ho),this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=y(e.retryAttempts,0),this._retryCount=0,y(e.parseUrl,!0)?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Oh(e,t){return l(e)?Ye(e):t}Wt.createIfNeeded=function(e){return e instanceof Wt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new Wt({url:e})};var MS;Wt.supportsImageBitmapOptions=function(){return l(MS)?MS:typeof createImageBitmap!="function"?(MS=Promise.resolve(!1),MS):(MS=Wt.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(t){let n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){let n=bm(t[0]),i=bm(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),MS)};Object.defineProperties(Wt,{isBlobSupported:{get:function(){return h$}}});Object.defineProperties(Wt.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 Ky(this._url)}},isDataUri:{get:function(){return hp(this._url)}},isBlobUri:{get:function(){return Jy(this._url)}},isCrossOriginUrl:{get:function(){return L0(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});Wt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Wt.prototype.parseUrl=function(e,t,n,i){let o=new m$.default(e),r=FVe(o.query());this._queryParameters=t?bN(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(kh(i))),this._url=o.toString()};function FVe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:od(e)}function bN(e,t,n){if(!n)return Tt(e,t);let i=Ye(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];l(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}Wt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${AVe(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(o,r){let s=i[r];return l(s)?encodeURIComponent(s):o})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function AVe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${jy(e)}`}Wt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=bN(this._queryParameters,e,!1):this._queryParameters=bN(e,this._queryParameters,!1)};Wt.prototype.appendQueryParameters=function(e){this._queryParameters=bN(e,this._queryParameters,!0)};Wt.prototype.setTemplateValues=function(e,t){t?this._templateValues=Tt(this._templateValues,e):this._templateValues=Tt(e,this._templateValues)};Wt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=y(e.preserveQueryParameters,!1);t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=Tt(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=Tt(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=Tt(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};Wt.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};Wt.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Ye(this._queryParameters),e._templateValues=Ye(this._templateValues),e.headers=Ye(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new Wt({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:l(this.credits)?this.credits.slice():void 0})};Wt.prototype.getBaseUri=function(e){return OL(this.getUrlComponent(e),e)};Wt.prototype.appendForwardSlash=function(){this._url=BL(this._url)};Wt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};Wt.fetchArrayBuffer=function(e){return new Wt(e).fetchArrayBuffer()};Wt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};Wt.fetchBlob=function(e){return new Wt(e).fetchBlob()};Wt.prototype.fetchImage=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.preferImageBitmap,!1),n=y(e.preferBlob,!1),i=y(e.flipY,!1),o=y(e.skipColorSpaceConversion,!1);if(pO(this.request),!h$||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return fO({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let s,a,c,d;return Wt.supportsImageBitmapOptions().then(function(u){return s=u,a=s&&t,r}).then(function(u){if(!l(u))return;if(d=u,a)return Wt.createImageBitmapFromBlob(u,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let m=window.URL.createObjectURL(u);return c=new Wt({url:m}),fO({resource:c,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(u){if(l(u))return u.blob=d,a||window.URL.revokeObjectURL(c.url),u}).catch(function(u){return l(c)&&window.URL.revokeObjectURL(c.url),u.blob=d,Promise.reject(u)})};function fO(e){let t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=yl();return Wt._Implementations.createImage(r,a,c,n,i,o),c.promise};let s=ja.request(r);if(l(s))return s.catch(function(a){return r.state!==jn.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(r.state=jn.UNISSUED,r.deferred=void 0,fO({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}Wt.fetchImage=function(e){return new Wt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};Wt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};Wt.fetchText=function(e){return new Wt(e).fetchText()};Wt.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};Wt.fetchJson=function(e){return new Wt(e).fetchJson()};Wt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};Wt.fetchXML=function(e){return new Wt(e).fetchXML()};Wt.prototype.fetchJsonp=function(e){e=y(e,"callback"),pO(this.request);let t;do t=`loadJsonp${W.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return f$(this,e,t)};function f$(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let o=e.request,r=e.url;o.url=r,o.requestFunction=function(){let a=yl();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},Wt._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=ja.request(o);if(l(s))return s.catch(function(a){return o.state!==jn.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(o.state=jn.UNISSUED,o.deferred=void 0,f$(e,t,n)):Promise.reject(a)})})}Wt.fetchJsonp=function(e){return new Wt(e).fetchJsonp(e.callbackParameterName)};Wt.prototype._makeRequest=function(e){let t=this;pO(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=Tt(e.headers,t.headers),a=e.overrideMimeType,c=e.method,d=e.data,u=yl(),m=Wt._Implementations.loadWithXhr(i,r,c,d,s,u,a);return l(m)&&l(m.abort)&&(n.cancelFunction=function(){m.abort()}),u.promise};let o=ja.request(n);if(l(o))return o.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==jn.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=jn.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function pO(e){if(e.state===jn.ISSUED||e.state===jn.ACTIVE)throw new de("The Resource is already being fetched.");e.state=jn.UNISSUED,e.deferred=void 0}var MVe=/^data:(.*?)(;base64)?,(.*)$/;function pN(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function u$(e,t){let n=pN(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r);return i}function NVe(e,t){t=y(t,"");let n=e[1],i=!!e[2],o=e[3],r,s;switch(t){case"":case"text":return pN(i,o);case"arraybuffer":return u$(i,o);case"blob":return r=u$(i,o),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(pN(i,o),n);case"json":return JSON.parse(pN(i,o));default:}}Wt.prototype.fetch=function(e){return e=Oh(e,{}),e.method="GET",this._makeRequest(e)};Wt.fetch=function(e){return new Wt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Wt.prototype.delete=function(e){return e=Oh(e,{}),e.method="DELETE",this._makeRequest(e)};Wt.delete=function(e){return new Wt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};Wt.prototype.head=function(e){return e=Oh(e,{}),e.method="HEAD",this._makeRequest(e)};Wt.head=function(e){return new Wt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Wt.prototype.options=function(e){return e=Oh(e,{}),e.method="OPTIONS",this._makeRequest(e)};Wt.options=function(e){return new Wt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Wt.prototype.post=function(e,t){return go.defined("data",e),t=Oh(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};Wt.post=function(e){return new Wt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Wt.prototype.put=function(e,t){return go.defined("data",e),t=Oh(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};Wt.put=function(e){return new Wt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Wt.prototype.patch=function(e,t){return go.defined("data",e),t=Oh(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};Wt.patch=function(e){return new Wt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Wt._Implementations={};Wt._Implementations.loadImageElement=function(e,t,n){let i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(o){n.reject(o)},t&&(AS.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};Wt._Implementations.createImage=function(e,t,n,i,o,r){let s=e.url;Wt.supportsImageBitmapOptions().then(function(a){if(!(a&&r)){Wt._Implementations.loadImageElement(s,t,n);return}let c="blob",d="GET",u=yl(),m=Wt._Implementations.loadWithXhr(s,c,d,void 0,void 0,u,void 0,void 0,void 0);return l(m)&&l(m.abort)&&(e.cancelFunction=function(){m.abort()}),u.promise.then(function(p){if(!l(p)){n.reject(new de(`Successfully retrieved ${s} but it contained no content.`));return}return Wt.createImageBitmapFromBlob(p,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(p){n.resolve(p)})}).catch(function(a){n.reject(a)})};Wt.createImageBitmapFromBlob=function(e,t){return go.defined("options",t),go.typeOf.bool("options.flipY",t.flipY),go.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),go.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function kVe(e,t,n,i,o,r,s){fetch(e,{method:n,headers:o}).then(async a=>{if(!a.ok){let c={};a.headers.forEach((d,u)=>{c[u]=d}),r.reject(new Dh(a.status,a,c));return}switch(t){case"text":r.resolve(a.text());break;case"json":r.resolve(a.json());break;default:r.resolve(new Uint8Array(await a.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new Dh)})}var UVe=typeof XMLHttpRequest>"u";Wt._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=MVe.exec(e);if(a!==null){r.resolve(NVe(a,t));return}if(UVe){kVe(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(AS.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(o))for(let u in o)o.hasOwnProperty(u)&&c.setRequestHeader(u,o[u]);l(t)&&(c.responseType=t);let d=!1;return typeof e=="string"&&(d=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(d&&c.status===0)){r.reject(new Dh(c.status,c.response,c.getAllResponseHeaders()));return}let u=c.response,m=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),f={};g.forEach(function(x){let _=x.split(": "),C=_.shift();f[C]=_.join(": ")}),r.resolve(f);return}if(c.status===204)r.resolve(void 0);else if(l(u)&&(!l(t)||m===t))r.resolve(u);else if(t==="json"&&typeof u=="string")try{r.resolve(JSON.parse(u))}catch(p){r.reject(p)}else(m===""||m==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(m===""||m==="text")&&l(c.responseText)?r.resolve(c.responseText):r.reject(new de("Invalid XMLHttpRequest response type."))},c.onerror=function(u){r.reject(new Dh)},c.send(i),c};Wt._Implementations.loadAndExecuteScript=function(e,t,n){return Qy(e,t).catch(function(i){n.reject(i)})};Wt._DefaultImplementations={};Wt._DefaultImplementations.createImage=Wt._Implementations.createImage;Wt._DefaultImplementations.loadWithXhr=Wt._Implementations.loadWithXhr;Wt._DefaultImplementations.loadAndExecuteScript=Wt._Implementations.loadAndExecuteScript;Wt.DEFAULT=Object.freeze(new Wt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Ee=Wt;function QL(e){e=y(e,y.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=y(e.addNewLeapSeconds,!0),l(e.data)?p$(this,e.data):p$(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}QL.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Ee.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new de(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new QL({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};QL.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new C0(0,0,0,0,0),t}});QL.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new C0(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,o=0,r=0;if(l(i)){let a=n[i],c=n[i+1],d=j.lessThanOrEquals(a,e),u=!l(c),m=u||j.greaterThanOrEquals(c,e);if(d&&m)return o=i,!u&&c.equals(e)&&++o,r=o+1,g$(this,n,this._samples,e,o,r,t),t}let s=Eo(n,e,j.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,o=s,r=s):(r=~s,o=r-1,o<0&&(o=0)),this._lastIndex=o,g$(this,n,this._samples,e,o,r,t),t};function DVe(e,t){return j.compare(e.julianDate,t)}function p$(e,t){if(!l(t.columnNames))throw new de("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new de("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),o=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||o<0||r<0||s<0||a<0||c<0)throw new de("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let d=e._samples=t.samples,u=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let m,p=e._addNewLeapSeconds;for(let g=0,f=d.length;g<f;g+=e._columnCount){let x=d[g+n],_=d[g+c],C=x+zn.MODIFIED_JULIAN_DATE_DIFFERENCE,V=new j(C,_,Hn.TAI);if(u.push(V),p){if(_!==m&&l(m)){let L=j.leapSeconds,Z=Eo(L,V,DVe);if(Z<0){let G=new Bi(V,_);L.splice(~Z,0,G)}}m=_}}}function b$(e,t,n,i,o){let r=n*i;o.xPoleWander=t[r+e._xPoleWanderRadiansColumn],o.yPoleWander=t[r+e._yPoleWanderRadiansColumn],o.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function JL(e,t,n){return t+e*(n-t)}function g$(e,t,n,i,o,r,s){let a=e._columnCount;if(r>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[o],d=t[r];if(c.equals(d)||i.equals(c))return b$(e,n,o,a,s),s;if(i.equals(d))return b$(e,n,r,a,s),s;let u=j.secondsDifference(i,c)/j.secondsDifference(d,c),m=o*a,p=r*a,g=n[m+e._ut1MinusUtcSecondsColumn],f=n[p+e._ut1MinusUtcSecondsColumn],x=f-g;if(x>.5||x<-.5){let _=n[m+e._taiMinusUtcSecondsColumn],C=n[p+e._taiMinusUtcSecondsColumn];_!==C&&(d.equals(i)?g=f:f-=C-_)}return s.xPoleWander=JL(u,n[m+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=JL(u,n[m+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=JL(u,n[m+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=JL(u,n[m+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=JL(u,g,f),s}var jL=QL;var FGt=T(S(),1);function qa(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.roll=y(n,0)}qa.fromQuaternion=function(e,t){l(t)||(t=new qa);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),r=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,r),t.roll=Math.atan2(o,i),t.pitch=-W.asinClamped(n),t};qa.fromDegrees=function(e,t,n,i){return l(i)||(i=new qa),i.heading=e*W.RADIANS_PER_DEGREE,i.pitch=t*W.RADIANS_PER_DEGREE,i.roll=n*W.RADIANS_PER_DEGREE,i};qa.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new qa(e.heading,e.pitch,e.roll)};qa.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};qa.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&W.equalsEpsilon(e.heading,t.heading,n,i)&&W.equalsEpsilon(e.pitch,t.pitch,n,i)&&W.equalsEpsilon(e.roll,t.roll,n,i)};qa.prototype.clone=function(e){return qa.clone(this,e)};qa.prototype.equals=function(e){return qa.equals(this,e)};qa.prototype.equalsEpsilon=function(e,t,n){return qa.equalsEpsilon(this,e,t,n)};qa.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Ca=qa;var $Gt=T(S(),1);var UGt=T(S(),1);var y$={};var x$=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function BVe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),o=x$.exec(i);if(o!==null)return o[1]}}var gN;function _$(e){return typeof document>"u"?e:(l(gN)||(gN=document.createElement("a")),gN.href=e,gN.href)}var ex;function T$(){if(l(ex))return ex;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(y$?.url)?e=kh(".",y$.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(D9.toUrl)?e=kh("..",tx("Core/buildModuleUrl.js")):e=BVe(),ex=new Ee({url:_$(e)}),ex.appendForwardSlash(),ex}function OVe(e){return _$(D9.toUrl(`../${e}`))}function S$(e){return T$().getDerivedResource({url:e}).url}var yN;function tx(e){return l(yN)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(D9.toUrl)?yN=OVe:yN=S$),yN(e)}tx._cesiumScriptRegex=x$;tx._buildModuleUrlFromBaseUrl=S$;tx._clearBaseResource=function(){ex=void 0};tx.setBaseUrl=function(e){ex=Ee.DEFAULT.getDerivedResource({url:e})};tx.getCesiumBaseUrl=T$;var rn=tx;var OGt=T(S(),1);function YVe(e,t,n){this.x=e,this.y=t,this.s=n}var nx=YVe;function yO(e){e=y(e,y.EMPTY_OBJECT),this._xysFileUrlTemplate=Ee.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=y(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=y(e.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new j(this._sampleZeroJulianEphemerisDate,0,Hn.TAI),this._stepSizeDays=y(e.stepSizeDays,1),this._samplesPerXysFile=y(e.samplesPerXysFile,1e3),this._totalSamples=y(e.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=o,i[r]=r*this._stepSizeDays;for(let s=0;s<=t;++s)s!==r&&(n[r]*=r-s);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}var HVe=new j(0,0,Hn.TAI);function bO(e,t,n){let i=HVe;return i.dayNumber=t,i.secondsOfDay=n,j.daysDifference(i,e._sampleZeroDateTT)}yO.prototype.preload=function(e,t,n,i){let o=bO(this,e,t),r=bO(this,n,i),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,d=a/this._samplesPerXysFile|0,u=[];for(let m=c;m<=d;++m)u.push(gO(this,m));return Promise.all(u)};yO.prototype.computeXysRadians=function(e,t,n){let i=bO(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let c=!1,d=this._samples;if(l(d[s*3])||(gO(this,s/this._samplesPerXysFile|0),c=!0),l(d[a*3])||(gO(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new nx(0,0,0);let u=i-s*this._stepSizeDays,m=this._work,p=this._denominators,g=this._coef,f=this._xTable,x,_;for(x=0;x<=r;++x)m[x]=u-f[x];for(x=0;x<=r;++x){for(g[x]=1,_=0;_<=r;++_)_!==x&&(g[x]*=m[_]);g[x]*=p[x];let C=(s+x)*3;n.x+=g[x]*d[C++],n.y+=g[x]*d[C++],n.s+=g[x]*d[C]}return n};function gO(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new Ee({url:rn(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=r.samples,c=t*e._samplesPerXysFile*3;for(let d=0,u=a.length;d<u;++d)s[c+d]=a[d]});return e._chunkDownloadsInProgress[t]=o,o}var qL=yO;var aEt=T(S(),1);function st(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.z=y(n,0),this.w=y(i,0)}var $L=new h;st.fromAxisAngle=function(e,t,n){let i=t/2,o=Math.sin(i);$L=h.normalize(e,$L);let r=$L.x*o,s=$L.y*o,a=$L.z*o,c=Math.cos(i);return l(n)?(n.x=r,n.y=s,n.z=a,n.w=c,n):new st(r,s,a,c)};var zVe=[1,2,0],KVe=new Array(3);st.fromRotationMatrix=function(e,t){let n,i,o,r,s,a=e[$.COLUMN0ROW0],c=e[$.COLUMN1ROW1],d=e[$.COLUMN2ROW2],u=a+c+d;if(u>0)n=Math.sqrt(u+1),s=.5*n,n=.5/n,i=(e[$.COLUMN1ROW2]-e[$.COLUMN2ROW1])*n,o=(e[$.COLUMN2ROW0]-e[$.COLUMN0ROW2])*n,r=(e[$.COLUMN0ROW1]-e[$.COLUMN1ROW0])*n;else{let m=zVe,p=0;c>a&&(p=1),d>a&&d>c&&(p=2);let g=m[p],f=m[g];n=Math.sqrt(e[$.getElementIndex(p,p)]-e[$.getElementIndex(g,g)]-e[$.getElementIndex(f,f)]+1);let x=KVe;x[p]=.5*n,n=.5/n,s=(e[$.getElementIndex(f,g)]-e[$.getElementIndex(g,f)])*n,x[g]=(e[$.getElementIndex(g,p)]+e[$.getElementIndex(p,g)])*n,x[f]=(e[$.getElementIndex(f,p)]+e[$.getElementIndex(p,f)])*n,i=-x[0],o=-x[1],r=-x[2]}return l(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new st(i,o,r,s)};var C$=new st,V$=new st,xO=new st,L$=new st;st.fromHeadingPitchRoll=function(e,t){return L$=st.fromAxisAngle(h.UNIT_X,e.roll,C$),xO=st.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=st.multiply(xO,L$,xO),V$=st.fromAxisAngle(h.UNIT_Z,-e.heading,C$),st.multiply(V$,t,t)};var xN=new h,_O=new h,gm=new st,R$=new st,_N=new st;st.packedLength=4;st.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};st.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new st),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};st.packedInterpolationLength=3;st.convertPackedArrayForInterpolation=function(e,t,n,i){st.unpack(e,n*4,_N),st.conjugate(_N,_N);for(let o=0,r=n-t+1;o<r;o++){let s=o*3;st.unpack(e,(t+o)*4,gm),st.multiply(gm,_N,gm),gm.w<0&&st.negate(gm,gm),st.computeAxis(gm,xN);let a=st.computeAngle(gm);l(i)||(i=[]),i[s]=xN.x*a,i[s+1]=xN.y*a,i[s+2]=xN.z*a}};st.unpackInterpolationResult=function(e,t,n,i,o){l(o)||(o=new st),h.fromArray(e,0,_O);let r=h.magnitude(_O);return st.unpack(t,i*4,R$),r===0?st.clone(st.IDENTITY,gm):st.fromAxisAngle(_O,r,gm),st.multiply(gm,R$,o)};st.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new st(e.x,e.y,e.z,e.w)};st.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};st.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};st.magnitude=function(e){return Math.sqrt(st.magnitudeSquared(e))};st.normalize=function(e,t){let n=1/st.magnitude(e),i=e.x*n,o=e.y*n,r=e.z*n,s=e.w*n;return t.x=i,t.y=o,t.z=r,t.w=s,t};st.inverse=function(e,t){let n=st.magnitudeSquared(e);return t=st.conjugate(e,t),st.multiplyByScalar(t,1/n,t)};st.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};st.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};st.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};st.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};st.multiply=function(e,t,n){let i=e.x,o=e.y,r=e.z,s=e.w,a=t.x,c=t.y,d=t.z,u=t.w,m=s*a+i*u+o*d-r*c,p=s*c-i*d+o*u+r*a,g=s*d+i*c-o*a+r*u,f=s*u-i*a-o*c-r*d;return n.x=m,n.y=p,n.z=g,n.w=f,n};st.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};st.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};st.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<W.EPSILON6||Math.abs(n+1)<W.EPSILON6)return t.x=1,t.y=t.z=0,t;let i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t};st.computeAngle=function(e){return Math.abs(e.w-1)<W.EPSILON6?0:2*Math.acos(e.w)};var TO=new st;st.lerp=function(e,t,n,i){return TO=st.multiplyByScalar(t,n,TO),i=st.multiplyByScalar(e,1-n,i),st.add(TO,i,i)};var Z$=new st,SO=new st,CO=new st;st.slerp=function(e,t,n,i){let o=st.dot(e,t),r=t;if(o<0&&(o=-o,r=Z$=st.negate(t,Z$)),1-o<W.EPSILON6)return st.lerp(e,r,n,i);let s=Math.acos(o);return SO=st.multiplyByScalar(e,Math.sin((1-n)*s),SO),CO=st.multiplyByScalar(r,Math.sin(n*s),CO),i=st.add(SO,CO,i),st.multiplyByScalar(i,1/Math.sin(s),i)};st.log=function(e,t){let n=W.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),h.multiplyByScalar(e,i,t)};st.exp=function(e,t){let n=h.magnitude(e),i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};var JVe=new h,QVe=new h,eR=new st,NS=new st;st.computeInnerQuadrangle=function(e,t,n,i){let o=st.conjugate(t,eR);st.multiply(o,n,NS);let r=st.log(NS,JVe);st.multiply(o,e,NS);let s=st.log(NS,QVe);return h.add(r,s,r),h.multiplyByScalar(r,.25,r),h.negate(r,r),st.exp(r,eR),st.multiply(t,eR,i)};st.squad=function(e,t,n,i,o,r){let s=st.slerp(e,t,o,eR),a=st.slerp(n,i,o,NS);return st.slerp(s,a,2*o*(1-o),r)};var jVe=new st,G$=1.9011074535173003,TN=zt.supportsTypedArrays()?new Float32Array(8):[],SN=zt.supportsTypedArrays()?new Float32Array(8):[],pp=zt.supportsTypedArrays()?new Float32Array(8):[],bp=zt.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;TN[e]=1/(t*n),SN[e]=t/n}TN[7]=G$/(8*17);SN[7]=G$*8/17;st.fastSlerp=function(e,t,n,i){let o=st.dot(e,t),r;o>=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,c=n*n,d=a*a;for(let g=7;g>=0;--g)pp[g]=(TN[g]*c-SN[g])*s,bp[g]=(TN[g]*d-SN[g])*s;let u=r*n*(1+pp[0]*(1+pp[1]*(1+pp[2]*(1+pp[3]*(1+pp[4]*(1+pp[5]*(1+pp[6]*(1+pp[7])))))))),m=a*(1+bp[0]*(1+bp[1]*(1+bp[2]*(1+bp[3]*(1+bp[4]*(1+bp[5]*(1+bp[6]*(1+bp[7])))))))),p=st.multiplyByScalar(e,m,jVe);return st.multiplyByScalar(t,u,i),st.add(p,i,i)};st.fastSquad=function(e,t,n,i,o,r){let s=st.fastSlerp(e,t,o,eR),a=st.fastSlerp(n,i,o,NS);return st.fastSlerp(s,a,2*o*(1-o),r)};st.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};st.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};st.ZERO=Object.freeze(new st(0,0,0,0));st.IDENTITY=Object.freeze(new st(0,0,0,1));st.prototype.clone=function(e){return st.clone(this,e)};st.prototype.equals=function(e){return st.equals(this,e)};st.prototype.equalsEpsilon=function(e,t){return st.equalsEpsilon(this,e,t)};st.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var we=st;var ui={},VO={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"}},kS={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},LO={},xl={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},R0=new h,Z0=new h,G0=new h;ui.localFrameToFixedFrameGenerator=function(e,t){if(!VO.hasOwnProperty(e)||!VO[e].hasOwnProperty(t))throw new pe("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=VO[e][t],i,o=e+t;return l(LO[o])?i=LO[o]:(i=function(r,s,a){if(l(a)||(a=new M),h.equalsEpsilon(r,h.ZERO,W.EPSILON14))h.unpack(kS[e],0,R0),h.unpack(kS[t],0,Z0),h.unpack(kS[n],0,G0);else if(W.equalsEpsilon(r.x,0,W.EPSILON14)&&W.equalsEpsilon(r.y,0,W.EPSILON14)){let c=W.sign(r.z);h.unpack(kS[e],0,R0),e!=="east"&&e!=="west"&&h.multiplyByScalar(R0,c,R0),h.unpack(kS[t],0,Z0),t!=="east"&&t!=="west"&&h.multiplyByScalar(Z0,c,Z0),h.unpack(kS[n],0,G0),n!=="east"&&n!=="west"&&h.multiplyByScalar(G0,c,G0)}else{s=y(s,ne.default),s.geodeticSurfaceNormal(r,xl.up);let c=xl.up,d=xl.east;d.x=-r.y,d.y=r.x,d.z=0,h.normalize(d,xl.east),h.cross(c,d,xl.north),h.multiplyByScalar(xl.up,-1,xl.down),h.multiplyByScalar(xl.east,-1,xl.west),h.multiplyByScalar(xl.north,-1,xl.south),R0=xl[e],Z0=xl[t],G0=xl[n]}return a[0]=R0.x,a[1]=R0.y,a[2]=R0.z,a[3]=0,a[4]=Z0.x,a[5]=Z0.y,a[6]=Z0.z,a[7]=0,a[8]=G0.x,a[9]=G0.y,a[10]=G0.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},LO[o]=i),i};ui.eastNorthUpToFixedFrame=ui.localFrameToFixedFrameGenerator("east","north");ui.northEastDownToFixedFrame=ui.localFrameToFixedFrameGenerator("north","east");ui.northUpEastToFixedFrame=ui.localFrameToFixedFrameGenerator("north","up");ui.northWestUpToFixedFrame=ui.localFrameToFixedFrameGenerator("north","west");var qVe=new we,$Ve=new h(1,1,1),eLe=new M;ui.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=y(i,ui.eastNorthUpToFixedFrame);let r=we.fromHeadingPitchRoll(t,qVe),s=M.fromTranslationQuaternionRotationScale(h.ZERO,r,$Ve,eLe);return o=i(e,n,o),M.multiply(o,s,o)};var tLe=new M,nLe=new $;ui.headingPitchRollQuaternion=function(e,t,n,i,o){let r=ui.headingPitchRollToFixedFrame(e,t,n,i,tLe),s=M.getMatrix3(r,nLe);return we.fromRotationMatrix(s,o)};var iLe=new h(1,1,1),oLe=new h,E$=new M,rLe=new M,sLe=new $,aLe=new we;ui.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=y(t,ne.default),n=y(n,ui.eastNorthUpToFixedFrame),l(i)||(i=new Ca);let o=M.getTranslation(e,oLe);if(h.equals(o,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=M.inverseTransformation(n(o,t,E$),E$),s=M.setScale(e,iLe,rLe);s=M.setTranslation(s,h.ZERO,s),r=M.multiply(r,s,r);let a=we.fromRotationMatrix(M.getMatrix3(r,sLe),aLe);return a=we.normalize(a,a),Ca.fromQuaternion(a,i)};var cLe=6*3600+41*60+50.54841,lLe=8640184812866e-6,dLe=.093104,uLe=-62e-7,mLe=11772758384668e-32,hLe=72921158553e-15,fLe=W.TWO_PI/86400,CN=new j;ui.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=ui.computeIcrfToFixedMatrix(e,t);return l(n)||(n=ui.computeTemeToPseudoFixedMatrix(e,t)),n};ui.computeTemeToPseudoFixedMatrix=function(e,t){CN=j.addSeconds(e,-j.computeTaiMinusUtc(e),CN);let n=CN.dayNumber,i=CN.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/zn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/zn.DAYS_PER_JULIAN_CENTURY;let a=(cLe+o*(lLe+o*(dLe+o*uLe)))*fLe%W.TWO_PI,c=hLe+mLe*(n-24515455e-1),d=(i+zn.SECONDS_PER_DAY*.5)%zn.SECONDS_PER_DAY,u=a+c*d,m=Math.cos(u),p=Math.sin(u);return l(t)?(t[0]=m,t[1]=-p,t[2]=0,t[3]=p,t[4]=m,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new $(m,p,0,-p,m,0,0,0,1)};ui.iau2006XysData=new qL;ui.earthOrientationParameters=jL.NONE;var GO=32.184,pLe=2451545;ui.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+GO,i=e.stop.dayNumber,o=e.stop.secondsOfDay+GO;return ui.iau2006XysData.preload(t,n,i,o)};ui.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=ui.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var bLe=32.184,gLe=2451545,VN=new Ca,yLe=new $,xLe=new j;ui.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=j.addSeconds(e,bLe,xLe),i=j.totalDays(n)-gLe,o=W.toRadians(12.112)-W.toRadians(.052992)*i,r=W.toRadians(24.224)-W.toRadians(.105984)*i,s=W.toRadians(227.645)+W.toRadians(13.012)*i,a=W.toRadians(261.105)+W.toRadians(13.340716)*i,c=W.toRadians(358)+W.toRadians(.9856)*i;return VN.pitch=W.toRadians(180)-W.toRadians(3.878)*Math.sin(o)-W.toRadians(.12)*Math.sin(r)+W.toRadians(.07)*Math.sin(s)-W.toRadians(.017)*Math.sin(a),VN.roll=W.toRadians(66.53-90)+W.toRadians(1.543)*Math.cos(o)+W.toRadians(.24)*Math.cos(r)-W.toRadians(.028)*Math.cos(s)+W.toRadians(.007)*Math.cos(a),VN.heading=W.toRadians(244.375-90)+W.toRadians(13.17635831)*i+W.toRadians(3.558)*Math.sin(o)+W.toRadians(.121)*Math.sin(r)-W.toRadians(.064)*Math.sin(s)+W.toRadians(.016)*Math.sin(a)+W.toRadians(.025)*Math.sin(c),$.fromHeadingPitchRoll(VN,yLe)};ui.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=ui.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var _Le=new nx(0,0,0),TLe=new C0(0,0,0,0,0,0),RO=new $,ZO=new $;ui.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=ui.earthOrientationParameters.compute(e,TLe);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+GO,r=ui.iau2006XysData.computeXysRadians(i,o,_Le);if(!l(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),d=RO;d[0]=1-c*s*s,d[3]=-c*s*a,d[6]=s,d[1]=-c*s*a,d[4]=1-c*a*a,d[7]=a,d[2]=-s,d[5]=-a,d[8]=1-c*(s*s+a*a);let u=$.fromRotationZ(-r.s,ZO),m=$.multiply(d,u,RO),p=e.dayNumber,g=e.secondsOfDay-j.computeTaiMinusUtc(e)+n.ut1MinusUtc,f=p-2451545,x=g/zn.SECONDS_PER_DAY,_=.779057273264+x+.00273781191135448*(f+x);_=_%1*W.TWO_PI;let C=$.fromRotationZ(_,ZO),V=$.multiply(m,C,RO),L=Math.cos(n.xPoleWander),Z=Math.cos(n.yPoleWander),G=Math.sin(n.xPoleWander),I=Math.sin(n.yPoleWander),v=i-pLe+o/zn.SECONDS_PER_DAY;v/=36525;let P=-47e-6*v*W.RADIANS_PER_DEGREE/3600,w=Math.cos(P),F=Math.sin(P),b=ZO;return b[0]=L*w,b[1]=L*F,b[2]=G,b[3]=-Z*F+I*G*w,b[4]=Z*w+I*G*F,b[5]=-I*L,b[6]=-I*F-Z*G*w,b[7]=I*w-Z*G*F,b[8]=Z*L,$.multiply(V,b,t)};var SLe=new se;ui.pointToWindowCoordinates=function(e,t,n,i){return i=ui.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};ui.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new D);let o=SLe;return M.multiplyByVector(e,se.fromElements(n.x,n.y,n.z,1,o),o),se.multiplyByScalar(o,1/o.w,o),M.multiplyByVector(t,o,o),D.fromCartesian4(o,i)};var CLe=new h,VLe=new h,LLe=new h;ui.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=y(n,ne.default).geodeticSurfaceNormal(e,CLe),r=h.cross(t,o,VLe);h.equalsEpsilon(r,h.ZERO,W.EPSILON6)&&(r=h.clone(h.UNIT_X,r));let s=h.cross(r,t,LLe);return h.normalize(s,s),h.cross(t,s,r),h.negate(r,r),h.normalize(r,r),l(i)||(i=new $),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=r.x,i[4]=r.y,i[5]=r.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};var I$=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),X$=new he,EO=new h,RLe=new h,ZLe=new $,IO=new M,W$=new M;ui.basisTo2D=function(e,t,n){let i=M.getTranslation(t,RLe),o=e.ellipsoid,r;if(h.equals(i,h.ZERO))r=h.clone(h.ZERO,EO);else{let u=o.cartesianToCartographic(i,X$);r=e.project(u,EO),h.fromElements(r.z,r.x,r.y,r)}let s=ui.eastNorthUpToFixedFrame(i,o,IO),a=M.inverseTransformation(s,W$),c=M.getMatrix3(t,ZLe),d=M.multiplyByMatrix3(a,c,n);return M.multiply(I$,d,n),M.setTranslation(n,r,n),n};ui.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=ui.eastNorthUpToFixedFrame(t,i,IO),r=M.inverseTransformation(o,W$),s=i.cartesianToCartographic(t,X$),a=e.project(s,EO);h.fromElements(a.z,a.x,a.y,a);let c=M.fromTranslation(a,IO);return M.multiply(I$,r,n),M.multiply(c,n,n),n};var Ft=ui;var wEt=T(S(),1);var WEt=T(S(),1);var P$={};function tR(e,t){l(P$[e])||(P$[e]=!0,console.warn(y(t,e)))}tR.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.";tR.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";tR.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";tR.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var St=tR;function GLe(e,t){St(e,t)}var ls=GLe;function Zn(e,t,n,i){this.west=y(e,0),this.south=y(t,0),this.east=y(n,0),this.north=y(i,0)}Object.defineProperties(Zn.prototype,{width:{get:function(){return Zn.computeWidth(this)}},height:{get:function(){return Zn.computeHeight(this)}}});Zn.packedLength=4;Zn.pack=function(e,t,n){return n=y(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};Zn.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Zn),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};Zn.computeWidth=function(e){let t=e.east,n=e.west;return t<n&&(t+=W.TWO_PI),t-n};Zn.computeHeight=function(e){return e.north-e.south};Zn.fromDegrees=function(e,t,n,i,o){return e=W.toRadians(y(e,0)),t=W.toRadians(y(t,0)),n=W.toRadians(y(n,0)),i=W.toRadians(y(i,0)),l(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new Zn(e,t,n,i)};Zn.fromRadians=function(e,t,n,i,o){return l(o)?(o.west=y(e,0),o.south=y(t,0),o.east=y(n,0),o.north=y(i,0),o):new Zn(e,t,n,i)};Zn.fromCartographicArray=function(e,t){let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE;for(let c=0,d=e.length;c<d;c++){let u=e[c];n=Math.min(n,u.longitude),i=Math.max(i,u.longitude),s=Math.min(s,u.latitude),a=Math.max(a,u.latitude);let m=u.longitude>=0?u.longitude:u.longitude+W.TWO_PI;o=Math.min(o,m),r=Math.max(r,m)}return i-n>r-o&&(n=o,i=r,i>W.PI&&(i=i-W.TWO_PI),n>W.PI&&(n=n-W.TWO_PI)),l(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new Zn(n,s,i,a)};Zn.fromCartesianArray=function(e,t,n){t=y(t,ne.default);let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let d=0,u=e.length;d<u;d++){let m=t.cartesianToCartographic(e[d]);i=Math.min(i,m.longitude),o=Math.max(o,m.longitude),a=Math.min(a,m.latitude),c=Math.max(c,m.latitude);let p=m.longitude>=0?m.longitude:m.longitude+W.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>W.PI&&(o=o-W.TWO_PI),i>W.PI&&(i=i-W.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=o,n.north=c,n):new Zn(i,a,o,c)};var ELe=new h,ILe=new h,XLe=new h,WLe=new h,PLe=new h,XO=new Array(5);for(let e=0;e<XO.length;++e)XO[e]=new h;Zn.fromBoundingSphere=function(e,t,n){let i=e.center,o=e.radius;if(l(t)||(t=ne.default),l(n)||(n=new Zn),h.equals(i,h.ZERO))return Zn.clone(Zn.MAX_VALUE,n),n;let r=Ft.eastNorthUpToFixedFrame(i,t,ELe),s=M.multiplyByPointAsVector(r,h.UNIT_X,ILe);h.normalize(s,s);let a=M.multiplyByPointAsVector(r,h.UNIT_Y,XLe);h.normalize(a,a),h.multiplyByScalar(a,o,a),h.multiplyByScalar(s,o,s);let c=h.negate(a,PLe),d=h.negate(s,WLe),u=XO,m=u[0];return h.add(i,a,m),m=u[1],h.add(i,d,m),m=u[2],h.add(i,c,m),m=u[3],h.add(i,s,m),u[4]=i,Zn.fromCartesianArray(u,t,n)};Zn.clone=function(e,t){if(l(e))return l(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new Zn(e.west,e.south,e.east,e.north)};Zn.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n};Zn.prototype.clone=function(e){return Zn.clone(this,e)};Zn.prototype.equals=function(e){return Zn.equals(this,e)};Zn.equals=function(e,t){return e===t||l(e)&&l(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};Zn.prototype.equalsEpsilon=function(e,t){return Zn.equalsEpsilon(this,e,t)};Zn.validate=function(e){return ls("Rectangle.validate","Rectangle.validate is a no-op and has been deprecated. It will be removed in Cesium 1.124."),Zn._validate(e)};Zn._validate=function(e){};Zn.southwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new he(e.west,e.south)};Zn.northwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new he(e.west,e.north)};Zn.northeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new he(e.east,e.north)};Zn.southeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new he(e.east,e.south)};Zn.center=function(e,t){let n=e.east,i=e.west;n<i&&(n+=W.TWO_PI);let o=W.negativePiToPi((i+n)*.5),r=(e.south+e.north)*.5;return l(t)?(t.longitude=o,t.latitude=r,t.height=0,t):new he(o,r)};Zn.intersection=function(e,t,n){let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=W.TWO_PI:r<s&&i>0&&(r+=W.TWO_PI),i<o&&s<0?s+=W.TWO_PI:r<s&&o<0&&(o+=W.TWO_PI);let a=W.negativePiToPi(Math.max(o,s)),c=W.negativePiToPi(Math.min(i,r));if((e.west<e.east||t.west<t.east)&&c<=a)return;let d=Math.max(e.south,t.south),u=Math.min(e.north,t.north);if(!(d>=u))return l(n)?(n.west=a,n.south=d,n.east=c,n.north=u,n):new Zn(a,d,c,u)};Zn.simpleIntersection=function(e,t,n){let i=Math.max(e.west,t.west),o=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||i>=r))return l(n)?(n.west=i,n.south=o,n.east=r,n.north=s,n):new Zn(i,o,r,s)};Zn.union=function(e,t,n){l(n)||(n=new Zn);let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=W.TWO_PI:r<s&&i>0&&(r+=W.TWO_PI),i<o&&s<0?s+=W.TWO_PI:r<s&&o<0&&(o+=W.TWO_PI);let a=W.negativePiToPi(Math.min(o,s)),c=W.negativePiToPi(Math.max(i,r));return n.west=a,n.south=Math.min(e.south,t.south),n.east=c,n.north=Math.max(e.north,t.north),n};Zn.expand=function(e,t,n){return l(n)||(n=new Zn),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n};Zn.contains=function(e,t){let n=t.longitude,i=t.latitude,o=e.west,r=e.east;return r<o&&(r+=W.TWO_PI,n<0&&(n+=W.TWO_PI)),(n>o||W.equalsEpsilon(n,o,W.EPSILON14))&&(n<r||W.equalsEpsilon(n,r,W.EPSILON14))&&i>=e.south&&i<=e.north};var vLe=new he;Zn.subsample=function(e,t,n,i){t=y(t,ne.default),n=y(n,0),l(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,c=e.west,d=vLe;d.height=n,d.longitude=c,d.latitude=r,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=a,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.latitude=s,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=c,i[o]=t.cartographicToCartesian(d,i[o]),o++,r<0?d.latitude=r:s>0?d.latitude=s:d.latitude=0;for(let u=1;u<8;++u)d.longitude=-Math.PI+u*W.PI_OVER_TWO,Zn.contains(e,d)&&(i[o]=t.cartographicToCartesian(d,i[o]),o++);return d.latitude===0&&(d.longitude=c,i[o]=t.cartographicToCartesian(d,i[o]),o++,d.longitude=a,i[o]=t.cartographicToCartesian(d,i[o]),o++),i.length=o,i};Zn.subsection=function(e,t,n,i,o,r){if(l(r)||(r=new Zn),e.west<=e.east){let a=e.east-e.west;r.west=e.west+t*a,r.east=e.west+i*a}else{let a=W.TWO_PI+e.east-e.west;r.west=W.negativePiToPi(e.west+t*a),r.east=W.negativePiToPi(e.west+i*a)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+o*s,t===1&&(r.west=e.east),i===1&&(r.east=e.east),n===1&&(r.south=e.north),o===1&&(r.north=e.north),r};Zn.MAX_VALUE=Object.freeze(new Zn(-Math.PI,-W.PI_OVER_TWO,Math.PI,W.PI_OVER_TWO));var ae=Zn;function Xr(e,t,n,i){this.x=y(e,0),this.y=y(t,0),this.width=y(n,0),this.height=y(i,0)}Xr.packedLength=4;Xr.pack=function(e,t,n){return n=y(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};Xr.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Xr),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};Xr.fromPoints=function(e,t){if(l(t)||(t=new Xr),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,o=e[0].y,r=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let c=e[a],d=c.x,u=c.y;i=Math.min(d,i),r=Math.max(d,r),o=Math.min(u,o),s=Math.max(u,s)}return t.x=i,t.y=o,t.width=r-i,t.height=s-o,t};var v$=new Ri,wLe=new he,FLe=new he;Xr.fromRectangle=function(e,t,n){if(l(n)||(n=new Xr),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;v$._ellipsoid=ne.default,t=y(t,v$);let i=t.project(ae.southwest(e,wLe)),o=t.project(ae.northeast(e,FLe));return D.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n};Xr.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new Xr(e.x,e.y,e.width,e.height)};Xr.union=function(e,t,n){l(n)||(n=new Xr);let i=Math.min(e.x,t.x),o=Math.min(e.y,t.y),r=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=o,n.width=r-i,n.height=s-o,n};Xr.expand=function(e,t,n){n=Xr.clone(e,n);let i=t.x-n.x,o=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),o>n.height?n.height=o:o<0&&(n.height-=o,n.y=t.y),n};Xr.intersect=function(e,t){let n=e.x,i=e.y,o=t.x,r=t.y;return n>o+t.width||n+e.width<o||i+e.height<r||i>r+t.height?Jt.OUTSIDE:Jt.INTERSECTING};Xr.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};Xr.prototype.clone=function(e){return Xr.clone(this,e)};Xr.prototype.intersect=function(e){return Xr.intersect(this,e)};Xr.prototype.equals=function(e){return Xr.equals(this,e)};var Ke=Xr;var rIt=T(S(),1);var Va={POINTS:ie.POINTS,LINES:ie.LINES,LINE_LOOP:ie.LINE_LOOP,LINE_STRIP:ie.LINE_STRIP,TRIANGLES:ie.TRIANGLES,TRIANGLE_STRIP:ie.TRIANGLE_STRIP,TRIANGLE_FAN:ie.TRIANGLE_FAN};Va.isLines=function(e){return e===Va.LINES||e===Va.LINE_LOOP||e===Va.LINE_STRIP};Va.isTriangles=function(e){return e===Va.TRIANGLES||e===Va.TRIANGLE_STRIP||e===Va.TRIANGLE_FAN};Va.validate=function(e){return e===Va.POINTS||e===Va.LINES||e===Va.LINE_LOOP||e===Va.LINE_STRIP||e===Va.TRIANGLES||e===Va.TRIANGLE_STRIP||e===Va.TRIANGLE_FAN};var Fe=Object.freeze(Va);var aIt=T(S(),1),ix=`in vec4 position;
  81. in vec2 textureCoordinates;
  82. out vec2 v_textureCoordinates;
  83. void main()
  84. {
  85. gl_Position = position;
  86. v_textureCoordinates = textureCoordinates;
  87. }
  88. `;var mIt=T(S(),1);var br={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function nR(e){e=y(e,y.EMPTY_OBJECT),this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=y(e.primitiveType,Fe.TRIANGLES),this._vertexArray=e.vertexArray,this._count=e.count,this._offset=y(e.offset,0),this._instanceCount=y(e.instanceCount,0),this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._pickMetadataAllowed=e.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=y(e.cull,!0),this.occlude=y(e.occlude,!0),this.executeInClosestFrustum=y(e.executeInClosestFrustum,!1),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.castShadows=y(e.castShadows,!1),this.receiveShadows=y(e.receiveShadows,!1),this.pickOnly=y(e.pickOnly,!1),this.depthForTranslucentClassification=y(e.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function $a(e,t){return(e._flags&t)===t}function E0(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(nR.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return $a(this,br.CULL)},set:function(e){$a(this,br.CULL)!==e&&(E0(this,br.CULL,e),this.dirty=!0)}},occlude:{get:function(){return $a(this,br.OCCLUDE)},set:function(e){$a(this,br.OCCLUDE)!==e&&(E0(this,br.OCCLUDE,e),this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return $a(this,br.CAST_SHADOWS)},set:function(e){$a(this,br.CAST_SHADOWS)!==e&&(E0(this,br.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return $a(this,br.RECEIVE_SHADOWS)},set:function(e){$a(this,br.RECEIVE_SHADOWS)!==e&&(E0(this,br.RECEIVE_SHADOWS,e),this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return $a(this,br.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){$a(this,br.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(E0(this,br.EXECUTE_IN_CLOSEST_FRUSTUM,e),this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return $a(this,br.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){$a(this,br.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(E0(this,br.DEBUG_SHOW_BOUNDING_VOLUME,e),this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickMetadataAllowed:{get:function(){return this._pickMetadataAllowed}},pickedMetadataInfo:{get:function(){return this._pickedMetadataInfo},set:function(e){this._pickedMetadataInfo!==e&&(this._pickedMetadataInfo=e,this.dirty=!0)}},pickOnly:{get:function(){return $a(this,br.PICK_ONLY)},set:function(e){$a(this,br.PICK_ONLY)!==e&&(E0(this,br.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return $a(this,br.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){$a(this,br.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(E0(this,br.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});nR.shallowClone=function(e,t){if(l(e))return l(t)||(t=new nR),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._owner=e._owner,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._pickId=e._pickId,t._pickMetadataAllowed=e._pickMetadataAllowed,t._pickedMetadataInfo=e._pickedMetadataInfo,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t};nR.prototype.execute=function(e,t){e.draw(this,t)};var tt=nR;var ZIt=T(S(),1);var xIt=T(S(),1);var pIt=T(S(),1);var mi={UNSIGNED_BYTE:ie.UNSIGNED_BYTE,UNSIGNED_SHORT:ie.UNSIGNED_SHORT,UNSIGNED_INT:ie.UNSIGNED_INT,FLOAT:ie.FLOAT,HALF_FLOAT:ie.HALF_FLOAT_OES,UNSIGNED_INT_24_8:ie.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:ie.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:ie.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:ie.UNSIGNED_SHORT_5_6_5};mi.toWebGLConstant=function(e,t){switch(e){case mi.UNSIGNED_BYTE:return ie.UNSIGNED_BYTE;case mi.UNSIGNED_SHORT:return ie.UNSIGNED_SHORT;case mi.UNSIGNED_INT:return ie.UNSIGNED_INT;case mi.FLOAT:return ie.FLOAT;case mi.HALF_FLOAT:return t.webgl2?ie.HALF_FLOAT:ie.HALF_FLOAT_OES;case mi.UNSIGNED_INT_24_8:return ie.UNSIGNED_INT_24_8;case mi.UNSIGNED_SHORT_4_4_4_4:return ie.UNSIGNED_SHORT_4_4_4_4;case mi.UNSIGNED_SHORT_5_5_5_1:return ie.UNSIGNED_SHORT_5_5_5_1;case mi.UNSIGNED_SHORT_5_6_5:return mi.UNSIGNED_SHORT_5_6_5}};mi.isPacked=function(e){return e===mi.UNSIGNED_INT_24_8||e===mi.UNSIGNED_SHORT_4_4_4_4||e===mi.UNSIGNED_SHORT_5_5_5_1||e===mi.UNSIGNED_SHORT_5_6_5};mi.sizeInBytes=function(e){switch(e){case mi.UNSIGNED_BYTE:return 1;case mi.UNSIGNED_SHORT:case mi.UNSIGNED_SHORT_4_4_4_4:case mi.UNSIGNED_SHORT_5_5_5_1:case mi.UNSIGNED_SHORT_5_6_5:case mi.HALF_FLOAT:return 2;case mi.UNSIGNED_INT:case mi.FLOAT:case mi.UNSIGNED_INT_24_8:return 4}};mi.validate=function(e){return e===mi.UNSIGNED_BYTE||e===mi.UNSIGNED_SHORT||e===mi.UNSIGNED_INT||e===mi.FLOAT||e===mi.HALF_FLOAT||e===mi.UNSIGNED_INT_24_8||e===mi.UNSIGNED_SHORT_4_4_4_4||e===mi.UNSIGNED_SHORT_5_5_5_1||e===mi.UNSIGNED_SHORT_5_6_5};mi.getTypedArrayConstructor=function(e){let t=mi.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===mi.FLOAT?Float32Array:Uint32Array};var qe=Object.freeze(mi);var lt={DEPTH_COMPONENT:ie.DEPTH_COMPONENT,DEPTH_STENCIL:ie.DEPTH_STENCIL,ALPHA:ie.ALPHA,RED:ie.RED,RG:ie.RG,RGB:ie.RGB,RGBA:ie.RGBA,LUMINANCE:ie.LUMINANCE,LUMINANCE_ALPHA:ie.LUMINANCE_ALPHA,RGB_DXT1:ie.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:ie.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:ie.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:ie.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:ie.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:ie.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:ie.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:ie.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:ie.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:ie.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:ie.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:ie.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:ie.COMPRESSED_RGBA_BPTC_UNORM};lt.componentsLength=function(e){switch(e){case lt.RGB:return 3;case lt.RGBA:return 4;case lt.LUMINANCE_ALPHA:case lt.RG:return 2;case lt.ALPHA:case lt.RED:case lt.LUMINANCE:return 1;default:return 1}};lt.validate=function(e){return e===lt.DEPTH_COMPONENT||e===lt.DEPTH_STENCIL||e===lt.ALPHA||e===lt.RED||e===lt.RG||e===lt.RGB||e===lt.RGBA||e===lt.LUMINANCE||e===lt.LUMINANCE_ALPHA||e===lt.RGB_DXT1||e===lt.RGBA_DXT1||e===lt.RGBA_DXT3||e===lt.RGBA_DXT5||e===lt.RGB_PVRTC_4BPPV1||e===lt.RGB_PVRTC_2BPPV1||e===lt.RGBA_PVRTC_4BPPV1||e===lt.RGBA_PVRTC_2BPPV1||e===lt.RGBA_ASTC||e===lt.RGB_ETC1||e===lt.RGB8_ETC2||e===lt.RGBA8_ETC2_EAC||e===lt.RGBA_BC7};lt.isColorFormat=function(e){return e===lt.RED||e===lt.ALPHA||e===lt.RGB||e===lt.RGBA||e===lt.LUMINANCE||e===lt.LUMINANCE_ALPHA};lt.isDepthFormat=function(e){return e===lt.DEPTH_COMPONENT||e===lt.DEPTH_STENCIL};lt.isCompressedFormat=function(e){return e===lt.RGB_DXT1||e===lt.RGBA_DXT1||e===lt.RGBA_DXT3||e===lt.RGBA_DXT5||e===lt.RGB_PVRTC_4BPPV1||e===lt.RGB_PVRTC_2BPPV1||e===lt.RGBA_PVRTC_4BPPV1||e===lt.RGBA_PVRTC_2BPPV1||e===lt.RGBA_ASTC||e===lt.RGB_ETC1||e===lt.RGB8_ETC2||e===lt.RGBA8_ETC2_EAC||e===lt.RGBA_BC7};lt.isDXTFormat=function(e){return e===lt.RGB_DXT1||e===lt.RGBA_DXT1||e===lt.RGBA_DXT3||e===lt.RGBA_DXT5};lt.isPVRTCFormat=function(e){return e===lt.RGB_PVRTC_4BPPV1||e===lt.RGB_PVRTC_2BPPV1||e===lt.RGBA_PVRTC_4BPPV1||e===lt.RGBA_PVRTC_2BPPV1};lt.isASTCFormat=function(e){return e===lt.RGBA_ASTC};lt.isETC1Format=function(e){return e===lt.RGB_ETC1};lt.isETC2Format=function(e){return e===lt.RGB8_ETC2||e===lt.RGBA8_ETC2_EAC};lt.isBC7Format=function(e){return e===lt.RGBA_BC7};lt.compressedTextureSizeInBytes=function(e,t,n){switch(e){case lt.RGB_DXT1:case lt.RGBA_DXT1:case lt.RGB_ETC1:case lt.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case lt.RGBA_DXT3:case lt.RGBA_DXT5:case lt.RGBA_ASTC:case lt.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case lt.RGB_PVRTC_4BPPV1:case lt.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case lt.RGB_PVRTC_2BPPV1:case lt.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case lt.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};lt.textureSizeInBytes=function(e,t,n,i){let o=lt.componentsLength(e);return qe.isPacked(t)&&(o=1),o*qe.sizeInBytes(t)*n*i};lt.alignmentInBytes=function(e,t,n){let i=lt.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};lt.createTypedArray=function(e,t,n,i){let o=qe.getTypedArrayConstructor(t),r=lt.componentsLength(e)*n*i;return new o(r)};lt.flipY=function(e,t,n,i,o){if(o===1)return e;let r=lt.createTypedArray(t,n,i,o),s=lt.componentsLength(t),a=i*s;for(let c=0;c<o;++c){let d=c*i*s,u=(o-c-1)*i*s;for(let m=0;m<a;++m)r[u+m]=e[d+m]}return r};lt.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===lt.DEPTH_STENCIL)return ie.DEPTH24_STENCIL8;if(e===lt.DEPTH_COMPONENT){if(t===qe.UNSIGNED_SHORT)return ie.DEPTH_COMPONENT16;if(t===qe.UNSIGNED_INT)return ie.DEPTH_COMPONENT24}if(t===qe.FLOAT)switch(e){case lt.RGBA:return ie.RGBA32F;case lt.RGB:return ie.RGB32F;case lt.RG:return ie.RG32F;case lt.RED:return ie.R32F}if(t===qe.HALF_FLOAT)switch(e){case lt.RGBA:return ie.RGBA16F;case lt.RGB:return ie.RGB16F;case lt.RG:return ie.RG16F;case lt.RED:return ie.R16F}return e};var ot=Object.freeze(lt);var TIt=T(S(),1),gr={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(gr,{maximumCombinedTextureImageUnits:{get:function(){return gr._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return gr._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return gr._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return gr._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return gr._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return gr._maximumTextureSize}},maximumVaryingVectors:{get:function(){return gr._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return gr._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return gr._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return gr._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return gr._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return gr._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return gr._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return gr._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return gr._maximumViewportWidth}},maximumViewportHeight:{get:function(){return gr._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return gr._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return gr._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return gr._maximumColorAttachments}},maximumSamples:{get:function(){return gr._maximumSamples}},highpFloatSupported:{get:function(){return gr._highpFloatSupported}},highpIntSupported:{get:function(){return gr._highpIntSupported}}});var Bt=gr;function WO(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function LN(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function ym(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Bt.maximumColorAttachments;if(this._gl=n,this._framebuffer=n.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=y(e.destroyAttachments,!0),this._bind(),l(e.colorTextures)){let o=e.colorTextures,r=this._colorTextures.length=this._activeColorAttachments.length=o.length;for(let s=0;s<r;++s){let a=o[s],c=this._gl.COLOR_ATTACHMENT0+s;WO(this,c,a),this._activeColorAttachments[s]=c,this._colorTextures[s]=a}}if(l(e.colorRenderbuffers)){let o=e.colorRenderbuffers,r=this._colorRenderbuffers.length=this._activeColorAttachments.length=o.length;for(let s=0;s<r;++s){let a=o[s],c=this._gl.COLOR_ATTACHMENT0+s;LN(this,c,a),this._activeColorAttachments[s]=c,this._colorRenderbuffers[s]=a}}if(l(e.depthTexture)){let o=e.depthTexture;WO(this,this._gl.DEPTH_ATTACHMENT,o),this._depthTexture=o}if(l(e.depthRenderbuffer)){let o=e.depthRenderbuffer;LN(this,this._gl.DEPTH_ATTACHMENT,o),this._depthRenderbuffer=o}if(l(e.stencilRenderbuffer)){let o=e.stencilRenderbuffer;LN(this,this._gl.STENCIL_ATTACHMENT,o),this._stencilRenderbuffer=o}if(l(e.depthStencilTexture)){let o=e.depthStencilTexture;WO(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilTexture=o}if(l(e.depthStencilRenderbuffer)){let o=e.depthStencilRenderbuffer;LN(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilRenderbuffer=o}this._unBind()}Object.defineProperties(ym.prototype,{status:{get:function(){this._bind();let e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}});ym.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};ym.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};ym.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};ym.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};ym.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};ym.prototype.getColorTexture=function(e){return this._colorTextures[e]};ym.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};ym.prototype.isDestroyed=function(){return!1};ym.prototype.destroy=function(){if(this.destroyAttachments){let e=this._colorTextures;for(let n=0;n<e.length;++n){let i=e[n];l(i)&&i.destroy()}let t=this._colorRenderbuffers;for(let n=0;n<t.length;++n){let i=t[n];l(i)&&i.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),me(this)};var Wr=ym;var kIt=T(S(),1);var IIt=T(S(),1);var RN={CLOCKWISE:ie.CW,COUNTER_CLOCKWISE:ie.CCW};RN.validate=function(e){return e===RN.CLOCKWISE||e===RN.COUNTER_CLOCKWISE};var ds=Object.freeze(RN);var WIt=T(S(),1);function w$(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=w$(e[t]));return Object.freeze(e)}var PO=w$;function Hh(e){let t=y(e,y.EMPTY_OBJECT),n=y(t.cull,y.EMPTY_OBJECT),i=y(t.polygonOffset,y.EMPTY_OBJECT),o=y(t.scissorTest,y.EMPTY_OBJECT),r=y(o.rectangle,y.EMPTY_OBJECT),s=y(t.depthRange,y.EMPTY_OBJECT),a=y(t.depthTest,y.EMPTY_OBJECT),c=y(t.colorMask,y.EMPTY_OBJECT),d=y(t.blending,y.EMPTY_OBJECT),u=y(d.color,y.EMPTY_OBJECT),m=y(t.stencilTest,y.EMPTY_OBJECT),p=y(m.frontOperation,y.EMPTY_OBJECT),g=y(m.backOperation,y.EMPTY_OBJECT),f=y(t.sampleCoverage,y.EMPTY_OBJECT),x=t.viewport;this.frontFace=y(t.frontFace,ds.COUNTER_CLOCKWISE),this.cull={enabled:y(n.enabled,!1),face:y(n.face,ie.BACK)},this.lineWidth=y(t.lineWidth,1),this.polygonOffset={enabled:y(i.enabled,!1),factor:y(i.factor,0),units:y(i.units,0)},this.scissorTest={enabled:y(o.enabled,!1),rectangle:Ke.clone(r)},this.depthRange={near:y(s.near,0),far:y(s.far,1)},this.depthTest={enabled:y(a.enabled,!1),func:y(a.func,ie.LESS)},this.colorMask={red:y(c.red,!0),green:y(c.green,!0),blue:y(c.blue,!0),alpha:y(c.alpha,!0)},this.depthMask=y(t.depthMask,!0),this.stencilMask=y(t.stencilMask,-1),this.blending={enabled:y(d.enabled,!1),color:new B(y(u.red,0),y(u.green,0),y(u.blue,0),y(u.alpha,0)),equationRgb:y(d.equationRgb,ie.FUNC_ADD),equationAlpha:y(d.equationAlpha,ie.FUNC_ADD),functionSourceRgb:y(d.functionSourceRgb,ie.ONE),functionSourceAlpha:y(d.functionSourceAlpha,ie.ONE),functionDestinationRgb:y(d.functionDestinationRgb,ie.ZERO),functionDestinationAlpha:y(d.functionDestinationAlpha,ie.ZERO)},this.stencilTest={enabled:y(m.enabled,!1),frontFunction:y(m.frontFunction,ie.ALWAYS),backFunction:y(m.backFunction,ie.ALWAYS),reference:y(m.reference,0),mask:y(m.mask,-1),frontOperation:{fail:y(p.fail,ie.KEEP),zFail:y(p.zFail,ie.KEEP),zPass:y(p.zPass,ie.KEEP)},backOperation:{fail:y(g.fail,ie.KEEP),zFail:y(g.zFail,ie.KEEP),zPass:y(g.zPass,ie.KEEP)}},this.sampleCoverage={enabled:y(f.enabled,!1),value:y(f.value,1),invert:y(f.invert,!1)},this.viewport=l(x)?new Ke(x.x,x.y,x.width,x.height):void 0,this.id=0,this._applyFunctions=[]}var ALe=0,Yh={};Hh.fromCache=function(e){let t=JSON.stringify(e),n=Yh[t];if(l(n))return++n.referenceCount,n.state;let i=new Hh(e),o=JSON.stringify(i);return n=Yh[o],l(n)||(i.id=ALe++,n={referenceCount:0,state:i},Yh[o]=n),++n.referenceCount,Yh[t]={referenceCount:1,state:n.state},n.state};Hh.removeFromCache=function(e){let t=new Hh(e),n=JSON.stringify(t),i=Yh[n],o=JSON.stringify(e),r=Yh[o];l(r)&&(--r.referenceCount,r.referenceCount===0&&(delete Yh[o],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete Yh[n]};Hh.getCache=function(){return Yh};Hh.clearCache=function(){Yh={}};function ox(e,t,n){n?e.enable(t):e.disable(t)}function F$(e,t){e.frontFace(t.frontFace)}function A$(e,t){let n=t.cull,i=n.enabled;ox(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function M$(e,t){e.lineWidth(t.lineWidth)}function N$(e,t){let n=t.polygonOffset,i=n.enabled;ox(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function k$(e,t,n){let i=t.scissorTest,o=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(ox(e,e.SCISSOR_TEST,o),o){let r=l(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(r.x,r.y,r.width,r.height)}}function U$(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function D$(e,t){let n=t.depthTest,i=n.enabled;ox(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function B$(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function O$(e,t){e.depthMask(t.depthMask)}function Y$(e,t){e.stencilMask(t.stencilMask)}function MLe(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function H$(e,t,n){let i=t.blending,o=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;ox(e,e.BLEND,o),o&&(MLe(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function z$(e,t){let n=t.stencilTest,i=n.enabled;if(ox(e,e.STENCIL_TEST,i),i){let o=n.frontFunction,r=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(o,s,a),e.stencilFuncSeparate(e.BACK,r,s,a),e.stencilFuncSeparate(e.FRONT,o,s,a);let c=n.frontOperation,d=c.fail,u=c.zFail,m=c.zPass;e.stencilOpSeparate(e.FRONT,d,u,m);let p=n.backOperation,g=p.fail,f=p.zFail,x=p.zPass;e.stencilOpSeparate(e.BACK,g,f,x)}}function K$(e,t){let n=t.sampleCoverage,i=n.enabled;ox(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var NLe=new Ke;function J$(e,t,n){let i=y(t.viewport,n.viewport);l(i)||(i=NLe,i.width=n.context.drawingBufferWidth,i.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=i,e.viewport(i.x,i.y,i.width,i.height)}Hh.apply=function(e,t,n){F$(e,t),A$(e,t),M$(e,t),N$(e,t),U$(e,t),D$(e,t),B$(e,t),O$(e,t),Y$(e,t),z$(e,t),K$(e,t),k$(e,t,n),H$(e,t,n),J$(e,t,n)};function kLe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(F$),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(A$),e.lineWidth!==t.lineWidth&&n.push(M$),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(N$),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(U$),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(D$),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&n.push(B$),e.depthMask!==t.depthMask&&n.push(O$),e.stencilMask!==t.stencilMask&&n.push(Y$),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&n.push(z$),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(K$),n}Hh.partialApply=function(e,t,n,i,o,r){if(t!==n){let u=n._applyFunctions[t.id];l(u)||(u=kLe(t,n),n._applyFunctions[t.id]=u);let m=u.length;for(let p=0;p<m;++p)u[p](e,n)}let s=l(i.scissorTest)?i.scissorTest:t.scissorTest,a=l(o.scissorTest)?o.scissorTest:n.scissorTest;(s!==a||r)&&k$(e,n,o);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,d=l(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(c!==d||d&&t.blending!==n.blending)&&H$(e,n,o),(t!==n||i!==o||i.context!==o.context)&&J$(e,n,o)};Hh.getState=function(e){return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:Ke.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:B.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:l(e.viewport)?Ke.clone(e.viewport):void 0}};var Ue=Hh;var CXt=T(S(),1);var nXt=T(S(),1);var YIt=T(S(),1);function jt(e,t,n,i){this[0]=y(e,0),this[1]=y(n,0),this[2]=y(t,0),this[3]=y(i,0)}jt.packedLength=4;jt.pack=function(e,t,n){return n=y(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};jt.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new jt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};jt.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)jt.pack(e[o],t,o*4);return t};jt.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=jt.unpack(e,i,t[o])}return t};jt.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new jt(e[0],e[2],e[1],e[3])};jt.fromArray=jt.unpack;jt.fromColumnMajorArray=function(e,t){return jt.clone(e,t)};jt.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new jt(e[0],e[1],e[2],e[3])};jt.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new jt(e.x,0,0,e.y)};jt.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new jt(e,0,0,e)};jt.fromRotation=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new jt(n,-i,i,n)};jt.toArray=function(e,t){return l(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]]};jt.getElementIndex=function(e,t){return e*2+t};jt.getColumn=function(e,t,n){let i=t*2,o=e[i],r=e[i+1];return n.x=o,n.y=r,n};jt.setColumn=function(e,t,n,i){i=jt.clone(e,i);let o=t*2;return i[o]=n.x,i[o+1]=n.y,i};jt.getRow=function(e,t,n){let i=e[t],o=e[t+2];return n.x=i,n.y=o,n};jt.setRow=function(e,t,n,i){return i=jt.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var ULe=new D;jt.setScale=function(e,t,n){let i=jt.getScale(e,ULe),o=t.x/i.x,r=t.y/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*r,n[3]=e[3]*r,n};var DLe=new D;jt.setUniformScale=function(e,t,n){let i=jt.getScale(e,DLe),o=t/i.x,r=t/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*r,n[3]=e[3]*r,n};var Q$=new D;jt.getScale=function(e,t){return t.x=D.magnitude(D.fromElements(e[0],e[1],Q$)),t.y=D.magnitude(D.fromElements(e[2],e[3],Q$)),t};var j$=new D;jt.getMaximumScale=function(e){return jt.getScale(e,j$),D.maximumComponent(j$)};var BLe=new D;jt.setRotation=function(e,t,n){let i=jt.getScale(e,BLe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.y,n[3]=t[3]*i.y,n};var OLe=new D;jt.getRotation=function(e,t){let n=jt.getScale(e,OLe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.y,t[3]=e[3]/n.y,t};jt.multiply=function(e,t,n){let i=e[0]*t[0]+e[2]*t[1],o=e[0]*t[2]+e[2]*t[3],r=e[1]*t[0]+e[3]*t[1],s=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n};jt.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};jt.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};jt.multiplyByVector=function(e,t,n){let i=e[0]*t.x+e[2]*t.y,o=e[1]*t.x+e[3]*t.y;return n.x=i,n.y=o,n};jt.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};jt.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};jt.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};jt.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};jt.transpose=function(e,t){let n=e[0],i=e[2],o=e[1],r=e[3];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t};jt.abs=function(e,t){return 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};jt.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};jt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]};jt.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n};jt.IDENTITY=Object.freeze(new jt(1,0,0,1));jt.ZERO=Object.freeze(new jt(0,0,0,0));jt.COLUMN0ROW0=0;jt.COLUMN0ROW1=1;jt.COLUMN1ROW0=2;jt.COLUMN1ROW1=3;Object.defineProperties(jt.prototype,{length:{get:function(){return jt.packedLength}}});jt.prototype.clone=function(e){return jt.clone(this,e)};jt.prototype.equals=function(e){return jt.equals(this,e)};jt.prototype.equalsEpsilon=function(e,t){return jt.equalsEpsilon(this,e,t)};jt.prototype.toString=function(){return`(${this[0]}, ${this[2]})
  89. (${this[1]}, ${this[3]})`};var wi=jt;function YLe(e,t,n,i){switch(t.type){case e.FLOAT:return new q$(e,t,n,i);case e.FLOAT_VEC2:return new $$(e,t,n,i);case e.FLOAT_VEC3:return new eee(e,t,n,i);case e.FLOAT_VEC4:return new tee(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new vO(e,t,n,i);case e.INT:case e.BOOL:return new nee(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new iee(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new oee(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new ree(e,t,n,i);case e.FLOAT_MAT2:return new see(e,t,n,i);case e.FLOAT_MAT3:return new aee(e,t,n,i);case e.FLOAT_MAT4:return new cee(e,t,n,i);default:throw new de(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function q$(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}q$.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function $$(e,t,n,i){this.name=n,this.value=void 0,this._value=new D,this._gl=e,this._location=i}$$.prototype.set=function(){let e=this.value;D.equals(e,this._value)||(D.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function eee(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}eee.prototype.set=function(){let e=this.value;l(e.red)?B.equals(e,this._value)||(this._value=B.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):l(e.x)&&(h.equals(e,this._value)||(this._value=h.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z)))};function tee(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}tee.prototype.set=function(){let e=this.value;l(e.red)?B.equals(e,this._value)||(this._value=B.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):l(e.x)&&(se.equals(e,this._value)||(this._value=se.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))};function vO(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}vO.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;e.bindTexture(t._target,t._texture)};vO.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function nee(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}nee.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function iee(e,t,n,i){this.name=n,this.value=void 0,this._value=new D,this._gl=e,this._location=i}iee.prototype.set=function(){let e=this.value;D.equals(e,this._value)||(D.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function oee(e,t,n,i){this.name=n,this.value=void 0,this._value=new h,this._gl=e,this._location=i}oee.prototype.set=function(){let e=this.value;h.equals(e,this._value)||(h.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function ree(e,t,n,i){this.name=n,this.value=void 0,this._value=new se,this._gl=e,this._location=i}ree.prototype.set=function(){let e=this.value;se.equals(e,this._value)||(se.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var HLe=new Float32Array(4);function see(e,t,n,i){this.name=n,this.value=void 0,this._value=new wi,this._gl=e,this._location=i}see.prototype.set=function(){if(!wi.equalsArray(this.value,this._value,0)){wi.clone(this.value,this._value);let e=wi.toArray(this.value,HLe);this._gl.uniformMatrix2fv(this._location,!1,e)}};var zLe=new Float32Array(9);function aee(e,t,n,i){this.name=n,this.value=void 0,this._value=new $,this._gl=e,this._location=i}aee.prototype.set=function(){if(!$.equalsArray(this.value,this._value,0)){$.clone(this.value,this._value);let e=$.toArray(this.value,zLe);this._gl.uniformMatrix3fv(this._location,!1,e)}};var KLe=new Float32Array(16);function cee(e,t,n,i){this.name=n,this.value=void 0,this._value=new M,this._gl=e,this._location=i}cee.prototype.set=function(){if(!M.equalsArray(this.value,this._value,0)){M.clone(this.value,this._value);let e=M.toArray(this.value,KLe);this._gl.uniformMatrix4fv(this._location,!1,e)}};var iR=YLe;var hXt=T(S(),1);function JLe(e,t,n,i){switch(t.type){case e.FLOAT:return new lee(e,t,n,i);case e.FLOAT_VEC2:return new dee(e,t,n,i);case e.FLOAT_VEC3:return new uee(e,t,n,i);case e.FLOAT_VEC4:return new mee(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new wO(e,t,n,i);case e.INT:case e.BOOL:return new hee(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new fee(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new pee(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new bee(e,t,n,i);case e.FLOAT_MAT2:return new gee(e,t,n,i);case e.FLOAT_MAT3:return new yee(e,t,n,i);case e.FLOAT_MAT4:return new xee(e,t,n,i);default:throw new de(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function lee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._location=i[0]}lee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let o=0;o<t;++o){let r=e[o];r!==n[o]&&(n[o]=r,i=!0)}i&&this._gl.uniform1fv(this._location,n)};function dee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*2),this._gl=e,this._location=i[0]}dee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];D.equalsArray(s,n,o)||(D.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2fv(this._location,n)};function uee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*3),this._gl=e,this._location=i[0]}uee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];l(s.red)?(s.red!==n[o]||s.green!==n[o+1]||s.blue!==n[o+2])&&(n[o]=s.red,n[o+1]=s.green,n[o+2]=s.blue,i=!0):l(s.x)&&(h.equalsArray(s,n,o)||(h.pack(s,n,o),i=!0)),o+=3}i&&this._gl.uniform3fv(this._location,n)};function mee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}mee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];l(s.red)?B.equalsArray(s,n,o)||(B.pack(s,n,o),i=!0):l(s.x)&&(se.equalsArray(s,n,o)||(se.pack(s,n,o),i=!0)),o+=4}i&&this._gl.uniform4fv(this._location,n)};function wO(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._locations=i,this.textureUnitIndex=void 0}wO.prototype.set=function(){let e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,n=this.value,i=n.length;for(let o=0;o<i;++o){let r=n[o];e.activeTexture(t+o),e.bindTexture(r._target,r._texture)}};wO.prototype._setSampler=function(e){this.textureUnitIndex=e;let t=this._locations,n=t.length;for(let i=0;i<n;++i){let o=e+i;this._gl.uniform1i(t[i],o)}return e+n};function hee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o),this._gl=e,this._location=i[0]}hee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let o=0;o<t;++o){let r=e[o];r!==n[o]&&(n[o]=r,i=!0)}i&&this._gl.uniform1iv(this._location,n)};function fee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*2),this._gl=e,this._location=i[0]}fee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];D.equalsArray(s,n,o)||(D.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function pee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*3),this._gl=e,this._location=i[0]}pee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];h.equalsArray(s,n,o)||(h.pack(s,n,o),i=!0),o+=3}i&&this._gl.uniform3iv(this._location,n)};function bee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*4),this._gl=e,this._location=i[0]}bee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];se.equalsArray(s,n,o)||(se.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniform4iv(this._location,n)};function gee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}gee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];wi.equalsArray(s,n,o)||(wi.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function yee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*9),this._gl=e,this._location=i[0]}yee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];$.equalsArray(s,n,o)||($.pack(s,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function xee(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*16),this._gl=e,this._location=i[0]}xee.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];M.equalsArray(s,n,o)||(M.pack(s,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var oR=JLe;var QLe=0;function gp(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));let i=jLe(t,n);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=i.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=i.fragmentShaderText,this.id=QLe++}gp.fromCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.getShaderProgram(e)};gp.replaceCache=function(e){return e=y(e,y.EMPTY_OBJECT),e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(gp.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return ZN(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return ZN(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return ZN(this),this._uniformsByName}}});function _ee(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o].trim(),s=r.slice(r.lastIndexOf(" ")+1);t.push(s)}}return t}function jLe(e,t){let n={};if(!Bt.highpFloatSupported||!Bt.highpIntSupported){let i,o,r,s,a=_ee(e),c=_ee(t),d=a.length,u=c.length;for(i=0;i<d;i++)for(o=0;o<u;o++)if(a[i]===c[o]){r=a[i],s=`czm_mediump_${r}`;let m=new RegExp(`${r}\\b`,"g");t=t.replace(m,s),n[s]=r}}return{fragmentShaderText:t,duplicateUniformNames:n}}var zh="[Cesium WebGL] ";function qLe(e,t){let n=t._vertexShaderText,i=t._fragmentShaderText,o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,n),e.compileShader(o);let r=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(r,i),e.compileShader(r);let s=e.createProgram();e.attachShader(s,o),e.attachShader(s,r);let a=t._attributeLocations;if(l(a))for(let p in a)a.hasOwnProperty(p)&&e.bindAttribLocation(s,a[p],p);e.linkProgram(s);let c;if(e.getProgramParameter(s,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${zh}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${zh}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${zh}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(r),s;let d,u=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${zh}Shader program link log: ${c}`),m(o,"vertex"),m(r,"fragment"),d=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${zh}Vertex shader compile log: ${c}`),console.error(`${zh} Vertex shader source:
  90. ${n}`),d=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${zh}Fragment shader compile log: ${c}`),console.error(`${zh} Fragment shader source:
  91. ${i}`),d=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new de(d);function m(p,g){if(!l(u))return;let f=u.getTranslatedShaderSource(p);if(f===""){console.error(`${zh}${g} shader translation failed.`);return}console.error(`${zh}Translated ${g} shaderSource:
  92. ${f}`)}}function $Le(e,t,n){let i={};for(let o=0;o<n;++o){let r=e.getActiveAttrib(t,o),s=e.getAttribLocation(t,r.name);i[r.name]={name:r.name,type:r.type,index:s}}return i}function eRe(e,t){let n={},i=[],o=[],r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<r;++s){let a=e.getActiveUniform(t,s),c="[0]",d=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(d.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let u=e.getUniformLocation(t,d);if(u!==null){let m=iR(e,a,d,u);n[d]=m,i.push(m),m._setSampler&&o.push(m)}}else{let u,m,p,g,f=d.indexOf("[");if(f>=0){if(u=n[d.slice(0,f)],!l(u))continue;m=u._locations,m.length<=1&&(p=u.value,g=e.getUniformLocation(t,d),g!==null&&(m.push(g),p.push(e.getUniform(t,g))))}else{m=[];for(let x=0;x<a.size;++x)g=e.getUniformLocation(t,`${d}[${x}]`),g!==null&&m.push(g);u=oR(e,a,d,m),n[d]=u,i.push(u),u._setSampler&&o.push(u)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function tRe(e,t){let n=[],i=[];for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=o,a=e._duplicateUniformNames[s];l(a)&&(r.name=a,s=a);let c=dp[s];l(c)?n.push({uniform:r,automaticUniform:c}):i.push(r)}return{automaticUniforms:n,manualUniforms:i}}function nRe(e,t,n){e.useProgram(t);let i=0,o=n.length;for(let r=0;r<o;++r)i=n[r]._setSampler(i);return e.useProgram(null),i}function ZN(e){l(e._program)||Tee(e)}function Tee(e){let t=e._program,n=e._gl,i=qLe(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),r=eRe(n,i),s=tRe(e,r.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=$Le(n,i,o),e._uniformsByName=r.uniformsByName,e._uniforms=r.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=nRe(n,i,r.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,d,u){let m=e._vertexShaderText,p=e._fragmentShaderText,g=/ ! = /g;e._vertexShaderText=a.replace(g," != "),e._fragmentShaderText=c.replace(g," != ");try{Tee(e),d(e._program)}catch(f){e._vertexShaderText=m,e._fragmentShaderText=p;let _=/(?:Compile|Link) error: ([^]*)/.exec(f.message);u(_?_[1]:f.message)}})}gp.prototype._bind=function(){ZN(this),this._gl.useProgram(this._program)};gp.prototype._setUniforms=function(e,t,n){let i,o;if(l(e)){let a=this._manualUniforms;for(i=a.length,o=0;o<i;++o){let c=a[o];c.value=e[c.name]()}}let r=this._automaticUniforms;for(i=r.length,o=0;o<i;++o){let a=r[o];a.uniform.value=a.automaticUniform.getValue(t)}let s=this._uniforms;for(i=s.length,o=0;o<i;++o)s[o].set();if(n){let a=this._gl,c=this._program;a.validateProgram(c)}};gp.prototype.isDestroyed=function(){return!1};gp.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};gp.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),me(this)};var tn=gp;function GN(e){this._context=e}var rR,iRe=new tt({primitiveType:Fe.TRIANGLES}),oRe=new ei({color:new B(0,0,0,0)});function rRe(e,t){return new Wr({context:e,colorTextures:[t],destroyAttachments:!1})}function sRe(e,t){return tn.fromCache({context:e,vertexShaderSource:ix,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function aRe(e,t){return(!l(rR)||rR.viewport.width!==e||rR.viewport.height!==t)&&(rR=Ue.fromCache({viewport:new Ke(0,0,e,t)})),rR}GN.prototype.execute=function(e){l(e.preExecute)&&e.preExecute(e);let t=e.outputTexture,n=t.width,i=t.height,o=this._context,r=l(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=l(e.shaderProgram)?e.shaderProgram:sRe(o,e.fragmentShaderSource),a=rRe(o,t),c=aRe(n,i),d=e.uniformMap,u=oRe;u.framebuffer=a,u.renderState=c,u.execute(o);let m=iRe;m.vertexArray=r,m.renderState=c,m.shaderProgram=s,m.uniformMap=d,m.framebuffer=a,m.execute(o),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&r.destroy()),l(e.postExecute)&&e.postExecute(t)};GN.prototype.isDestroyed=function(){return!1};GN.prototype.destroy=function(){return me(this)};var sR=GN;var QDt=T(S(),1);var UXt=T(S(),1);var Gn={BYTE:ie.BYTE,UNSIGNED_BYTE:ie.UNSIGNED_BYTE,SHORT:ie.SHORT,UNSIGNED_SHORT:ie.UNSIGNED_SHORT,INT:ie.INT,UNSIGNED_INT:ie.UNSIGNED_INT,FLOAT:ie.FLOAT,DOUBLE:ie.DOUBLE};Gn.getSizeInBytes=function(e){switch(e){case Gn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case Gn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Gn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case Gn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Gn.INT:return Int32Array.BYTES_PER_ELEMENT;case Gn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Gn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case Gn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};Gn.fromTypedArray=function(e){if(e instanceof Int8Array)return Gn.BYTE;if(e instanceof Uint8Array)return Gn.UNSIGNED_BYTE;if(e instanceof Int16Array)return Gn.SHORT;if(e instanceof Uint16Array)return Gn.UNSIGNED_SHORT;if(e instanceof Int32Array)return Gn.INT;if(e instanceof Uint32Array)return Gn.UNSIGNED_INT;if(e instanceof Float32Array)return Gn.FLOAT;if(e instanceof Float64Array)return Gn.DOUBLE};Gn.validate=function(e){return l(e)&&(e===Gn.BYTE||e===Gn.UNSIGNED_BYTE||e===Gn.SHORT||e===Gn.UNSIGNED_SHORT||e===Gn.INT||e===Gn.UNSIGNED_INT||e===Gn.FLOAT||e===Gn.DOUBLE)};Gn.createTypedArray=function(e,t){switch(e){case Gn.BYTE:return new Int8Array(t);case Gn.UNSIGNED_BYTE:return new Uint8Array(t);case Gn.SHORT:return new Int16Array(t);case Gn.UNSIGNED_SHORT:return new Uint16Array(t);case Gn.INT:return new Int32Array(t);case Gn.UNSIGNED_INT:return new Uint32Array(t);case Gn.FLOAT:return new Float32Array(t);case Gn.DOUBLE:return new Float64Array(t)}};Gn.createArrayBufferView=function(e,t,n,i){switch(n=y(n,0),i=y(i,(t.byteLength-n)/Gn.getSizeInBytes(e)),e){case Gn.BYTE:return new Int8Array(t,n,i);case Gn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case Gn.SHORT:return new Int16Array(t,n,i);case Gn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case Gn.INT:return new Int32Array(t,n,i);case Gn.UNSIGNED_INT:return new Uint32Array(t,n,i);case Gn.FLOAT:return new Float32Array(t,n,i);case Gn.DOUBLE:return new Float64Array(t,n,i)}};Gn.fromName=function(e){switch(e){case"BYTE":return Gn.BYTE;case"UNSIGNED_BYTE":return Gn.UNSIGNED_BYTE;case"SHORT":return Gn.SHORT;case"UNSIGNED_SHORT":return Gn.UNSIGNED_SHORT;case"INT":return Gn.INT;case"UNSIGNED_INT":return Gn.UNSIGNED_INT;case"FLOAT":return Gn.FLOAT;case"DOUBLE":return Gn.DOUBLE}};var Q=Object.freeze(Gn);var oWt=T(S(),1);var BXt=T(S(),1),cRe={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},du=Object.freeze(cRe);function FO(e){e=y(e,y.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=y(e.primitiveType,Fe.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=y(e.geometryType,du.NONE),this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}FO.computeNumberOfVertices=function(e){let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&l(e.attributes[n])&&l(e.attributes[n].values)){let i=e.attributes[n];t=i.values.length/i.componentsPerAttribute}return t};var lRe=new he,dRe=new h,See=new M,uRe=[new he,new he,new he],mRe=[new D,new D,new D],hRe=[new D,new D,new D],fRe=new h,pRe=new we,bRe=new M,gRe=new wi;FO._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=ae.center(i,lRe),s=he.toCartesian(r,n,dRe),a=Ft.eastNorthUpToFixedFrame(s,n,See),c=M.inverse(a,See),d=mRe,u=uRe;u[0].longitude=i.west,u[0].latitude=i.south,u[1].longitude=i.west,u[1].latitude=i.north,u[2].longitude=i.east,u[2].latitude=i.south;let m=fRe;for(o=0;o<3;o++)he.toCartesian(u[o],n,m),m=M.multiplyByPointAsVector(c,m,m),d[o].x=m.x,d[o].y=m.y;let p=we.fromAxisAngle(h.UNIT_Z,-t,pRe),g=$.fromQuaternion(p,bRe),f=e.length,x=Number.POSITIVE_INFINITY,_=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,V=Number.NEGATIVE_INFINITY;for(o=0;o<f;o++)m=M.multiplyByPointAsVector(c,e[o],m),m=$.multiplyByVector(g,m,m),x=Math.min(x,m.x),_=Math.min(_,m.y),C=Math.max(C,m.x),V=Math.max(V,m.y);let L=wi.fromRotation(t,gRe),Z=hRe;Z[0].x=x,Z[0].y=_,Z[1].x=x,Z[1].y=V,Z[2].x=C,Z[2].y=_;let G=d[0],I=d[2].x-G.x,v=d[1].y-G.y;for(o=0;o<3;o++){let R=Z[o];wi.multiplyByVector(L,R,R),R.x=(R.x-G.x)/I,R.y=(R.y-G.y)/v}let P=Z[0],w=Z[1],F=Z[2],b=new Array(6);return D.pack(P,b),D.pack(w,b,2),D.pack(F,b,4),b};var ht=FO;var aWt=T(S(),1);function yRe(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.values=e.values}var Ze=yRe;var WWt=T(S(),1);var GWt=T(S(),1);var dWt=T(S(),1);function US(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(US.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}},arrayBufferView:{get:function(){return this._buffer}}});US.clone=function(e){if(l(e))return new US(e._format,e._datatype,e._width,e._height,e._buffer)};US.prototype.clone=function(){return US.clone(this)};var aR=US;var SWt=T(S(),1),Cee=T(id(),1);function Vee(){if(!l(oa._canTransferArrayBuffer)){let e=NO("transferTypedArrayTest");e.postMessage=y(e.webkitPostMessage,e.postMessage);let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return oa._canTransferArrayBuffer=!1,oa._canTransferArrayBuffer}oa._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,s=l(r)&&r[0]===t;i(s),e.terminate(),oa._canTransferArrayBuffer=s}})}return oa._canTransferArrayBuffer}var MO=new be;function AO(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{let o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,r=new o;r.append(e),t=r.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function NO(e){let t=new Cee.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(L0(e))s=e;else if(!n){let a=rn(`${oa._workerModulePrefix}/${i}.js`);L0(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=AO(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=`
  93. importScripts("${AO(CESIUM_WORKERS)}");
  94. CesiumWorkers["${i}"]();
  95. `;return r=AO(a),new Worker(r,o)}if(r=e,n||(r=rn(`${oa._workerModulePrefix+i}.js`)),!zt.supportsEsmWebWorkers())throw new de("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function xRe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!zt.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new de(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=rn(t.fallbackModulePath),n}n.wasmBinaryFile=rn(t.wasmBinaryFile);let i=await Ee.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function oa(e,t){this._workerPath=e,this._maximumActiveTasks=y(t,Number.POSITIVE_INFINITY),this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var _Re=(e,t,n,i)=>{let o=({data:r})=>{if(r.id===t){if(l(r.error)){let s=r.error;s.name==="RuntimeError"?(s=new de(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new pe(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),MO.raiseEvent(s),i(s)}else MO.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},TRe=[];async function SRe(e,t,n){let i=await Promise.resolve(Vee());l(n)?i||(n.length=0):n=TRe;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",_Re(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:rn.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function CRe(e,t,n){++e._activeTasks;try{let i=await SRe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}oa.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=NO(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return CRe(this,e,t)};oa.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=NO(this._workerPath),i=await xRe(this,e),o=await Promise.resolve(Vee()),r,s=i.wasmBinary;l(s)&&o&&(r=[s]);let a=new Promise((c,d)=>{n.onmessage=function({data:u}){l(u)?c(u.result):d(new de("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};oa.prototype.isDestroyed=function(){return!1};oa.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),me(this)};oa.taskCompletedEvent=MO;oa._defaultWorkerModulePrefix="Workers/";oa._workerModulePrefix=oa._defaultWorkerModulePrefix;oa._canTransferArrayBuffer=void 0;var bi=oa;function yp(){}yp._transcodeTaskProcessor=new bi("transcodeKTX2",Number.POSITIVE_INFINITY);yp._readyPromise=void 0;function VRe(){let e=yp._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return yp._transcodeTaskProcessor;throw new de("KTX2 transcoder could not be initialized.")});yp._readyPromise=e}yp.transcode=function(e,t){return l(yp._readyPromise)||VRe(),yp._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));let o={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(o,[i.buffer])}).then(function(n){let i=n.length,o=Object.keys(n[0]);for(let r=0;r<i;r++){let s=n[r];for(let a=0;a<o.length;a++){let c=s[o[a]];s[o[a]]=new aR(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(o.length===1){for(let r=0;r<i;++r)n[r]=n[r][o[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var cR=yp;var Lee;Ree.setKTX2SupportedFormats=function(e,t,n,i,o,r){Lee={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:r}};function Ree(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=Ee.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return cR.transcode(n,Lee)})}var _l=Ree;var nwt=T(S(),1);var g2t=T(S(),1);var JWt=T(S(),1);var wWt=T(S(),1);function LRe(e,t){this.start=y(e,0),this.stop=y(t,0)}var La=LRe;function fn(e,t){this.center=h.clone(y(e,h.ZERO)),this.radius=y(t,0)}var DO=new h,BO=new h,OO=new h,YO=new h,HO=new h,zO=new h,KO=new h,ra=new h,JO=new h,QO=new h,jO=new h,qO=new h,RRe=4/3*W.PI;fn.fromPoints=function(e,t){if(l(t)||(t=new fn),!l(e)||e.length===0)return t.center=h.clone(h.ZERO,t.center),t.radius=0,t;let n=h.clone(e[0],KO),i=h.clone(n,DO),o=h.clone(n,BO),r=h.clone(n,OO),s=h.clone(n,YO),a=h.clone(n,HO),c=h.clone(n,zO),d=e.length,u;for(u=1;u<d;u++){h.clone(e[u],n);let P=n.x,w=n.y,F=n.z;P<i.x&&h.clone(n,i),P>s.x&&h.clone(n,s),w<o.y&&h.clone(n,o),w>a.y&&h.clone(n,a),F<r.z&&h.clone(n,r),F>c.z&&h.clone(n,c)}let m=h.magnitudeSquared(h.subtract(s,i,ra)),p=h.magnitudeSquared(h.subtract(a,o,ra)),g=h.magnitudeSquared(h.subtract(c,r,ra)),f=i,x=s,_=m;p>_&&(_=p,f=o,x=a),g>_&&(_=g,f=r,x=c);let C=JO;C.x=(f.x+x.x)*.5,C.y=(f.y+x.y)*.5,C.z=(f.z+x.z)*.5;let V=h.magnitudeSquared(h.subtract(x,C,ra)),L=Math.sqrt(V),Z=QO;Z.x=i.x,Z.y=o.y,Z.z=r.z;let G=jO;G.x=s.x,G.y=a.y,G.z=c.z;let I=h.midpoint(Z,G,qO),v=0;for(u=0;u<d;u++){h.clone(e[u],n);let P=h.magnitude(h.subtract(n,I,ra));P>v&&(v=P);let w=h.magnitudeSquared(h.subtract(n,C,ra));if(w>V){let F=Math.sqrt(w);L=(L+F)*.5,V=L*L;let b=F-L;C.x=(L*C.x+b*n.x)/F,C.y=(L*C.y+b*n.y)/F,C.z=(L*C.z+b*n.z)/F}}return L<v?(h.clone(C,t.center),t.radius=L):(h.clone(I,t.center),t.radius=v),t};var Zee=new Ri,ZRe=new h,GRe=new h,kO=new he,UO=new he;fn.fromRectangle2D=function(e,t,n){return fn.fromRectangleWithHeights2D(e,t,0,0,n)};fn.fromRectangleWithHeights2D=function(e,t,n,i,o){if(l(o)||(o=new fn),!l(e))return o.center=h.clone(h.ZERO,o.center),o.radius=0,o;Zee._ellipsoid=ne.default,t=y(t,Zee),ae.southwest(e,kO),kO.height=n,ae.northeast(e,UO),UO.height=i;let r=t.project(kO,ZRe),s=t.project(UO,GRe),a=s.x-r.x,c=s.y-r.y,d=s.z-r.z;o.radius=Math.sqrt(a*a+c*c+d*d)*.5;let u=o.center;return u.x=r.x+a*.5,u.y=r.y+c*.5,u.z=r.z+d*.5,o};var ERe=[];fn.fromRectangle3D=function(e,t,n,i){if(t=y(t,ne.default),n=y(n,0),l(i)||(i=new fn),!l(e))return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;let o=ae.subsample(e,t,n,ERe);return fn.fromPoints(o,i)};fn.fromVertices=function(e,t,n,i){if(l(i)||(i=new fn),!l(e)||e.length===0)return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;t=y(t,h.ZERO),n=y(n,3);let o=KO;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;let r=h.clone(o,DO),s=h.clone(o,BO),a=h.clone(o,OO),c=h.clone(o,YO),d=h.clone(o,HO),u=h.clone(o,zO),m=e.length,p;for(p=0;p<m;p+=n){let F=e[p]+t.x,b=e[p+1]+t.y,R=e[p+2]+t.z;o.x=F,o.y=b,o.z=R,F<r.x&&h.clone(o,r),F>c.x&&h.clone(o,c),b<s.y&&h.clone(o,s),b>d.y&&h.clone(o,d),R<a.z&&h.clone(o,a),R>u.z&&h.clone(o,u)}let g=h.magnitudeSquared(h.subtract(c,r,ra)),f=h.magnitudeSquared(h.subtract(d,s,ra)),x=h.magnitudeSquared(h.subtract(u,a,ra)),_=r,C=c,V=g;f>V&&(V=f,_=s,C=d),x>V&&(V=x,_=a,C=u);let L=JO;L.x=(_.x+C.x)*.5,L.y=(_.y+C.y)*.5,L.z=(_.z+C.z)*.5;let Z=h.magnitudeSquared(h.subtract(C,L,ra)),G=Math.sqrt(Z),I=QO;I.x=r.x,I.y=s.y,I.z=a.z;let v=jO;v.x=c.x,v.y=d.y,v.z=u.z;let P=h.midpoint(I,v,qO),w=0;for(p=0;p<m;p+=n){o.x=e[p]+t.x,o.y=e[p+1]+t.y,o.z=e[p+2]+t.z;let F=h.magnitude(h.subtract(o,P,ra));F>w&&(w=F);let b=h.magnitudeSquared(h.subtract(o,L,ra));if(b>Z){let R=Math.sqrt(b);G=(G+R)*.5,Z=G*G;let E=R-G;L.x=(G*L.x+E*o.x)/R,L.y=(G*L.y+E*o.y)/R,L.z=(G*L.z+E*o.z)/R}}return G<w?(h.clone(L,i.center),i.radius=G):(h.clone(P,i.center),i.radius=w),i};fn.fromEncodedCartesianVertices=function(e,t,n){if(l(n)||(n=new fn),!l(e)||!l(t)||e.length!==t.length||e.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=KO;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let o=h.clone(i,DO),r=h.clone(i,BO),s=h.clone(i,OO),a=h.clone(i,YO),c=h.clone(i,HO),d=h.clone(i,zO),u=e.length,m;for(m=0;m<u;m+=3){let w=e[m]+t[m],F=e[m+1]+t[m+1],b=e[m+2]+t[m+2];i.x=w,i.y=F,i.z=b,w<o.x&&h.clone(i,o),w>a.x&&h.clone(i,a),F<r.y&&h.clone(i,r),F>c.y&&h.clone(i,c),b<s.z&&h.clone(i,s),b>d.z&&h.clone(i,d)}let p=h.magnitudeSquared(h.subtract(a,o,ra)),g=h.magnitudeSquared(h.subtract(c,r,ra)),f=h.magnitudeSquared(h.subtract(d,s,ra)),x=o,_=a,C=p;g>C&&(C=g,x=r,_=c),f>C&&(C=f,x=s,_=d);let V=JO;V.x=(x.x+_.x)*.5,V.y=(x.y+_.y)*.5,V.z=(x.z+_.z)*.5;let L=h.magnitudeSquared(h.subtract(_,V,ra)),Z=Math.sqrt(L),G=QO;G.x=o.x,G.y=r.y,G.z=s.z;let I=jO;I.x=a.x,I.y=c.y,I.z=d.z;let v=h.midpoint(G,I,qO),P=0;for(m=0;m<u;m+=3){i.x=e[m]+t[m],i.y=e[m+1]+t[m+1],i.z=e[m+2]+t[m+2];let w=h.magnitude(h.subtract(i,v,ra));w>P&&(P=w);let F=h.magnitudeSquared(h.subtract(i,V,ra));if(F>L){let b=Math.sqrt(F);Z=(Z+b)*.5,L=Z*Z;let R=b-Z;V.x=(Z*V.x+R*i.x)/b,V.y=(Z*V.y+R*i.y)/b,V.z=(Z*V.z+R*i.z)/b}}return Z<P?(h.clone(V,n.center),n.radius=Z):(h.clone(v,n.center),n.radius=P),n};fn.fromCornerPoints=function(e,t,n){l(n)||(n=new fn);let i=h.midpoint(e,t,n.center);return n.radius=h.distance(i,t),n};fn.fromEllipsoid=function(e,t){return l(t)||(t=new fn),h.clone(h.ZERO,t.center),t.radius=e.maximumRadius,t};var IRe=new h;fn.fromBoundingSpheres=function(e,t){if(l(t)||(t=new fn),!l(e)||e.length===0)return t.center=h.clone(h.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return fn.clone(e[0],t);if(n===2)return fn.union(e[0],e[1],t);let i=[],o;for(o=0;o<n;o++)i.push(e[o].center);t=fn.fromPoints(i,t);let r=t.center,s=t.radius;for(o=0;o<n;o++){let a=e[o];s=Math.max(s,h.distance(r,a.center,IRe)+a.radius)}return t.radius=s,t};var XRe=new h,WRe=new h,PRe=new h;fn.fromOrientedBoundingBox=function(e,t){l(t)||(t=new fn);let n=e.halfAxes,i=$.getColumn(n,0,XRe),o=$.getColumn(n,1,WRe),r=$.getColumn(n,2,PRe);return h.add(i,o,i),h.add(i,r,i),t.center=h.clone(e.center,t.center),t.radius=h.magnitude(i),t};var vRe=new h,wRe=new h;fn.fromTransformation=function(e,t){l(t)||(t=new fn);let n=M.getTranslation(e,vRe),i=M.getScale(e,wRe),o=.5*h.magnitude(i);return t.center=h.clone(n,t.center),t.radius=o,t};fn.clone=function(e,t){if(l(e))return l(t)?(t.center=h.clone(e.center,t.center),t.radius=e.radius,t):new fn(e.center,e.radius)};fn.packedLength=4;fn.pack=function(e,t,n){n=y(n,0);let i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t};fn.unpack=function(e,t,n){t=y(t,0),l(n)||(n=new fn);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var FRe=new h,ARe=new h;fn.union=function(e,t,n){l(n)||(n=new fn);let i=e.center,o=e.radius,r=t.center,s=t.radius,a=h.subtract(r,i,FRe),c=h.magnitude(a);if(o>=c+s)return e.clone(n),n;if(s>=c+o)return t.clone(n),n;let d=(o+c+s)*.5,u=h.multiplyByScalar(a,(-o+d)/c,ARe);return h.add(u,i,u),h.clone(u,n.center),n.radius=d,n};var MRe=new h;fn.expand=function(e,t,n){n=fn.clone(e,n);let i=h.magnitude(h.subtract(t,n.center,MRe));return i>n.radius&&(n.radius=i),n};fn.intersectPlane=function(e,t){let n=e.center,i=e.radius,o=t.normal,r=h.dot(o,n)+t.distance;return r<-i?Jt.OUTSIDE:r<i?Jt.INTERSECTING:Jt.INSIDE};fn.transform=function(e,t,n){return l(n)||(n=new fn),n.center=M.multiplyByPoint(t,e.center,n.center),n.radius=M.getMaximumScale(t)*e.radius,n};var NRe=new h;fn.distanceSquaredTo=function(e,t){let n=h.subtract(e.center,t,NRe),i=h.magnitude(n)-e.radius;return i<=0?0:i*i};fn.transformWithoutScale=function(e,t,n){return l(n)||(n=new fn),n.center=M.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var kRe=new h;fn.computePlaneDistances=function(e,t,n,i){l(i)||(i=new La);let o=h.subtract(e.center,t,kRe),r=h.dot(n,o);return i.start=r-e.radius,i.stop=r+e.radius,i};var Gee=new h,URe=new h,DRe=new h,BRe=new h,ORe=new h,YRe=new he,Iee=new Array(8);for(let e=0;e<8;++e)Iee[e]=new h;var Eee=new Ri;fn.projectTo2D=function(e,t,n){Eee._ellipsoid=ne.default,t=y(t,Eee);let i=t.ellipsoid,o=e.center,r=e.radius,s;h.equals(o,h.ZERO)?s=h.clone(h.UNIT_X,Gee):s=i.geodeticSurfaceNormal(o,Gee);let a=h.cross(h.UNIT_Z,s,URe);h.normalize(a,a);let c=h.cross(s,a,DRe);h.normalize(c,c),h.multiplyByScalar(s,r,s),h.multiplyByScalar(c,r,c),h.multiplyByScalar(a,r,a);let d=h.negate(c,ORe),u=h.negate(a,BRe),m=Iee,p=m[0];h.add(s,c,p),h.add(p,a,p),p=m[1],h.add(s,c,p),h.add(p,u,p),p=m[2],h.add(s,d,p),h.add(p,u,p),p=m[3],h.add(s,d,p),h.add(p,a,p),h.negate(s,s),p=m[4],h.add(s,c,p),h.add(p,a,p),p=m[5],h.add(s,c,p),h.add(p,u,p),p=m[6],h.add(s,d,p),h.add(p,u,p),p=m[7],h.add(s,d,p),h.add(p,a,p);let g=m.length;for(let C=0;C<g;++C){let V=m[C];h.add(o,V,V);let L=i.cartesianToCartographic(V,YRe);t.project(L,V)}n=fn.fromPoints(m,n),o=n.center;let f=o.x,x=o.y,_=o.z;return o.x=_,o.y=f,o.z=x,n};fn.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)};fn.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&e.radius===t.radius};fn.prototype.intersectPlane=function(e){return fn.intersectPlane(this,e)};fn.prototype.distanceSquaredTo=function(e){return fn.distanceSquaredTo(this,e)};fn.prototype.computePlaneDistances=function(e,t,n){return fn.computePlaneDistances(this,e,t,n)};fn.prototype.isOccluded=function(e){return fn.isOccluded(this,e)};fn.prototype.equals=function(e){return fn.equals(this,e)};fn.prototype.clone=function(e){return fn.clone(this,e)};fn.prototype.volume=function(){let e=this.radius;return RRe*e*e*e};var ce=fn;var qWt=T(S(),1);function HRe(e){e=y(e,y.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}var mn=HRe;var e2t=T(S(),1),zRe={NONE:0,TOP:1,ALL:2},cn=Object.freeze(zRe);var o2t=T(S(),1);function us(e){e=y(e,y.EMPTY_OBJECT),this.position=y(e.position,!1),this.normal=y(e.normal,!1),this.st=y(e.st,!1),this.bitangent=y(e.bitangent,!1),this.tangent=y(e.tangent,!1),this.color=y(e.color,!1)}us.POSITION_ONLY=Object.freeze(new us({position:!0}));us.POSITION_AND_NORMAL=Object.freeze(new us({position:!0,normal:!0}));us.POSITION_NORMAL_AND_ST=Object.freeze(new us({position:!0,normal:!0,st:!0}));us.POSITION_AND_ST=Object.freeze(new us({position:!0,st:!0}));us.POSITION_AND_COLOR=Object.freeze(new us({position:!0,color:!0}));us.ALL=Object.freeze(new us({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));us.DEFAULT=us.POSITION_NORMAL_AND_ST;us.packedLength=6;us.pack=function(e,t,n){return n=y(n,0),t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t};us.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new us),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n};us.clone=function(e,t){if(l(e))return l(t)||(t=new us),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};var We=us;var KRe=new h;function rd(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum,i=y(e.vertexFormat,We.DEFAULT);this._minimum=h.clone(t),this._maximum=h.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}rd.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new rd({minimum:h.negate(n,new h),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};rd.fromAxisAlignedBoundingBox=function(e){return new rd({minimum:e.minimum,maximum:e.maximum})};rd.packedLength=2*h.packedLength+We.packedLength+1;rd.pack=function(e,t,n){return n=y(n,0),h.pack(e._minimum,t,n),h.pack(e._maximum,t,n+h.packedLength),We.pack(e._vertexFormat,t,n+2*h.packedLength),t[n+2*h.packedLength+We.packedLength]=y(e._offsetAttribute,-1),t};var Wee=new h,Pee=new h,vee=new We,Xee={minimum:Wee,maximum:Pee,vertexFormat:vee,offsetAttribute:void 0};rd.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,Wee),o=h.unpack(e,t+h.packedLength,Pee),r=We.unpack(e,t+2*h.packedLength,vee),s=e[t+2*h.packedLength+We.packedLength];return l(n)?(n._minimum=h.clone(i,n._minimum),n._maximum=h.clone(o,n._maximum),n._vertexFormat=We.clone(r,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(Xee.offsetAttribute=s===-1?void 0:s,new rd(Xee))};rd.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(h.equals(t,n))return;let o=new mn,r,s;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(s=new Float64Array(6*4*3),s[0]=t.x,s[1]=t.y,s[2]=n.z,s[3]=n.x,s[4]=t.y,s[5]=n.z,s[6]=n.x,s[7]=n.y,s[8]=n.z,s[9]=t.x,s[10]=n.y,s[11]=n.z,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=n.x,s[16]=t.y,s[17]=t.z,s[18]=n.x,s[19]=n.y,s[20]=t.z,s[21]=t.x,s[22]=n.y,s[23]=t.z,s[24]=n.x,s[25]=t.y,s[26]=t.z,s[27]=n.x,s[28]=n.y,s[29]=t.z,s[30]=n.x,s[31]=n.y,s[32]=n.z,s[33]=n.x,s[34]=t.y,s[35]=n.z,s[36]=t.x,s[37]=t.y,s[38]=t.z,s[39]=t.x,s[40]=n.y,s[41]=t.z,s[42]=t.x,s[43]=n.y,s[44]=n.z,s[45]=t.x,s[46]=t.y,s[47]=n.z,s[48]=t.x,s[49]=n.y,s[50]=t.z,s[51]=n.x,s[52]=n.y,s[53]=t.z,s[54]=n.x,s[55]=n.y,s[56]=n.z,s[57]=t.x,s[58]=n.y,s[59]=n.z,s[60]=t.x,s[61]=t.y,s[62]=t.z,s[63]=n.x,s[64]=t.y,s[65]=t.z,s[66]=n.x,s[67]=t.y,s[68]=n.z,s[69]=t.x,s[70]=t.y,s[71]=n.z,o.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let d=new Float32Array(72);d[0]=0,d[1]=0,d[2]=1,d[3]=0,d[4]=0,d[5]=1,d[6]=0,d[7]=0,d[8]=1,d[9]=0,d[10]=0,d[11]=1,d[12]=0,d[13]=0,d[14]=-1,d[15]=0,d[16]=0,d[17]=-1,d[18]=0,d[19]=0,d[20]=-1,d[21]=0,d[22]=0,d[23]=-1,d[24]=1,d[25]=0,d[26]=0,d[27]=1,d[28]=0,d[29]=0,d[30]=1,d[31]=0,d[32]=0,d[33]=1,d[34]=0,d[35]=0,d[36]=-1,d[37]=0,d[38]=0,d[39]=-1,d[40]=0,d[41]=0,d[42]=-1,d[43]=0,d[44]=0,d[45]=-1,d[46]=0,d[47]=0,d[48]=0,d[49]=1,d[50]=0,d[51]=0,d[52]=1,d[53]=0,d[54]=0,d[55]=1,d[56]=0,d[57]=0,d[58]=1,d[59]=0,d[60]=0,d[61]=-1,d[62]=0,d[63]=0,d[64]=-1,d[65]=0,d[66]=0,d[67]=-1,d[68]=0,d[69]=0,d[70]=-1,d[71]=0,o.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:d})}if(i.st){let d=new Float32Array(48);d[0]=0,d[1]=0,d[2]=1,d[3]=0,d[4]=1,d[5]=1,d[6]=0,d[7]=1,d[8]=1,d[9]=0,d[10]=0,d[11]=0,d[12]=0,d[13]=1,d[14]=1,d[15]=1,d[16]=0,d[17]=0,d[18]=1,d[19]=0,d[20]=1,d[21]=1,d[22]=0,d[23]=1,d[24]=1,d[25]=0,d[26]=0,d[27]=0,d[28]=0,d[29]=1,d[30]=1,d[31]=1,d[32]=1,d[33]=0,d[34]=0,d[35]=0,d[36]=0,d[37]=1,d[38]=1,d[39]=1,d[40]=0,d[41]=0,d[42]=1,d[43]=0,d[44]=1,d[45]=1,d[46]=0,d[47]=1,o.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:d})}if(i.tangent){let d=new Float32Array(72);d[0]=1,d[1]=0,d[2]=0,d[3]=1,d[4]=0,d[5]=0,d[6]=1,d[7]=0,d[8]=0,d[9]=1,d[10]=0,d[11]=0,d[12]=-1,d[13]=0,d[14]=0,d[15]=-1,d[16]=0,d[17]=0,d[18]=-1,d[19]=0,d[20]=0,d[21]=-1,d[22]=0,d[23]=0,d[24]=0,d[25]=1,d[26]=0,d[27]=0,d[28]=1,d[29]=0,d[30]=0,d[31]=1,d[32]=0,d[33]=0,d[34]=1,d[35]=0,d[36]=0,d[37]=-1,d[38]=0,d[39]=0,d[40]=-1,d[41]=0,d[42]=0,d[43]=-1,d[44]=0,d[45]=0,d[46]=-1,d[47]=0,d[48]=-1,d[49]=0,d[50]=0,d[51]=-1,d[52]=0,d[53]=0,d[54]=-1,d[55]=0,d[56]=0,d[57]=-1,d[58]=0,d[59]=0,d[60]=1,d[61]=0,d[62]=0,d[63]=1,d[64]=0,d[65]=0,d[66]=1,d[67]=0,d[68]=0,d[69]=1,d[70]=0,d[71]=0,o.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:d})}if(i.bitangent){let d=new Float32Array(72);d[0]=0,d[1]=1,d[2]=0,d[3]=0,d[4]=1,d[5]=0,d[6]=0,d[7]=1,d[8]=0,d[9]=0,d[10]=1,d[11]=0,d[12]=0,d[13]=1,d[14]=0,d[15]=0,d[16]=1,d[17]=0,d[18]=0,d[19]=1,d[20]=0,d[21]=0,d[22]=1,d[23]=0,d[24]=0,d[25]=0,d[26]=1,d[27]=0,d[28]=0,d[29]=1,d[30]=0,d[31]=0,d[32]=1,d[33]=0,d[34]=0,d[35]=1,d[36]=0,d[37]=0,d[38]=1,d[39]=0,d[40]=0,d[41]=1,d[42]=0,d[43]=0,d[44]=1,d[45]=0,d[46]=0,d[47]=1,d[48]=0,d[49]=0,d[50]=1,d[51]=0,d[52]=0,d[53]=1,d[54]=0,d[55]=0,d[56]=1,d[57]=0,d[58]=0,d[59]=1,d[60]=0,d[61]=0,d[62]=1,d[63]=0,d[64]=0,d[65]=1,d[66]=0,d[67]=0,d[68]=1,d[69]=0,d[70]=0,d[71]=1,o.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:d})}r=new Uint16Array(6*2*3),r[0]=0,r[1]=1,r[2]=2,r[3]=0,r[4]=2,r[5]=3,r[6]=6,r[7]=5,r[8]=4,r[9]=7,r[10]=6,r[11]=4,r[12]=8,r[13]=9,r[14]=10,r[15]=8,r[16]=10,r[17]=11,r[18]=14,r[19]=13,r[20]=12,r[21]=15,r[22]=14,r[23]=12,r[24]=18,r[25]=17,r[26]=16,r[27]=19,r[28]=18,r[29]=16,r[30]=20,r[31]=21,r[32]=22,r[33]=20,r[34]=22,r[35]=23}else s=new Float64Array(8*3),s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=n.x,s[4]=t.y,s[5]=t.z,s[6]=n.x,s[7]=n.y,s[8]=t.z,s[9]=t.x,s[10]=n.y,s[11]=t.z,s[12]=t.x,s[13]=t.y,s[14]=n.z,s[15]=n.x,s[16]=t.y,s[17]=n.z,s[18]=n.x,s[19]=n.y,s[20]=n.z,s[21]=t.x,s[22]=n.y,s[23]=n.z,o.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s}),r=new Uint16Array(6*2*3),r[0]=4,r[1]=5,r[2]=6,r[3]=4,r[4]=6,r[5]=7,r[6]=1,r[7]=0,r[8]=3,r[9]=1,r[10]=3,r[11]=2,r[12]=1,r[13]=6,r[14]=5,r[15]=1,r[16]=2,r[17]=6,r[18]=2,r[19]=3,r[20]=7,r[21]=2,r[22]=7,r[23]=6,r[24]=3,r[25]=0,r[26]=4,r[27]=3,r[28]=4,r[29]=7,r[30]=0,r[31]=1,r[32]=5,r[33]=0,r[34]=5,r[35]=4;let a=h.subtract(n,t,KRe),c=h.magnitude(a)*.5;if(l(e._offsetAttribute)){let d=s.length,u=e._offsetAttribute===cn.NONE?0:1,m=new Uint8Array(d/3).fill(u);o.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return new ht({attributes:o,indices:r,primitiveType:Fe.TRIANGLES,boundingSphere:new ce(h.ZERO,c),offsetAttribute:e._offsetAttribute})};var $O;rd.getUnitBox=function(){return l($O)||($O=rd.createGeometry(rd.fromDimensions({dimensions:new h(1,1,1),vertexFormat:We.POSITION_ONLY}))),$O};var Ra=rd;var $Pt=T(S(),1);var P2t=T(S(),1);var L2t=T(S(),1);var $i={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};$i.getMathType=function(e){switch(e){case $i.SCALAR:return Number;case $i.VEC2:return D;case $i.VEC3:return h;case $i.VEC4:return se;case $i.MAT2:return wi;case $i.MAT3:return $;case $i.MAT4:return M}};$i.getNumberOfComponents=function(e){switch(e){case $i.SCALAR:return 1;case $i.VEC2:return 2;case $i.VEC3:return 3;case $i.VEC4:case $i.MAT2:return 4;case $i.MAT3:return 9;case $i.MAT4:return 16}};$i.getAttributeLocationCount=function(e){switch(e){case $i.SCALAR:case $i.VEC2:case $i.VEC3:case $i.VEC4:return 1;case $i.MAT2:return 2;case $i.MAT3:return 3;case $i.MAT4:return 4}};$i.getGlslType=function(e){switch(e){case $i.SCALAR:return"float";case $i.VEC2:return"vec2";case $i.VEC3:return"vec3";case $i.VEC4:return"vec4";case $i.MAT2:return"mat2";case $i.MAT3:return"mat3";case $i.MAT4:return"mat4"}};var sn=Object.freeze($i);var wee=1/256,Fee=256,yo={};yo.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,o=n.y;n.x=(1-Math.abs(o))*W.signNotZero(i),n.y=(1-Math.abs(i))*W.signNotZero(o)}return n.x=W.toSNorm(n.x,t),n.y=W.toSNorm(n.y,t),n};yo.octEncode=function(e,t){return yo.octEncodeInRange(e,255,t)};var lR=new D,Aee=new Uint8Array(1);function EN(e){return Aee[0]=e,Aee[0]}yo.octEncodeToCartesian4=function(e,t){return yo.octEncodeInRange(e,65535,lR),t.x=EN(lR.x*wee),t.y=EN(lR.x),t.z=EN(lR.y*wee),t.w=EN(lR.y),t};yo.octDecodeInRange=function(e,t,n,i){if(i.x=W.fromSNorm(e,n),i.y=W.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let o=i.x;i.x=(1-Math.abs(i.y))*W.signNotZero(o),i.y=(1-Math.abs(o))*W.signNotZero(i.y)}return h.normalize(i,i)};yo.octDecode=function(e,t,n){return yo.octDecodeInRange(e,t,255,n)};yo.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,o=e.z,r=e.w,s=n*Fee+i,a=o*Fee+r;return yo.octDecodeInRange(s,a,65535,t)};yo.octPackFloat=function(e){return 256*e.x+e.y};var tY=new D;yo.octEncodeFloat=function(e){return yo.octEncode(e,tY),yo.octPackFloat(tY)};yo.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),o=(n-i)*256;return yo.octDecode(i,o,t)};yo.octPack=function(e,t,n,i){let o=yo.octEncodeFloat(e),r=yo.octEncodeFloat(t),s=yo.octEncode(n,tY);return i.x=65536*s.x+o,i.y=65536*s.y+r,i};yo.octUnpack=function(e,t,n,i){let o=e.x/65536,r=Math.floor(o),s=(o-r)*65536;o=e.y/65536;let a=Math.floor(o),c=(o-a)*65536;yo.octDecodeFloat(s,t),yo.octDecodeFloat(c,n),yo.octDecode(r,a,i)};yo.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};yo.decompressTextureCoordinates=function(e,t){let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function eY(e){return e>>1^-(e&1)}yo.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,s=0;for(let a=0;a<i;++a)o+=eY(e[a]),r+=eY(t[a]),e[a]=o,t[a]=r,l(n)&&(s+=eY(n[a]),n[a]=s)};yo.dequantize=function(e,t,n,i){let o=sn.getNumberOfComponents(n),r;switch(t){case Q.BYTE:r=127;break;case Q.UNSIGNED_BYTE:r=255;break;case Q.SHORT:r=32767;break;case Q.UNSIGNED_SHORT:r=65535;break;case Q.INT:r=2147483647;break;case Q.UNSIGNED_INT:r=4294967295;break}let s=new Float32Array(i*o);for(let a=0;a<i;a++)for(let c=0;c<o;c++){let d=a*o+c;s[d]=Math.max(e[d]/r,-1)}return s};yo.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=31,o=63,r=1/31,s=1/63;for(let a=0;a<n;a++){let c=e[a],d=c>>11,u=c>>5&o,m=c&i,p=3*a;t[p]=d*r,t[p+1]=u*s,t[p+2]=m*r}return t};var wn=yo;var N2t=T(S(),1);var Mee=new h,Nee=new h,kee=new h;function JRe(e,t,n,i,o){l(o)||(o=new h);let r,s,a,c,d,u,m,p;if(l(t.z)){if(h.equalsEpsilon(e,t,W.EPSILON14))return h.clone(h.UNIT_X,o);if(h.equalsEpsilon(e,n,W.EPSILON14))return h.clone(h.UNIT_Y,o);if(h.equalsEpsilon(e,i,W.EPSILON14))return h.clone(h.UNIT_Z,o);r=h.subtract(n,t,Mee),s=h.subtract(i,t,Nee),a=h.subtract(e,t,kee),c=h.dot(r,r),d=h.dot(r,s),u=h.dot(r,a),m=h.dot(s,s),p=h.dot(s,a)}else{if(D.equalsEpsilon(e,t,W.EPSILON14))return h.clone(h.UNIT_X,o);if(D.equalsEpsilon(e,n,W.EPSILON14))return h.clone(h.UNIT_Y,o);if(D.equalsEpsilon(e,i,W.EPSILON14))return h.clone(h.UNIT_Z,o);r=D.subtract(n,t,Mee),s=D.subtract(i,t,Nee),a=D.subtract(e,t,kee),c=D.dot(r,r),d=D.dot(r,s),u=D.dot(r,a),m=D.dot(s,s),p=D.dot(s,a)}o.y=m*u-d*p,o.z=c*p-d*u;let g=c*m-d*d;if(g!==0)return o.y/=g,o.z/=g,o.x=1-o.y-o.z,o}var rx=JRe;var B2t=T(S(),1);function Kh(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}Kh.encode=function(e,t){l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var xp={high:0,low:0};Kh.fromCartesian=function(e,t){l(t)||(t=new Kh);let n=t.high,i=t.low;return Kh.encode(e.x,xp),n.x=xp.high,i.x=xp.low,Kh.encode(e.y,xp),n.y=xp.high,i.y=xp.low,Kh.encode(e.z,xp),n.z=xp.high,i.z=xp.low,t};var nY=new Kh;Kh.writeElements=function(e,t,n){Kh.fromCartesian(e,nY);let i=nY.high,o=nY.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z};var On=Kh;var gPt=T(S(),1);var H2t=T(S(),1);var iY={};iY.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function Uee(e,t,n){let i=e+t;return W.sign(e)!==W.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}iY.computeRealRoots=function(e,t,n){let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let c=Math.abs(n),d=Math.abs(e);if(c<d&&c/d<W.EPSILON14)return[0,0];if(c>d&&d/c<W.EPSILON14)return[];if(i=-n/e,i<0)return[];let u=Math.sqrt(i);return[-u,u]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let o=t*t,r=4*e*n,s=Uee(o,-r,W.EPSILON14);if(s<0)return[];let a=-.5*Uee(t,W.sign(t)*Math.sqrt(s),W.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var Wc=iY;var ePt=T(S(),1);var J2t=T(S(),1);var rY={};rY.computeDiscriminant=function(e,t,n,i){let o=e*e,r=t*t,s=n*n,a=i*i;return 18*e*t*n*i+r*s-27*o*a-4*(e*s*n+r*t*i)};function oY(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,c=o*s,d=r*a,u=r*r,m=s*s,p=o*s-u,g=o*a-r*s,f=r*a-m,x=4*p*f-g*g,_,C;if(x<0){let H,J,te;u*d>=c*m?(H=o,J=p,te=-2*r*p+o*g):(H=a,J=f,te=-a*g+2*s*f);let q=-(te<0?-1:1)*Math.abs(H)*Math.sqrt(-x);C=-te+q;let ee=C/2,fe=ee<0?-Math.pow(-ee,1/3):Math.pow(ee,1/3),_e=C===q?-fe:-J/fe;return _=J<=0?fe+_e:-te/(fe*fe+_e*_e+J),u*d>=c*m?[(_-r)/o]:[-a/(_+s)]}let V=p,L=-2*r*p+o*g,Z=f,G=-a*g+2*s*f,I=Math.sqrt(x),v=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*I,-L)/3);_=2*Math.sqrt(-V);let w=Math.cos(P);C=_*w;let F=_*(-w/2-v*Math.sin(P)),b=C+F>2*r?C-r:F-r,R=o,E=b/R;P=Math.abs(Math.atan2(a*I,-G)/3),_=2*Math.sqrt(-Z),w=Math.cos(P),C=_*w,F=_*(-w/2-v*Math.sin(P));let X=-a,A=C+F<2*s?C+s:F+s,N=X/A,O=R*A,U=-b*A-R*X,Y=b*X,k=(s*U-r*Y)/(-r*U+s*O);return E<=k?E<=N?k<=N?[E,k,N]:[E,N,k]:[N,E,k]:E<=N?[k,E,N]:k<=N?[k,N,E]:[N,k,E]}rY.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return Wc.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];r=-i/e;let s=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[s,s,s]}else if(i===0)return o=Wc.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return oY(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):oY(e,t,0,i);if(i===0)return o=Wc.computeRealRoots(e,t,n),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return oY(e,t,n,i)};var sx=rY;var sY={};sY.computeDiscriminant=function(e,t,n,i,o){let r=e*e,s=r*e,a=t*t,c=a*t,d=n*n,u=d*n,m=i*i,p=m*i,g=o*o,f=g*o;return a*d*m-4*c*p-4*e*u*m+18*e*t*n*p-27*r*m*m+256*s*f+o*(18*c*n*i-4*a*u+16*e*d*d-80*e*t*d*i-6*e*a*m+144*r*n*m)+g*(144*e*a*n-27*a*a-128*r*d-192*r*t*i)};function xm(e,t,n,i){let o=e*e,r=t-3*o/8,s=n-t*e/2+o*e/8,a=i-n*e/4+t*o/16-3*o*o/256,c=sx.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(c.length>0){let d=-e/4,u=c[c.length-1];if(Math.abs(u)<W.EPSILON14){let m=Wc.computeRealRoots(1,r,a);if(m.length===2){let p=m[0],g=m[1],f;if(p>=0&&g>=0){let x=Math.sqrt(p),_=Math.sqrt(g);return[d-_,d-x,d+x,d+_]}else{if(p>=0&&g<0)return f=Math.sqrt(p),[d-f,d+f];if(p<0&&g>=0)return f=Math.sqrt(g),[d-f,d+f]}}return[]}else if(u>0){let m=Math.sqrt(u),p=(r+u-s/m)/2,g=(r+u+s/m)/2,f=Wc.computeRealRoots(1,m,p),x=Wc.computeRealRoots(1,-m,g);return f.length!==0?(f[0]+=d,f[1]+=d,x.length!==0?(x[0]+=d,x[1]+=d,f[1]<=x[0]?[f[0],f[1],x[0],x[1]]:x[1]<=f[0]?[x[0],x[1],f[0],f[1]]:f[0]>=x[0]&&f[1]<=x[1]?[x[0],f[0],f[1],x[1]]:x[0]>=f[0]&&x[1]<=f[1]?[f[0],x[0],x[1],f[1]]:f[0]>x[0]&&f[0]<x[1]?[x[0],f[0],x[1],f[1]]:[f[0],x[0],f[1],x[1]]):f):x.length!==0?(x[0]+=d,x[1]+=d,x):[]}}return[]}function dR(e,t,n,i){let o=n*n,r=t*t,s=e*e,a=-2*t,c=n*e+r-4*i,d=s*i-n*t*e+o,u=sx.computeRealRoots(1,a,c,d);if(u.length>0){let m=u[0],p=t-m,g=p*p,f=e/2,x=p/2,_=g-4*i,C=g+4*Math.abs(i),V=s-4*m,L=s+4*Math.abs(m),Z,G;if(m<0||_*L<V*C){let R=Math.sqrt(V);Z=R/2,G=R===0?0:(e*x-n)/R}else{let R=Math.sqrt(_);Z=R===0?0:(e*x-n)/R,G=R/2}let I,v;f===0&&Z===0?(I=0,v=0):W.sign(f)===W.sign(Z)?(I=f+Z,v=m/I):(v=f-Z,I=m/v);let P,w;x===0&&G===0?(P=0,w=0):W.sign(x)===W.sign(G)?(P=x+G,w=i/P):(w=x-G,P=i/w);let F=Wc.computeRealRoots(1,I,P),b=Wc.computeRealRoots(1,v,w);if(F.length!==0)return b.length!==0?F[1]<=b[0]?[F[0],F[1],b[0],b[1]]:b[1]<=F[0]?[b[0],b[1],F[0],F[1]]:F[0]>=b[0]&&F[1]<=b[1]?[b[0],F[0],F[1],b[1]]:b[0]>=F[0]&&b[1]<=F[1]?[F[0],b[0],b[1],F[1]]:F[0]>b[0]&&F[0]<b[1]?[b[0],F[0],b[1],F[1]]:[F[0],b[0],F[1],b[1]]:F;if(b.length!==0)return b}return[]}sY.computeRealRoots=function(e,t,n,i,o){if(Math.abs(e)<W.EPSILON15)return sx.computeRealRoots(t,n,i,o);let r=t/e,s=n/e,a=i/e,c=o/e,d=r<0?1:0;switch(d+=s<0?d+1:d,d+=a<0?d+1:d,d+=c<0?d+1:d,d){case 0:return xm(r,s,a,c);case 1:return dR(r,s,a,c);case 2:return dR(r,s,a,c);case 3:return xm(r,s,a,c);case 4:return xm(r,s,a,c);case 5:return dR(r,s,a,c);case 6:return xm(r,s,a,c);case 7:return xm(r,s,a,c);case 8:return dR(r,s,a,c);case 9:return xm(r,s,a,c);case 10:return xm(r,s,a,c);case 11:return dR(r,s,a,c);case 12:return xm(r,s,a,c);case 13:return xm(r,s,a,c);case 14:return xm(r,s,a,c);case 15:return xm(r,s,a,c);default:return}};var uR=sY;var rPt=T(S(),1);function IN(e,t){t=h.clone(y(t,h.ZERO)),h.equals(t,h.ZERO)||h.normalize(t,t),this.origin=h.clone(y(e,h.ZERO)),this.direction=t}IN.clone=function(e,t){if(l(e))return l(t)?(t.origin=h.clone(e.origin),t.direction=h.clone(e.direction),t):new IN(e.origin,e.direction)};IN.getPoint=function(e,t,n){return l(n)||(n=new h),n=h.multiplyByScalar(e.direction,t,n),h.add(e.origin,n,n)};var pn=IN;var Ao={};Ao.rayPlane=function(e,t,n){l(n)||(n=new h);let i=e.origin,o=e.direction,r=t.normal,s=h.dot(r,o);if(Math.abs(s)<W.EPSILON15)return;let a=(-t.distance-h.dot(r,i))/s;if(!(a<0))return n=h.multiplyByScalar(o,a,n),h.add(i,n,n)};var QRe=new h,jRe=new h,Jee=new h,Dee=new h,Bee=new h;Ao.rayTriangleParametric=function(e,t,n,i,o){o=y(o,!1);let r=e.origin,s=e.direction,a=h.subtract(n,t,QRe),c=h.subtract(i,t,jRe),d=h.cross(s,c,Jee),u=h.dot(a,d),m,p,g,f,x;if(o){if(u<W.EPSILON6||(m=h.subtract(r,t,Dee),g=h.dot(m,d),g<0||g>u)||(p=h.cross(m,a,Bee),f=h.dot(s,p),f<0||g+f>u))return;x=h.dot(c,p)/u}else{if(Math.abs(u)<W.EPSILON6)return;let _=1/u;if(m=h.subtract(r,t,Dee),g=h.dot(m,d)*_,g<0||g>1||(p=h.cross(m,a,Bee),f=h.dot(s,p)*_,f<0||g+f>1))return;x=h.dot(c,p)*_}return x};Ao.rayTriangle=function(e,t,n,i,o,r){let s=Ao.rayTriangleParametric(e,t,n,i,o);if(!(!l(s)||s<0))return l(r)||(r=new h),h.multiplyByScalar(e.direction,s,r),h.add(e.origin,r,r)};var qRe=new pn;Ao.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=qRe;h.clone(e,a.origin),h.subtract(t,e,a.direction),h.normalize(a.direction,a.direction);let c=Ao.rayTriangleParametric(a,n,i,o,r);if(!(!l(c)||c<0||c>h.distance(e,t)))return l(s)||(s=new h),h.multiplyByScalar(a.direction,c,s),h.add(a.origin,s,s)};function $Re(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let s=1/(2*e),a=Math.sqrt(o),c=(-t+a)*s,d=(-t-a)*s;return c<d?(i.root0=c,i.root1=d):(i.root0=d,i.root1=c),i}let r=-t/(2*e);if(r!==0)return i.root0=i.root1=r,i}var eZe={root0:0,root1:0};function Qee(e,t,n){l(n)||(n=new La);let i=e.origin,o=e.direction,r=t.center,s=t.radius*t.radius,a=h.subtract(i,r,Jee),c=h.dot(o,o),d=2*h.dot(o,a),u=h.magnitudeSquared(a)-s,m=$Re(c,d,u,eZe);if(l(m))return n.start=m.root0,n.stop=m.root1,n}Ao.raySphere=function(e,t,n){if(n=Qee(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var tZe=new pn;Ao.lineSegmentSphere=function(e,t,n,i){let o=tZe;h.clone(e,o.origin);let r=h.subtract(t,e,o.direction),s=h.magnitude(r);if(h.normalize(r,r),i=Qee(o,n,i),!(!l(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var nZe=new h,iZe=new h;Ao.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,nZe),o=h.multiplyComponents(n,e.direction,iZe),r=h.magnitudeSquared(i),s=h.dot(i,o),a,c,d,u,m;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,c=h.magnitudeSquared(o),d=c*a,p<d)return;if(p>d){u=s*s-d,m=-s+Math.sqrt(u);let f=m/c,x=a/m;return f<x?new La(f,x):{start:x,stop:f}}let g=Math.sqrt(a/c);return new La(g,g)}else if(r<1)return a=r-1,c=h.magnitudeSquared(o),d=c*a,u=s*s-d,m=-s+Math.sqrt(u),new La(0,m/c);if(s<0)return c=h.magnitudeSquared(o),new La(0,-s/c)};function ax(e,t,n){let i=e+t;return W.sign(e)!==W.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Ao.quadraticVectorExpression=function(e,t,n,i,o){let r=i*i,s=o*o,a=(e[$.COLUMN1ROW1]-e[$.COLUMN2ROW2])*s,c=o*(i*ax(e[$.COLUMN1ROW0],e[$.COLUMN0ROW1],W.EPSILON15)+t.y),d=e[$.COLUMN0ROW0]*r+e[$.COLUMN2ROW2]*s+i*t.x+n,u=s*ax(e[$.COLUMN2ROW1],e[$.COLUMN1ROW2],W.EPSILON15),m=o*(i*ax(e[$.COLUMN2ROW0],e[$.COLUMN0ROW2])+t.z),p,g=[];if(m===0&&u===0){if(p=Wc.computeRealRoots(a,c,d),p.length===0)return g;let P=p[0],w=Math.sqrt(Math.max(1-P*P,0));if(g.push(new h(i,o*P,o*-w)),g.push(new h(i,o*P,o*w)),p.length===2){let F=p[1],b=Math.sqrt(Math.max(1-F*F,0));g.push(new h(i,o*F,o*-b)),g.push(new h(i,o*F,o*b))}return g}let f=m*m,x=u*u,_=a*a,C=m*u,V=_+x,L=2*(c*a+C),Z=2*d*a+c*c-x+f,G=2*(d*c-C),I=d*d-f;if(V===0&&L===0&&Z===0&&G===0)return g;p=uR.computeRealRoots(V,L,Z,G,I);let v=p.length;if(v===0)return g;for(let P=0;P<v;++P){let w=p[P],F=w*w,b=Math.max(1-F,0),R=Math.sqrt(b),E;W.sign(a)===W.sign(d)?E=ax(a*F+d,c*w,W.EPSILON12):W.sign(d)===W.sign(c*w)?E=ax(a*F,c*w+d,W.EPSILON12):E=ax(a*F+c*w,d,W.EPSILON12);let X=ax(u*w,m,W.EPSILON15),A=E*X;A<0?g.push(new h(i,o*w,o*R)):A>0?g.push(new h(i,o*w,o*-R)):R!==0?(g.push(new h(i,o*w,o*-R)),g.push(new h(i,o*w,o*R)),++P):g.push(new h(i,o*w,o*R))}return g};var aY=new h,Oee=new h,Yee=new h,XN=new h,oZe=new h,rZe=new $,sZe=new $,aZe=new $,cZe=new $,lZe=new $,Hee=new $,zee=new $,Kee=new h,dZe=new h,uZe=new he;Ao.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let I=t.geodeticSurfaceNormal(n,aY);if(h.dot(i,I)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,aY),s=h.normalize(r,r),a=h.mostOrthogonalAxis(r,XN),c=h.normalize(h.cross(a,s,Oee),Oee),d=h.normalize(h.cross(s,c,Yee),Yee),u=rZe;u[0]=s.x,u[1]=s.y,u[2]=s.z,u[3]=c.x,u[4]=c.y,u[5]=c.z,u[6]=d.x,u[7]=d.y,u[8]=d.z;let m=$.transpose(u,sZe),p=$.fromScale(t.radii,aZe),g=$.fromScale(t.oneOverRadii,cZe),f=lZe;f[0]=0,f[1]=-i.z,f[2]=i.y,f[3]=i.z,f[4]=0,f[5]=-i.x,f[6]=-i.y,f[7]=i.x,f[8]=0;let x=$.multiply($.multiply(m,g,Hee),f,Hee),_=$.multiply($.multiply(x,p,zee),u,zee),C=$.multiplyByVector(x,n,oZe),V=Ao.quadraticVectorExpression(_,h.negate(C,aY),0,0,1),L,Z,G=V.length;if(G>0){let I=h.clone(h.ZERO,dZe),v=Number.NEGATIVE_INFINITY;for(let w=0;w<G;++w){L=$.multiplyByVector(p,$.multiplyByVector(u,V[w],Kee),Kee);let F=h.normalize(h.subtract(L,n,XN),XN),b=h.dot(F,i);b>v&&(v=b,I=h.clone(L,I))}let P=t.cartesianToCartographic(I,uZe);return v=W.clamp(v,0,1),Z=h.magnitude(h.subtract(I,n,XN))*Math.sqrt(1-v*v),Z=o?-Z:Z,P.height=Z,t.cartographicToCartesian(P,new h)}};var mZe=new h;Ao.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let o=h.subtract(t,e,mZe),r=n.normal,s=h.dot(r,o);if(Math.abs(s)<W.EPSILON6)return;let a=h.dot(r,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return h.multiplyByScalar(o,c,i),h.add(e,i,i),i};Ao.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,s=h.dot(o,e)+r<0,a=h.dot(o,t)+r<0,c=h.dot(o,n)+r<0,d=0;d+=s?1:0,d+=a?1:0,d+=c?1:0;let u,m;if((d===1||d===2)&&(u=new h,m=new h),d===1){if(s)return Ao.lineSegmentPlane(e,t,i,u),Ao.lineSegmentPlane(e,n,i,m),{positions:[e,t,n,u,m],indices:[0,3,4,1,2,4,1,4,3]};if(a)return Ao.lineSegmentPlane(t,n,i,u),Ao.lineSegmentPlane(t,e,i,m),{positions:[e,t,n,u,m],indices:[1,3,4,2,0,4,2,4,3]};if(c)return Ao.lineSegmentPlane(n,e,i,u),Ao.lineSegmentPlane(n,t,i,m),{positions:[e,t,n,u,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(d===2)if(s)if(a){if(!c)return Ao.lineSegmentPlane(e,n,i,u),Ao.lineSegmentPlane(t,n,i,m),{positions:[e,t,n,u,m],indices:[0,1,4,0,4,3,2,3,4]}}else return Ao.lineSegmentPlane(n,t,i,u),Ao.lineSegmentPlane(e,t,i,m),{positions:[e,t,n,u,m],indices:[2,0,4,2,4,3,1,3,4]};else return Ao.lineSegmentPlane(t,e,i,u),Ao.lineSegmentPlane(n,e,i,m),{positions:[e,t,n,u,m],indices:[1,2,4,1,4,3,0,3,4]}};var qn=Ao;var CPt=T(S(),1);function ws(e,t){this.normal=h.clone(e),this.distance=t}ws.fromPointNormal=function(e,t,n){let i=-h.dot(t,e);return l(n)?(h.clone(t,n.normal),n.distance=i,n):new ws(t,i)};var hZe=new h;ws.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,hZe),i=e.w;return l(t)?(h.clone(n,t.normal),t.distance=i,t):new ws(n,i)};ws.getPointDistance=function(e,t){return h.dot(e.normal,t)+e.distance};var fZe=new h;ws.projectPointOntoPlane=function(e,t,n){l(n)||(n=new h);let i=ws.getPointDistance(e,t),o=h.multiplyByScalar(e.normal,i,fZe);return h.subtract(t,o,n)};var pZe=new M,bZe=new se,gZe=new h;ws.transform=function(e,t,n){let i=e.normal,o=e.distance,r=M.inverseTranspose(t,pZe),s=se.fromElements(i.x,i.y,i.z,o,bZe);s=M.multiplyByVector(r,s,s);let a=h.fromCartesian4(s,gZe);return s=se.divideByScalar(s,h.magnitude(a),s),ws.fromCartesian4(s,n)};ws.clone=function(e,t){return l(t)?(h.clone(e.normal,t.normal),t.distance=e.distance,t):new ws(e.normal,e.distance)};ws.equals=function(e,t){return e.distance===t.distance&&h.equals(e.normal,t.normal)};ws.ORIGIN_XY_PLANE=Object.freeze(new ws(h.UNIT_Z,0));ws.ORIGIN_YZ_PLANE=Object.freeze(new ws(h.UNIT_X,0));ws.ORIGIN_ZX_PLANE=Object.freeze(new ws(h.UNIT_Y,0));var ln=ws;var ZPt=T(S(),1);var cY={};cY.calculateACMR=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;a<o;)c>n&&(n=c),++a,c=t[a]}let r=[];for(let a=0;a<n+1;a++)r[a]=0;let s=i+1;for(let a=0;a<o;++a)s-r[t[a]]>i&&(r[t[a]]=s,++s);return(s-i+1)/(o/3)};cY.tipsify=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.indices,n=e.maximumIndex,i=y(e.cacheSize,24),o;function r(b,R,E,X){for(;R.length>=1;){let A=R[R.length-1];if(R.splice(R.length-1,1),b[A].numLiveTriangles>0)return A}for(;o<X;){if(b[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function s(b,R,E,X,A,N,O){let U=-1,Y,k=-1,H=0;for(;H<E.length;){let J=E[H];X[J].numLiveTriangles&&(Y=0,A-X[J].timeStamp+2*X[J].numLiveTriangles<=R&&(Y=A-X[J].timeStamp),(Y>k||k===-1)&&(k=Y,U=J)),++H}return U===-1?r(X,N,b,O):U}let a=t.length,c=0,d=0,u=t[d],m=a;if(l(n))c=n+1;else{for(;d<m;)u>c&&(c=u),++d,u=t[d];if(c===-1)return 0;++c}let p=[],g;for(g=0;g<c;g++)p[g]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};d=0;let f=0;for(;d<m;)p[t[d]].vertexTriangles.push(f),++p[t[d]].numLiveTriangles,p[t[d+1]].vertexTriangles.push(f),++p[t[d+1]].numLiveTriangles,p[t[d+2]].vertexTriangles.push(f),++p[t[d+2]].numLiveTriangles,++f,d+=3;let x=0,_=i+1;o=1;let C=[],V=[],L,Z,G=0,I=[],v=a/3,P=[];for(g=0;g<v;g++)P[g]=!1;let w,F;for(;x!==-1;){C=[],Z=p[x],F=Z.vertexTriangles.length;for(let b=0;b<F;++b)if(f=Z.vertexTriangles[b],!P[f]){P[f]=!0,d=f+f+f;for(let R=0;R<3;++R)w=t[d],C.push(w),V.push(w),I[G]=w,++G,L=p[w],--L.numLiveTriangles,_-L.timeStamp>i&&(L.timeStamp=_,++_),++d}x=s(t,i,C,p,_,V,c)}return I};var mR=cY;var Pc={};function MN(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function yZe(e){let t=e.length,n=t/3*6,i=Ae.createTypedArray(t,n),o=0;for(let r=0;r<t;r+=3,o+=6)MN(i,o,e[r],e[r+1],e[r+2]);return i}function xZe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Ae.createTypedArray(t,n);MN(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r<t;++r,o+=6)MN(i,o,e[r-1],e[r],e[r-2]);return i}return new Uint16Array}function _Ze(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Ae.createTypedArray(t,n),o=e[0],r=0;for(let s=1;s<t;++s,r+=6)MN(i,r,o,e[s],e[s+1]);return i}return new Uint16Array}Pc.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Fe.TRIANGLES:e.indices=yZe(t);break;case Fe.TRIANGLE_STRIP:e.indices=xZe(t);break;case Fe.TRIANGLE_FAN:e.indices=_Ze(t);break}e.primitiveType=Fe.LINES}return e};Pc.createLineSegmentsForVectors=function(e,t,n){t=y(t,"normal"),n=y(n,1e4);let i=e.attributes.position.values,o=e.attributes[t].values,r=i.length,s=new Float64Array(2*r),a=0;for(let u=0;u<r;u+=3)s[a++]=i[u],s[a++]=i[u+1],s[a++]=i[u+2],s[a++]=i[u]+o[u]*n,s[a++]=i[u+1]+o[u+1]*n,s[a++]=i[u+2]+o[u+2]*n;let c,d=e.boundingSphere;return l(d)&&(c=new ce(d.center,d.radius+n)),new ht({attributes:{position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Fe.LINES,boundingSphere:c})};Pc.createAttributeLocations=function(e){let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},o=0,r,s=t.length;for(r=0;r<s;++r){let a=t[r];l(n[a])&&(i[a]=o++)}for(let a in n)n.hasOwnProperty(a)&&!l(i[a])&&(i[a]=o++);return i};Pc.reorderForPreVertexCache=function(e){let t=ht.computeNumberOfVertices(e),n=e.indices;if(l(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let o=n,r=o.length,s=Ae.createTypedArray(t,r),a=0,c=0,d=0,u;for(;a<r;)u=i[o[a]],u!==-1?s[c]=u:(u=o[a],i[u]=d,s[c]=d,++d),++a,++c;e.indices=s;let m=e.attributes;for(let p in m)if(m.hasOwnProperty(p)&&l(m[p])&&l(m[p].values)){let g=m[p],f=g.values,x=0,_=g.componentsPerAttribute,C=Q.createTypedArray(g.componentDatatype,d*_);for(;x<t;){let V=i[x];if(V!==-1)for(let L=0;L<_;L++)C[_*V+L]=f[_*x+L];++x}g.values=C}}return e};Pc.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Fe.TRIANGLES&&l(n)){let i=n.length,o=0;for(let r=0;r<i;r++)n[r]>o&&(o=n[r]);e.indices=mR.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function jee(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new Ze({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function TZe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];for(let r=0;r<o.componentsPerAttribute;++r)e[i].values.push(o.values[n*o.componentsPerAttribute+r])}}Pc.fitToUnsignedShortIndices=function(e){let t=[],n=ht.computeNumberOfVertices(e);if(l(e.indices)&&n>=W.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=jee(e.attributes),a=e.indices,c=a.length,d;e.primitiveType===Fe.TRIANGLES?d=3:e.primitiveType===Fe.LINES?d=2:e.primitiveType===Fe.POINTS&&(d=1);for(let u=0;u<c;u+=d){for(let m=0;m<d;++m){let p=a[u+m],g=i[p];l(g)||(g=r++,i[p]=g,TZe(s,e.attributes,p)),o.push(g)}r+d>=W.SIXTY_FOUR_KILOBYTES&&(t.push(new ht({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=jee(e.attributes))}o.length!==0&&t.push(new ht({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var qee=new h,SZe=new he;Pc.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new Ri;let s=o.ellipsoid,a=r.values,c=new Float64Array(a.length),d=0;for(let u=0;u<a.length;u+=3){let m=h.fromArray(a,u,qee),p=s.cartesianToCartographic(m,SZe),g=o.project(p,qee);c[d++]=g.x,c[d++]=g.y,c[d++]=g.z}return e.attributes[n]=r,e.attributes[i]=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var lY={high:0,low:0};Pc.encodeAttribute=function(e,t,n,i){let o=e.attributes[t],r=o.values,s=r.length,a=new Float32Array(s),c=new Float32Array(s);for(let u=0;u<s;++u)On.encode(r[u],lY),a[u]=lY.high,c[u]=lY.low;let d=o.componentsPerAttribute;return e.attributes[n]=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:d,values:a}),e.attributes[i]=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:d,values:c}),delete e.attributes[t],e};var Tm=new h;function dY(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)h.unpack(n,o,Tm),M.multiplyByPoint(e,Tm,Tm),h.pack(Tm,n,o)}}function uY(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)h.unpack(n,o,Tm),$.multiplyByVector(e,Tm,Tm),Tm=h.normalize(Tm,Tm),h.pack(Tm,n,o)}}var WN=new M,PN=new $;Pc.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(M.equals(t,M.IDENTITY))return e;let n=e.geometry.attributes;dY(t,n.position),dY(t,n.prevPosition),dY(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(M.inverse(t,WN),M.transpose(WN,WN),M.getMatrix3(WN,PN),uY(PN,n.normal),uY(PN,n.tangent),uY(PN,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=ce.transform(i,t,i)),e.modelMatrix=M.clone(M.IDENTITY),e};function CZe(e,t){let n=e.length,i={},o=e[0][t].attributes,r;for(r in o)if(o.hasOwnProperty(r)&&l(o[r])&&l(o[r].values)){let s=o[r],a=s.values.length,c=!0;for(let d=1;d<n;++d){let u=e[d][t].attributes[r];if(!l(u)||s.componentDatatype!==u.componentDatatype||s.componentsPerAttribute!==u.componentsPerAttribute||s.normalize!==u.normalize){c=!1;break}a+=u.values.length}c&&(i[r]=new Ze({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:Q.createTypedArray(s.componentDatatype,a)}))}return i}var VZe=new h;function mY(e,t){let n=e.length,i,o,r,s,a=e[0].modelMatrix,c=l(e[0][t].indices),d=e[0][t].primitiveType,u=CZe(e,t),m,p,g;for(i in u)if(u.hasOwnProperty(i))for(m=u[i].values,s=0,o=0;o<n;++o)for(p=e[o][t].attributes[i].values,g=p.length,r=0;r<g;++r)m[s++]=p[r];let f;if(c){let V=0;for(o=0;o<n;++o)V+=e[o][t].indices.length;let L=ht.computeNumberOfVertices(new ht({attributes:u,primitiveType:Fe.POINTS})),Z=Ae.createTypedArray(L,V),G=0,I=0;for(o=0;o<n;++o){let v=e[o][t].indices,P=v.length;for(s=0;s<P;++s)Z[G++]=I+v[s];I+=ht.computeNumberOfVertices(e[o][t])}f=Z}let x=new h,_=0,C;for(o=0;o<n;++o){if(C=e[o][t].boundingSphere,!l(C)){x=void 0;break}h.add(C.center,x,x)}if(l(x))for(h.divideByScalar(x,n,x),o=0;o<n;++o){C=e[o][t].boundingSphere;let V=h.magnitude(h.subtract(C.center,x,VZe))+C.radius;V>_&&(_=V)}return new ht({attributes:u,indices:f,primitiveType:d,boundingSphere:l(x)?new ce(x,_):void 0})}Pc.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let s=e[r];l(s.geometry)?t.push(s):l(s.westHemisphereGeometry)&&l(s.eastHemisphereGeometry)&&n.push(s)}let o=[];return t.length>0&&o.push(mY(t,"geometry")),n.length>0&&(o.push(mY(n,"westHemisphereGeometry")),o.push(mY(n,"eastHemisphereGeometry"))),o};var uu=new h,hR=new h,DS=new h,BS=new h;Pc.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,s=new Array(o),a=new Array(r/3),c=new Array(r),d;for(d=0;d<o;d++)s[d]={indexOffset:0,count:0,currentCount:0};let u=0;for(d=0;d<r;d+=3){let f=t[d],x=t[d+1],_=t[d+2],C=f*3,V=x*3,L=_*3;hR.x=i[C],hR.y=i[C+1],hR.z=i[C+2],DS.x=i[V],DS.y=i[V+1],DS.z=i[V+2],BS.x=i[L],BS.y=i[L+1],BS.z=i[L+2],s[f].count++,s[x].count++,s[_].count++,h.subtract(DS,hR,DS),h.subtract(BS,hR,BS),a[u]=h.cross(DS,BS,new h),u++}let m=0;for(d=0;d<o;d++)s[d].indexOffset+=m,m+=s[d].count;u=0;let p;for(d=0;d<r;d+=3){p=s[t[d]];let f=p.indexOffset+p.currentCount;c[f]=u,p.currentCount++,p=s[t[d+1]],f=p.indexOffset+p.currentCount,c[f]=u,p.currentCount++,p=s[t[d+2]],f=p.indexOffset+p.currentCount,c[f]=u,p.currentCount++,u++}let g=new Float32Array(o*3);for(d=0;d<o;d++){let f=d*3;if(p=s[d],h.clone(h.ZERO,uu),p.count>0){for(u=0;u<p.count;u++)h.add(uu,a[c[p.indexOffset+u]],uu);h.equalsEpsilon(h.ZERO,uu,W.EPSILON10)&&h.clone(a[c[p.indexOffset]],uu)}h.equalsEpsilon(h.ZERO,uu,W.EPSILON10)&&(uu.z=1),h.normalize(uu,uu),g[f]=uu.x,g[f+1]=uu.y,g[f+2]=uu.z}return e.attributes.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g}),e};var LZe=new h,$ee=new h,RZe=new h;Pc.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,o=e.attributes.normal.values,r=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,c=new Array(s*3),d;for(d=0;d<c.length;d++)c[d]=0;let u,m,p;for(d=0;d<a;d+=3){let x=n[d],_=n[d+1],C=n[d+2];u=x*3,m=_*3,p=C*3;let V=x*2,L=_*2,Z=C*2,G=i[u],I=i[u+1],v=i[u+2],P=r[V],w=r[V+1],F=r[L+1]-w,b=r[Z+1]-w,R=1/((r[L]-P)*b-(r[Z]-P)*F),E=(b*(i[m]-G)-F*(i[p]-G))*R,X=(b*(i[m+1]-I)-F*(i[p+1]-I))*R,A=(b*(i[m+2]-v)-F*(i[p+2]-v))*R;c[u]+=E,c[u+1]+=X,c[u+2]+=A,c[m]+=E,c[m+1]+=X,c[m+2]+=A,c[p]+=E,c[p+1]+=X,c[p+2]+=A}let g=new Float32Array(s*3),f=new Float32Array(s*3);for(d=0;d<s;d++){u=d*3,m=u+1,p=u+2;let x=h.fromArray(o,u,LZe),_=h.fromArray(c,u,RZe),C=h.dot(x,_);h.multiplyByScalar(x,C,$ee),h.normalize(h.subtract(_,$ee,_),_),g[u]=_.x,g[m]=_.y,g[p]=_.z,h.normalize(h.cross(x,_,_),_),f[u]=_.x,f[m]=_.y,f[p]=_.z}return e.attributes.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f}),e};var fR=new D,_m=new h,ete=new h,tte=new h,vN=new D;Pc.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let I=t.values;i=I.length/3;let v=new Float32Array(i*2),P=0;for(n=0;n<i;++n){if(h.fromArray(I,n*3,_m),h.equals(_m,h.ZERO)){P+=2;continue}vN=wn.octEncodeInRange(_m,65535,vN),v[P++]=vN.x,v[P++]=vN.y}return e.attributes.compressedAttributes=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:v}),delete e.attributes.extrudeDirection,e}let o=e.attributes.normal,r=e.attributes.st,s=l(o),a=l(r);if(!s&&!a)return e;let c=e.attributes.tangent,d=e.attributes.bitangent,u=l(c),m=l(d),p,g,f,x;s&&(p=o.values),a&&(g=r.values),u&&(f=c.values),m&&(x=d.values),i=(s?p.length:g.length)/(s?3:2);let V=i,L=a&&s?2:1;L+=u||m?1:0,V*=L;let Z=new Float32Array(V),G=0;for(n=0;n<i;++n){a&&(D.fromArray(g,n*2,fR),Z[G++]=wn.compressTextureCoordinates(fR));let I=n*3;s&&l(f)&&l(x)?(h.fromArray(p,I,_m),h.fromArray(f,I,ete),h.fromArray(x,I,tte),wn.octPack(_m,ete,tte,fR),Z[G++]=fR.x,Z[G++]=fR.y):(s&&(h.fromArray(p,I,_m),Z[G++]=wn.octEncodeFloat(_m)),u&&(h.fromArray(f,I,_m),Z[G++]=wn.octEncodeFloat(_m)),m&&(h.fromArray(x,I,_m),Z[G++]=wn.octEncodeFloat(_m)))}return e.attributes.compressedAttributes=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:L,values:Z}),s&&delete e.attributes.normal,a&&delete e.attributes.st,m&&delete e.attributes.bitangent,u&&delete e.attributes.tangent,e};function ZZe(e){if(l(e.indices))return e;let t=ht.computeNumberOfVertices(e),n=Ae.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function GZe(e){let t=ht.computeNumberOfVertices(e),n=Ae.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let o=3;o<t;++o)n[i++]=o-1,n[i++]=0,n[i++]=o;return e.indices=n,e.primitiveType=Fe.TRIANGLES,e}function EZe(e){let t=ht.computeNumberOfVertices(e),n=Ae.createTypedArray(t,(t-2)*3);n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;o<t-1;o+=2)n[i++]=o,n[i++]=o-1,n[i++]=o+1,o+2<t&&(n[i++]=o,n[i++]=o+1,n[i++]=o+2);return e.indices=n,e.primitiveType=Fe.TRIANGLES,e}function IZe(e){if(l(e.indices))return e;let t=ht.computeNumberOfVertices(e),n=Ae.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function XZe(e){let t=ht.computeNumberOfVertices(e),n=Ae.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return e.indices=n,e.primitiveType=Fe.LINES,e}function WZe(e){let t=ht.computeNumberOfVertices(e),n=Ae.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Fe.LINES,e}function PZe(e){switch(e.primitiveType){case Fe.TRIANGLE_FAN:return GZe(e);case Fe.TRIANGLE_STRIP:return EZe(e);case Fe.TRIANGLES:return ZZe(e);case Fe.LINE_STRIP:return XZe(e);case Fe.LINE_LOOP:return WZe(e);case Fe.LINES:return IZe(e)}return e}function I0(e,t){Math.abs(e.y)<W.EPSILON6&&(t?e.y=-W.EPSILON6:e.y=W.EPSILON6)}function vZe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){I0(e,e.y<0),I0(t,t.y<0),I0(n,n.y<0);return}let i=Math.abs(e.y),o=Math.abs(t.y),r=Math.abs(n.y),s;i>o?i>r?s=W.sign(e.y):s=W.sign(n.y):o>r?s=W.sign(t.y):s=W.sign(n.y);let a=s<0;I0(e,a),I0(t,a),I0(n,a)}var nte=new h;function mu(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,nte),e.y/(e.y-t.y),nte),n),h.clone(n,i),I0(n,!0),I0(i,!1)}var cx=new h,lx=new h,dx=new h,ux=new h,hY={positions:new Array(7),indices:new Array(3*3)};function wZe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;vZe(e,t,n);let i=e.y<0,o=t.y<0,r=n.y<0,s=0;s+=i?1:0,s+=o?1:0,s+=r?1:0;let a=hY.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(mu(e,t,cx,dx),mu(e,n,lx,ux),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(mu(t,n,cx,dx),mu(t,e,lx,ux),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(mu(n,e,cx,dx),mu(n,t,lx,ux),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?o?r||(mu(n,e,cx,dx),mu(n,t,lx,ux),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(mu(t,n,cx,dx),mu(t,e,lx,ux),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(mu(e,t,cx,dx),mu(e,n,lx,ux),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=hY.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=cx,c[4]=lx,c[5]=dx,c[6]=ux,c.length=7),hY}function ite(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&l(n[o])&&l(n[o].values)){let r=n[o];r.values=Q.createTypedArray(r.componentDatatype,r.values)}let i=ht.computeNumberOfVertices(e);return e.indices=Ae.createTypedArray(i,e.indices),t&&(e.boundingSphere=ce.fromVertices(n.position.values)),e}function YS(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];n[i]=new Ze({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new ht({attributes:n,indices:[],primitiveType:e.primitiveType})}function gY(e,t,n){let i=l(e.geometry.boundingSphere);t=ite(t,i),n=ite(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function yY(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,c,d,u,m,p){let g=e.fromArray(d,r*t,n),f=e.fromArray(d,s*t,i),x=e.fromArray(d,a*t,o);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(f,c.y,f),e.multiplyByScalar(x,c.z,x);let _=e.add(g,f,g);e.add(_,x,_),p&&e.normalize(_,_),e.pack(_,u,m*t)}}var FZe=yY(se,4),AN=yY(h,3),lte=yY(D,2),AZe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,c=o[t]*i.y,d=o[n]*i.z;r[s]=a+c+d>W.EPSILON6?1:0},pR=new h,fY=new h,pY=new h,MZe=new h;function wN(e,t,n,i,o,r,s,a,c,d,u,m,p,g,f,x){if(!l(r)&&!l(s)&&!l(a)&&!l(c)&&!l(d)&&g===0)return;let _=h.fromArray(o,e*3,pR),C=h.fromArray(o,t*3,fY),V=h.fromArray(o,n*3,pY),L=rx(i,_,C,V,MZe);if(l(L)){if(l(r)&&AN(e,t,n,L,r,m.normal.values,x,!0),l(d)){let Z=h.fromArray(d,e*3,pR),G=h.fromArray(d,t*3,fY),I=h.fromArray(d,n*3,pY);h.multiplyByScalar(Z,L.x,Z),h.multiplyByScalar(G,L.y,G),h.multiplyByScalar(I,L.z,I);let v;!h.equals(Z,h.ZERO)||!h.equals(G,h.ZERO)||!h.equals(I,h.ZERO)?(v=h.add(Z,G,Z),h.add(v,I,v),h.normalize(v,v)):(v=pR,v.x=0,v.y=0,v.z=0),h.pack(v,m.extrudeDirection.values,x*3)}if(l(u)&&AZe(e,t,n,L,u,m.applyOffset.values,x),l(s)&&AN(e,t,n,L,s,m.tangent.values,x,!0),l(a)&&AN(e,t,n,L,a,m.bitangent.values,x,!0),l(c)&&lte(e,t,n,L,c,m.st.values,x),g>0)for(let Z=0;Z<g;Z++){let G=p[Z];NZe(e,t,n,L,x,f[G],m[G])}}}function NZe(e,t,n,i,o,r,s){let a=r.componentsPerAttribute,c=r.values,d=s.values;switch(a){case 4:FZe(e,t,n,i,c,d,o,!1);break;case 3:AN(e,t,n,i,c,d,o,!1);break;case 2:lte(e,t,n,i,c,d,o,!1);break;default:d[o]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function Jh(e,t,n,i,o,r){let s=e.position.values.length/3;if(o!==-1){let a=i[o],c=n[a];return c===-1?(n[a]=s,e.position.values.push(r.x,r.y,r.z),t.push(s),s):(t.push(c),c)}return e.position.values.push(r.x,r.y,r.z),t.push(s),s}var kZe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function ote(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.normal)?n.normal.values:void 0,r=l(n.bitangent)?n.bitangent.values:void 0,s=l(n.tangent)?n.tangent.values:void 0,a=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,d=l(n.applyOffset)?n.applyOffset.values:void 0,u=t.indices,m=[];for(let v in n)n.hasOwnProperty(v)&&!kZe[v]&&l(n[v])&&m.push(v);let p=m.length,g=YS(t),f=YS(t),x,_,C,V,L,Z=[];Z.length=i.length/3;let G=[];for(G.length=i.length/3,L=0;L<Z.length;++L)Z[L]=-1,G[L]=-1;let I=u.length;for(L=0;L<I;L+=3){let v=u[L],P=u[L+1],w=u[L+2],F=h.fromArray(i,v*3),b=h.fromArray(i,P*3),R=h.fromArray(i,w*3),E=wZe(F,b,R);if(l(E)&&E.positions.length>3){let X=E.positions,A=E.indices,N=A.length;for(let O=0;O<N;++O){let U=A[O],Y=X[U];Y.y<0?(x=f.attributes,_=f.indices,C=Z):(x=g.attributes,_=g.indices,C=G),V=Jh(x,_,C,u,U<3?L+U:-1,Y),wN(v,P,w,Y,i,o,s,r,a,c,d,x,m,p,n,V)}}else l(E)&&(F=E.positions[0],b=E.positions[1],R=E.positions[2]),F.y<0?(x=f.attributes,_=f.indices,C=Z):(x=g.attributes,_=g.indices,C=G),V=Jh(x,_,C,u,L,F),wN(v,P,w,F,i,o,s,r,a,c,d,x,m,p,n,V),V=Jh(x,_,C,u,L+1,b),wN(v,P,w,b,i,o,s,r,a,c,d,x,m,p,n,V),V=Jh(x,_,C,u,L+2,R),wN(v,P,w,R,i,o,s,r,a,c,d,x,m,p,n,V)}gY(e,f,g)}var dte=ln.fromPointNormal(h.ZERO,h.UNIT_Y),UZe=new h,DZe=new h;function OS(e,t,n,i,o,r,s){if(!l(s))return;let a=h.fromArray(i,e*3,pR);h.equalsEpsilon(a,n,W.EPSILON10)?r.applyOffset.values[o]=s[e]:r.applyOffset.values[o]=s[t]}function rte(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.applyOffset)?n.applyOffset.values:void 0,r=t.indices,s=YS(t),a=YS(t),c,d=r.length,u=[];u.length=i.length/3;let m=[];for(m.length=i.length/3,c=0;c<u.length;++c)u[c]=-1,m[c]=-1;for(c=0;c<d;c+=2){let p=r[c],g=r[c+1],f=h.fromArray(i,p*3,pR),x=h.fromArray(i,g*3,fY),_;Math.abs(f.y)<W.EPSILON6&&(f.y<0?f.y=-W.EPSILON6:f.y=W.EPSILON6),Math.abs(x.y)<W.EPSILON6&&(x.y<0?x.y=-W.EPSILON6:x.y=W.EPSILON6);let C=s.attributes,V=s.indices,L=m,Z=a.attributes,G=a.indices,I=u,v=qn.lineSegmentPlane(f,x,dte,pY);if(l(v)){let P=h.multiplyByScalar(h.UNIT_Y,5*W.EPSILON9,UZe);f.y<0&&(h.negate(P,P),C=a.attributes,V=a.indices,L=u,Z=s.attributes,G=s.indices,I=m);let w=h.add(v,P,DZe);_=Jh(C,V,L,r,c,f),OS(p,g,f,i,_,C,o),_=Jh(C,V,L,r,-1,w),OS(p,g,w,i,_,C,o),h.negate(P,P),h.add(v,P,w),_=Jh(Z,G,I,r,-1,w),OS(p,g,w,i,_,Z,o),_=Jh(Z,G,I,r,c+1,x),OS(p,g,x,i,_,Z,o)}else{let P,w,F;f.y<0?(P=a.attributes,w=a.indices,F=u):(P=s.attributes,w=s.indices,F=m),_=Jh(P,w,F,r,c,f),OS(p,g,f,i,_,P,o),_=Jh(P,w,F,r,c+1,x),OS(p,g,x,i,_,P,o)}}gY(e,a,s)}var ste=new D,BZe=new D,ute=new h,mte=new h,bY=new h,OZe=new h,YZe=new h,HZe=new h,ate=new se;function cte(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,o=t.nextPosition.values,r=n.length;for(let s=0;s<r;s+=3){let a=h.unpack(n,s,ute);if(a.x>0)continue;let c=h.unpack(i,s,mte);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):h.pack(a,i,s));let d=h.unpack(o,s,bY);(a.y<0&&d.y>0||a.y>0&&d.y<0)&&(s+3<r?(o[s]=n[s+3],o[s+1]=n[s+4],o[s+2]=n[s+5]):h.pack(a,o,s))}}var zZe=5*W.EPSILON9,FN=W.EPSILON6;function KZe(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=n.prevPosition.values,r=n.nextPosition.values,s=n.expandAndWidth.values,a=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,d=YS(t),u=YS(t),m,p,g,f=!1,x=i.length/3;for(m=0;m<x;m+=4){let _=m,C=m+2,V=h.fromArray(i,_*3,ute),L=h.fromArray(i,C*3,mte);if(Math.abs(V.y)<FN)for(V.y=FN*(L.y<0?-1:1),i[m*3+1]=V.y,i[(m+1)*3+1]=V.y,p=_*3;p<_*3+4*3;p+=3)o[p]=i[m*3],o[p+1]=i[m*3+1],o[p+2]=i[m*3+2];if(Math.abs(L.y)<FN)for(L.y=FN*(V.y<0?-1:1),i[(m+2)*3+1]=L.y,i[(m+3)*3+1]=L.y,p=_*3;p<_*3+4*3;p+=3)r[p]=i[(m+2)*3],r[p+1]=i[(m+2)*3+1],r[p+2]=i[(m+2)*3+2];let Z=d.attributes,G=d.indices,I=u.attributes,v=u.indices,P=qn.lineSegmentPlane(V,L,dte,OZe);if(l(P)){f=!0;let w=h.multiplyByScalar(h.UNIT_Y,zZe,YZe);V.y<0&&(h.negate(w,w),Z=u.attributes,G=u.indices,I=d.attributes,v=d.indices);let F=h.add(P,w,HZe);Z.position.values.push(V.x,V.y,V.z,V.x,V.y,V.z),Z.position.values.push(F.x,F.y,F.z),Z.position.values.push(F.x,F.y,F.z),Z.prevPosition.values.push(o[_*3],o[_*3+1],o[_*3+2]),Z.prevPosition.values.push(o[_*3+3],o[_*3+4],o[_*3+5]),Z.prevPosition.values.push(V.x,V.y,V.z,V.x,V.y,V.z),Z.nextPosition.values.push(F.x,F.y,F.z),Z.nextPosition.values.push(F.x,F.y,F.z),Z.nextPosition.values.push(F.x,F.y,F.z),Z.nextPosition.values.push(F.x,F.y,F.z),h.negate(w,w),h.add(P,w,F),I.position.values.push(F.x,F.y,F.z),I.position.values.push(F.x,F.y,F.z),I.position.values.push(L.x,L.y,L.z,L.x,L.y,L.z),I.prevPosition.values.push(F.x,F.y,F.z),I.prevPosition.values.push(F.x,F.y,F.z),I.prevPosition.values.push(F.x,F.y,F.z),I.prevPosition.values.push(F.x,F.y,F.z),I.nextPosition.values.push(L.x,L.y,L.z,L.x,L.y,L.z),I.nextPosition.values.push(r[C*3],r[C*3+1],r[C*3+2]),I.nextPosition.values.push(r[C*3+3],r[C*3+4],r[C*3+5]);let b=D.fromArray(s,_*2,ste),R=Math.abs(b.y);Z.expandAndWidth.values.push(-1,R,1,R),Z.expandAndWidth.values.push(-1,-R,1,-R),I.expandAndWidth.values.push(-1,R,1,R),I.expandAndWidth.values.push(-1,-R,1,-R);let E=h.magnitudeSquared(h.subtract(P,V,bY));if(E/=h.magnitudeSquared(h.subtract(L,V,bY)),l(c)){let X=se.fromArray(c,_*4,ate),A=se.fromArray(c,C*4,ate),N=W.lerp(X.x,A.x,E),O=W.lerp(X.y,A.y,E),U=W.lerp(X.z,A.z,E),Y=W.lerp(X.w,A.w,E);for(p=_*4;p<_*4+2*4;++p)Z.color.values.push(c[p]);for(Z.color.values.push(N,O,U,Y),Z.color.values.push(N,O,U,Y),I.color.values.push(N,O,U,Y),I.color.values.push(N,O,U,Y),p=C*4;p<C*4+2*4;++p)I.color.values.push(c[p])}if(l(a)){let X=D.fromArray(a,_*2,ste),A=D.fromArray(a,(m+3)*2,BZe),N=W.lerp(X.x,A.x,E);for(p=_*2;p<_*2+2*2;++p)Z.st.values.push(a[p]);for(Z.st.values.push(N,X.y),Z.st.values.push(N,A.y),I.st.values.push(N,X.y),I.st.values.push(N,A.y),p=C*2;p<C*2+2*2;++p)I.st.values.push(a[p])}g=Z.position.values.length/3-4,G.push(g,g+2,g+1),G.push(g+1,g+2,g+3),g=I.position.values.length/3-4,v.push(g,g+2,g+1),v.push(g+1,g+2,g+3)}else{let w,F;for(V.y<0?(w=u.attributes,F=u.indices):(w=d.attributes,F=d.indices),w.position.values.push(V.x,V.y,V.z),w.position.values.push(V.x,V.y,V.z),w.position.values.push(L.x,L.y,L.z),w.position.values.push(L.x,L.y,L.z),p=m*3;p<m*3+4*3;++p)w.prevPosition.values.push(o[p]),w.nextPosition.values.push(r[p]);for(p=m*2;p<m*2+4*2;++p)w.expandAndWidth.values.push(s[p]),l(a)&&w.st.values.push(a[p]);if(l(c))for(p=m*4;p<m*4+4*4;++p)w.color.values.push(c[p]);g=w.position.values.length/3-4,F.push(g,g+2,g+1),F.push(g+1,g+2,g+3)}}f&&(cte(u),cte(d)),gY(e,u,d)}Pc.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||ce.intersectPlane(n,ln.ORIGIN_ZX_PLANE)!==Jt.INTERSECTING))return e;if(t.geometryType!==du.NONE)switch(t.geometryType){case du.POLYLINES:KZe(e);break;case du.TRIANGLES:ote(e);break;case du.LINES:rte(e);break}else PZe(t),t.primitiveType===Fe.TRIANGLES?ote(e):t.primitiveType===Fe.LINES&&rte(e);return e};var Fn=Pc;var rvt=T(S(),1);function bR(e,t,n,i,o,r,s,a,c,d,u){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=o,this._pixelFormat=r,this._size=a,this._preMultiplyAlpha=c,this._flipY=d,this._initialized=u}Object.defineProperties(bR.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});bR.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,{width:r,height:s}=i,a=this._context._gl,c=this._textureTarget,d=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let u=i.arrayBufferView,m=this._size,p=this._pixelFormat,g=this._internalFormat,f=this._pixelDatatype,x=this._preMultiplyAlpha,_=this._flipY,C=4;l(u)&&(C=ot.alignmentInBytes(p,f,r)),a.pixelStorei(a.UNPACK_ALIGNMENT,C),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let V=!1;if(!this._initialized){let L;t===0&&n===0&&r===m&&s===m?(l(u)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),_&&(u=ot.flipY(u,p,f,m,m)),L=u):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,_),L=i),V=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),L=ot.createTypedArray(p,f,m,m)),a.texImage2D(d,0,g,m,m,0,p,qe.toWebGLConstant(f,this._context),L),this._initialized=!0}V||(l(u)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),_&&(u=ot.flipY(u,p,f,r,s)),a.texSubImage2D(d,0,t,n,r,s,p,qe.toWebGLConstant(f,this._context),u)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,x),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,_),a.texSubImage2D(d,0,t,n,p,qe.toWebGLConstant(f,this._context),i))),a.bindTexture(c,null)};bR.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),o=y(o,this._size),r=y(r,this._size);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};bR.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,o){e=y(e,0),t=y(t,0),n=y(n,this._size),i=y(i,this._size),o=y(o,0);let r=this._context._gl,s=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(s,this._texture),r.copyTexImage2D(this._targetFace,o,this._internalFormat,e,t,n,i,0),r.bindTexture(s,null),this._initialized=!0};var gR=bR;var cvt=T(S(),1);var NN={DONT_CARE:ie.DONT_CARE,FASTEST:ie.FASTEST,NICEST:ie.NICEST,validate:function(e){return e===NN.DONT_CARE||e===NN.FASTEST||e===NN.NICEST}},Qh=Object.freeze(NN);var Vvt=T(S(),1);var uvt=T(S(),1);var kN={NEAREST:ie.NEAREST,LINEAR:ie.LINEAR};kN.validate=function(e){return e===kN.NEAREST||e===kN.LINEAR};var hi=Object.freeze(kN);var fvt=T(S(),1);var X0={NEAREST:ie.NEAREST,LINEAR:ie.LINEAR,NEAREST_MIPMAP_NEAREST:ie.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:ie.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:ie.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:ie.LINEAR_MIPMAP_LINEAR};X0.validate=function(e){return e===X0.NEAREST||e===X0.LINEAR||e===X0.NEAREST_MIPMAP_NEAREST||e===X0.LINEAR_MIPMAP_NEAREST||e===X0.NEAREST_MIPMAP_LINEAR||e===X0.LINEAR_MIPMAP_LINEAR};var $t=Object.freeze(X0);var gvt=T(S(),1);var UN={CLAMP_TO_EDGE:ie.CLAMP_TO_EDGE,REPEAT:ie.REPEAT,MIRRORED_REPEAT:ie.MIRRORED_REPEAT,validate:function(e){return e===UN.CLAMP_TO_EDGE||e===UN.REPEAT||e===UN.MIRRORED_REPEAT}},Cn=Object.freeze(UN);function yR(e){e=y(e,y.EMPTY_OBJECT);let{wrapS:t=Cn.CLAMP_TO_EDGE,wrapT:n=Cn.CLAMP_TO_EDGE,minificationFilter:i=$t.LINEAR,magnificationFilter:o=hi.LINEAR,maximumAnisotropy:r=1}=e;this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=r}Object.defineProperties(yR.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});yR.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};yR.NEAREST=Object.freeze(new yR({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:$t.NEAREST,magnificationFilter:hi.NEAREST}));var en=yR;var Avt=T(S(),1);function JZe(e,t,n,i){let o=l(t.vertexBuffer),r=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:y(t.index,n),enabled:y(t.enabled,!0),vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:y(t.componentDatatype,Q.FLOAT),normalize:y(t.normalize,!1),offsetInBytes:y(t.offsetInBytes,0),strideInBytes:y(t.strideInBytes,0),instanceDivisor:y(t.instanceDivisor,0)};if(o)a.vertexAttrib=function(c){let d=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(d,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(d),this.instanceDivisor>0&&(i.glVertexAttribDivisor(d,this.instanceDivisor),i._vertexAttribDivisors[d]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function fte(e,t,n){for(let i=0;i<t.length;++i){let o=t[i];o.enabled&&o.vertexAttrib(e)}l(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function _p(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer,r,s=[],a=1,c=!1,d=!1,u=i.length;for(r=0;r<u;++r)JZe(s,i[r],r,t);for(u=s.length,r=0;r<u;++r){let p=s[r];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let g=p.strideInBytes||p.componentsPerAttribute*Q.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/g;break}}for(r=0;r<u;++r)s[r].instanceDivisor>0&&(c=!0),l(s[r].value)&&(d=!0);let m;t.vertexArrayObject&&(m=t.glCreateVertexArray(),t.glBindVertexArray(m),fte(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=d,this._context=t,this._gl=n,this._vao=m,this._attributes=s,this._indexBuffer=o}function hte(e){return e.values.length/e.componentsPerAttribute}function QZe(e){return Q.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function jZe(e){let t,n,i,o=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(o.push(n),e[n].componentDatatype===Q.DOUBLE&&(e[n].componentDatatype=Q.FLOAT,e[n].values=Q.createTypedArray(Q.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=hte(e[o[0]]),t=1;t<s;++t){let d=hte(e[o[t]]);if(d!==r)throw new de(`Each attribute list must have the same number of vertices. Attribute ${o[t]} has a different number of vertices (${d.toString()}) than attribute ${o[0]} (${r.toString()}).`)}o.sort(function(d,u){return Q.getSizeInBytes(e[u].componentDatatype)-Q.getSizeInBytes(e[d].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=o[t],i=e[n],c[n]=a,a+=QZe(i);if(a>0){let d=Q.getSizeInBytes(e[o[0]].componentDatatype),u=a%d;u!==0&&(a+=d-u);let m=r*a,p=new ArrayBuffer(m),g={};for(t=0;t<s;++t){n=o[t];let f=Q.getSizeInBytes(e[n].componentDatatype);g[n]={pointer:Q.createTypedArray(e[n].componentDatatype,p),index:c[n]/f,strideInComponentType:a/f}}for(t=0;t<r;++t)for(let f=0;f<s;++f){n=o[f],i=e[n];let x=i.values,_=g[n],C=_.pointer,V=i.componentsPerAttribute;for(let L=0;L<V;++L)C[_.index+L]=x[t*V+L];_.index+=_.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:a}}}_p.fromGeometry=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=y(e.geometry,y.EMPTY_OBJECT),i=y(e.bufferUsage,Me.DYNAMIC_DRAW),o=y(e.attributeLocations,y.EMPTY_OBJECT),r=y(e.interleave,!1),s=e.vertexArrayAttributes,a,c,d,u=l(s)?s:[],m=n.attributes;if(r){let f=jZe(m);if(l(f)){d=xt.createVertexBuffer({context:t,typedArray:f.buffer,usage:i});let x=f.offsetsInBytes,_=f.vertexSizeInBytes;for(a in m)m.hasOwnProperty(a)&&l(m[a])&&(c=m[a],l(c.values)?u.push({index:o[a],vertexBuffer:d,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:x[a],strideInBytes:_}):u.push({index:o[a],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(a in m)if(m.hasOwnProperty(a)&&l(m[a])){c=m[a];let f=c.componentDatatype;f===Q.DOUBLE&&(f=Q.FLOAT),d=void 0,l(c.values)&&(d=xt.createVertexBuffer({context:t,typedArray:Q.createTypedArray(f,c.values),usage:i})),u.push({index:o[a],vertexBuffer:d,value:c.value,componentDatatype:f,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize})}let p,g=n.indices;return l(g)&&(ht.computeNumberOfVertices(n)>=W.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=xt.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Ae.UNSIGNED_INT}):p=xt.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Ae.UNSIGNED_SHORT})),new _p({context:t,attributes:u,indexBuffer:p})};Object.defineProperties(_p.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});_p.prototype.getAttribute=function(e){return this._attributes[e]};function qZe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=Bt.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s<a;++s){let c=o[s];if(c.enabled){let d=c.instanceDivisor,u=c.index;d!==i[u]&&(t.glVertexAttribDivisor(u,d),i[u]=d)}}}else for(s=0;s<r;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function $Ze(e,t){let n=e._attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];r.enabled&&l(r.value)&&r.vertexAttrib(t)}}_p.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&qZe(this),this._hasConstantAttributes&&$Ze(this,this._gl)):fte(this._gl,this._attributes,this._indexBuffer)};_p.prototype._unBind=function(){if(l(this._vao))this._context.glBindVertexArray(null);else{let e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){let i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}};_p.prototype.isDestroyed=function(){return!1};_p.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;l(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return l(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),l(this._vao)&&this._context.glDeleteVertexArray(this._vao),me(this)};var ti=_p;function Ko(e){e=y(e,y.EMPTY_OBJECT);let{context:t,source:n,pixelFormat:i=ot.RGBA,pixelDatatype:o=qe.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new en}=e,c=e.preMultiplyAlpha||i===ot.RGB||i===ot.LUMINANCE,{width:d,height:u}=e;l(n)&&({width:d,height:u}=n.positiveX);let m=d,p=ot.textureSizeInBytes(i,o,m,m)*6,g=ot.toInternalFormat(i,o,t),f=t._gl,x=f.TEXTURE_CUBE_MAP,_=f.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=x,this._texture=_,this._pixelFormat=i,this._pixelDatatype=o,this._size=m,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=c,this._flipY=r;let C=l(n);function V(L){return new gR(t,_,x,L,g,i,o,m,c,r,C)}this._positiveX=V(f.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=V(f.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=V(f.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=V(f.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=V(f.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=V(f.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,pte(this,a),f.activeTexture(f.TEXTURE0),f.bindTexture(x,_),s?f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.NONE):f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.BROWSER_DEFAULT_WEBGL);for(let L of Ko.faceNames())xY(this[L],n?.[L],0);f.bindTexture(x,null)}Ko.prototype.copyFace=function(e,t,n,i){let o=e.context,r=new Wr({context:o,colorTextures:[t],destroyAttachments:!1});r._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,y(i,0)),r._unBind(),r.destroy()};Ko.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*eGe(){yield Ko.FaceName.POSITIVEX,yield Ko.FaceName.NEGATIVEX,yield Ko.FaceName.POSITIVEY,yield Ko.FaceName.NEGATIVEY,yield Ko.FaceName.POSITIVEZ,yield Ko.FaceName.NEGATIVEZ}Ko.faceNames=function(){return eGe()};function xY(e,t,n){n=y(n,0);let i=e._targetFace,o=Math.max(Math.floor(e._size/2**n),1),r=e._pixelFormat,s=e._pixelDatatype,a=e._internalFormat,c=e._flipY,d=e._preMultiplyAlpha,u=e._context,m=u._gl;if(!l(t)){m.texImage2D(i,n,a,o,o,0,r,qe.toWebGLConstant(s,u),null);return}let{arrayBufferView:p}=t,g=4;l(p)&&(g=ot.alignmentInBytes(r,s,o)),m.pixelStorei(m.UNPACK_ALIGNMENT,g),l(p)?(m.pixelStorei(m.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,!1),c&&(p=ot.flipY(p,r,s,o,o)),m.texImage2D(i,n,a,o,o,0,r,qe.toWebGLConstant(s,u),p)):(m.pixelStorei(m.UNPACK_PREMULTIPLY_ALPHA_WEBGL,d),m.pixelStorei(m.UNPACK_FLIP_Y_WEBGL,c),m.texImage2D(i,n,a,r,qe.toWebGLConstant(s,u),t))}Ko.loadFace=xY;Object.defineProperties(Ko.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){pte(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});Ko.getDirection=function(e,t){switch(e){case Ko.FaceName.POSITIVEX:return h.clone(h.UNIT_X,t);case Ko.FaceName.NEGATIVEX:return h.negate(h.UNIT_X,t);case Ko.FaceName.POSITIVEY:return h.clone(h.UNIT_Y,t);case Ko.FaceName.NEGATIVEY:return h.negate(h.UNIT_Y,t);case Ko.FaceName.POSITIVEZ:return h.clone(h.UNIT_Z,t);case Ko.FaceName.NEGATIVEZ:return h.negate(h.UNIT_Z,t)}};function pte(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[$t.NEAREST_MIPMAP_NEAREST,$t.NEAREST_MIPMAP_LINEAR,$t.LINEAR_MIPMAP_NEAREST,$t.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelDatatype;(s===qe.FLOAT&&!r.textureFloatLinear||s===qe.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?$t.NEAREST_MIPMAP_NEAREST:$t.NEAREST,i=hi.NEAREST);let a=r._gl,c=e._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,e._texture),a.texParameteri(c,a.TEXTURE_MIN_FILTER,n),a.texParameteri(c,a.TEXTURE_MAG_FILTER,i),a.texParameteri(c,a.TEXTURE_WRAP_S,t.wrapS),a.texParameteri(c,a.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&a.texParameteri(c,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),a.bindTexture(c,null)}Ko.prototype.loadMipmaps=function(e,t){t=y(t,!1);let n=this._context._gl,i=this._texture,o=this._textureTarget;n.activeTexture(n.TEXTURE0),n.bindTexture(o,i),t?n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE):n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL);for(let r=0;r<e.length;r++){let s=e[r],a=r+1;for(let c of Ko.faceNames())xY(this[c],s[c],a)}n.bindTexture(o,null),this._hasMipmap=!0};Ko.prototype.generateMipmap=function(e){e=y(e,Qh.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};Ko.createVertexArray=function(e){let t=Ra.createGeometry(Ra.fromDimensions({dimensions:new h(2,2,2),vertexFormat:We.POSITION_ONLY})),n=this._attributeLocations=Fn.createAttributeLocations(t);return ti.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Me.STATIC_DRAW})};Ko.prototype.isDestroyed=function(){return!1};Ko.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=me(this._positiveX),this._negativeX=me(this._negativeX),this._positiveY=me(this._positiveY),this._negativeY=me(this._negativeY),this._positiveZ=me(this._positiveZ),this._negativeZ=me(this._negativeZ),me(this)};var yr=Ko;var owt=T(S(),1);function tGe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var ec=tGe;var jkt=T(S(),1);var Ykt=T(S(),1);var Fkt=T(S(),1);var swt=T(S(),1),xR=`/**
  96. * A built-in GLSL floating-point constant for converting radians to degrees.
  97. *
  98. * @alias czm_degreesPerRadian
  99. * @glslConstant
  100. *
  101. * @see CesiumMath.DEGREES_PER_RADIAN
  102. *
  103. * @example
  104. * // GLSL declaration
  105. * const float czm_degreesPerRadian = ...;
  106. *
  107. * // Example
  108. * float deg = czm_degreesPerRadian * rad;
  109. */
  110. const float czm_degreesPerRadian = 57.29577951308232;
  111. `;var cwt=T(S(),1),_R=`/**
  112. * A built-in GLSL vec2 constant for defining the depth range.
  113. * This is a workaround to a bug where IE11 does not implement gl_DepthRange.
  114. *
  115. * @alias czm_depthRange
  116. * @glslConstant
  117. *
  118. * @example
  119. * // GLSL declaration
  120. * float depthRangeNear = czm_depthRange.near;
  121. * float depthRangeFar = czm_depthRange.far;
  122. *
  123. */
  124. const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);
  125. `;var dwt=T(S(),1),TR=`/**
  126. * 0.1
  127. *
  128. * @name czm_epsilon1
  129. * @glslConstant
  130. */
  131. const float czm_epsilon1 = 0.1;
  132. `;var mwt=T(S(),1),SR=`/**
  133. * 0.01
  134. *
  135. * @name czm_epsilon2
  136. * @glslConstant
  137. */
  138. const float czm_epsilon2 = 0.01;
  139. `;var fwt=T(S(),1),CR=`/**
  140. * 0.001
  141. *
  142. * @name czm_epsilon3
  143. * @glslConstant
  144. */
  145. const float czm_epsilon3 = 0.001;
  146. `;var bwt=T(S(),1),VR=`/**
  147. * 0.0001
  148. *
  149. * @name czm_epsilon4
  150. * @glslConstant
  151. */
  152. const float czm_epsilon4 = 0.0001;
  153. `;var ywt=T(S(),1),LR=`/**
  154. * 0.00001
  155. *
  156. * @name czm_epsilon5
  157. * @glslConstant
  158. */
  159. const float czm_epsilon5 = 0.00001;
  160. `;var _wt=T(S(),1),RR=`/**
  161. * 0.000001
  162. *
  163. * @name czm_epsilon6
  164. * @glslConstant
  165. */
  166. const float czm_epsilon6 = 0.000001;
  167. `;var Swt=T(S(),1),ZR=`/**
  168. * 0.0000001
  169. *
  170. * @name czm_epsilon7
  171. * @glslConstant
  172. */
  173. const float czm_epsilon7 = 0.0000001;
  174. `;var Vwt=T(S(),1),GR=`/**
  175. * DOC_TBA
  176. *
  177. * @name czm_infinity
  178. * @glslConstant
  179. */
  180. const float czm_infinity = 5906376272000.0; // Distance from the Sun to Pluto in meters. TODO: What is best given lowp, mediump, and highp?
  181. `;var Rwt=T(S(),1),ER=`/**
  182. * A built-in GLSL floating-point constant for <code>1/pi</code>.
  183. *
  184. * @alias czm_oneOverPi
  185. * @glslConstant
  186. *
  187. * @see CesiumMath.ONE_OVER_PI
  188. *
  189. * @example
  190. * // GLSL declaration
  191. * const float czm_oneOverPi = ...;
  192. *
  193. * // Example
  194. * float pi = 1.0 / czm_oneOverPi;
  195. */
  196. const float czm_oneOverPi = 0.3183098861837907;
  197. `;var Gwt=T(S(),1),IR=`/**
  198. * A built-in GLSL floating-point constant for <code>1/2pi</code>.
  199. *
  200. * @alias czm_oneOverTwoPi
  201. * @glslConstant
  202. *
  203. * @see CesiumMath.ONE_OVER_TWO_PI
  204. *
  205. * @example
  206. * // GLSL declaration
  207. * const float czm_oneOverTwoPi = ...;
  208. *
  209. * // Example
  210. * float pi = 2.0 * czm_oneOverTwoPi;
  211. */
  212. const float czm_oneOverTwoPi = 0.15915494309189535;
  213. `;var Iwt=T(S(),1),XR=`/**
  214. * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE}
  215. *
  216. * @name czm_passCesium3DTile
  217. * @glslConstant
  218. *
  219. * @see czm_pass
  220. */
  221. const float czm_passCesium3DTile = 4.0;
  222. `;var Wwt=T(S(),1),WR=`/**
  223. * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION}
  224. *
  225. * @name czm_passCesium3DTileClassification
  226. * @glslConstant
  227. *
  228. * @see czm_pass
  229. */
  230. const float czm_passCesium3DTileClassification = 5.0;
  231. `;var vwt=T(S(),1),PR=`/**
  232. * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW}
  233. *
  234. * @name czm_passCesium3DTileClassificationIgnoreShow
  235. * @glslConstant
  236. *
  237. * @see czm_pass
  238. */
  239. const float czm_passCesium3DTileClassificationIgnoreShow = 6.0;
  240. `;var Fwt=T(S(),1),vR=`/**
  241. * The automatic GLSL constant for {@link Pass#CLASSIFICATION}
  242. *
  243. * @name czm_passClassification
  244. * @glslConstant
  245. *
  246. * @see czm_pass
  247. */
  248. const float czm_passClassification = 7.0;
  249. `;var Mwt=T(S(),1),wR=`/**
  250. * The automatic GLSL constant for {@link Pass#COMPUTE}
  251. *
  252. * @name czm_passCompute
  253. * @glslConstant
  254. *
  255. * @see czm_pass
  256. */
  257. const float czm_passCompute = 1.0;
  258. `;var kwt=T(S(),1),FR=`/**
  259. * The automatic GLSL constant for {@link Pass#ENVIRONMENT}
  260. *
  261. * @name czm_passEnvironment
  262. * @glslConstant
  263. *
  264. * @see czm_pass
  265. */
  266. const float czm_passEnvironment = 0.0;
  267. `;var Dwt=T(S(),1),AR=`/**
  268. * The automatic GLSL constant for {@link Pass#GLOBE}
  269. *
  270. * @name czm_passGlobe
  271. * @glslConstant
  272. *
  273. * @see czm_pass
  274. */
  275. const float czm_passGlobe = 2.0;
  276. `;var Owt=T(S(),1),MR=`/**
  277. * The automatic GLSL constant for {@link Pass#OPAQUE}
  278. *
  279. * @name czm_passOpaque
  280. * @glslConstant
  281. *
  282. * @see czm_pass
  283. */
  284. const float czm_passOpaque = 7.0;
  285. `;var Hwt=T(S(),1),NR=`/**
  286. * The automatic GLSL constant for {@link Pass#OVERLAY}
  287. *
  288. * @name czm_passOverlay
  289. * @glslConstant
  290. *
  291. * @see czm_pass
  292. */
  293. const float czm_passOverlay = 10.0;
  294. `;var Kwt=T(S(),1),kR=`/**
  295. * The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION}
  296. *
  297. * @name czm_passTerrainClassification
  298. * @glslConstant
  299. *
  300. * @see czm_pass
  301. */
  302. const float czm_passTerrainClassification = 3.0;
  303. `;var Qwt=T(S(),1),UR=`/**
  304. * The automatic GLSL constant for {@link Pass#TRANSLUCENT}
  305. *
  306. * @name czm_passTranslucent
  307. * @glslConstant
  308. *
  309. * @see czm_pass
  310. */
  311. const float czm_passTranslucent = 8.0;
  312. `;var qwt=T(S(),1),DR=`/**
  313. * The automatic GLSL constant for {@link Pass#VOXELS}
  314. *
  315. * @name czm_passVoxels
  316. * @glslConstant
  317. *
  318. * @see czm_pass
  319. */
  320. const float czm_passVoxels = 9.0;
  321. `;var eFt=T(S(),1),BR=`/**
  322. * A built-in GLSL floating-point constant for <code>Math.PI</code>.
  323. *
  324. * @alias czm_pi
  325. * @glslConstant
  326. *
  327. * @see CesiumMath.PI
  328. *
  329. * @example
  330. * // GLSL declaration
  331. * const float czm_pi = ...;
  332. *
  333. * // Example
  334. * float twoPi = 2.0 * czm_pi;
  335. */
  336. const float czm_pi = 3.141592653589793;
  337. `;var nFt=T(S(),1),OR=`/**
  338. * A built-in GLSL floating-point constant for <code>pi/4</code>.
  339. *
  340. * @alias czm_piOverFour
  341. * @glslConstant
  342. *
  343. * @see CesiumMath.PI_OVER_FOUR
  344. *
  345. * @example
  346. * // GLSL declaration
  347. * const float czm_piOverFour = ...;
  348. *
  349. * // Example
  350. * float pi = 4.0 * czm_piOverFour;
  351. */
  352. const float czm_piOverFour = 0.7853981633974483;
  353. `;var oFt=T(S(),1),YR=`/**
  354. * A built-in GLSL floating-point constant for <code>pi/6</code>.
  355. *
  356. * @alias czm_piOverSix
  357. * @glslConstant
  358. *
  359. * @see CesiumMath.PI_OVER_SIX
  360. *
  361. * @example
  362. * // GLSL declaration
  363. * const float czm_piOverSix = ...;
  364. *
  365. * // Example
  366. * float pi = 6.0 * czm_piOverSix;
  367. */
  368. const float czm_piOverSix = 0.5235987755982988;
  369. `;var sFt=T(S(),1),HR=`/**
  370. * A built-in GLSL floating-point constant for <code>pi/3</code>.
  371. *
  372. * @alias czm_piOverThree
  373. * @glslConstant
  374. *
  375. * @see CesiumMath.PI_OVER_THREE
  376. *
  377. * @example
  378. * // GLSL declaration
  379. * const float czm_piOverThree = ...;
  380. *
  381. * // Example
  382. * float pi = 3.0 * czm_piOverThree;
  383. */
  384. const float czm_piOverThree = 1.0471975511965976;
  385. `;var cFt=T(S(),1),zR=`/**
  386. * A built-in GLSL floating-point constant for <code>pi/2</code>.
  387. *
  388. * @alias czm_piOverTwo
  389. * @glslConstant
  390. *
  391. * @see CesiumMath.PI_OVER_TWO
  392. *
  393. * @example
  394. * // GLSL declaration
  395. * const float czm_piOverTwo = ...;
  396. *
  397. * // Example
  398. * float pi = 2.0 * czm_piOverTwo;
  399. */
  400. const float czm_piOverTwo = 1.5707963267948966;
  401. `;var dFt=T(S(),1),KR=`/**
  402. * A built-in GLSL floating-point constant for converting degrees to radians.
  403. *
  404. * @alias czm_radiansPerDegree
  405. * @glslConstant
  406. *
  407. * @see CesiumMath.RADIANS_PER_DEGREE
  408. *
  409. * @example
  410. * // GLSL declaration
  411. * const float czm_radiansPerDegree = ...;
  412. *
  413. * // Example
  414. * float rad = czm_radiansPerDegree * deg;
  415. */
  416. const float czm_radiansPerDegree = 0.017453292519943295;
  417. `;var mFt=T(S(),1),JR=`/**
  418. * The constant identifier for the 2D {@link SceneMode}
  419. *
  420. * @name czm_sceneMode2D
  421. * @glslConstant
  422. * @see czm_sceneMode
  423. * @see czm_sceneModeColumbusView
  424. * @see czm_sceneMode3D
  425. * @see czm_sceneModeMorphing
  426. */
  427. const float czm_sceneMode2D = 2.0;
  428. `;var fFt=T(S(),1),QR=`/**
  429. * The constant identifier for the 3D {@link SceneMode}
  430. *
  431. * @name czm_sceneMode3D
  432. * @glslConstant
  433. * @see czm_sceneMode
  434. * @see czm_sceneMode2D
  435. * @see czm_sceneModeColumbusView
  436. * @see czm_sceneModeMorphing
  437. */
  438. const float czm_sceneMode3D = 3.0;
  439. `;var bFt=T(S(),1),jR=`/**
  440. * The constant identifier for the Columbus View {@link SceneMode}
  441. *
  442. * @name czm_sceneModeColumbusView
  443. * @glslConstant
  444. * @see czm_sceneMode
  445. * @see czm_sceneMode2D
  446. * @see czm_sceneMode3D
  447. * @see czm_sceneModeMorphing
  448. */
  449. const float czm_sceneModeColumbusView = 1.0;
  450. `;var yFt=T(S(),1),qR=`/**
  451. * The constant identifier for the Morphing {@link SceneMode}
  452. *
  453. * @name czm_sceneModeMorphing
  454. * @glslConstant
  455. * @see czm_sceneMode
  456. * @see czm_sceneMode2D
  457. * @see czm_sceneModeColumbusView
  458. * @see czm_sceneMode3D
  459. */
  460. const float czm_sceneModeMorphing = 0.0;
  461. `;var _Ft=T(S(),1),$R=`/**
  462. * A built-in GLSL floating-point constant for one solar radius.
  463. *
  464. * @alias czm_solarRadius
  465. * @glslConstant
  466. *
  467. * @see CesiumMath.SOLAR_RADIUS
  468. *
  469. * @example
  470. * // GLSL declaration
  471. * const float czm_solarRadius = ...;
  472. */
  473. const float czm_solarRadius = 695500000.0;
  474. `;var SFt=T(S(),1),eZ=`/**
  475. * A built-in GLSL floating-point constant for <code>3pi/2</code>.
  476. *
  477. * @alias czm_threePiOver2
  478. * @glslConstant
  479. *
  480. * @see CesiumMath.THREE_PI_OVER_TWO
  481. *
  482. * @example
  483. * // GLSL declaration
  484. * const float czm_threePiOver2 = ...;
  485. *
  486. * // Example
  487. * float pi = (2.0 / 3.0) * czm_threePiOver2;
  488. */
  489. const float czm_threePiOver2 = 4.71238898038469;
  490. `;var VFt=T(S(),1),tZ=`/**
  491. * A built-in GLSL floating-point constant for <code>2pi</code>.
  492. *
  493. * @alias czm_twoPi
  494. * @glslConstant
  495. *
  496. * @see CesiumMath.TWO_PI
  497. *
  498. * @example
  499. * // GLSL declaration
  500. * const float czm_twoPi = ...;
  501. *
  502. * // Example
  503. * float pi = czm_twoPi / 2.0;
  504. */
  505. const float czm_twoPi = 6.283185307179586;
  506. `;var RFt=T(S(),1),nZ=`/**
  507. * The maximum latitude, in radians, both North and South, supported by a Web Mercator
  508. * (EPSG:3857) projection. Technically, the Mercator projection is defined
  509. * for any latitude up to (but not including) 90 degrees, but it makes sense
  510. * to cut it off sooner because it grows exponentially with increasing latitude.
  511. * The logic behind this particular cutoff value, which is the one used by
  512. * Google Maps, Bing Maps, and Esri, is that it makes the projection
  513. * square. That is, the rectangle is equal in the X and Y directions.
  514. *
  515. * The constant value is computed as follows:
  516. * czm_pi * 0.5 - (2.0 * atan(exp(-czm_pi)))
  517. *
  518. * @name czm_webMercatorMaxLatitude
  519. * @glslConstant
  520. */
  521. const float czm_webMercatorMaxLatitude = 1.4844222297453324;
  522. `;var GFt=T(S(),1),iZ=`/**
  523. * @name czm_depthRangeStruct
  524. * @glslStruct
  525. */
  526. struct czm_depthRangeStruct
  527. {
  528. float near;
  529. float far;
  530. };
  531. `;var IFt=T(S(),1),oZ=`/**
  532. * Holds material information that can be used for lighting. Returned by all czm_getMaterial functions.
  533. *
  534. * @name czm_material
  535. * @glslStruct
  536. *
  537. * @property {vec3} diffuse Incoming light that scatters evenly in all directions.
  538. * @property {float} specular Intensity of incoming light reflecting in a single direction.
  539. * @property {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight.
  540. * @property {vec3} normal Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.
  541. * @property {vec3} emission Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.
  542. * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.
  543. */
  544. struct czm_material
  545. {
  546. vec3 diffuse;
  547. float specular;
  548. float shininess;
  549. vec3 normal;
  550. vec3 emission;
  551. float alpha;
  552. };
  553. `;var WFt=T(S(),1),rZ=`/**
  554. * Used as input to every material's czm_getMaterial function.
  555. *
  556. * @name czm_materialInput
  557. * @glslStruct
  558. *
  559. * @property {float} s 1D texture coordinates.
  560. * @property {vec2} st 2D texture coordinates.
  561. * @property {vec3} str 3D texture coordinates.
  562. * @property {vec3} normalEC Unperturbed surface normal in eye coordinates.
  563. * @property {mat3} tangentToEyeMatrix Matrix for converting a tangent space normal to eye space.
  564. * @property {vec3} positionToEyeEC Vector from the fragment to the eye in eye coordinates. The magnitude is the distance in meters from the fragment to the eye.
  565. * @property {float} height The height of the terrain in meters above or below the ellipsoid. Only available for globe materials.
  566. * @property {float} slope The slope of the terrain in radians. 0 is flat; pi/2 is vertical. Only available for globe materials.
  567. * @property {float} aspect The aspect of the terrain in radians. 0 is East, pi/2 is North, pi is West, 3pi/2 is South. Only available for globe materials.
  568. * @property {float} waterMask The value of the water mask. 0 is land, 1 is water. Only available for globe materials.
  569. */
  570. struct czm_materialInput
  571. {
  572. float s;
  573. vec2 st;
  574. vec3 str;
  575. vec3 normalEC;
  576. mat3 tangentToEyeMatrix;
  577. vec3 positionToEyeEC;
  578. float height;
  579. float slope;
  580. float aspect;
  581. float waterMask;
  582. };
  583. `;var vFt=T(S(),1),sZ=`/**
  584. * Struct for representing a material for a {@link Model}. The model
  585. * rendering pipeline will pass this struct between material, custom shaders,
  586. * and lighting stages. This is not to be confused with {@link czm_material}
  587. * which is used by the older Fabric materials system, although they are similar.
  588. * <p>
  589. * All color values (diffuse, specular, emissive) are in linear color space.
  590. * </p>
  591. *
  592. * @name czm_modelMaterial
  593. * @glslStruct
  594. *
  595. * @property {vec4} baseColor The base color of the material.
  596. * @property {vec3} diffuse Incoming light that scatters evenly in all directions.
  597. * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.
  598. * @property {vec3} specular Color of reflected light at normal incidence in PBR materials. This is sometimes referred to as f0 in the literature.
  599. * @property {float} roughness A number from 0.0 to 1.0 representing how rough the surface is. Values near 0.0 produce glossy surfaces, while values near 1.0 produce rough surfaces.
  600. * @property {vec3} normalEC Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.
  601. * @property {float} occlusion Ambient occlusion recieved at this point on the material. 1.0 means fully lit, 0.0 means fully occluded.
  602. * @property {vec3} emissive Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.
  603. */
  604. struct czm_modelMaterial {
  605. vec4 baseColor;
  606. vec3 diffuse;
  607. float alpha;
  608. vec3 specular;
  609. float roughness;
  610. vec3 normalEC;
  611. float occlusion;
  612. vec3 emissive;
  613. #ifdef USE_SPECULAR
  614. float specularWeight;
  615. #endif
  616. #ifdef USE_ANISOTROPY
  617. vec3 anisotropicT;
  618. vec3 anisotropicB;
  619. float anisotropyStrength;
  620. #endif
  621. #ifdef USE_CLEARCOAT
  622. float clearcoatFactor;
  623. float clearcoatRoughness;
  624. vec3 clearcoatNormal;
  625. // Add clearcoatF0 when KHR_materials_ior is implemented
  626. #endif
  627. };
  628. `;var FFt=T(S(),1),aZ=`/**
  629. * Struct for representing the output of a custom vertex shader.
  630. *
  631. * @name czm_modelVertexOutput
  632. * @glslStruct
  633. *
  634. * @see {@link CustomShader}
  635. * @see {@link Model}
  636. *
  637. * @property {vec3} positionMC The position of the vertex in model coordinates
  638. * @property {float} pointSize A custom value for gl_PointSize. This is only used for point primitives.
  639. */
  640. struct czm_modelVertexOutput {
  641. vec3 positionMC;
  642. float pointSize;
  643. };
  644. `;var MFt=T(S(),1),cZ=`/**
  645. * DOC_TBA
  646. *
  647. * @name czm_ray
  648. * @glslStruct
  649. */
  650. struct czm_ray
  651. {
  652. vec3 origin;
  653. vec3 direction;
  654. };
  655. `;var kFt=T(S(),1),lZ=`/**
  656. * DOC_TBA
  657. *
  658. * @name czm_raySegment
  659. * @glslStruct
  660. */
  661. struct czm_raySegment
  662. {
  663. float start;
  664. float stop;
  665. };
  666. /**
  667. * DOC_TBA
  668. *
  669. * @name czm_emptyRaySegment
  670. * @glslConstant
  671. */
  672. const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);
  673. /**
  674. * DOC_TBA
  675. *
  676. * @name czm_fullRaySegment
  677. * @glslConstant
  678. */
  679. const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);
  680. `;var DFt=T(S(),1),dZ=`struct czm_shadowParameters
  681. {
  682. #ifdef USE_CUBE_MAP_SHADOW
  683. vec3 texCoords;
  684. #else
  685. vec2 texCoords;
  686. #endif
  687. float depthBias;
  688. float depth;
  689. float nDotL;
  690. vec2 texelStepSize;
  691. float normalShadingSmooth;
  692. float darkness;
  693. };
  694. `;var OFt=T(S(),1),uZ=`/**
  695. * Converts an HSB color (hue, saturation, brightness) to RGB
  696. * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}
  697. *
  698. * @name czm_HSBToRGB
  699. * @glslFunction
  700. *
  701. * @param {vec3} hsb The color in HSB.
  702. *
  703. * @returns {vec3} The color in RGB.
  704. *
  705. * @example
  706. * vec3 hsb = czm_RGBToHSB(rgb);
  707. * hsb.z *= 0.1;
  708. * rgb = czm_HSBToRGB(hsb);
  709. */
  710. const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
  711. vec3 czm_HSBToRGB(vec3 hsb)
  712. {
  713. vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);
  714. return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y);
  715. }
  716. `;var HFt=T(S(),1),mZ=`/**
  717. * Converts an HSL color (hue, saturation, lightness) to RGB
  718. * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}
  719. *
  720. * @name czm_HSLToRGB
  721. * @glslFunction
  722. *
  723. * @param {vec3} rgb The color in HSL.
  724. *
  725. * @returns {vec3} The color in RGB.
  726. *
  727. * @example
  728. * vec3 hsl = czm_RGBToHSL(rgb);
  729. * hsl.z *= 0.1;
  730. * rgb = czm_HSLToRGB(hsl);
  731. */
  732. vec3 hueToRGB(float hue)
  733. {
  734. float r = abs(hue * 6.0 - 3.0) - 1.0;
  735. float g = 2.0 - abs(hue * 6.0 - 2.0);
  736. float b = 2.0 - abs(hue * 6.0 - 4.0);
  737. return clamp(vec3(r, g, b), 0.0, 1.0);
  738. }
  739. vec3 czm_HSLToRGB(vec3 hsl)
  740. {
  741. vec3 rgb = hueToRGB(hsl.x);
  742. float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;
  743. return (rgb - 0.5) * c + hsl.z;
  744. }
  745. `;var KFt=T(S(),1),hZ=`/**
  746. * Converts an RGB color to HSB (hue, saturation, brightness)
  747. * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}
  748. *
  749. * @name czm_RGBToHSB
  750. * @glslFunction
  751. *
  752. * @param {vec3} rgb The color in RGB.
  753. *
  754. * @returns {vec3} The color in HSB.
  755. *
  756. * @example
  757. * vec3 hsb = czm_RGBToHSB(rgb);
  758. * hsb.z *= 0.1;
  759. * rgb = czm_HSBToRGB(hsb);
  760. */
  761. const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
  762. vec3 czm_RGBToHSB(vec3 rgb)
  763. {
  764. vec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g));
  765. vec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r));
  766. float d = q.x - min(q.w, q.y);
  767. return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);
  768. }
  769. `;var QFt=T(S(),1),fZ=`/**
  770. * Converts an RGB color to HSL (hue, saturation, lightness)
  771. * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}
  772. *
  773. * @name czm_RGBToHSL
  774. * @glslFunction
  775. *
  776. * @param {vec3} rgb The color in RGB.
  777. *
  778. * @returns {vec3} The color in HSL.
  779. *
  780. * @example
  781. * vec3 hsl = czm_RGBToHSL(rgb);
  782. * hsl.z *= 0.1;
  783. * rgb = czm_HSLToRGB(hsl);
  784. */
  785. vec3 RGBtoHCV(vec3 rgb)
  786. {
  787. // Based on work by Sam Hocevar and Emil Persson
  788. vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0);
  789. vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx);
  790. float c = q.x - min(q.w, q.y);
  791. float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z);
  792. return vec3(h, c, q.x);
  793. }
  794. vec3 czm_RGBToHSL(vec3 rgb)
  795. {
  796. vec3 hcv = RGBtoHCV(rgb);
  797. float l = hcv.z - hcv.y * 0.5;
  798. float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7);
  799. return vec3(hcv.x, s, l);
  800. }
  801. `;var qFt=T(S(),1),pZ=`/**
  802. * Converts an RGB color to CIE Yxy.
  803. * <p>The conversion is described in
  804. * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}
  805. * </p>
  806. *
  807. * @name czm_RGBToXYZ
  808. * @glslFunction
  809. *
  810. * @param {vec3} rgb The color in RGB.
  811. *
  812. * @returns {vec3} The color in CIE Yxy.
  813. *
  814. * @example
  815. * vec3 xyz = czm_RGBToXYZ(rgb);
  816. * xyz.x = max(xyz.x - luminanceThreshold, 0.0);
  817. * rgb = czm_XYZToRGB(xyz);
  818. */
  819. vec3 czm_RGBToXYZ(vec3 rgb)
  820. {
  821. const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,
  822. 0.3576, 0.7152, 0.1192,
  823. 0.1805, 0.0722, 0.9505);
  824. vec3 xyz = RGB2XYZ * rgb;
  825. vec3 Yxy;
  826. Yxy.r = xyz.g;
  827. float temp = dot(vec3(1.0), xyz);
  828. Yxy.gb = xyz.rg / temp;
  829. return Yxy;
  830. }
  831. `;var eAt=T(S(),1),bZ=`/**
  832. * Converts a CIE Yxy color to RGB.
  833. * <p>The conversion is described in
  834. * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}
  835. * </p>
  836. *
  837. * @name czm_XYZToRGB
  838. * @glslFunction
  839. *
  840. * @param {vec3} Yxy The color in CIE Yxy.
  841. *
  842. * @returns {vec3} The color in RGB.
  843. *
  844. * @example
  845. * vec3 xyz = czm_RGBToXYZ(rgb);
  846. * xyz.x = max(xyz.x - luminanceThreshold, 0.0);
  847. * rgb = czm_XYZToRGB(xyz);
  848. */
  849. vec3 czm_XYZToRGB(vec3 Yxy)
  850. {
  851. const mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556,
  852. -1.5371, 1.8760, -0.2040,
  853. -0.4985, 0.0416, 1.0572);
  854. vec3 xyz;
  855. xyz.r = Yxy.r * Yxy.g / Yxy.b;
  856. xyz.g = Yxy.r;
  857. xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;
  858. return XYZ2RGB * xyz;
  859. }
  860. `;var nAt=T(S(),1),gZ=`// See:
  861. // https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/
  862. vec3 czm_acesTonemapping(vec3 color) {
  863. float g = 0.985;
  864. float a = 0.065;
  865. float b = 0.0001;
  866. float c = 0.433;
  867. float d = 0.238;
  868. color = (color * (color + a) - b) / (color * (g * color + c) + d);
  869. color = clamp(color, 0.0, 1.0);
  870. return color;
  871. }
  872. `;var oAt=T(S(),1),yZ=`/**
  873. * @private
  874. */
  875. float czm_alphaWeight(float a)
  876. {
  877. float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];
  878. // See Weighted Blended Order-Independent Transparency for examples of different weighting functions:
  879. // http://jcgt.org/published/0002/02/09/
  880. return pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0))));
  881. }
  882. `;var sAt=T(S(),1),xZ=`/**
  883. * Procedural anti-aliasing by blurring two colors that meet at a sharp edge.
  884. *
  885. * @name czm_antialias
  886. * @glslFunction
  887. *
  888. * @param {vec4} color1 The color on one side of the edge.
  889. * @param {vec4} color2 The color on the other side of the edge.
  890. * @param {vec4} currentcolor The current color, either <code>color1</code> or <code>color2</code>.
  891. * @param {float} dist The distance to the edge in texture coordinates.
  892. * @param {float} [fuzzFactor=0.1] Controls the blurriness between the two colors.
  893. * @returns {vec4} The anti-aliased color.
  894. *
  895. * @example
  896. * // GLSL declarations
  897. * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor);
  898. * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist);
  899. *
  900. * // get the color for a material that has a sharp edge at the line y = 0.5 in texture space
  901. * float dist = abs(textureCoordinates.t - 0.5);
  902. * vec4 currentColor = mix(bottomColor, topColor, step(0.5, textureCoordinates.t));
  903. * vec4 color = czm_antialias(bottomColor, topColor, currentColor, dist, 0.1);
  904. */
  905. vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)
  906. {
  907. float val1 = clamp(dist / fuzzFactor, 0.0, 1.0);
  908. float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);
  909. val1 = val1 * (1.0 - val2);
  910. val1 = val1 * val1 * (3.0 - (2.0 * val1));
  911. val1 = pow(val1, 0.5); //makes the transition nicer
  912. vec4 midColor = (color1 + color2) * 0.5;
  913. return mix(midColor, currentColor, val1);
  914. }
  915. vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)
  916. {
  917. return czm_antialias(color1, color2, currentColor, dist, 0.1);
  918. }
  919. `;var cAt=T(S(),1),_Z=`/**
  920. * Apply a HSB color shift to an RGB color.
  921. *
  922. * @param {vec3} rgb The color in RGB space.
  923. * @param {vec3} hsbShift The amount to shift each component. The xyz components correspond to hue, saturation, and brightness. Shifting the hue by +/- 1.0 corresponds to shifting the hue by a full cycle. Saturation and brightness are clamped between 0 and 1 after the adjustment
  924. * @param {bool} ignoreBlackPixels If true, black pixels will be unchanged. This is necessary in some shaders such as atmosphere-related effects.
  925. *
  926. * @return {vec3} The RGB color after shifting in HSB space and clamping saturation and brightness to a valid range.
  927. */
  928. vec3 czm_applyHSBShift(vec3 rgb, vec3 hsbShift, bool ignoreBlackPixels) {
  929. // Convert rgb color to hsb
  930. vec3 hsb = czm_RGBToHSB(rgb);
  931. // Perform hsb shift
  932. // Hue cycles around so no clamp is needed.
  933. hsb.x += hsbShift.x; // hue
  934. hsb.y = clamp(hsb.y + hsbShift.y, 0.0, 1.0); // saturation
  935. // brightness
  936. //
  937. // Some shaders such as atmosphere-related effects need to leave black
  938. // pixels unchanged
  939. if (ignoreBlackPixels) {
  940. hsb.z = hsb.z > czm_epsilon7 ? hsb.z + hsbShift.z : 0.0;
  941. } else {
  942. hsb.z = hsb.z + hsbShift.z;
  943. }
  944. hsb.z = clamp(hsb.z, 0.0, 1.0);
  945. // Convert shifted hsb back to rgb
  946. return czm_HSBToRGB(hsb);
  947. }
  948. `;var dAt=T(S(),1),TZ=`/**
  949. * Approximately computes spherical coordinates given a normal.
  950. * Uses approximate inverse trigonometry for speed and consistency,
  951. * since inverse trigonometry can differ from vendor-to-vendor and when compared with the CPU.
  952. *
  953. * @name czm_approximateSphericalCoordinates
  954. * @glslFunction
  955. *
  956. * @param {vec3} normal arbitrary-length normal.
  957. *
  958. * @returns {vec2} Approximate latitude and longitude spherical coordinates.
  959. */
  960. vec2 czm_approximateSphericalCoordinates(vec3 normal) {
  961. // Project into plane with vertical for latitude
  962. float latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z);
  963. float longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y);
  964. return vec2(latitudeApproximation, longitudeApproximation);
  965. }
  966. `;var mAt=T(S(),1),SZ=`/**
  967. * Compute a rational approximation to tanh(x)
  968. *
  969. * @param {float} x A real number input
  970. * @returns {float} An approximation for tanh(x)
  971. */
  972. float czm_approximateTanh(float x) {
  973. float x2 = x * x;
  974. return max(-1.0, min(1.0, x * (27.0 + x2) / (27.0 + 9.0 * x2)));
  975. }
  976. `;var fAt=T(S(),1),CZ=`/**
  977. * Determines if the fragment is back facing
  978. *
  979. * @name czm_backFacing
  980. * @glslFunction
  981. *
  982. * @returns {bool} <code>true</code> if the fragment is back facing; otherwise, <code>false</code>.
  983. */
  984. bool czm_backFacing()
  985. {
  986. // !gl_FrontFacing doesn't work as expected on Mac/Intel so use the more verbose form instead. See https://github.com/CesiumGS/cesium/pull/8494.
  987. return gl_FrontFacing == false;
  988. }
  989. `;var bAt=T(S(),1),VZ=`/**
  990. * Branchless ternary operator to be used when it's inexpensive to explicitly
  991. * evaluate both possibilities for a float expression.
  992. *
  993. * @name czm_branchFreeTernary
  994. * @glslFunction
  995. *
  996. * @param {bool} comparison A comparison statement
  997. * @param {float} a Value to return if the comparison is true.
  998. * @param {float} b Value to return if the comparison is false.
  999. *
  1000. * @returns {float} equivalent of comparison ? a : b
  1001. */
  1002. float czm_branchFreeTernary(bool comparison, float a, float b) {
  1003. float useA = float(comparison);
  1004. return a * useA + b * (1.0 - useA);
  1005. }
  1006. /**
  1007. * Branchless ternary operator to be used when it's inexpensive to explicitly
  1008. * evaluate both possibilities for a vec2 expression.
  1009. *
  1010. * @name czm_branchFreeTernary
  1011. * @glslFunction
  1012. *
  1013. * @param {bool} comparison A comparison statement
  1014. * @param {vec2} a Value to return if the comparison is true.
  1015. * @param {vec2} b Value to return if the comparison is false.
  1016. *
  1017. * @returns {vec2} equivalent of comparison ? a : b
  1018. */
  1019. vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) {
  1020. float useA = float(comparison);
  1021. return a * useA + b * (1.0 - useA);
  1022. }
  1023. /**
  1024. * Branchless ternary operator to be used when it's inexpensive to explicitly
  1025. * evaluate both possibilities for a vec3 expression.
  1026. *
  1027. * @name czm_branchFreeTernary
  1028. * @glslFunction
  1029. *
  1030. * @param {bool} comparison A comparison statement
  1031. * @param {vec3} a Value to return if the comparison is true.
  1032. * @param {vec3} b Value to return if the comparison is false.
  1033. *
  1034. * @returns {vec3} equivalent of comparison ? a : b
  1035. */
  1036. vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) {
  1037. float useA = float(comparison);
  1038. return a * useA + b * (1.0 - useA);
  1039. }
  1040. /**
  1041. * Branchless ternary operator to be used when it's inexpensive to explicitly
  1042. * evaluate both possibilities for a vec4 expression.
  1043. *
  1044. * @name czm_branchFreeTernary
  1045. * @glslFunction
  1046. *
  1047. * @param {bool} comparison A comparison statement
  1048. * @param {vec3} a Value to return if the comparison is true.
  1049. * @param {vec3} b Value to return if the comparison is false.
  1050. *
  1051. * @returns {vec3} equivalent of comparison ? a : b
  1052. */
  1053. vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) {
  1054. float useA = float(comparison);
  1055. return a * useA + b * (1.0 - useA);
  1056. }
  1057. `;var yAt=T(S(),1),LZ=`
  1058. vec4 czm_cascadeColor(vec4 weights)
  1059. {
  1060. return vec4(1.0, 0.0, 0.0, 1.0) * weights.x +
  1061. vec4(0.0, 1.0, 0.0, 1.0) * weights.y +
  1062. vec4(0.0, 0.0, 1.0, 1.0) * weights.z +
  1063. vec4(1.0, 0.0, 1.0, 1.0) * weights.w;
  1064. }
  1065. `;var _At=T(S(),1),RZ=`
  1066. uniform vec4 shadowMap_cascadeDistances;
  1067. float czm_cascadeDistance(vec4 weights)
  1068. {
  1069. return dot(shadowMap_cascadeDistances, weights);
  1070. }
  1071. `;var SAt=T(S(),1),ZZ=`
  1072. uniform mat4 shadowMap_cascadeMatrices[4];
  1073. mat4 czm_cascadeMatrix(vec4 weights)
  1074. {
  1075. return shadowMap_cascadeMatrices[0] * weights.x +
  1076. shadowMap_cascadeMatrices[1] * weights.y +
  1077. shadowMap_cascadeMatrices[2] * weights.z +
  1078. shadowMap_cascadeMatrices[3] * weights.w;
  1079. }
  1080. `;var VAt=T(S(),1),GZ=`
  1081. uniform vec4 shadowMap_cascadeSplits[2];
  1082. vec4 czm_cascadeWeights(float depthEye)
  1083. {
  1084. // One component is set to 1.0 and all others set to 0.0.
  1085. vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));
  1086. vec4 far = step(depthEye, shadowMap_cascadeSplits[1]);
  1087. return near * far;
  1088. }
  1089. `;var RAt=T(S(),1),EZ=`float getSignedDistance(vec2 uv, highp sampler2D clippingDistance) {
  1090. float signedDistance = texture(clippingDistance, uv).r;
  1091. return (signedDistance - 0.5) * 2.0;
  1092. }
  1093. void czm_clipPolygons(highp sampler2D clippingDistance, int extentsLength, vec2 clippingPosition, int regionIndex) {
  1094. // Position is completely outside of polygons bounds
  1095. vec2 rectUv = clippingPosition;
  1096. if (regionIndex < 0 || rectUv.x <= 0.0 || rectUv.y <= 0.0 || rectUv.x >= 1.0 || rectUv.y >= 1.0) {
  1097. #ifdef CLIPPING_INVERSE
  1098. discard;
  1099. #endif
  1100. return;
  1101. }
  1102. vec2 clippingDistanceTextureDimensions = vec2(textureSize(clippingDistance, 0));
  1103. vec2 sampleOffset = max(1.0 / clippingDistanceTextureDimensions, vec2(0.005));
  1104. float dimension = float(extentsLength);
  1105. if (extentsLength > 2) {
  1106. dimension = ceil(log2(float(extentsLength)));
  1107. }
  1108. vec2 textureOffset = vec2(mod(float(regionIndex), dimension), floor(float(regionIndex) / dimension)) / dimension;
  1109. vec2 uv = textureOffset + rectUv / dimension;
  1110. float signedDistance = getSignedDistance(uv, clippingDistance);
  1111. #ifdef CLIPPING_INVERSE
  1112. if (signedDistance > 0.0) {
  1113. discard;
  1114. }
  1115. #else
  1116. if (signedDistance < 0.0) {
  1117. discard;
  1118. }
  1119. #endif
  1120. }
  1121. `;var GAt=T(S(),1),IZ=`/**
  1122. * DOC_TBA
  1123. *
  1124. * @name czm_columbusViewMorph
  1125. * @glslFunction
  1126. */
  1127. vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)
  1128. {
  1129. // Just linear for now.
  1130. vec3 p = mix(position2D.xyz, position3D.xyz, time);
  1131. return vec4(p, 1.0);
  1132. }
  1133. `;var IAt=T(S(),1),XZ=`/**
  1134. * Compute the atmosphere color, applying Rayleigh and Mie scattering. This
  1135. * builtin uses automatic uniforms so the atmophere settings are synced with the
  1136. * state of the Scene, even in other contexts like Model.
  1137. *
  1138. * @name czm_computeAtmosphereColor
  1139. * @glslFunction
  1140. *
  1141. * @param {vec3} positionWC Position of the fragment in world coords (low precision)
  1142. * @param {vec3} lightDirection Light direction from the sun or other light source.
  1143. * @param {vec3} rayleighColor The Rayleigh scattering color computed by a scattering function
  1144. * @param {vec3} mieColor The Mie scattering color computed by a scattering function
  1145. * @param {float} opacity The opacity computed by a scattering function.
  1146. */
  1147. vec4 czm_computeAtmosphereColor(
  1148. vec3 positionWC,
  1149. vec3 lightDirection,
  1150. vec3 rayleighColor,
  1151. vec3 mieColor,
  1152. float opacity
  1153. ) {
  1154. // Setup the primary ray: from the camera position to the vertex position.
  1155. vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
  1156. vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
  1157. float cosAngle = dot(cameraToPositionWCDirection, lightDirection);
  1158. float cosAngleSq = cosAngle * cosAngle;
  1159. float G = czm_atmosphereMieAnisotropy;
  1160. float GSq = G * G;
  1161. // The Rayleigh phase function.
  1162. float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
  1163. // The Mie phase function.
  1164. float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));
  1165. // The final color is generated by combining the effects of the Rayleigh and Mie scattering.
  1166. vec3 rayleigh = rayleighPhase * rayleighColor;
  1167. vec3 mie = miePhase * mieColor;
  1168. vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity;
  1169. return vec4(color, opacity);
  1170. }
  1171. /**
  1172. * Compute the atmosphere color, applying Rayleigh and Mie scattering. This
  1173. * builtin uses automatic uniforms so the atmophere settings are synced with the
  1174. * state of the Scene, even in other contexts like Model.
  1175. *
  1176. * @name czm_computeAtmosphereColor
  1177. * @glslFunction
  1178. *
  1179. * @param {czm_ray} primaryRay Ray from the origin to sky fragment to in world coords (low precision)
  1180. * @param {vec3} lightDirection Light direction from the sun or other light source.
  1181. * @param {vec3} rayleighColor The Rayleigh scattering color computed by a scattering function
  1182. * @param {vec3} mieColor The Mie scattering color computed by a scattering function
  1183. * @param {float} opacity The opacity computed by a scattering function.
  1184. */
  1185. vec4 czm_computeAtmosphereColor(
  1186. czm_ray primaryRay,
  1187. vec3 lightDirection,
  1188. vec3 rayleighColor,
  1189. vec3 mieColor,
  1190. float opacity
  1191. ) {
  1192. vec3 direction = normalize(primaryRay.direction);
  1193. float cosAngle = dot(direction, lightDirection);
  1194. float cosAngleSq = cosAngle * cosAngle;
  1195. float G = czm_atmosphereMieAnisotropy;
  1196. float GSq = G * G;
  1197. // The Rayleigh phase function.
  1198. float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
  1199. // The Mie phase function.
  1200. float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));
  1201. // The final color is generated by combining the effects of the Rayleigh and Mie scattering.
  1202. vec3 rayleigh = rayleighPhase * rayleighColor;
  1203. vec3 mie = miePhase * mieColor;
  1204. vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity;
  1205. return vec4(color, opacity);
  1206. }
  1207. `;var WAt=T(S(),1),WZ=`/**
  1208. * Compute atmosphere scattering for the ground atmosphere and fog. This method
  1209. * uses automatic uniforms so it is always synced with the scene settings.
  1210. *
  1211. * @name czm_computeGroundAtmosphereScattering
  1212. * @glslfunction
  1213. *
  1214. * @param {vec3} positionWC The position of the fragment in world coordinates.
  1215. * @param {vec3} lightDirection The direction of the light to calculate the scattering from.
  1216. * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.
  1217. * @param {vec3} mieColor The variable the Mie scattering will be written to.
  1218. * @param {float} opacity The variable the transmittance will be written to.
  1219. */
  1220. void czm_computeGroundAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) {
  1221. vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
  1222. vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
  1223. czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);
  1224. float atmosphereInnerRadius = length(positionWC);
  1225. czm_computeScattering(
  1226. primaryRay,
  1227. length(cameraToPositionWC),
  1228. lightDirection,
  1229. atmosphereInnerRadius,
  1230. rayleighColor,
  1231. mieColor,
  1232. opacity
  1233. );
  1234. }
  1235. `;var vAt=T(S(),1),PZ=`/**
  1236. * Returns a position in model coordinates relative to eye taking into
  1237. * account the current scene mode: 3D, 2D, or Columbus view.
  1238. * <p>
  1239. * This uses standard position attributes, <code>position3DHigh</code>,
  1240. * <code>position3DLow</code>, <code>position2DHigh</code>, and <code>position2DLow</code>,
  1241. * and should be used when writing a vertex shader for an {@link Appearance}.
  1242. * </p>
  1243. *
  1244. * @name czm_computePosition
  1245. * @glslFunction
  1246. *
  1247. * @returns {vec4} The position relative to eye.
  1248. *
  1249. * @example
  1250. * vec4 p = czm_computePosition();
  1251. * v_positionEC = (czm_modelViewRelativeToEye * p).xyz;
  1252. * gl_Position = czm_modelViewProjectionRelativeToEye * p;
  1253. *
  1254. * @see czm_translateRelativeToEye
  1255. */
  1256. vec4 czm_computePosition();
  1257. `;var FAt=T(S(),1),vZ=`/**
  1258. * This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as
  1259. * the transmittance value for the ray. This function uses automatic uniforms
  1260. * so the atmosphere settings are always synced with the current scene.
  1261. *
  1262. * @name czm_computeScattering
  1263. * @glslfunction
  1264. *
  1265. * @param {czm_ray} primaryRay The ray from the camera to the position.
  1266. * @param {float} primaryRayLength The length of the primary ray.
  1267. * @param {vec3} lightDirection The direction of the light to calculate the scattering from.
  1268. * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.
  1269. * @param {vec3} mieColor The variable the Mie scattering will be written to.
  1270. * @param {float} opacity The variable the transmittance will be written to.
  1271. */
  1272. void czm_computeScattering(
  1273. czm_ray primaryRay,
  1274. float primaryRayLength,
  1275. vec3 lightDirection,
  1276. float atmosphereInnerRadius,
  1277. out vec3 rayleighColor,
  1278. out vec3 mieColor,
  1279. out float opacity
  1280. ) {
  1281. const float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters.
  1282. const int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled.
  1283. const int LIGHT_STEPS_MAX = 4; // Maximum number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.
  1284. // Initialize the default scattering amounts to 0.
  1285. rayleighColor = vec3(0.0);
  1286. mieColor = vec3(0.0);
  1287. opacity = 0.0;
  1288. float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
  1289. vec3 origin = vec3(0.0);
  1290. // Calculate intersection from the camera to the outer ring of the atmosphere.
  1291. czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);
  1292. // Return empty colors if no intersection with the atmosphere geometry.
  1293. if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {
  1294. return;
  1295. }
  1296. // To deal with smaller values of PRIMARY_STEPS (e.g. 4)
  1297. // we implement a split strategy: sky or horizon.
  1298. // For performance reasons, instead of a if/else branch
  1299. // a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0
  1300. float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength);
  1301. // Value close to 0.0: close to the horizon
  1302. // Value close to 1.0: above in the sky
  1303. float w_stop_gt_lprl = 0.5 * (1.0 + czm_approximateTanh(x));
  1304. // The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere.
  1305. float start_0 = primaryRayAtmosphereIntersect.start;
  1306. primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);
  1307. // The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller.
  1308. primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));
  1309. // For the number of ray steps, distinguish inside or outside atmosphere (outer space)
  1310. // (1) from outer space we have to use more ray steps to get a realistic rendering
  1311. // (2) within atmosphere we need fewer steps for faster rendering
  1312. float x_o_a = start_0 - ATMOSPHERE_THICKNESS; // ATMOSPHERE_THICKNESS used as an ad-hoc constant, no precise meaning here, only the order of magnitude matters
  1313. float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + czm_approximateTanh(x_o_a));
  1314. int PRIMARY_STEPS = PRIMARY_STEPS_MAX - int(w_inside_atmosphere * 12.0); // Number of times the ray from the camera to the world position (primary ray) is sampled.
  1315. int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.
  1316. // Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere.
  1317. float rayPositionLength = primaryRayAtmosphereIntersect.start;
  1318. // (1) Outside the atmosphere: constant rayStepLength
  1319. // (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps
  1320. float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength;
  1321. float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0));
  1322. float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS));
  1323. vec3 rayleighAccumulation = vec3(0.0);
  1324. vec3 mieAccumulation = vec3(0.0);
  1325. vec2 opticalDepth = vec2(0.0);
  1326. vec2 heightScale = vec2(czm_atmosphereRayleighScaleHeight, czm_atmosphereMieScaleHeight);
  1327. // Sample positions on the primary ray.
  1328. for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) {
  1329. // The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot
  1330. // loop with non-constant condition, so it has to break early instead
  1331. if (i >= PRIMARY_STEPS) {
  1332. break;
  1333. }
  1334. // Calculate sample position along viewpoint ray.
  1335. vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);
  1336. // Calculate height of sample position above ellipsoid.
  1337. float sampleHeight = length(samplePosition) - atmosphereInnerRadius;
  1338. // Calculate and accumulate density of particles at the sample position.
  1339. vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;
  1340. opticalDepth += sampleDensity;
  1341. // Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere.
  1342. czm_ray lightRay = czm_ray(samplePosition, lightDirection);
  1343. czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius);
  1344. float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS);
  1345. float lightPositionLength = 0.0;
  1346. vec2 lightOpticalDepth = vec2(0.0);
  1347. // Sample positions along the light ray, to accumulate incidence of light on the latest sample segment.
  1348. for (int j = 0; j < LIGHT_STEPS_MAX; ++j) {
  1349. // The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot
  1350. // loop with non-constant condition, so it has to break early instead
  1351. if (j >= LIGHT_STEPS) {
  1352. break;
  1353. }
  1354. // Calculate sample position along light ray.
  1355. vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);
  1356. // Calculate height of the light sample position above ellipsoid.
  1357. float lightHeight = length(lightPosition) - atmosphereInnerRadius;
  1358. // Calculate density of photons at the light sample position.
  1359. lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;
  1360. // Increment distance on light ray.
  1361. lightPositionLength += lightStepLength;
  1362. }
  1363. // Compute attenuation via the primary ray and the light ray.
  1364. vec3 attenuation = exp(-((czm_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (czm_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));
  1365. // Accumulate the scattering.
  1366. rayleighAccumulation += sampleDensity.x * attenuation;
  1367. mieAccumulation += sampleDensity.y * attenuation;
  1368. // Increment distance on primary ray.
  1369. rayPositionLength += (rayStepLength += rayStepLengthIncrease);
  1370. }
  1371. // Compute the scattering amount.
  1372. rayleighColor = czm_atmosphereRayleighCoefficient * rayleighAccumulation;
  1373. mieColor = czm_atmosphereMieCoefficient * mieAccumulation;
  1374. // Compute the transmittance i.e. how much light is passing through the atmosphere.
  1375. opacity = length(exp(-((czm_atmosphereMieCoefficient * opticalDepth.y) + (czm_atmosphereRayleighCoefficient * opticalDepth.x))));
  1376. }
  1377. `;var MAt=T(S(),1),wZ=`/**
  1378. * @private
  1379. */
  1380. vec2 cordic(float angle)
  1381. {
  1382. // Scale the vector by the appropriate factor for the 24 iterations to follow.
  1383. vec2 vector = vec2(6.0725293500888267e-1, 0.0);
  1384. // Iteration 1
  1385. float sense = (angle < 0.0) ? -1.0 : 1.0;
  1386. // float factor = sense * 1.0; // 2^-0
  1387. mat2 rotation = mat2(1.0, sense, -sense, 1.0);
  1388. vector = rotation * vector;
  1389. angle -= sense * 7.8539816339744828e-1; // atan(2^-0)
  1390. // Iteration 2
  1391. sense = (angle < 0.0) ? -1.0 : 1.0;
  1392. float factor = sense * 5.0e-1; // 2^-1
  1393. rotation[0][1] = factor;
  1394. rotation[1][0] = -factor;
  1395. vector = rotation * vector;
  1396. angle -= sense * 4.6364760900080609e-1; // atan(2^-1)
  1397. // Iteration 3
  1398. sense = (angle < 0.0) ? -1.0 : 1.0;
  1399. factor = sense * 2.5e-1; // 2^-2
  1400. rotation[0][1] = factor;
  1401. rotation[1][0] = -factor;
  1402. vector = rotation * vector;
  1403. angle -= sense * 2.4497866312686414e-1; // atan(2^-2)
  1404. // Iteration 4
  1405. sense = (angle < 0.0) ? -1.0 : 1.0;
  1406. factor = sense * 1.25e-1; // 2^-3
  1407. rotation[0][1] = factor;
  1408. rotation[1][0] = -factor;
  1409. vector = rotation * vector;
  1410. angle -= sense * 1.2435499454676144e-1; // atan(2^-3)
  1411. // Iteration 5
  1412. sense = (angle < 0.0) ? -1.0 : 1.0;
  1413. factor = sense * 6.25e-2; // 2^-4
  1414. rotation[0][1] = factor;
  1415. rotation[1][0] = -factor;
  1416. vector = rotation * vector;
  1417. angle -= sense * 6.2418809995957350e-2; // atan(2^-4)
  1418. // Iteration 6
  1419. sense = (angle < 0.0) ? -1.0 : 1.0;
  1420. factor = sense * 3.125e-2; // 2^-5
  1421. rotation[0][1] = factor;
  1422. rotation[1][0] = -factor;
  1423. vector = rotation * vector;
  1424. angle -= sense * 3.1239833430268277e-2; // atan(2^-5)
  1425. // Iteration 7
  1426. sense = (angle < 0.0) ? -1.0 : 1.0;
  1427. factor = sense * 1.5625e-2; // 2^-6
  1428. rotation[0][1] = factor;
  1429. rotation[1][0] = -factor;
  1430. vector = rotation * vector;
  1431. angle -= sense * 1.5623728620476831e-2; // atan(2^-6)
  1432. // Iteration 8
  1433. sense = (angle < 0.0) ? -1.0 : 1.0;
  1434. factor = sense * 7.8125e-3; // 2^-7
  1435. rotation[0][1] = factor;
  1436. rotation[1][0] = -factor;
  1437. vector = rotation * vector;
  1438. angle -= sense * 7.8123410601011111e-3; // atan(2^-7)
  1439. // Iteration 9
  1440. sense = (angle < 0.0) ? -1.0 : 1.0;
  1441. factor = sense * 3.90625e-3; // 2^-8
  1442. rotation[0][1] = factor;
  1443. rotation[1][0] = -factor;
  1444. vector = rotation * vector;
  1445. angle -= sense * 3.9062301319669718e-3; // atan(2^-8)
  1446. // Iteration 10
  1447. sense = (angle < 0.0) ? -1.0 : 1.0;
  1448. factor = sense * 1.953125e-3; // 2^-9
  1449. rotation[0][1] = factor;
  1450. rotation[1][0] = -factor;
  1451. vector = rotation * vector;
  1452. angle -= sense * 1.9531225164788188e-3; // atan(2^-9)
  1453. // Iteration 11
  1454. sense = (angle < 0.0) ? -1.0 : 1.0;
  1455. factor = sense * 9.765625e-4; // 2^-10
  1456. rotation[0][1] = factor;
  1457. rotation[1][0] = -factor;
  1458. vector = rotation * vector;
  1459. angle -= sense * 9.7656218955931946e-4; // atan(2^-10)
  1460. // Iteration 12
  1461. sense = (angle < 0.0) ? -1.0 : 1.0;
  1462. factor = sense * 4.8828125e-4; // 2^-11
  1463. rotation[0][1] = factor;
  1464. rotation[1][0] = -factor;
  1465. vector = rotation * vector;
  1466. angle -= sense * 4.8828121119489829e-4; // atan(2^-11)
  1467. // Iteration 13
  1468. sense = (angle < 0.0) ? -1.0 : 1.0;
  1469. factor = sense * 2.44140625e-4; // 2^-12
  1470. rotation[0][1] = factor;
  1471. rotation[1][0] = -factor;
  1472. vector = rotation * vector;
  1473. angle -= sense * 2.4414062014936177e-4; // atan(2^-12)
  1474. // Iteration 14
  1475. sense = (angle < 0.0) ? -1.0 : 1.0;
  1476. factor = sense * 1.220703125e-4; // 2^-13
  1477. rotation[0][1] = factor;
  1478. rotation[1][0] = -factor;
  1479. vector = rotation * vector;
  1480. angle -= sense * 1.2207031189367021e-4; // atan(2^-13)
  1481. // Iteration 15
  1482. sense = (angle < 0.0) ? -1.0 : 1.0;
  1483. factor = sense * 6.103515625e-5; // 2^-14
  1484. rotation[0][1] = factor;
  1485. rotation[1][0] = -factor;
  1486. vector = rotation * vector;
  1487. angle -= sense * 6.1035156174208773e-5; // atan(2^-14)
  1488. // Iteration 16
  1489. sense = (angle < 0.0) ? -1.0 : 1.0;
  1490. factor = sense * 3.0517578125e-5; // 2^-15
  1491. rotation[0][1] = factor;
  1492. rotation[1][0] = -factor;
  1493. vector = rotation * vector;
  1494. angle -= sense * 3.0517578115526096e-5; // atan(2^-15)
  1495. // Iteration 17
  1496. sense = (angle < 0.0) ? -1.0 : 1.0;
  1497. factor = sense * 1.52587890625e-5; // 2^-16
  1498. rotation[0][1] = factor;
  1499. rotation[1][0] = -factor;
  1500. vector = rotation * vector;
  1501. angle -= sense * 1.5258789061315762e-5; // atan(2^-16)
  1502. // Iteration 18
  1503. sense = (angle < 0.0) ? -1.0 : 1.0;
  1504. factor = sense * 7.62939453125e-6; // 2^-17
  1505. rotation[0][1] = factor;
  1506. rotation[1][0] = -factor;
  1507. vector = rotation * vector;
  1508. angle -= sense * 7.6293945311019700e-6; // atan(2^-17)
  1509. // Iteration 19
  1510. sense = (angle < 0.0) ? -1.0 : 1.0;
  1511. factor = sense * 3.814697265625e-6; // 2^-18
  1512. rotation[0][1] = factor;
  1513. rotation[1][0] = -factor;
  1514. vector = rotation * vector;
  1515. angle -= sense * 3.8146972656064961e-6; // atan(2^-18)
  1516. // Iteration 20
  1517. sense = (angle < 0.0) ? -1.0 : 1.0;
  1518. factor = sense * 1.9073486328125e-6; // 2^-19
  1519. rotation[0][1] = factor;
  1520. rotation[1][0] = -factor;
  1521. vector = rotation * vector;
  1522. angle -= sense * 1.9073486328101870e-6; // atan(2^-19)
  1523. // Iteration 21
  1524. sense = (angle < 0.0) ? -1.0 : 1.0;
  1525. factor = sense * 9.5367431640625e-7; // 2^-20
  1526. rotation[0][1] = factor;
  1527. rotation[1][0] = -factor;
  1528. vector = rotation * vector;
  1529. angle -= sense * 9.5367431640596084e-7; // atan(2^-20)
  1530. // Iteration 22
  1531. sense = (angle < 0.0) ? -1.0 : 1.0;
  1532. factor = sense * 4.76837158203125e-7; // 2^-21
  1533. rotation[0][1] = factor;
  1534. rotation[1][0] = -factor;
  1535. vector = rotation * vector;
  1536. angle -= sense * 4.7683715820308884e-7; // atan(2^-21)
  1537. // Iteration 23
  1538. sense = (angle < 0.0) ? -1.0 : 1.0;
  1539. factor = sense * 2.384185791015625e-7; // 2^-22
  1540. rotation[0][1] = factor;
  1541. rotation[1][0] = -factor;
  1542. vector = rotation * vector;
  1543. angle -= sense * 2.3841857910155797e-7; // atan(2^-22)
  1544. // Iteration 24
  1545. sense = (angle < 0.0) ? -1.0 : 1.0;
  1546. factor = sense * 1.1920928955078125e-7; // 2^-23
  1547. rotation[0][1] = factor;
  1548. rotation[1][0] = -factor;
  1549. vector = rotation * vector;
  1550. // angle -= sense * 1.1920928955078068e-7; // atan(2^-23)
  1551. return vector;
  1552. }
  1553. /**
  1554. * Computes the cosine and sine of the provided angle using the CORDIC algorithm.
  1555. *
  1556. * @name czm_cosineAndSine
  1557. * @glslFunction
  1558. *
  1559. * @param {float} angle The angle in radians.
  1560. *
  1561. * @returns {vec2} The resulting cosine of the angle (as the x coordinate) and sine of the angle (as the y coordinate).
  1562. *
  1563. * @example
  1564. * vec2 v = czm_cosineAndSine(czm_piOverSix);
  1565. * float cosine = v.x;
  1566. * float sine = v.y;
  1567. */
  1568. vec2 czm_cosineAndSine(float angle)
  1569. {
  1570. if (angle < -czm_piOverTwo || angle > czm_piOverTwo)
  1571. {
  1572. if (angle < 0.0)
  1573. {
  1574. return -cordic(angle + czm_pi);
  1575. }
  1576. else
  1577. {
  1578. return -cordic(angle - czm_pi);
  1579. }
  1580. }
  1581. else
  1582. {
  1583. return cordic(angle);
  1584. }
  1585. }
  1586. `;var kAt=T(S(),1),FZ=`/**
  1587. * Decompresses texture coordinates that were packed into a single float.
  1588. *
  1589. * @name czm_decompressTextureCoordinates
  1590. * @glslFunction
  1591. *
  1592. * @param {float} encoded The compressed texture coordinates.
  1593. * @returns {vec2} The decompressed texture coordinates.
  1594. */
  1595. vec2 czm_decompressTextureCoordinates(float encoded)
  1596. {
  1597. float temp = encoded / 4096.0;
  1598. float xZeroTo4095 = floor(temp);
  1599. float stx = xZeroTo4095 / 4095.0;
  1600. float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;
  1601. return vec2(stx, sty);
  1602. }
  1603. `;var DAt=T(S(),1),AZ=`// emulated noperspective
  1604. #if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH)
  1605. out float v_WindowZ;
  1606. #endif
  1607. /**
  1608. * Emulates GL_DEPTH_CLAMP, which is not available in WebGL 1 or 2.
  1609. * GL_DEPTH_CLAMP clamps geometry that is outside the near and far planes,
  1610. * capping the shadow volume. More information here:
  1611. * https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_depth_clamp.txt.
  1612. *
  1613. * When GL_EXT_frag_depth is available we emulate GL_DEPTH_CLAMP by ensuring
  1614. * no geometry gets clipped by setting the clip space z value to 0.0 and then
  1615. * sending the unaltered screen space z value (using emulated noperspective
  1616. * interpolation) to the frag shader where it is clamped to [0,1] and then
  1617. * written with gl_FragDepth (see czm_writeDepthClamp). This technique is based on:
  1618. * https://stackoverflow.com/questions/5960757/how-to-emulate-gl-depth-clamp-nv.
  1619. *
  1620. * When GL_EXT_frag_depth is not available, which is the case on some mobile
  1621. * devices, we must attempt to fix this only in the vertex shader.
  1622. * The approach is to clamp the z value to the far plane, which closes the
  1623. * shadow volume but also distorts the geometry, so there can still be artifacts
  1624. * on frustum seams.
  1625. *
  1626. * @name czm_depthClamp
  1627. * @glslFunction
  1628. *
  1629. * @param {vec4} coords The vertex in clip coordinates.
  1630. * @returns {vec4} The modified vertex.
  1631. *
  1632. * @example
  1633. * gl_Position = czm_depthClamp(czm_modelViewProjection * vec4(position, 1.0));
  1634. *
  1635. * @see czm_writeDepthClamp
  1636. */
  1637. vec4 czm_depthClamp(vec4 coords)
  1638. {
  1639. #ifndef LOG_DEPTH
  1640. #if __VERSION__ == 300 || defined(GL_EXT_frag_depth)
  1641. v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w;
  1642. coords.z = 0.0;
  1643. #else
  1644. coords.z = min(coords.z, coords.w);
  1645. #endif
  1646. #endif
  1647. return coords;
  1648. }
  1649. `;var OAt=T(S(),1),MZ=`/**
  1650. * Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system
  1651. * to eye coordinates. In east-north-up coordinates, x points east, y points north, and z points along the
  1652. * surface normal. East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping.
  1653. * <br /><br />
  1654. * The ellipsoid is assumed to be centered at the model coordinate's origin.
  1655. *
  1656. * @name czm_eastNorthUpToEyeCoordinates
  1657. * @glslFunction
  1658. *
  1659. * @param {vec3} positionMC The position on the ellipsoid in model coordinates.
  1660. * @param {vec3} normalEC The normalized ellipsoid surface normal, at <code>positionMC</code>, in eye coordinates.
  1661. *
  1662. * @returns {mat3} A 3x3 rotation matrix that transforms vectors from the east-north-up coordinate system to eye coordinates.
  1663. *
  1664. * @example
  1665. * // Transform a vector defined in the east-north-up coordinate
  1666. * // system, (0, 0, 1) which is the surface normal, to eye
  1667. * // coordinates.
  1668. * mat3 m = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);
  1669. * vec3 normalEC = m * vec3(0.0, 0.0, 1.0);
  1670. */
  1671. mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)
  1672. {
  1673. vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0)); // normalized surface tangent in model coordinates
  1674. vec3 tangentEC = normalize(czm_normal3D * tangentMC); // normalized surface tangent in eye coordinates
  1675. vec3 bitangentEC = normalize(cross(normalEC, tangentEC)); // normalized surface bitangent in eye coordinates
  1676. return mat3(
  1677. tangentEC.x, tangentEC.y, tangentEC.z,
  1678. bitangentEC.x, bitangentEC.y, bitangentEC.z,
  1679. normalEC.x, normalEC.y, normalEC.z);
  1680. }
  1681. `;var HAt=T(S(),1),NZ=`/**
  1682. * DOC_TBA
  1683. *
  1684. * @name czm_ellipsoidContainsPoint
  1685. * @glslFunction
  1686. *
  1687. */
  1688. bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point)
  1689. {
  1690. vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;
  1691. return (dot(scaled, scaled) <= 1.0);
  1692. }
  1693. `;var KAt=T(S(),1),kZ=`/**
  1694. * Approximate uv coordinates based on the ellipsoid normal.
  1695. *
  1696. * @name czm_ellipsoidTextureCoordinates
  1697. * @glslFunction
  1698. */
  1699. vec2 czm_ellipsoidTextureCoordinates(vec3 normal)
  1700. {
  1701. return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);
  1702. }
  1703. `;var QAt=T(S(),1),UZ=`/**
  1704. * Compares <code>left</code> and <code>right</code> componentwise. Returns <code>true</code>
  1705. * if they are within <code>epsilon</code> and <code>false</code> otherwise. The inputs
  1706. * <code>left</code> and <code>right</code> can be <code>float</code>s, <code>vec2</code>s,
  1707. * <code>vec3</code>s, or <code>vec4</code>s.
  1708. *
  1709. * @name czm_equalsEpsilon
  1710. * @glslFunction
  1711. *
  1712. * @param {} left The first vector.
  1713. * @param {} right The second vector.
  1714. * @param {float} epsilon The epsilon to use for equality testing.
  1715. * @returns {bool} <code>true</code> if the components are within <code>epsilon</code> and <code>false</code> otherwise.
  1716. *
  1717. * @example
  1718. * // GLSL declarations
  1719. * bool czm_equalsEpsilon(float left, float right, float epsilon);
  1720. * bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon);
  1721. * bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon);
  1722. * bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon);
  1723. */
  1724. bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {
  1725. return all(lessThanEqual(abs(left - right), vec4(epsilon)));
  1726. }
  1727. bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {
  1728. return all(lessThanEqual(abs(left - right), vec3(epsilon)));
  1729. }
  1730. bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {
  1731. return all(lessThanEqual(abs(left - right), vec2(epsilon)));
  1732. }
  1733. bool czm_equalsEpsilon(float left, float right, float epsilon) {
  1734. return (abs(left - right) <= epsilon);
  1735. }
  1736. `;var qAt=T(S(),1),DZ=`/**
  1737. * DOC_TBA
  1738. *
  1739. * @name czm_eyeOffset
  1740. * @glslFunction
  1741. *
  1742. * @param {vec4} positionEC DOC_TBA.
  1743. * @param {vec3} eyeOffset DOC_TBA.
  1744. *
  1745. * @returns {vec4} DOC_TBA.
  1746. */
  1747. vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)
  1748. {
  1749. // This equation is approximate in x and y.
  1750. vec4 p = positionEC;
  1751. vec4 zEyeOffset = normalize(p) * eyeOffset.z;
  1752. p.xy += eyeOffset.xy + zEyeOffset.xy;
  1753. p.z += zEyeOffset.z;
  1754. return p;
  1755. }
  1756. `;var eMt=T(S(),1),BZ=`/**
  1757. * Transforms a position from eye to window coordinates. The transformation
  1758. * from eye to clip coordinates is done using {@link czm_projection}.
  1759. * The transform from normalized device coordinates to window coordinates is
  1760. * done using {@link czm_viewportTransformation}, which assumes a depth range
  1761. * of <code>near = 0</code> and <code>far = 1</code>.
  1762. * <br /><br />
  1763. * This transform is useful when there is a need to manipulate window coordinates
  1764. * in a vertex shader as done by {@link BillboardCollection}.
  1765. *
  1766. * @name czm_eyeToWindowCoordinates
  1767. * @glslFunction
  1768. *
  1769. * @param {vec4} position The position in eye coordinates to transform.
  1770. *
  1771. * @returns {vec4} The transformed position in window coordinates.
  1772. *
  1773. * @see czm_modelToWindowCoordinates
  1774. * @see czm_projection
  1775. * @see czm_viewportTransformation
  1776. * @see BillboardCollection
  1777. *
  1778. * @example
  1779. * vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
  1780. */
  1781. vec4 czm_eyeToWindowCoordinates(vec4 positionEC)
  1782. {
  1783. vec4 q = czm_projection * positionEC; // clip coordinates
  1784. q.xyz /= q.w; // normalized device coordinates
  1785. q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates
  1786. return q;
  1787. }
  1788. `;var nMt=T(S(),1),OZ=`/**
  1789. * Approxiamtes atan over the range [0, 1]. Safe to flip output for negative input.
  1790. *
  1791. * Based on Michal Drobot's approximation from ShaderFastLibs, which in turn is based on
  1792. * "Efficient approximations for the arctangent function," Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.
  1793. * Adapted from ShaderFastLibs under MIT License.
  1794. *
  1795. * Chosen for the following characteristics over range [0, 1]:
  1796. * - basically no error at 0 and 1, important for getting around range limit (naive atan2 via atan requires infinite range atan)
  1797. * - no visible artifacts from first-derivative discontinuities, unlike latitude via range-reduced sqrt asin approximations (at equator)
  1798. *
  1799. * The original code is x * (-0.1784 * abs(x) - 0.0663 * x * x + 1.0301);
  1800. * Removed the abs() in here because it isn't needed, the input range is guaranteed as [0, 1] by how we're approximating atan2.
  1801. *
  1802. * @name czm_fastApproximateAtan
  1803. * @glslFunction
  1804. *
  1805. * @param {float} x Value between 0 and 1 inclusive.
  1806. *
  1807. * @returns {float} Approximation of atan(x)
  1808. */
  1809. float czm_fastApproximateAtan(float x) {
  1810. return x * (-0.1784 * x - 0.0663 * x * x + 1.0301);
  1811. }
  1812. /**
  1813. * Approximation of atan2.
  1814. *
  1815. * Range reduction math based on nvidia's cg reference implementation for atan2: http://developer.download.nvidia.com/cg/atan2.html
  1816. * However, we replaced their atan curve with Michael Drobot's (see above).
  1817. *
  1818. * @name czm_fastApproximateAtan
  1819. * @glslFunction
  1820. *
  1821. * @param {float} x Value between -1 and 1 inclusive.
  1822. * @param {float} y Value between -1 and 1 inclusive.
  1823. *
  1824. * @returns {float} Approximation of atan2(x, y)
  1825. */
  1826. float czm_fastApproximateAtan(float x, float y) {
  1827. // atan approximations are usually only reliable over [-1, 1], or, in our case, [0, 1] due to modifications.
  1828. // So range-reduce using abs and by flipping whether x or y is on top.
  1829. float t = abs(x); // t used as swap and atan result.
  1830. float opposite = abs(y);
  1831. float adjacent = max(t, opposite);
  1832. opposite = min(t, opposite);
  1833. t = czm_fastApproximateAtan(opposite / adjacent);
  1834. // Undo range reduction
  1835. t = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t);
  1836. t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t);
  1837. t = czm_branchFreeTernary(y < 0.0, -t, t);
  1838. return t;
  1839. }
  1840. `;var oMt=T(S(),1),YZ=`/**
  1841. * Gets the color with fog at a distance from the camera.
  1842. *
  1843. * @name czm_fog
  1844. * @glslFunction
  1845. *
  1846. * @param {float} distanceToCamera The distance to the camera in meters.
  1847. * @param {vec3} color The original color.
  1848. * @param {vec3} fogColor The color of the fog.
  1849. *
  1850. * @returns {vec3} The color adjusted for fog at the distance from the camera.
  1851. */
  1852. vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)
  1853. {
  1854. float scalar = distanceToCamera * czm_fogDensity;
  1855. float fog = 1.0 - exp(-(scalar * scalar));
  1856. return mix(color, fogColor, fog);
  1857. }
  1858. /**
  1859. * Gets the color with fog at a distance from the camera.
  1860. *
  1861. * @name czm_fog
  1862. * @glslFunction
  1863. *
  1864. * @param {float} distanceToCamera The distance to the camera in meters.
  1865. * @param {vec3} color The original color.
  1866. * @param {vec3} fogColor The color of the fog.
  1867. * @param {float} fogModifierConstant A constant to modify the appearance of fog.
  1868. *
  1869. * @returns {vec3} The color adjusted for fog at the distance from the camera.
  1870. */
  1871. vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant)
  1872. {
  1873. float scalar = distanceToCamera * czm_fogDensity;
  1874. float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant))));
  1875. return mix(color, fogColor, fog);
  1876. }
  1877. `;var sMt=T(S(),1),HZ=`/**
  1878. * Converts a color from RGB space to linear space.
  1879. *
  1880. * @name czm_gammaCorrect
  1881. * @glslFunction
  1882. *
  1883. * @param {vec3} color The color in RGB space.
  1884. * @returns {vec3} The color in linear space.
  1885. */
  1886. vec3 czm_gammaCorrect(vec3 color) {
  1887. #ifdef HDR
  1888. color = pow(color, vec3(czm_gamma));
  1889. #endif
  1890. return color;
  1891. }
  1892. vec4 czm_gammaCorrect(vec4 color) {
  1893. #ifdef HDR
  1894. color.rgb = pow(color.rgb, vec3(czm_gamma));
  1895. #endif
  1896. return color;
  1897. }
  1898. `;var cMt=T(S(),1),zZ=`/**
  1899. * DOC_TBA
  1900. *
  1901. * @name czm_geodeticSurfaceNormal
  1902. * @glslFunction
  1903. *
  1904. * @param {vec3} positionOnEllipsoid DOC_TBA
  1905. * @param {vec3} ellipsoidCenter DOC_TBA
  1906. * @param {vec3} oneOverEllipsoidRadiiSquared DOC_TBA
  1907. *
  1908. * @returns {vec3} DOC_TBA.
  1909. */
  1910. vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)
  1911. {
  1912. return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);
  1913. }
  1914. `;var dMt=T(S(),1),KZ=`/**
  1915. * An czm_material with default values. Every material's czm_getMaterial
  1916. * should use this default material as a base for the material it returns.
  1917. * The default normal value is given by materialInput.normalEC.
  1918. *
  1919. * @name czm_getDefaultMaterial
  1920. * @glslFunction
  1921. *
  1922. * @param {czm_materialInput} input The input used to construct the default material.
  1923. *
  1924. * @returns {czm_material} The default material.
  1925. *
  1926. * @see czm_materialInput
  1927. * @see czm_material
  1928. * @see czm_getMaterial
  1929. */
  1930. czm_material czm_getDefaultMaterial(czm_materialInput materialInput)
  1931. {
  1932. czm_material material;
  1933. material.diffuse = vec3(0.0);
  1934. material.specular = 0.0;
  1935. material.shininess = 1.0;
  1936. material.normal = materialInput.normalEC;
  1937. material.emission = vec3(0.0);
  1938. material.alpha = 1.0;
  1939. return material;
  1940. }
  1941. `;var mMt=T(S(),1),JZ=`/**
  1942. * Select which direction vector to use for dynamic atmosphere lighting based on an enum value
  1943. *
  1944. * @name czm_getDynamicAtmosphereLightDirection
  1945. * @glslfunction
  1946. * @see DynamicAtmosphereLightingType.js
  1947. *
  1948. * @param {vec3} positionWC the position of the vertex/fragment in world coordinates. This is normalized and returned when dynamic lighting is turned off.
  1949. * @param {float} lightEnum The enum value for selecting between light sources.
  1950. * @return {vec3} The normalized light direction vector. Depending on the enum value, it is either positionWC, czm_lightDirectionWC or czm_sunDirectionWC
  1951. */
  1952. vec3 czm_getDynamicAtmosphereLightDirection(vec3 positionWC, float lightEnum) {
  1953. const float NONE = 0.0;
  1954. const float SCENE_LIGHT = 1.0;
  1955. const float SUNLIGHT = 2.0;
  1956. vec3 lightDirection =
  1957. positionWC * float(lightEnum == NONE) +
  1958. czm_lightDirectionWC * float(lightEnum == SCENE_LIGHT) +
  1959. czm_sunDirectionWC * float(lightEnum == SUNLIGHT);
  1960. return normalize(lightDirection);
  1961. }
  1962. `;var fMt=T(S(),1),QZ=`/**
  1963. * Calculates the intensity of diffusely reflected light.
  1964. *
  1965. * @name czm_getLambertDiffuse
  1966. * @glslFunction
  1967. *
  1968. * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
  1969. * @param {vec3} normalEC The surface normal in eye coordinates.
  1970. *
  1971. * @returns {float} The intensity of the diffuse reflection.
  1972. *
  1973. * @see czm_phong
  1974. *
  1975. * @example
  1976. * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);
  1977. * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);
  1978. * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);
  1979. */
  1980. float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)
  1981. {
  1982. return max(dot(lightDirectionEC, normalEC), 0.0);
  1983. }
  1984. `;var bMt=T(S(),1),jZ=`/**
  1985. * Calculates the specular intensity of reflected light.
  1986. *
  1987. * @name czm_getSpecular
  1988. * @glslFunction
  1989. *
  1990. * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
  1991. * @param {vec3} toEyeEC Unit vector pointing to the eye position in eye coordinates.
  1992. * @param {vec3} normalEC The surface normal in eye coordinates.
  1993. * @param {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight.
  1994. *
  1995. * @returns {float} The intensity of the specular highlight.
  1996. *
  1997. * @see czm_phong
  1998. *
  1999. * @example
  2000. * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);
  2001. * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);
  2002. * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);
  2003. */
  2004. float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)
  2005. {
  2006. vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);
  2007. float specular = max(dot(toReflectedLight, toEyeEC), 0.0);
  2008. // pow has undefined behavior if both parameters <= 0.
  2009. // Prevent this by making sure shininess is at least czm_epsilon2.
  2010. return pow(specular, max(shininess, czm_epsilon2));
  2011. }
  2012. `;var yMt=T(S(),1),qZ=`/**
  2013. * @private
  2014. */
  2015. vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)
  2016. {
  2017. float cosAngle = cos(angleInRadians);
  2018. float sinAngle = sin(angleInRadians);
  2019. // time dependent sampling directions
  2020. vec2 s0 = vec2(1.0/17.0, 0.0);
  2021. vec2 s1 = vec2(-1.0/29.0, 0.0);
  2022. vec2 s2 = vec2(1.0/101.0, 1.0/59.0);
  2023. vec2 s3 = vec2(-1.0/109.0, -1.0/57.0);
  2024. // rotate sampling direction by specified angle
  2025. s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));
  2026. s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));
  2027. s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));
  2028. s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));
  2029. vec2 uv0 = (uv/103.0) + (time * s0);
  2030. vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);
  2031. vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);
  2032. vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);
  2033. uv0 = fract(uv0);
  2034. uv1 = fract(uv1);
  2035. uv2 = fract(uv2);
  2036. uv3 = fract(uv3);
  2037. vec4 noise = (texture(normalMap, uv0)) +
  2038. (texture(normalMap, uv1)) +
  2039. (texture(normalMap, uv2)) +
  2040. (texture(normalMap, uv3));
  2041. // average and scale to between -1 and 1
  2042. return ((noise / 4.0) - 0.5) * 2.0;
  2043. }
  2044. `;var _Mt=T(S(),1),$Z=`/**
  2045. * Adjusts the hue of a color.
  2046. *
  2047. * @name czm_hue
  2048. * @glslFunction
  2049. *
  2050. * @param {vec3} rgb The color.
  2051. * @param {float} adjustment The amount to adjust the hue of the color in radians.
  2052. *
  2053. * @returns {float} The color with the hue adjusted.
  2054. *
  2055. * @example
  2056. * vec3 adjustHue = czm_hue(color, czm_pi); // The same as czm_hue(color, -czm_pi)
  2057. */
  2058. vec3 czm_hue(vec3 rgb, float adjustment)
  2059. {
  2060. const mat3 toYIQ = mat3(0.299, 0.587, 0.114,
  2061. 0.595716, -0.274453, -0.321263,
  2062. 0.211456, -0.522591, 0.311135);
  2063. const mat3 toRGB = mat3(1.0, 0.9563, 0.6210,
  2064. 1.0, -0.2721, -0.6474,
  2065. 1.0, -1.107, 1.7046);
  2066. vec3 yiq = toYIQ * rgb;
  2067. float hue = atan(yiq.z, yiq.y) + adjustment;
  2068. float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);
  2069. vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));
  2070. return toRGB * color;
  2071. }
  2072. `;var SMt=T(S(),1),eG=`/**
  2073. * Converts a color in linear space to RGB space.
  2074. *
  2075. * @name czm_inverseGamma
  2076. * @glslFunction
  2077. *
  2078. * @param {vec3} color The color in linear space.
  2079. * @returns {vec3} The color in RGB space.
  2080. */
  2081. vec3 czm_inverseGamma(vec3 color) {
  2082. return pow(color, vec3(1.0 / czm_gamma));
  2083. }
  2084. `;var VMt=T(S(),1),tG=`/**
  2085. * Determines if a time interval is empty.
  2086. *
  2087. * @name czm_isEmpty
  2088. * @glslFunction
  2089. *
  2090. * @param {czm_raySegment} interval The interval to test.
  2091. *
  2092. * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.
  2093. *
  2094. * @example
  2095. * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true
  2096. * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false
  2097. * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.
  2098. */
  2099. bool czm_isEmpty(czm_raySegment interval)
  2100. {
  2101. return (interval.stop < 0.0);
  2102. }
  2103. `;var RMt=T(S(),1),nG=`/**
  2104. * Determines if a time interval is empty.
  2105. *
  2106. * @name czm_isFull
  2107. * @glslFunction
  2108. *
  2109. * @param {czm_raySegment} interval The interval to test.
  2110. *
  2111. * @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.
  2112. *
  2113. * @example
  2114. * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true
  2115. * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false
  2116. * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.
  2117. */
  2118. bool czm_isFull(czm_raySegment interval)
  2119. {
  2120. return (interval.start == 0.0 && interval.stop == czm_infinity);
  2121. }
  2122. `;var GMt=T(S(),1),iG=`/**
  2123. * Computes the fraction of a Web Wercator rectangle at which a given geodetic latitude is located.
  2124. *
  2125. * @name czm_latitudeToWebMercatorFraction
  2126. * @glslFunction
  2127. *
  2128. * @param {float} latitude The geodetic latitude, in radians.
  2129. * @param {float} southMercatorY The Web Mercator coordinate of the southern boundary of the rectangle.
  2130. * @param {float} oneOverMercatorHeight The total height of the rectangle in Web Mercator coordinates.
  2131. *
  2132. * @returns {float} The fraction of the rectangle at which the latitude occurs. If the latitude is the southern
  2133. * boundary of the rectangle, the return value will be zero. If it is the northern boundary, the return
  2134. * value will be 1.0. Latitudes in between are mapped according to the Web Mercator projection.
  2135. */
  2136. float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)
  2137. {
  2138. float sinLatitude = sin(latitude);
  2139. float mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));
  2140. return (mercatorY - southMercatorY) * oneOverMercatorHeight;
  2141. }
  2142. `;var IMt=T(S(),1),oG=`/**
  2143. * Computes distance from an point in 2D to a line in 2D.
  2144. *
  2145. * @name czm_lineDistance
  2146. * @glslFunction
  2147. *
  2148. * param {vec2} point1 A point along the line.
  2149. * param {vec2} point2 A point along the line.
  2150. * param {vec2} point A point that may or may not be on the line.
  2151. * returns {float} The distance from the point to the line.
  2152. */
  2153. float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) {
  2154. return abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1);
  2155. }
  2156. `;var WMt=T(S(),1),rG=`/**
  2157. * Converts a linear RGB color to an sRGB color.
  2158. *
  2159. * @param {vec3|vec4} linearIn The color in linear color space.
  2160. * @returns {vec3|vec4} The color in sRGB color space. The vector type matches the input.
  2161. */
  2162. vec3 czm_linearToSrgb(vec3 linearIn)
  2163. {
  2164. return pow(linearIn, vec3(1.0/2.2));
  2165. }
  2166. vec4 czm_linearToSrgb(vec4 linearIn)
  2167. {
  2168. vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2));
  2169. return vec4(srgbOut, linearIn.a);
  2170. }
  2171. `;var vMt=T(S(),1),sG=`/**
  2172. * Computes the luminance of a color.
  2173. *
  2174. * @name czm_luminance
  2175. * @glslFunction
  2176. *
  2177. * @param {vec3} rgb The color.
  2178. *
  2179. * @returns {float} The luminance.
  2180. *
  2181. * @example
  2182. * float light = czm_luminance(vec3(0.0)); // 0.0
  2183. * float dark = czm_luminance(vec3(1.0)); // ~1.0
  2184. */
  2185. float czm_luminance(vec3 rgb)
  2186. {
  2187. // Algorithm from Chapter 10 of Graphics Shaders.
  2188. const vec3 W = vec3(0.2125, 0.7154, 0.0721);
  2189. return dot(rgb, W);
  2190. }
  2191. `;var FMt=T(S(),1),aG=`/**
  2192. * Find the maximum component of a vector.
  2193. *
  2194. * @name czm_maximumComponent
  2195. * @glslFunction
  2196. *
  2197. * @param {vec2|vec3|vec4} v The input vector.
  2198. * @returns {float} The value of the largest component.
  2199. */
  2200. float czm_maximumComponent(vec2 v)
  2201. {
  2202. return max(v.x, v.y);
  2203. }
  2204. float czm_maximumComponent(vec3 v)
  2205. {
  2206. return max(max(v.x, v.y), v.z);
  2207. }
  2208. float czm_maximumComponent(vec4 v)
  2209. {
  2210. return max(max(max(v.x, v.y), v.z), v.w);
  2211. }
  2212. `;var MMt=T(S(),1),cG=`/**
  2213. * Computes the size of a pixel in meters at a distance from the eye.
  2214. * <p>
  2215. * Use this version when passing in a custom pixel ratio. For example, passing in 1.0 will return meters per native device pixel.
  2216. * </p>
  2217. * @name czm_metersPerPixel
  2218. * @glslFunction
  2219. *
  2220. * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.
  2221. * @param {float} pixelRatio The scaling factor from pixel space to coordinate space
  2222. *
  2223. * @returns {float} The meters per pixel at positionEC.
  2224. */
  2225. float czm_metersPerPixel(vec4 positionEC, float pixelRatio)
  2226. {
  2227. float width = czm_viewport.z;
  2228. float height = czm_viewport.w;
  2229. float pixelWidth;
  2230. float pixelHeight;
  2231. float top = czm_frustumPlanes.x;
  2232. float bottom = czm_frustumPlanes.y;
  2233. float left = czm_frustumPlanes.z;
  2234. float right = czm_frustumPlanes.w;
  2235. if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0)
  2236. {
  2237. float frustumWidth = right - left;
  2238. float frustumHeight = top - bottom;
  2239. pixelWidth = frustumWidth / width;
  2240. pixelHeight = frustumHeight / height;
  2241. }
  2242. else
  2243. {
  2244. float distanceToPixel = -positionEC.z;
  2245. float inverseNear = 1.0 / czm_currentFrustum.x;
  2246. float tanTheta = top * inverseNear;
  2247. pixelHeight = 2.0 * distanceToPixel * tanTheta / height;
  2248. tanTheta = right * inverseNear;
  2249. pixelWidth = 2.0 * distanceToPixel * tanTheta / width;
  2250. }
  2251. return max(pixelWidth, pixelHeight) * pixelRatio;
  2252. }
  2253. /**
  2254. * Computes the size of a pixel in meters at a distance from the eye.
  2255. * <p>
  2256. * Use this version when scaling by pixel ratio.
  2257. * </p>
  2258. * @name czm_metersPerPixel
  2259. * @glslFunction
  2260. *
  2261. * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.
  2262. *
  2263. * @returns {float} The meters per pixel at positionEC.
  2264. */
  2265. float czm_metersPerPixel(vec4 positionEC)
  2266. {
  2267. return czm_metersPerPixel(positionEC, czm_pixelRatio);
  2268. }
  2269. `;var kMt=T(S(),1),lG=`/**
  2270. * Transforms a position from model to window coordinates. The transformation
  2271. * from model to clip coordinates is done using {@link czm_modelViewProjection}.
  2272. * The transform from normalized device coordinates to window coordinates is
  2273. * done using {@link czm_viewportTransformation}, which assumes a depth range
  2274. * of <code>near = 0</code> and <code>far = 1</code>.
  2275. * <br /><br />
  2276. * This transform is useful when there is a need to manipulate window coordinates
  2277. * in a vertex shader as done by {@link BillboardCollection}.
  2278. * <br /><br />
  2279. * This function should not be confused with {@link czm_viewportOrthographic},
  2280. * which is an orthographic projection matrix that transforms from window
  2281. * coordinates to clip coordinates.
  2282. *
  2283. * @name czm_modelToWindowCoordinates
  2284. * @glslFunction
  2285. *
  2286. * @param {vec4} position The position in model coordinates to transform.
  2287. *
  2288. * @returns {vec4} The transformed position in window coordinates.
  2289. *
  2290. * @see czm_eyeToWindowCoordinates
  2291. * @see czm_modelViewProjection
  2292. * @see czm_viewportTransformation
  2293. * @see czm_viewportOrthographic
  2294. * @see BillboardCollection
  2295. *
  2296. * @example
  2297. * vec4 positionWC = czm_modelToWindowCoordinates(positionMC);
  2298. */
  2299. vec4 czm_modelToWindowCoordinates(vec4 position)
  2300. {
  2301. vec4 q = czm_modelViewProjection * position; // clip coordinates
  2302. q.xyz /= q.w; // normalized device coordinates
  2303. q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates
  2304. return q;
  2305. }
  2306. `;var DMt=T(S(),1),dG=`/**
  2307. * DOC_TBA
  2308. *
  2309. * @name czm_multiplyWithColorBalance
  2310. * @glslFunction
  2311. */
  2312. vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)
  2313. {
  2314. // Algorithm from Chapter 10 of Graphics Shaders.
  2315. const vec3 W = vec3(0.2125, 0.7154, 0.0721);
  2316. vec3 target = left * right;
  2317. float leftLuminance = dot(left, W);
  2318. float rightLuminance = dot(right, W);
  2319. float targetLuminance = dot(target, W);
  2320. return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;
  2321. }
  2322. `;var OMt=T(S(),1),uG=`/**
  2323. * Computes a value that scales with distance. The scaling is clamped at the near and
  2324. * far distances, and does not extrapolate. This function works with the
  2325. * {@link NearFarScalar} JavaScript class.
  2326. *
  2327. * @name czm_nearFarScalar
  2328. * @glslFunction
  2329. *
  2330. * @param {vec4} nearFarScalar A vector with 4 components: Near distance (x), Near value (y), Far distance (z), Far value (w).
  2331. * @param {float} cameraDistSq The square of the current distance from the camera.
  2332. *
  2333. * @returns {float} The value at this distance.
  2334. */
  2335. float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)
  2336. {
  2337. float valueAtMin = nearFarScalar.y;
  2338. float valueAtMax = nearFarScalar.w;
  2339. float nearDistanceSq = nearFarScalar.x * nearFarScalar.x;
  2340. float farDistanceSq = nearFarScalar.z * nearFarScalar.z;
  2341. float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);
  2342. t = pow(clamp(t, 0.0, 1.0), 0.2);
  2343. return mix(valueAtMin, valueAtMax, t);
  2344. }
  2345. `;var HMt=T(S(),1),mG=` /**
  2346. * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.
  2347. * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
  2348. * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
  2349. *
  2350. * @name czm_octDecode
  2351. * @param {vec2} encoded The oct-encoded, unit-length vector
  2352. * @param {float} range The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits.
  2353. * @returns {vec3} The decoded and normalized vector
  2354. */
  2355. vec3 czm_octDecode(vec2 encoded, float range)
  2356. {
  2357. if (encoded.x == 0.0 && encoded.y == 0.0) {
  2358. return vec3(0.0, 0.0, 0.0);
  2359. }
  2360. encoded = encoded / range * 2.0 - 1.0;
  2361. vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));
  2362. if (v.z < 0.0)
  2363. {
  2364. v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);
  2365. }
  2366. return normalize(v);
  2367. }
  2368. /**
  2369. * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.
  2370. * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
  2371. * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
  2372. *
  2373. * @name czm_octDecode
  2374. * @param {vec2} encoded The oct-encoded, unit-length vector
  2375. * @returns {vec3} The decoded and normalized vector
  2376. */
  2377. vec3 czm_octDecode(vec2 encoded)
  2378. {
  2379. return czm_octDecode(encoded, 255.0);
  2380. }
  2381. /**
  2382. * Decodes a unit-length vector in 'oct' encoding packed into a floating-point number to a normalized 3-component Cartesian vector.
  2383. * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
  2384. * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
  2385. *
  2386. * @name czm_octDecode
  2387. * @param {float} encoded The oct-encoded, unit-length vector
  2388. * @returns {vec3} The decoded and normalized vector
  2389. */
  2390. vec3 czm_octDecode(float encoded)
  2391. {
  2392. float temp = encoded / 256.0;
  2393. float x = floor(temp);
  2394. float y = (temp - x) * 256.0;
  2395. return czm_octDecode(vec2(x, y));
  2396. }
  2397. /**
  2398. * Decodes three unit-length vectors in 'oct' encoding packed into two floating-point numbers to normalized 3-component Cartesian vectors.
  2399. * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
  2400. * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
  2401. *
  2402. * @name czm_octDecode
  2403. * @param {vec2} encoded The packed oct-encoded, unit-length vectors.
  2404. * @param {vec3} vector1 One decoded and normalized vector.
  2405. * @param {vec3} vector2 One decoded and normalized vector.
  2406. * @param {vec3} vector3 One decoded and normalized vector.
  2407. */
  2408. void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)
  2409. {
  2410. float temp = encoded.x / 65536.0;
  2411. float x = floor(temp);
  2412. float encodedFloat1 = (temp - x) * 65536.0;
  2413. temp = encoded.y / 65536.0;
  2414. float y = floor(temp);
  2415. float encodedFloat2 = (temp - y) * 65536.0;
  2416. vector1 = czm_octDecode(encodedFloat1);
  2417. vector2 = czm_octDecode(encodedFloat2);
  2418. vector3 = czm_octDecode(vec2(x, y));
  2419. }
  2420. `;var KMt=T(S(),1),hG=`/**
  2421. * Packs a depth value into a vec4 that can be represented by unsigned bytes.
  2422. *
  2423. * @name czm_packDepth
  2424. * @glslFunction
  2425. *
  2426. * @param {float} depth The floating-point depth.
  2427. * @returns {vec4} The packed depth.
  2428. */
  2429. vec4 czm_packDepth(float depth)
  2430. {
  2431. // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA
  2432. // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/
  2433. vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;
  2434. enc = fract(enc);
  2435. enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);
  2436. return enc;
  2437. }
  2438. `;var QMt=T(S(),1),fG=`vec3 lambertianDiffuse(vec3 diffuseColor)
  2439. {
  2440. return diffuseColor / czm_pi;
  2441. }
  2442. vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH)
  2443. {
  2444. float versine = 1.0 - VdotH;
  2445. // pow(versine, 5.0) is slow. See https://stackoverflow.com/a/68793086/10082269
  2446. float versineSquared = versine * versine;
  2447. return f0 + (f90 - f0) * versineSquared * versineSquared * versine;
  2448. }
  2449. #ifdef USE_ANISOTROPY
  2450. /**
  2451. * @param {float} bitangentRoughness Material roughness (along the anisotropy bitangent)
  2452. * @param {float} tangentialRoughness Anisotropic roughness (along the anisotropy tangent)
  2453. * @param {vec3} lightDirection The direction from the fragment to the light source, transformed to tangent-bitangent-normal coordinates
  2454. * @param {vec3} viewDirection The direction from the fragment to the camera, transformed to tangent-bitangent-normal coordinates
  2455. */
  2456. float smithVisibilityGGX_anisotropic(float bitangentRoughness, float tangentialRoughness, vec3 lightDirection, vec3 viewDirection)
  2457. {
  2458. vec3 roughnessScale = vec3(tangentialRoughness, bitangentRoughness, 1.0);
  2459. float GGXV = lightDirection.z * length(roughnessScale * viewDirection);
  2460. float GGXL = viewDirection.z * length(roughnessScale * lightDirection);
  2461. float v = 0.5 / (GGXV + GGXL);
  2462. return clamp(v, 0.0, 1.0);
  2463. }
  2464. /**
  2465. * @param {float} bitangentRoughness Material roughness (along the anisotropy bitangent)
  2466. * @param {float} tangentialRoughness Anisotropic roughness (along the anisotropy tangent)
  2467. * @param {vec3} halfwayDirection The unit vector halfway between light and view directions, transformed to tangent-bitangent-normal coordinates
  2468. */
  2469. float GGX_anisotropic(float bitangentRoughness, float tangentialRoughness, vec3 halfwayDirection)
  2470. {
  2471. float roughnessSquared = bitangentRoughness * tangentialRoughness;
  2472. vec3 f = halfwayDirection * vec3(bitangentRoughness, tangentialRoughness, roughnessSquared);
  2473. float w2 = roughnessSquared / dot(f, f);
  2474. return roughnessSquared * w2 * w2 / czm_pi;
  2475. }
  2476. #endif
  2477. /**
  2478. * Estimate the geometric self-shadowing of the microfacets in a surface,
  2479. * using the Smith Joint GGX visibility function.
  2480. * Note: Vis = G / (4 * NdotL * NdotV)
  2481. * see Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs. Journal of Computer Graphics Techniques, 3
  2482. * see Real-Time Rendering. Page 331 to 336.
  2483. * see https://google.github.io/filament/Filament.md.html#materialsystem/specularbrdf/geometricshadowing(specularg)
  2484. *
  2485. * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
  2486. * @param {float} NdotL The cosine of the angle between the surface normal and the direction to the light source.
  2487. * @param {float} NdotV The cosine of the angle between the surface normal and the direction to the camera.
  2488. */
  2489. float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV)
  2490. {
  2491. float alphaRoughnessSq = alphaRoughness * alphaRoughness;
  2492. float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
  2493. float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
  2494. float GGX = GGXV + GGXL;
  2495. if (GGX > 0.0)
  2496. {
  2497. return 0.5 / GGX;
  2498. }
  2499. return 0.0;
  2500. }
  2501. /**
  2502. * Estimate the fraction of the microfacets in a surface that are aligned with
  2503. * the halfway vector, which is aligned halfway between the directions from
  2504. * the fragment to the camera and from the fragment to the light source.
  2505. *
  2506. * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
  2507. * @param {float} NdotH The cosine of the angle between the surface normal and the halfway vector.
  2508. * @return {float} The fraction of microfacets aligned to the halfway vector.
  2509. */
  2510. float GGX(float alphaRoughness, float NdotH)
  2511. {
  2512. float alphaRoughnessSquared = alphaRoughness * alphaRoughness;
  2513. float f = (NdotH * alphaRoughnessSquared - NdotH) * NdotH + 1.0;
  2514. return alphaRoughnessSquared / (czm_pi * f * f);
  2515. }
  2516. /**
  2517. * Compute the strength of the specular reflection due to direct lighting.
  2518. *
  2519. * @param {vec3} normal The surface normal.
  2520. * @param {vec3} lightDirection The unit vector pointing from the fragment to the light source.
  2521. * @param {vec3} viewDirection The unit vector pointing from the fragment to the camera.
  2522. * @param {vec3} halfwayDirection The unit vector pointing from the fragment to halfway between the light source and the camera.
  2523. * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
  2524. * @return {float} The strength of the specular reflection.
  2525. */
  2526. float computeDirectSpecularStrength(vec3 normal, vec3 lightDirection, vec3 viewDirection, vec3 halfwayDirection, float alphaRoughness)
  2527. {
  2528. float NdotL = clamp(dot(normal, lightDirection), 0.0, 1.0);
  2529. float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0);
  2530. float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV);
  2531. float NdotH = clamp(dot(normal, halfwayDirection), 0.0, 1.0);
  2532. float D = GGX(alphaRoughness, NdotH);
  2533. return G * D;
  2534. }
  2535. /**
  2536. * Compute the diffuse and specular contributions using physically based
  2537. * rendering. This function only handles direct lighting.
  2538. * <p>
  2539. * This function only handles the lighting calculations. Metallic/roughness
  2540. * and specular/glossy must be handled separately. See {@MaterialStageFS}
  2541. * </p>
  2542. *
  2543. * @name czm_pbrLighting
  2544. * @glslFunction
  2545. *
  2546. * @param {vec3} viewDirectionEC Unit vector pointing from the fragment to the eye position
  2547. * @param {vec3} normalEC The surface normal in eye coordinates
  2548. * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
  2549. * @param {czm_modelMaterial} The material properties.
  2550. * @return {vec3} The computed HDR color
  2551. */
  2552. vec3 czm_pbrLighting(vec3 viewDirectionEC, vec3 normalEC, vec3 lightDirectionEC, czm_modelMaterial material)
  2553. {
  2554. vec3 halfwayDirectionEC = normalize(viewDirectionEC + lightDirectionEC);
  2555. float VdotH = clamp(dot(viewDirectionEC, halfwayDirectionEC), 0.0, 1.0);
  2556. float NdotL = clamp(dot(normalEC, lightDirectionEC), 0.001, 1.0);
  2557. vec3 f0 = material.specular;
  2558. float reflectance = czm_maximumComponent(f0);
  2559. // Typical dielectrics will have reflectance 0.04, so f90 will be 1.0.
  2560. // In this case, at grazing angle, all incident energy is reflected.
  2561. vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));
  2562. vec3 F = fresnelSchlick2(f0, f90, VdotH);
  2563. #if defined(USE_SPECULAR)
  2564. F *= material.specularWeight;
  2565. #endif
  2566. float alphaRoughness = material.roughness * material.roughness;
  2567. #ifdef USE_ANISOTROPY
  2568. mat3 tbn = mat3(material.anisotropicT, material.anisotropicB, normalEC);
  2569. vec3 lightDirection = lightDirectionEC * tbn;
  2570. vec3 viewDirection = viewDirectionEC * tbn;
  2571. vec3 halfwayDirection = halfwayDirectionEC * tbn;
  2572. float anisotropyStrength = material.anisotropyStrength;
  2573. float tangentialRoughness = mix(alphaRoughness, 1.0, anisotropyStrength * anisotropyStrength);
  2574. float bitangentRoughness = clamp(alphaRoughness, 0.001, 1.0);
  2575. float G = smithVisibilityGGX_anisotropic(bitangentRoughness, tangentialRoughness, lightDirection, viewDirection);
  2576. float D = GGX_anisotropic(bitangentRoughness, tangentialRoughness, halfwayDirection);
  2577. vec3 specularContribution = F * G * D;
  2578. #else
  2579. float specularStrength = computeDirectSpecularStrength(normalEC, lightDirectionEC, viewDirectionEC, halfwayDirectionEC, alphaRoughness);
  2580. vec3 specularContribution = F * specularStrength;
  2581. #endif
  2582. vec3 diffuseColor = material.diffuse;
  2583. // F here represents the specular contribution
  2584. vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);
  2585. // Lo = (diffuse + specular) * Li * NdotL
  2586. return (diffuseContribution + specularContribution) * NdotL;
  2587. }
  2588. `;var qMt=T(S(),1),pG=`// KhronosGroup https://github.com/KhronosGroup/ToneMapping/tree/main/PBR_Neutral
  2589. // Input color is non-negative and resides in the Linear Rec. 709 color space.
  2590. // Output color is also Linear Rec. 709, but in the [0, 1] range.
  2591. vec3 czm_pbrNeutralTonemapping(vec3 color) {
  2592. const float startCompression = 0.8 - 0.04;
  2593. const float desaturation = 0.15;
  2594. float x = min(color.r, min(color.g, color.b));
  2595. float offset = czm_branchFreeTernary(x < 0.08, x - 6.25 * x * x, 0.04);
  2596. color -= offset;
  2597. float peak = max(color.r, max(color.g, color.b));
  2598. if (peak < startCompression) return color;
  2599. const float d = 1.0 - startCompression;
  2600. float newPeak = 1.0 - d * d / (peak + d - startCompression);
  2601. color *= newPeak / peak;
  2602. float g = 1.0 - 1.0 / (desaturation * (peak - newPeak) + 1.0);
  2603. return mix(color, newPeak * vec3(1.0, 1.0, 1.0), g);
  2604. }
  2605. `;var e9t=T(S(),1),bG=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)
  2606. {
  2607. return czm_getLambertDiffuse(lightDirectionEC, material.normal);
  2608. }
  2609. float czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)
  2610. {
  2611. return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);
  2612. }
  2613. /**
  2614. * Computes a color using the Phong lighting model.
  2615. *
  2616. * @name czm_phong
  2617. * @glslFunction
  2618. *
  2619. * @param {vec3} toEye A normalized vector from the fragment to the eye in eye coordinates.
  2620. * @param {czm_material} material The fragment's material.
  2621. *
  2622. * @returns {vec4} The computed color.
  2623. *
  2624. * @example
  2625. * vec3 positionToEyeEC = // ...
  2626. * czm_material material = // ...
  2627. * vec3 lightDirectionEC = // ...
  2628. * out_FragColor = czm_phong(normalize(positionToEyeEC), material, lightDirectionEC);
  2629. *
  2630. * @see czm_getMaterial
  2631. */
  2632. vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
  2633. {
  2634. // Diffuse from directional light sources at eye (for top-down)
  2635. float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);
  2636. if (czm_sceneMode == czm_sceneMode3D) {
  2637. // (and horizon views in 3D)
  2638. diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);
  2639. }
  2640. float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);
  2641. // Temporary workaround for adding ambient.
  2642. vec3 materialDiffuse = material.diffuse * 0.5;
  2643. vec3 ambient = materialDiffuse;
  2644. vec3 color = ambient + material.emission;
  2645. color += materialDiffuse * diffuse * czm_lightColor;
  2646. color += material.specular * specular * czm_lightColor;
  2647. return vec4(color, material.alpha);
  2648. }
  2649. vec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
  2650. {
  2651. float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material);
  2652. float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);
  2653. vec3 ambient = vec3(0.0);
  2654. vec3 color = ambient + material.emission;
  2655. color += material.diffuse * diffuse * czm_lightColor;
  2656. color += material.specular * specular * czm_lightColor;
  2657. return vec4(color, material.alpha);
  2658. }
  2659. `;var n9t=T(S(),1),gG=`/**
  2660. * Computes distance from a point to a plane.
  2661. *
  2662. * @name czm_planeDistance
  2663. * @glslFunction
  2664. *
  2665. * param {vec4} plane A Plane in Hessian Normal Form. See Plane.js
  2666. * param {vec3} point A point in the same space as the plane.
  2667. * returns {float} The distance from the point to the plane.
  2668. */
  2669. float czm_planeDistance(vec4 plane, vec3 point) {
  2670. return (dot(plane.xyz, point) + plane.w);
  2671. }
  2672. /**
  2673. * Computes distance from a point to a plane.
  2674. *
  2675. * @name czm_planeDistance
  2676. * @glslFunction
  2677. *
  2678. * param {vec3} planeNormal Normal for a plane in Hessian Normal Form. See Plane.js
  2679. * param {float} planeDistance Distance for a plane in Hessian Normal form. See Plane.js
  2680. * param {vec3} point A point in the same space as the plane.
  2681. * returns {float} The distance from the point to the plane.
  2682. */
  2683. float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) {
  2684. return (dot(planeNormal, point) + planeDistance);
  2685. }
  2686. `;var o9t=T(S(),1),yG=`/**
  2687. * Computes the point along a ray at the given time. <code>time</code> can be positive, negative, or zero.
  2688. *
  2689. * @name czm_pointAlongRay
  2690. * @glslFunction
  2691. *
  2692. * @param {czm_ray} ray The ray to compute the point along.
  2693. * @param {float} time The time along the ray.
  2694. *
  2695. * @returns {vec3} The point along the ray at the given time.
  2696. *
  2697. * @example
  2698. * czm_ray ray = czm_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)); // origin, direction
  2699. * vec3 v = czm_pointAlongRay(ray, 2.0); // (2.0, 0.0, 0.0)
  2700. */
  2701. vec3 czm_pointAlongRay(czm_ray ray, float time)
  2702. {
  2703. return ray.origin + (time * ray.direction);
  2704. }
  2705. `;var s9t=T(S(),1),xG=`/**
  2706. * DOC_TBA
  2707. *
  2708. * @name czm_rayEllipsoidIntersectionInterval
  2709. * @glslFunction
  2710. */
  2711. czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii)
  2712. {
  2713. // ray and ellipsoid center in eye coordinates. radii in model coordinates.
  2714. vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;
  2715. vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;
  2716. q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz;
  2717. float q2 = dot(q, q);
  2718. float qw = dot(q, w);
  2719. if (q2 > 1.0) // Outside ellipsoid.
  2720. {
  2721. if (qw >= 0.0) // Looking outward or tangent (0 intersections).
  2722. {
  2723. return czm_emptyRaySegment;
  2724. }
  2725. else // qw < 0.0.
  2726. {
  2727. float qw2 = qw * qw;
  2728. float difference = q2 - 1.0; // Positively valued.
  2729. float w2 = dot(w, w);
  2730. float product = w2 * difference;
  2731. if (qw2 < product) // Imaginary roots (0 intersections).
  2732. {
  2733. return czm_emptyRaySegment;
  2734. }
  2735. else if (qw2 > product) // Distinct roots (2 intersections).
  2736. {
  2737. float discriminant = qw * qw - product;
  2738. float temp = -qw + sqrt(discriminant); // Avoid cancellation.
  2739. float root0 = temp / w2;
  2740. float root1 = difference / temp;
  2741. if (root0 < root1)
  2742. {
  2743. czm_raySegment i = czm_raySegment(root0, root1);
  2744. return i;
  2745. }
  2746. else
  2747. {
  2748. czm_raySegment i = czm_raySegment(root1, root0);
  2749. return i;
  2750. }
  2751. }
  2752. else // qw2 == product. Repeated roots (2 intersections).
  2753. {
  2754. float root = sqrt(difference / w2);
  2755. czm_raySegment i = czm_raySegment(root, root);
  2756. return i;
  2757. }
  2758. }
  2759. }
  2760. else if (q2 < 1.0) // Inside ellipsoid (2 intersections).
  2761. {
  2762. float difference = q2 - 1.0; // Negatively valued.
  2763. float w2 = dot(w, w);
  2764. float product = w2 * difference; // Negatively valued.
  2765. float discriminant = qw * qw - product;
  2766. float temp = -qw + sqrt(discriminant); // Positively valued.
  2767. czm_raySegment i = czm_raySegment(0.0, temp / w2);
  2768. return i;
  2769. }
  2770. else // q2 == 1.0. On ellipsoid.
  2771. {
  2772. if (qw < 0.0) // Looking inward.
  2773. {
  2774. float w2 = dot(w, w);
  2775. czm_raySegment i = czm_raySegment(0.0, -qw / w2);
  2776. return i;
  2777. }
  2778. else // qw >= 0.0. Looking outward or tangent.
  2779. {
  2780. return czm_emptyRaySegment;
  2781. }
  2782. }
  2783. }
  2784. `;var c9t=T(S(),1),_G=`/**
  2785. * Compute the intersection interval of a ray with a sphere.
  2786. *
  2787. * @name czm_raySphereIntersectionInterval
  2788. * @glslFunction
  2789. *
  2790. * @param {czm_ray} ray The ray.
  2791. * @param {vec3} center The center of the sphere.
  2792. * @param {float} radius The radius of the sphere.
  2793. * @return {czm_raySegment} The intersection interval of the ray with the sphere.
  2794. */
  2795. czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius)
  2796. {
  2797. vec3 o = ray.origin;
  2798. vec3 d = ray.direction;
  2799. vec3 oc = o - center;
  2800. float a = dot(d, d);
  2801. float b = 2.0 * dot(d, oc);
  2802. float c = dot(oc, oc) - (radius * radius);
  2803. float det = (b * b) - (4.0 * a * c);
  2804. if (det < 0.0) {
  2805. return czm_emptyRaySegment;
  2806. }
  2807. float sqrtDet = sqrt(det);
  2808. float t0 = (-b - sqrtDet) / (2.0 * a);
  2809. float t1 = (-b + sqrtDet) / (2.0 * a);
  2810. czm_raySegment result = czm_raySegment(t0, t1);
  2811. return result;
  2812. }
  2813. `;var d9t=T(S(),1),TG=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords)
  2814. {
  2815. return czm_reverseLogDepth(texture(depthTexture, texCoords).r);
  2816. }
  2817. `;var m9t=T(S(),1),SG=`/**
  2818. * Reads a value previously transformed with {@link czm_writeNonPerspective}
  2819. * by dividing it by \`w\`, the value used in the perspective divide.
  2820. * This function is intended to be called in a fragment shader to access a
  2821. * \`varying\` that should not be subject to perspective interpolation.
  2822. * For example, screen-space texture coordinates. The value should have been
  2823. * previously written in the vertex shader with a call to
  2824. * {@link czm_writeNonPerspective}.
  2825. *
  2826. * @name czm_readNonPerspective
  2827. * @glslFunction
  2828. *
  2829. * @param {float|vec2|vec3|vec4} value The non-perspective value to be read.
  2830. * @param {float} oneOverW One over the perspective divide value, \`w\`. Usually this is simply \`gl_FragCoord.w\`.
  2831. * @returns {float|vec2|vec3|vec4} The usable value.
  2832. */
  2833. float czm_readNonPerspective(float value, float oneOverW) {
  2834. return value * oneOverW;
  2835. }
  2836. vec2 czm_readNonPerspective(vec2 value, float oneOverW) {
  2837. return value * oneOverW;
  2838. }
  2839. vec3 czm_readNonPerspective(vec3 value, float oneOverW) {
  2840. return value * oneOverW;
  2841. }
  2842. vec4 czm_readNonPerspective(vec4 value, float oneOverW) {
  2843. return value * oneOverW;
  2844. }
  2845. `;var f9t=T(S(),1),CG=`float czm_reverseLogDepth(float logZ)
  2846. {
  2847. #ifdef LOG_DEPTH
  2848. float near = czm_currentFrustum.x;
  2849. float far = czm_currentFrustum.y;
  2850. float log2Depth = logZ * czm_log2FarDepthFromNearPlusOne;
  2851. float depthFromNear = pow(2.0, log2Depth) - 1.0;
  2852. return far * (1.0 - near / (depthFromNear + near)) / (far - near);
  2853. #endif
  2854. return logZ;
  2855. }
  2856. `;var b9t=T(S(),1),VG=`/**
  2857. * Round a floating point value. This function exists because round() doesn't
  2858. * exist in GLSL 1.00.
  2859. *
  2860. * @param {float|vec2|vec3|vec4} value The value to round
  2861. * @param {float|vec2|vec3|vec3} The rounded value. The type matches the input.
  2862. */
  2863. float czm_round(float value) {
  2864. return floor(value + 0.5);
  2865. }
  2866. vec2 czm_round(vec2 value) {
  2867. return floor(value + 0.5);
  2868. }
  2869. vec3 czm_round(vec3 value) {
  2870. return floor(value + 0.5);
  2871. }
  2872. vec4 czm_round(vec4 value) {
  2873. return floor(value + 0.5);
  2874. }
  2875. `;var y9t=T(S(),1),LG=`/**
  2876. * Adjusts the saturation of a color.
  2877. *
  2878. * @name czm_saturation
  2879. * @glslFunction
  2880. *
  2881. * @param {vec3} rgb The color.
  2882. * @param {float} adjustment The amount to adjust the saturation of the color.
  2883. *
  2884. * @returns {float} The color with the saturation adjusted.
  2885. *
  2886. * @example
  2887. * vec3 greyScale = czm_saturation(color, 0.0);
  2888. * vec3 doubleSaturation = czm_saturation(color, 2.0);
  2889. */
  2890. vec3 czm_saturation(vec3 rgb, float adjustment)
  2891. {
  2892. // Algorithm from Chapter 16 of OpenGL Shading Language
  2893. const vec3 W = vec3(0.2125, 0.7154, 0.0721);
  2894. vec3 intensity = vec3(dot(rgb, W));
  2895. return mix(intensity, rgb, adjustment);
  2896. }
  2897. `;var _9t=T(S(),1),RG=`
  2898. float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d)
  2899. {
  2900. return czm_unpackDepth(czm_textureCube(shadowMap, d));
  2901. }
  2902. float czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv)
  2903. {
  2904. #ifdef USE_SHADOW_DEPTH_TEXTURE
  2905. return texture(shadowMap, uv).r;
  2906. #else
  2907. return czm_unpackDepth(texture(shadowMap, uv));
  2908. #endif
  2909. }
  2910. float czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)
  2911. {
  2912. return step(depth, czm_sampleShadowMap(shadowMap, uv));
  2913. }
  2914. float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)
  2915. {
  2916. return step(depth, czm_sampleShadowMap(shadowMap, uv));
  2917. }
  2918. `;var S9t=T(S(),1),ZG=`
  2919. float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)
  2920. {
  2921. #ifdef USE_NORMAL_SHADING
  2922. #ifdef USE_NORMAL_SHADING_SMOOTH
  2923. float strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);
  2924. #else
  2925. float strength = step(0.0, nDotL);
  2926. #endif
  2927. visibility *= strength;
  2928. #endif
  2929. visibility = max(visibility, darkness);
  2930. return visibility;
  2931. }
  2932. #ifdef USE_CUBE_MAP_SHADOW
  2933. float czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)
  2934. {
  2935. float depthBias = shadowParameters.depthBias;
  2936. float depth = shadowParameters.depth;
  2937. float nDotL = shadowParameters.nDotL;
  2938. float normalShadingSmooth = shadowParameters.normalShadingSmooth;
  2939. float darkness = shadowParameters.darkness;
  2940. vec3 uvw = shadowParameters.texCoords;
  2941. depth -= depthBias;
  2942. float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);
  2943. return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);
  2944. }
  2945. #else
  2946. float czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)
  2947. {
  2948. float depthBias = shadowParameters.depthBias;
  2949. float depth = shadowParameters.depth;
  2950. float nDotL = shadowParameters.nDotL;
  2951. float normalShadingSmooth = shadowParameters.normalShadingSmooth;
  2952. float darkness = shadowParameters.darkness;
  2953. vec2 uv = shadowParameters.texCoords;
  2954. depth -= depthBias;
  2955. #ifdef USE_SOFT_SHADOWS
  2956. vec2 texelStepSize = shadowParameters.texelStepSize;
  2957. float radius = 1.0;
  2958. float dx0 = -texelStepSize.x * radius;
  2959. float dy0 = -texelStepSize.y * radius;
  2960. float dx1 = texelStepSize.x * radius;
  2961. float dy1 = texelStepSize.y * radius;
  2962. float visibility = (
  2963. czm_shadowDepthCompare(shadowMap, uv, depth) +
  2964. czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +
  2965. czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +
  2966. czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +
  2967. czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +
  2968. czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +
  2969. czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +
  2970. czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +
  2971. czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)
  2972. ) * (1.0 / 9.0);
  2973. #else
  2974. float visibility = czm_shadowDepthCompare(shadowMap, uv, depth);
  2975. #endif
  2976. return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);
  2977. }
  2978. #endif
  2979. `;var V9t=T(S(),1),GG=`/**
  2980. * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative. This is similar to the GLSL
  2981. * built-in function <code>sign</code> except that returns 1.0 instead of 0.0 when the input value is 0.0.
  2982. *
  2983. * @name czm_signNotZero
  2984. * @glslFunction
  2985. *
  2986. * @param {} value The value for which to determine the sign.
  2987. * @returns {} 1.0 if the value is positive or zero, -1.0 if the value is negative.
  2988. */
  2989. float czm_signNotZero(float value)
  2990. {
  2991. return value >= 0.0 ? 1.0 : -1.0;
  2992. }
  2993. vec2 czm_signNotZero(vec2 value)
  2994. {
  2995. return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));
  2996. }
  2997. vec3 czm_signNotZero(vec3 value)
  2998. {
  2999. return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));
  3000. }
  3001. vec4 czm_signNotZero(vec4 value)
  3002. {
  3003. return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));
  3004. }
  3005. `;var R9t=T(S(),1),EG=`/**
  3006. * Computes a color from the third order spherical harmonic coefficients and a normalized direction vector.
  3007. * <p>
  3008. * The order of the coefficients is [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22].
  3009. * </p>
  3010. *
  3011. * @name czm_sphericalHarmonics
  3012. * @glslFunction
  3013. *
  3014. * @param {vec3} normal The normalized direction.
  3015. * @param {vec3[9]} coefficients The third order spherical harmonic coefficients.
  3016. * @returns {vec3} The color at the direction.
  3017. *
  3018. * @see https://graphics.stanford.edu/papers/envmap/envmap.pdf
  3019. */
  3020. vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9])
  3021. {
  3022. vec3 L00 = coefficients[0];
  3023. vec3 L1_1 = coefficients[1];
  3024. vec3 L10 = coefficients[2];
  3025. vec3 L11 = coefficients[3];
  3026. vec3 L2_2 = coefficients[4];
  3027. vec3 L2_1 = coefficients[5];
  3028. vec3 L20 = coefficients[6];
  3029. vec3 L21 = coefficients[7];
  3030. vec3 L22 = coefficients[8];
  3031. float x = normal.x;
  3032. float y = normal.y;
  3033. float z = normal.z;
  3034. vec3 L =
  3035. L00
  3036. + L1_1 * y
  3037. + L10 * z
  3038. + L11 * x
  3039. + L2_2 * (y * x)
  3040. + L2_1 * (y * z)
  3041. + L20 * (3.0 * z * z - 1.0)
  3042. + L21 * (z * x)
  3043. + L22 * (x * x - y * y);
  3044. return max(L, vec3(0.0));
  3045. }
  3046. `;var G9t=T(S(),1),IG=`/**
  3047. * Converts an sRGB color to a linear RGB color.
  3048. *
  3049. * @param {vec3|vec4} srgbIn The color in sRGB space
  3050. * @returns {vec3|vec4} The color in linear color space. The vector type matches the input.
  3051. */
  3052. vec3 czm_srgbToLinear(vec3 srgbIn)
  3053. {
  3054. return pow(srgbIn, vec3(2.2));
  3055. }
  3056. vec4 czm_srgbToLinear(vec4 srgbIn)
  3057. {
  3058. vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));
  3059. return vec4(linearOut, srgbIn.a);
  3060. }
  3061. `;var I9t=T(S(),1),XG=`/**
  3062. * Creates a matrix that transforms vectors from tangent space to eye space.
  3063. *
  3064. * @name czm_tangentToEyeSpaceMatrix
  3065. * @glslFunction
  3066. *
  3067. * @param {vec3} normalEC The normal vector in eye coordinates.
  3068. * @param {vec3} tangentEC The tangent vector in eye coordinates.
  3069. * @param {vec3} bitangentEC The bitangent vector in eye coordinates.
  3070. *
  3071. * @returns {mat3} The matrix that transforms from tangent space to eye space.
  3072. *
  3073. * @example
  3074. * mat3 tangentToEye = czm_tangentToEyeSpaceMatrix(normalEC, tangentEC, bitangentEC);
  3075. * vec3 normal = tangentToEye * texture(normalMap, st).xyz;
  3076. */
  3077. mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)
  3078. {
  3079. vec3 normal = normalize(normalEC);
  3080. vec3 tangent = normalize(tangentEC);
  3081. vec3 bitangent = normalize(bitangentEC);
  3082. return mat3(tangent.x , tangent.y , tangent.z,
  3083. bitangent.x, bitangent.y, bitangent.z,
  3084. normal.x , normal.y , normal.z);
  3085. }
  3086. `;var W9t=T(S(),1),WG=`/**
  3087. * A wrapper around the texture (WebGL2) / textureCube (WebGL1)
  3088. * function to allow for WebGL 1 support.
  3089. *
  3090. * @name czm_textureCube
  3091. * @glslFunction
  3092. *
  3093. * @param {samplerCube} sampler The sampler.
  3094. * @param {vec3} p The coordinate at which to sample the texture.
  3095. */
  3096. vec4 czm_textureCube(samplerCube sampler, vec3 p) {
  3097. #if __VERSION__ == 300
  3098. return texture(sampler, p);
  3099. #else
  3100. return textureCube(sampler, p);
  3101. #endif
  3102. }
  3103. /**
  3104. * A wrapper around the textureLod (WebGL2) / textureCube (WebGL1)
  3105. * function to allow for WebGL 1 support in fragment shaders.
  3106. *
  3107. * @name czm_textureCubeLod
  3108. * @glslFunction
  3109. *
  3110. * @param {samplerCube} sampler The sampler.
  3111. * @param {vec3} p The coordinate at which to sample the texture.
  3112. * @param {float} lod The mipmap level from which to sample.
  3113. */
  3114. vec4 czm_textureCube(samplerCube sampler, vec3 p, float lod) {
  3115. #if __VERSION__ == 300
  3116. return textureLod(sampler, p, lod);
  3117. #elif defined(GL_EXT_shader_texture_lod)
  3118. return textureCubeLodEXT(sampler, p, lod);
  3119. #endif
  3120. }`;var v9t=T(S(),1),PG=`/**
  3121. * Transforms a plane.
  3122. *
  3123. * @name czm_transformPlane
  3124. * @glslFunction
  3125. *
  3126. * @param {vec4} plane The plane in Hessian Normal Form.
  3127. * @param {mat4} transform The inverse-transpose of a transformation matrix.
  3128. */
  3129. vec4 czm_transformPlane(vec4 plane, mat4 transform) {
  3130. vec4 transformedPlane = transform * plane;
  3131. // Convert the transformed plane to Hessian Normal Form
  3132. float normalMagnitude = length(transformedPlane.xyz);
  3133. return transformedPlane / normalMagnitude;
  3134. }
  3135. `;var F9t=T(S(),1),vG=`/**
  3136. * Translates a position (or any <code>vec3</code>) that was encoded with {@link EncodedCartesian3},
  3137. * and then provided to the shader as separate <code>high</code> and <code>low</code> bits to
  3138. * be relative to the eye. As shown in the example, the position can then be transformed in eye
  3139. * or clip coordinates using {@link czm_modelViewRelativeToEye} or {@link czm_modelViewProjectionRelativeToEye},
  3140. * respectively.
  3141. * <p>
  3142. * This technique, called GPU RTE, eliminates jittering artifacts when using large coordinates as
  3143. * described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.
  3144. * </p>
  3145. *
  3146. * @name czm_translateRelativeToEye
  3147. * @glslFunction
  3148. *
  3149. * @param {vec3} high The position's high bits.
  3150. * @param {vec3} low The position's low bits.
  3151. * @returns {vec3} The position translated to be relative to the camera's position.
  3152. *
  3153. * @example
  3154. * in vec3 positionHigh;
  3155. * in vec3 positionLow;
  3156. *
  3157. * void main()
  3158. * {
  3159. * vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
  3160. * gl_Position = czm_modelViewProjectionRelativeToEye * p;
  3161. * }
  3162. *
  3163. * @see czm_modelViewRelativeToEye
  3164. * @see czm_modelViewProjectionRelativeToEye
  3165. * @see czm_computePosition
  3166. * @see EncodedCartesian3
  3167. */
  3168. vec4 czm_translateRelativeToEye(vec3 high, vec3 low)
  3169. {
  3170. vec3 highDifference = high - czm_encodedCameraPositionMCHigh;
  3171. // This check handles the case when NaN values have gotten into \`highDifference\`.
  3172. // Such a thing could happen on devices running iOS.
  3173. if (length(highDifference) == 0.0) {
  3174. highDifference = vec3(0);
  3175. }
  3176. vec3 lowDifference = low - czm_encodedCameraPositionMCLow;
  3177. return vec4(highDifference + lowDifference, 1.0);
  3178. }
  3179. `;var M9t=T(S(),1),wG=`/**
  3180. * @private
  3181. */
  3182. vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
  3183. {
  3184. // Diffuse from directional light sources at eye (for top-down and horizon views)
  3185. float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);
  3186. if (czm_sceneMode == czm_sceneMode3D) {
  3187. // (and horizon views in 3D)
  3188. diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);
  3189. }
  3190. diffuse = clamp(diffuse, 0.0, 1.0);
  3191. float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess);
  3192. // Temporary workaround for adding ambient.
  3193. vec3 materialDiffuse = material.diffuse * 0.5;
  3194. vec3 ambient = materialDiffuse;
  3195. vec3 color = ambient + material.emission;
  3196. color += materialDiffuse * diffuse * czm_lightColor;
  3197. color += material.specular * specular * czm_lightColor;
  3198. return vec4(color, material.alpha);
  3199. }
  3200. `;var k9t=T(S(),1),FG=`/**
  3201. * Returns the transpose of the matrix. The input <code>matrix</code> can be
  3202. * a <code>mat2</code>, <code>mat3</code>, or <code>mat4</code>.
  3203. *
  3204. * @name czm_transpose
  3205. * @glslFunction
  3206. *
  3207. * @param {} matrix The matrix to transpose.
  3208. *
  3209. * @returns {} The transposed matrix.
  3210. *
  3211. * @example
  3212. * // GLSL declarations
  3213. * mat2 czm_transpose(mat2 matrix);
  3214. * mat3 czm_transpose(mat3 matrix);
  3215. * mat4 czm_transpose(mat4 matrix);
  3216. *
  3217. * // Transpose a 3x3 rotation matrix to find its inverse.
  3218. * mat3 eastNorthUpToEye = czm_eastNorthUpToEyeCoordinates(
  3219. * positionMC, normalEC);
  3220. * mat3 eyeToEastNorthUp = czm_transpose(eastNorthUpToEye);
  3221. */
  3222. mat2 czm_transpose(mat2 matrix)
  3223. {
  3224. return mat2(
  3225. matrix[0][0], matrix[1][0],
  3226. matrix[0][1], matrix[1][1]);
  3227. }
  3228. mat3 czm_transpose(mat3 matrix)
  3229. {
  3230. return mat3(
  3231. matrix[0][0], matrix[1][0], matrix[2][0],
  3232. matrix[0][1], matrix[1][1], matrix[2][1],
  3233. matrix[0][2], matrix[1][2], matrix[2][2]);
  3234. }
  3235. mat4 czm_transpose(mat4 matrix)
  3236. {
  3237. return mat4(
  3238. matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],
  3239. matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],
  3240. matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],
  3241. matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);
  3242. }
  3243. `;var D9t=T(S(),1),AG=`vec2 getLookupUv(vec2 dimensions, int i) {
  3244. int pixY = i / int(dimensions.x);
  3245. int pixX = i - (pixY * int(dimensions.x));
  3246. float pixelWidth = 1.0 / dimensions.x;
  3247. float pixelHeight = 1.0 / dimensions.y;
  3248. float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
  3249. float v = (float(pixY) + 0.5) * pixelHeight;
  3250. return vec2(u, v);
  3251. }
  3252. vec4 czm_unpackClippingExtents(highp sampler2D extentsTexture, int index) {
  3253. vec2 textureDimensions = vec2(textureSize(extentsTexture, 0));
  3254. return texture(extentsTexture, getLookupUv(textureDimensions, index));
  3255. }`;var O9t=T(S(),1),MG=`/**
  3256. * Unpacks a vec4 depth value to a float in [0, 1) range.
  3257. *
  3258. * @name czm_unpackDepth
  3259. * @glslFunction
  3260. *
  3261. * @param {vec4} packedDepth The packed depth.
  3262. *
  3263. * @returns {float} The floating-point depth in [0, 1) range.
  3264. */
  3265. float czm_unpackDepth(vec4 packedDepth)
  3266. {
  3267. // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA
  3268. // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/
  3269. return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));
  3270. }
  3271. `;var H9t=T(S(),1),NG=`/**
  3272. * Unpack an IEEE 754 single-precision float that is packed as a little-endian unsigned normalized vec4.
  3273. *
  3274. * @name czm_unpackFloat
  3275. * @glslFunction
  3276. *
  3277. * @param {vec4} packedFloat The packed float.
  3278. *
  3279. * @returns {float} The floating-point depth in arbitrary range.
  3280. */
  3281. float czm_unpackFloat(vec4 packedFloat)
  3282. {
  3283. // Convert to [0.0, 255.0] and round to integer
  3284. packedFloat = floor(packedFloat * 255.0 + 0.5);
  3285. float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0;
  3286. float exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0;
  3287. if (exponent == -127.0)
  3288. {
  3289. return 0.0;
  3290. }
  3291. float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000);
  3292. float result = sign * exp2(exponent - 23.0) * mantissa;
  3293. return result;
  3294. }
  3295. `;var K9t=T(S(),1),kG=`/**
  3296. * Unpack unsigned integers of 1-4 bytes. in WebGL 1, there is no uint type,
  3297. * so the return value is an int.
  3298. * <p>
  3299. * There are also precision limitations in WebGL 1. highp int is still limited
  3300. * to 24 bits. Above the value of 2^24 = 16777216, precision loss may occur.
  3301. * </p>
  3302. *
  3303. * @param {float|vec2|vec3|vec4} packed The packed value. For vectors, the components are listed in little-endian order.
  3304. *
  3305. * @return {int} The unpacked value.
  3306. */
  3307. int czm_unpackUint(float packedValue) {
  3308. float rounded = czm_round(packedValue * 255.0);
  3309. return int(rounded);
  3310. }
  3311. int czm_unpackUint(vec2 packedValue) {
  3312. vec2 rounded = czm_round(packedValue * 255.0);
  3313. return int(dot(rounded, vec2(1.0, 256.0)));
  3314. }
  3315. int czm_unpackUint(vec3 packedValue) {
  3316. vec3 rounded = czm_round(packedValue * 255.0);
  3317. return int(dot(rounded, vec3(1.0, 256.0, 65536.0)));
  3318. }
  3319. int czm_unpackUint(vec4 packedValue) {
  3320. vec4 rounded = czm_round(packedValue * 255.0);
  3321. return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0)));
  3322. }
  3323. `;var Q9t=T(S(),1),UG=`/**
  3324. * Transform metadata values following the EXT_structural_metadata spec
  3325. * by multiplying by scale and adding the offset. Operations are always
  3326. * performed component-wise, even for matrices.
  3327. *
  3328. * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} offset The offset to add
  3329. * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} scale The scale factor to multiply
  3330. * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} value The original value.
  3331. *
  3332. * @return {float|vec2|vec3|vec4|mat2|mat3|mat4} The transformed value of the same scalar/vector/matrix type as the input.
  3333. */
  3334. float czm_valueTransform(float offset, float scale, float value) {
  3335. return scale * value + offset;
  3336. }
  3337. vec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) {
  3338. return scale * value + offset;
  3339. }
  3340. vec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) {
  3341. return scale * value + offset;
  3342. }
  3343. vec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) {
  3344. return scale * value + offset;
  3345. }
  3346. mat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) {
  3347. return matrixCompMult(scale, value) + offset;
  3348. }
  3349. mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) {
  3350. return matrixCompMult(scale, value) + offset;
  3351. }
  3352. mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) {
  3353. return matrixCompMult(scale, value) + offset;
  3354. }
  3355. `;var q9t=T(S(),1),DG=`#ifdef LOG_DEPTH
  3356. // 1.0 at the near plane, increasing linearly from there.
  3357. out float v_depthFromNearPlusOne;
  3358. #ifdef SHADOW_MAP
  3359. out vec3 v_logPositionEC;
  3360. #endif
  3361. #endif
  3362. vec4 czm_updatePositionDepth(vec4 coords) {
  3363. #if defined(LOG_DEPTH)
  3364. #ifdef SHADOW_MAP
  3365. vec3 logPositionEC = (czm_inverseProjection * coords).xyz;
  3366. v_logPositionEC = logPositionEC;
  3367. #endif
  3368. // With the very high far/near ratios used with the logarithmic depth
  3369. // buffer, floating point rounding errors can cause linear depth values
  3370. // to end up on the wrong side of the far plane, even for vertices that
  3371. // are really nowhere near it. Since we always write a correct logarithmic
  3372. // depth value in the fragment shader anyway, we just need to make sure
  3373. // such errors don't cause the primitive to be clipped entirely before
  3374. // we even get to the fragment shader.
  3375. coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w;
  3376. #endif
  3377. return coords;
  3378. }
  3379. /**
  3380. * Writes the logarithmic depth to gl_Position using the already computed gl_Position.
  3381. *
  3382. * @name czm_vertexLogDepth
  3383. * @glslFunction
  3384. */
  3385. void czm_vertexLogDepth()
  3386. {
  3387. #ifdef LOG_DEPTH
  3388. v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0;
  3389. gl_Position = czm_updatePositionDepth(gl_Position);
  3390. #endif
  3391. }
  3392. /**
  3393. * Writes the logarithmic depth to gl_Position using the provided clip coordinates.
  3394. * <p>
  3395. * An example use case for this function would be moving the vertex in window coordinates
  3396. * before converting back to clip coordinates. Use the original vertex clip coordinates.
  3397. * </p>
  3398. * @name czm_vertexLogDepth
  3399. * @glslFunction
  3400. *
  3401. * @param {vec4} clipCoords The vertex in clip coordinates.
  3402. *
  3403. * @example
  3404. * czm_vertexLogDepth(czm_projection * vec4(positionEyeCoordinates, 1.0));
  3405. */
  3406. void czm_vertexLogDepth(vec4 clipCoords)
  3407. {
  3408. #ifdef LOG_DEPTH
  3409. v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0;
  3410. czm_updatePositionDepth(clipCoords);
  3411. #endif
  3412. }
  3413. `;var eNt=T(S(),1),BG=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate)
  3414. {
  3415. // Reconstruct NDC coordinates
  3416. float x = 2.0 * screenCoordinate.x - 1.0;
  3417. float y = 2.0 * screenCoordinate.y - 1.0;
  3418. float z = (screenCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];
  3419. vec4 q = vec4(x, y, z, 1.0);
  3420. // Reverse the perspective division to obtain clip coordinates.
  3421. q /= screenCoordinate.w;
  3422. // Reverse the projection transformation to obtain eye coordinates.
  3423. if (!(czm_inverseProjection == mat4(0.0))) // IE and Edge sometimes do something weird with != between mat4s
  3424. {
  3425. q = czm_inverseProjection * q;
  3426. }
  3427. else
  3428. {
  3429. float top = czm_frustumPlanes.x;
  3430. float bottom = czm_frustumPlanes.y;
  3431. float left = czm_frustumPlanes.z;
  3432. float right = czm_frustumPlanes.w;
  3433. float near = czm_currentFrustum.x;
  3434. float far = czm_currentFrustum.y;
  3435. q.x = (q.x * (right - left) + left + right) * 0.5;
  3436. q.y = (q.y * (top - bottom) + bottom + top) * 0.5;
  3437. q.z = (q.z * (near - far) - near - far) * 0.5;
  3438. q.w = 1.0;
  3439. }
  3440. return q;
  3441. }
  3442. /**
  3443. * Transforms a position from window to eye coordinates.
  3444. * The transform from window to normalized device coordinates is done using components
  3445. * of (@link czm_viewport} and {@link czm_viewportTransformation} instead of calculating
  3446. * the inverse of <code>czm_viewportTransformation</code>. The transformation from
  3447. * normalized device coordinates to clip coordinates is done using <code>fragmentCoordinate.w</code>,
  3448. * which is expected to be the scalar used in the perspective divide. The transformation
  3449. * from clip to eye coordinates is done using {@link czm_inverseProjection}.
  3450. *
  3451. * @name czm_windowToEyeCoordinates
  3452. * @glslFunction
  3453. *
  3454. * @param {vec4} fragmentCoordinate The position in window coordinates to transform.
  3455. *
  3456. * @returns {vec4} The transformed position in eye coordinates.
  3457. *
  3458. * @see czm_modelToWindowCoordinates
  3459. * @see czm_eyeToWindowCoordinates
  3460. * @see czm_inverseProjection
  3461. * @see czm_viewport
  3462. * @see czm_viewportTransformation
  3463. *
  3464. * @example
  3465. * vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord);
  3466. */
  3467. vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)
  3468. {
  3469. vec2 screenCoordXY = (fragmentCoordinate.xy - czm_viewport.xy) / czm_viewport.zw;
  3470. return czm_screenToEyeCoordinates(vec4(screenCoordXY, fragmentCoordinate.zw));
  3471. }
  3472. vec4 czm_screenToEyeCoordinates(vec2 screenCoordinateXY, float depthOrLogDepth)
  3473. {
  3474. // See reverseLogDepth.glsl. This is separate to re-use the pow.
  3475. #if defined(LOG_DEPTH) || defined(LOG_DEPTH_READ_ONLY)
  3476. float near = czm_currentFrustum.x;
  3477. float far = czm_currentFrustum.y;
  3478. float log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne;
  3479. float depthFromNear = exp2(log2Depth) - 1.0;
  3480. float depthFromCamera = depthFromNear + near;
  3481. vec4 screenCoord = vec4(screenCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0);
  3482. vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord);
  3483. eyeCoordinate.w = 1.0 / depthFromCamera; // Better precision
  3484. return eyeCoordinate;
  3485. #else
  3486. vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0);
  3487. vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord);
  3488. #endif
  3489. return eyeCoordinate;
  3490. }
  3491. /**
  3492. * Transforms a position given as window x/y and a depth or a log depth from window to eye coordinates.
  3493. * This function produces more accurate results for window positions with log depth than
  3494. * conventionally unpacking the log depth using czm_reverseLogDepth and using the standard version
  3495. * of czm_windowToEyeCoordinates.
  3496. *
  3497. * @name czm_windowToEyeCoordinates
  3498. * @glslFunction
  3499. *
  3500. * @param {vec2} fragmentCoordinateXY The XY position in window coordinates to transform.
  3501. * @param {float} depthOrLogDepth A depth or log depth for the fragment.
  3502. *
  3503. * @see czm_modelToWindowCoordinates
  3504. * @see czm_eyeToWindowCoordinates
  3505. * @see czm_inverseProjection
  3506. * @see czm_viewport
  3507. * @see czm_viewportTransformation
  3508. *
  3509. * @returns {vec4} The transformed position in eye coordinates.
  3510. */
  3511. vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth)
  3512. {
  3513. vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw;
  3514. return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth);
  3515. }
  3516. `;var nNt=T(S(),1),OG=`// emulated noperspective
  3517. #if !defined(LOG_DEPTH)
  3518. in float v_WindowZ;
  3519. #endif
  3520. /**
  3521. * Emulates GL_DEPTH_CLAMP. Clamps a fragment to the near and far plane
  3522. * by writing the fragment's depth. See czm_depthClamp for more details.
  3523. *
  3524. * @name czm_writeDepthClamp
  3525. * @glslFunction
  3526. *
  3527. * @example
  3528. * out_FragColor = color;
  3529. * czm_writeDepthClamp();
  3530. *
  3531. * @see czm_depthClamp
  3532. */
  3533. void czm_writeDepthClamp()
  3534. {
  3535. #if (!defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
  3536. gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0);
  3537. #endif
  3538. }
  3539. `;var oNt=T(S(),1),YG=`#ifdef LOG_DEPTH
  3540. in float v_depthFromNearPlusOne;
  3541. #ifdef POLYGON_OFFSET
  3542. uniform vec2 u_polygonOffset;
  3543. #endif
  3544. #endif
  3545. /**
  3546. * Writes the fragment depth to the logarithmic depth buffer.
  3547. * <p>
  3548. * Use this when the vertex shader does not call {@link czm_vertexLogDepth}, for example, when
  3549. * ray-casting geometry using a full screen quad.
  3550. * </p>
  3551. * @name czm_writeLogDepth
  3552. * @glslFunction
  3553. *
  3554. * @param {float} depth The depth coordinate, where 1.0 is on the near plane and
  3555. * depth increases in eye-space units from there
  3556. *
  3557. * @example
  3558. * czm_writeLogDepth((czm_projection * v_positionEyeCoordinates).w + 1.0);
  3559. */
  3560. void czm_writeLogDepth(float depth)
  3561. {
  3562. #if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
  3563. // Discard the vertex if it's not between the near and far planes.
  3564. // We allow a bit of epsilon on the near plane comparison because a 1.0
  3565. // from the vertex shader (indicating the vertex should be _on_ the near
  3566. // plane) will not necessarily come here as exactly 1.0.
  3567. if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) {
  3568. discard;
  3569. }
  3570. #ifdef POLYGON_OFFSET
  3571. // Polygon offset: m * factor + r * units
  3572. float factor = u_polygonOffset[0];
  3573. float units = u_polygonOffset[1];
  3574. #if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
  3575. // This factor doesn't work in IE 10
  3576. if (factor != 0.0) {
  3577. // m = sqrt(dZdX^2 + dZdY^2);
  3578. float x = dFdx(depth);
  3579. float y = dFdy(depth);
  3580. float m = sqrt(x * x + y * y);
  3581. // Apply the factor before computing the log depth.
  3582. depth += m * factor;
  3583. }
  3584. #endif
  3585. #endif
  3586. gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne;
  3587. #ifdef POLYGON_OFFSET
  3588. // Apply the units after the log depth.
  3589. gl_FragDepth += czm_epsilon7 * units;
  3590. #endif
  3591. #endif
  3592. }
  3593. /**
  3594. * Writes the fragment depth to the logarithmic depth buffer.
  3595. * <p>
  3596. * Use this when the vertex shader calls {@link czm_vertexLogDepth}.
  3597. * </p>
  3598. *
  3599. * @name czm_writeLogDepth
  3600. * @glslFunction
  3601. */
  3602. void czm_writeLogDepth() {
  3603. #ifdef LOG_DEPTH
  3604. czm_writeLogDepth(v_depthFromNearPlusOne);
  3605. #endif
  3606. }
  3607. `;var sNt=T(S(),1),HG=`/**
  3608. * Transforms a value for non-perspective interpolation by multiplying
  3609. * it by w, the value used in the perspective divide. This function is
  3610. * intended to be called in a vertex shader to compute the value of a
  3611. * \`varying\` that should not be subject to perspective interpolation.
  3612. * For example, screen-space texture coordinates. The fragment shader
  3613. * must call {@link czm_readNonPerspective} to retrieve the final
  3614. * non-perspective value.
  3615. *
  3616. * @name czm_writeNonPerspective
  3617. * @glslFunction
  3618. *
  3619. * @param {float|vec2|vec3|vec4} value The value to be interpolated without accounting for perspective.
  3620. * @param {float} w The perspective divide value. Usually this is the computed \`gl_Position.w\`.
  3621. * @returns {float|vec2|vec3|vec4} The transformed value, intended to be stored in a \`varying\` and read in the
  3622. * fragment shader with {@link czm_readNonPerspective}.
  3623. */
  3624. float czm_writeNonPerspective(float value, float w) {
  3625. return value * w;
  3626. }
  3627. vec2 czm_writeNonPerspective(vec2 value, float w) {
  3628. return value * w;
  3629. }
  3630. vec3 czm_writeNonPerspective(vec3 value, float w) {
  3631. return value * w;
  3632. }
  3633. vec4 czm_writeNonPerspective(vec4 value, float w) {
  3634. return value * w;
  3635. }
  3636. `;var mx={czm_degreesPerRadian:xR,czm_depthRange:_R,czm_epsilon1:TR,czm_epsilon2:SR,czm_epsilon3:CR,czm_epsilon4:VR,czm_epsilon5:LR,czm_epsilon6:RR,czm_epsilon7:ZR,czm_infinity:GR,czm_oneOverPi:ER,czm_oneOverTwoPi:IR,czm_passCesium3DTile:XR,czm_passCesium3DTileClassification:WR,czm_passCesium3DTileClassificationIgnoreShow:PR,czm_passClassification:vR,czm_passCompute:wR,czm_passEnvironment:FR,czm_passGlobe:AR,czm_passOpaque:MR,czm_passOverlay:NR,czm_passTerrainClassification:kR,czm_passTranslucent:UR,czm_passVoxels:DR,czm_pi:BR,czm_piOverFour:OR,czm_piOverSix:YR,czm_piOverThree:HR,czm_piOverTwo:zR,czm_radiansPerDegree:KR,czm_sceneMode2D:JR,czm_sceneMode3D:QR,czm_sceneModeColumbusView:jR,czm_sceneModeMorphing:qR,czm_solarRadius:$R,czm_threePiOver2:eZ,czm_twoPi:tZ,czm_webMercatorMaxLatitude:nZ,czm_depthRangeStruct:iZ,czm_material:oZ,czm_materialInput:rZ,czm_modelMaterial:sZ,czm_modelVertexOutput:aZ,czm_ray:cZ,czm_raySegment:lZ,czm_shadowParameters:dZ,czm_HSBToRGB:uZ,czm_HSLToRGB:mZ,czm_RGBToHSB:hZ,czm_RGBToHSL:fZ,czm_RGBToXYZ:pZ,czm_XYZToRGB:bZ,czm_acesTonemapping:gZ,czm_alphaWeight:yZ,czm_antialias:xZ,czm_applyHSBShift:_Z,czm_approximateSphericalCoordinates:TZ,czm_approximateTanh:SZ,czm_backFacing:CZ,czm_branchFreeTernary:VZ,czm_cascadeColor:LZ,czm_cascadeDistance:RZ,czm_cascadeMatrix:ZZ,czm_cascadeWeights:GZ,czm_clipPolygons:EZ,czm_columbusViewMorph:IZ,czm_computeAtmosphereColor:XZ,czm_computeGroundAtmosphereScattering:WZ,czm_computePosition:PZ,czm_computeScattering:vZ,czm_cosineAndSine:wZ,czm_decompressTextureCoordinates:FZ,czm_depthClamp:AZ,czm_eastNorthUpToEyeCoordinates:MZ,czm_ellipsoidContainsPoint:NZ,czm_ellipsoidTextureCoordinates:kZ,czm_equalsEpsilon:UZ,czm_eyeOffset:DZ,czm_eyeToWindowCoordinates:BZ,czm_fastApproximateAtan:OZ,czm_fog:YZ,czm_gammaCorrect:HZ,czm_geodeticSurfaceNormal:zZ,czm_getDefaultMaterial:KZ,czm_getDynamicAtmosphereLightDirection:JZ,czm_getLambertDiffuse:QZ,czm_getSpecular:jZ,czm_getWaterNoise:qZ,czm_hue:$Z,czm_inverseGamma:eG,czm_isEmpty:tG,czm_isFull:nG,czm_latitudeToWebMercatorFraction:iG,czm_lineDistance:oG,czm_linearToSrgb:rG,czm_luminance:sG,czm_maximumComponent:aG,czm_metersPerPixel:cG,czm_modelToWindowCoordinates:lG,czm_multiplyWithColorBalance:dG,czm_nearFarScalar:uG,czm_octDecode:mG,czm_packDepth:hG,czm_pbrLighting:fG,czm_pbrNeutralTonemapping:pG,czm_phong:bG,czm_planeDistance:gG,czm_pointAlongRay:yG,czm_rayEllipsoidIntersectionInterval:xG,czm_raySphereIntersectionInterval:_G,czm_readDepth:TG,czm_readNonPerspective:SG,czm_reverseLogDepth:CG,czm_round:VG,czm_saturation:LG,czm_shadowDepthCompare:RG,czm_shadowVisibility:ZG,czm_signNotZero:GG,czm_sphericalHarmonics:EG,czm_srgbToLinear:IG,czm_tangentToEyeSpaceMatrix:XG,czm_textureCube:WG,czm_transformPlane:PG,czm_translateRelativeToEye:vG,czm_translucentPhong:wG,czm_transpose:FG,czm_unpackClippingExtents:AG,czm_unpackDepth:MG,czm_unpackFloat:NG,czm_unpackUint:kG,czm_valueTransform:UG,czm_vertexLogDepth:DG,czm_windowToEyeCoordinates:BG,czm_writeDepthClamp:OG,czm_writeLogDepth:YG,czm_writeNonPerspective:HG};var Mkt=T(S(),1);function nGe(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/\n\s*(in)\s+(vec\d|mat\d|float)/g,`
  3637. varying $2`),/out_FragData_(\d+)/.test(n)&&(n=`#extension GL_EXT_draw_buffers : enable
  3638. ${n}`,n=n.replaceAll(/layout\s+\(location\s*=\s*\d+\)\s*out\s+vec4\s+out_FragData_\d+;/g,""),n=n.replaceAll(/out_FragData_(\d+)/g,"gl_FragData[$1]")),n=n.replaceAll(/layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,""),n=n.replaceAll(/out_FragColor/g,"gl_FragColor"),n=n.replaceAll(/out_FragColor\[(\d+)\]/g,"gl_FragColor[$1]"),/gl_FragDepth/.test(n)&&(n=`#extension GL_EXT_frag_depth : enable
  3639. ${n}`,n=n.replaceAll(/gl_FragDepth/g,"gl_FragDepthEXT")),n=`#ifdef GL_EXT_shader_texture_lod
  3640. #extension GL_EXT_shader_texture_lod : enable
  3641. #endif
  3642. ${n}`,n=`#ifdef GL_OES_standard_derivatives
  3643. #extension GL_OES_standard_derivatives : enable
  3644. #endif
  3645. ${n}`):(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"attribute $2"),n=n.replaceAll(/(out)\s+(vec\d|mat\d|float)\s+([\w]+);/g,"varying $2 $3;")),n=`#version 100
  3646. ${n}`,n}var zG=nGe;function bte(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let o=0;o<n;++o)i+=`
  3647. `;return i})}function gte(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return l(i)||(t=bte(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function yte(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);l(n)&&n!==null&&(n=n.filter(function(i,o){return n.indexOf(i)===o}),n.forEach(function(i){if(i!==e.name&&Fs._czmBuiltinsAndUniforms.hasOwnProperty(i)){let o=gte(i,Fs._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(o),o.requiredBy.push(e),yte(o,t)}}))}function iGe(e){let t=[],n=[];for(;e.length>0;){let o=e.pop();n.push(o),o.requiredBy.length===0&&t.push(o)}for(;t.length>0;){let o=t.shift();e.push(o);for(let r=0;r<o.dependsOn.length;++r){let s=o.dependsOn[r],a=s.requiredBy.indexOf(o);s.requiredBy.splice(a,1),s.requiredBy.length===0&&t.push(s)}}let i=[];for(let o=0;o<n.length;++o)n[o].requiredBy.length!==0&&i.push(n[o])}function oGe(e){let t=[],n=gte("main",e,t);yte(n,t),iGe(t);let i="";for(let o=t.length-1;o>=0;--o)i=`${i+t[o].glslSource}
  3648. `;return i.replace(n.glslSource,"")}function xte(e,t,n){let i,o,r="",s=e.sources;if(l(s))for(i=0,o=s.length;i<o;++i)r+=`
  3649. #line 0
  3650. ${s[i]}`;r=bte(r);let a;r=r.replace(/#version\s+(.*?)\n/gm,function(x,_){return a=_,`
  3651. `});let c=[];r=r.replace(/#extension.*\n/gm,function(x){return c.push(x),`
  3652. `}),r=r.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");let d=e.pickColorQualifier;l(d)&&(r=Fs.createPickFragmentShaderSource(r,d));let u="",m=c.length;for(i=0;i<m;i++)u+=c[i];t&&(u+=`#ifdef GL_FRAGMENT_PRECISION_HIGH
  3653. precision highp float;
  3654. precision highp int;
  3655. #else
  3656. precision mediump float;
  3657. precision mediump int;
  3658. #define highp mediump
  3659. #endif
  3660. `);let p=e.defines;if(l(p))for(i=0,o=p.length;i<o;++i){let x=p[i];x.length!==0&&(u+=`#define ${x}
  3661. `)}n.textureFloatLinear&&(u+=`#define OES_texture_float_linear
  3662. `),n.floatingPointTexture&&(u+=`#define OES_texture_float
  3663. `);let g="";e.includeBuiltIns&&(g=oGe(r)),u+=`
  3664. #line 0
  3665. `;let f=g+r;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(f)&&!/czm_out_FragColor/g.test(f)&&/out_FragColor/g.test(f)&&(u+=`layout(location = 0) out vec4 out_FragColor;
  3666. `),u+=g,u+=r,n.webgl2?u=`#version 300 es
  3667. ${u}`:u=zG(u,t),u}function Fs(e){e=y(e,y.EMPTY_OBJECT);let t=e.pickColorQualifier;this.defines=l(e.defines)?e.defines.slice(0):[],this.sources=l(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=y(e.includeBuiltIns,!0)}Fs.prototype.clone=function(){return new Fs({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};Fs.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};Fs.prototype.getCacheKey=function(){let t=this.defines.slice().sort().join(","),n=this.pickColorQualifier,i=this.includeBuiltIns,o=this.sources.join(`
  3668. `);return`${t}:${n}:${i}:${o}`};Fs.prototype.createCombinedVertexShader=function(e){return xte(this,!1,e)};Fs.prototype.createCombinedFragmentShader=function(e){return xte(this,!0,e)};Fs._czmBuiltinsAndUniforms={};for(let e in mx)mx.hasOwnProperty(e)&&(Fs._czmBuiltinsAndUniforms[e]=mx[e]);for(let e in dp)if(dp.hasOwnProperty(e)){let t=dp[e];typeof t.getDeclaration=="function"&&(Fs._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}Fs.createPickVertexShaderSource=function(e){return`${Fs.replaceMain(e,"czm_old_main")}
  3669. in vec4 pickColor;
  3670. out vec4 czm_pickColor;
  3671. void main()
  3672. {
  3673. czm_old_main();
  3674. czm_pickColor = pickColor;
  3675. }`};Fs.createPickFragmentShaderSource=function(e,t){let n=Fs.replaceMain(e,"czm_old_main"),i=`${t} vec4 czm_pickColor;
  3676. void main()
  3677. {
  3678. czm_old_main();
  3679. if (out_FragColor.a == 0.0) {
  3680. discard;
  3681. }
  3682. out_FragColor = czm_pickColor;
  3683. }`;return`${n}
  3684. ${i}`};function rGe(e,t){let n=e.defines,i=n.length;for(let o=0;o<i;++o)if(n[o]===t)return!0;return!1}function _te(e,t){let n=e.sources,i=n.length;for(let o=0;o<i;++o)if(n[o].indexOf(t)!==-1)return!0;return!1}function Tte(e,t){let n=t.length;for(let i=0;i<n;++i){let o=t[i];if(_te(e,o))return o}}var sGe=["v_normalEC","v_normal"];Fs.findNormalVarying=function(e){return _te(e,"#ifdef HAS_NORMALS")?rGe(e,"HAS_NORMALS")?"v_normalEC":void 0:Tte(e,sGe)};var aGe=["v_positionEC"];Fs.findPositionVarying=function(e){return Tte(e,aGe)};var De=Fs;function Sm(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(Sm.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});Sm.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function cGe(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}Sm.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new De({sources:[t]})),typeof n=="string"&&(n=new De({sources:[n]}));let o=t.getCacheKey(),r=n.getCacheKey(),s=l(i)?cGe(i):"",a=`${o}:${r}:${s}`,c;if(l(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let d=this._context,u=t.createCombinedVertexShader(d),m=n.createCombinedFragmentShader(d),p=new tn({gl:d._gl,logShaderCompilation:d.logShaderCompilation,debugShaders:d.debugShaders,vertexShaderSource:t,vertexShaderText:u,fragmentShaderSource:n,fragmentShaderText:m,attributeLocations:i});c={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0},p._cachedShader=c,this._shaders[a]=c,++this._numberOfShaders}return++c.count,c.shaderProgram};Sm.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(l(r)){_Y(this,r);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};Sm.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};Sm.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof r=="string"&&(r=new De({sources:[r]})),typeof s=="string"&&(s=new De({sources:[s]}));let c=this._context,d=r.createCombinedVertexShader(c),u=s.createCombinedFragmentShader(c),m=new tn({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:d,fragmentShaderSource:s,fragmentShaderText:u,attributeLocations:a}),p={cache:this,shaderProgram:m,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),m._cachedShader=p,this._shaders[o]=p,m};function _Y(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;o<i;++o){let r=n[o]+t.keyword,s=e._shaders[r];_Y(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}Sm.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];_Y(this,n),--this._numberOfShaders}this._shadersToRelease={}};Sm.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};Sm.prototype.isDestroyed=function(){return!1};Sm.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return me(this)};var KG=Sm;var dUt=T(S(),1);function Cm(e){e=y(e,y.EMPTY_OBJECT);let{context:t,source:n,pixelFormat:i=ot.RGBA,pixelDatatype:o=qe.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new en}=e,{width:c,height:d}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(d)||(d=n.videoHeight??n.naturalHeight??n.height));let u=e.preMultiplyAlpha||i===ot.RGB||i===ot.LUMINANCE,m=ot.toInternalFormat(i,o,t),p=ot.isCompressedFormat(m),g=t._gl,f=p?ot.compressedTextureSizeInBytes(i,c,d):ot.textureSizeInBytes(i,o,c,d);this._id=Bn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=g.TEXTURE_2D,this._texture=g.createTexture(),this._internalFormat=m,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=d,this._dimensions=new D(c,d),this._hasMipmap=!1,this._sizeInBytes=f,this._preMultiplyAlpha=u,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,Ste(this,a),g.activeTexture(g.TEXTURE0),g.bindTexture(this._textureTarget,this._texture),l(n)?(s?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),l(n.arrayBufferView)?ot.isCompressedFormat(m)?lGe(this,n):dGe(this,n):l(n.framebuffer)?uGe(this,n):mGe(this,n),this._initialized=!0):hGe(this),g.bindTexture(this._textureTarget,null)}function lGe(e,t){let i=e._context._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a}=e;if(i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.compressedTexImage2D(o,0,r,s,a,0,t.arrayBufferView),l(t.mipLevels)){let c=s,d=a;for(let u=0;u<t.mipLevels.length;++u)c=DN(c),d=DN(d),i.compressedTexImage2D(o,u+1,r,c,d,0,t.mipLevels[u])}}function dGe(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a,pixelFormat:c,pixelDatatype:d,flipY:u}=e,m=ot.alignmentInBytes(c,d,s);i.pixelStorei(i.UNPACK_ALIGNMENT,m),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let p=t.arrayBufferView;if(u&&(p=ot.flipY(p,c,d,s,a)),i.texImage2D(o,0,r,s,a,0,c,qe.toWebGLConstant(d,n),p),l(t.mipLevels)){let g=s,f=a;for(let x=0;x<t.mipLevels.length;++x)g=DN(g),f=DN(f),i.texImage2D(o,x+1,r,g,f,0,c,qe.toWebGLConstant(d,n),t.mipLevels[x])}}function uGe(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._bind(),i.copyTexImage2D(e._textureTarget,0,e._internalFormat,t.xOffset,t.yOffset,e.width,e.height,0),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._unBind()}function mGe(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,e.flipY),i.texImage2D(e._textureTarget,0,e._internalFormat,e.pixelFormat,qe.toWebGLConstant(e.pixelDatatype,n),t)}function DN(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function hGe(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,qe.toWebGLConstant(e._pixelDatatype,t),null)}Cm.create=function(e){return new Cm(e)};Cm.fromFramebuffer=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.context,n=t._gl,{pixelFormat:i=ot.RGB,framebufferXOffset:o=0,framebufferYOffset:r=0,width:s=n.drawingBufferWidth,height:a=n.drawingBufferHeight,framebuffer:c}=e;return new Cm({context:t,width:s,height:a,pixelFormat:i,source:{framebuffer:l(c)?c:t.defaultFramebuffer,xOffset:o,yOffset:r,width:s,height:a}})};Object.defineProperties(Cm.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){Ste(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function Ste(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[$t.NEAREST_MIPMAP_NEAREST,$t.NEAREST_MIPMAP_LINEAR,$t.LINEAR_MIPMAP_NEAREST,$t.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===qe.FLOAT&&!r.textureFloatLinear||a===qe.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?$t.NEAREST_MIPMAP_NEAREST:$t.NEAREST,i=hi.NEAREST),r.webgl2&&ot.isDepthFormat(s)&&(n=$t.NEAREST,i=hi.NEAREST);let c=r._gl,d=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(d,e._texture),c.texParameteri(d,c.TEXTURE_MIN_FILTER,n),c.texParameteri(d,c.TEXTURE_MAG_FILTER,i),c.texParameteri(d,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(d,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(d,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(d,null)}Cm.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,r=this._context,s=r._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:d}=i,u=i.arrayBufferView;l(i.videoWidth)&&l(i.videoHeight)?(c=i.videoWidth,d=i.videoHeight):l(i.naturalWidth)&&l(i.naturalHeight)&&(c=i.naturalWidth,d=i.naturalHeight);let m=this._width,p=this._height,g=this._internalFormat,f=this._pixelFormat,x=this._pixelDatatype,_=this._preMultiplyAlpha,C=this._flipY,V=4;l(u)&&(V=ot.alignmentInBytes(f,x,c)),s.pixelStorei(s.UNPACK_ALIGNMENT,V),o?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let L=!1;if(!this._initialized){let Z;t===0&&n===0&&c===m&&d===p?(l(u)?(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),C?Z=ot.flipY(u,f,x,m,p):Z=u):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,C),Z=i),L=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),Z=ot.createTypedArray(f,x,m,p)),s.texImage2D(a,0,g,m,p,0,f,qe.toWebGLConstant(x,r),Z),this._initialized=!0}if(!L){let Z;l(u)?(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),C?Z=ot.flipY(u,f,x,c,d):Z=u):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,C),Z=i),s.texSubImage2D(a,0,t,n,c,d,f,qe.toWebGLConstant(x,r),Z)}s.bindTexture(a,null)};Cm.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=y(e,0),t=y(t,0),n=y(n,0),i=y(i,0),o=y(o,this._width),r=y(r,this._height);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(a,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};Cm.prototype.generateMipmap=function(e){e=y(e,Qh.DONT_CARE),this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};Cm.prototype.isDestroyed=function(){return!1};Cm.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),me(this)};var Pt=Cm;var fUt=T(S(),1);function hx(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(hx.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});hx.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};hx.prototype.addTexture=function(e,t){let n={texture:t,count:1};t.finalDestroy=t.destroy;let i=this;t.destroy=function(){--n.count===0&&(i._texturesToRelease[e]=n)},this._textures[e]=n,++this._numberOfTextures};hx.prototype.destroyReleasedTextures=function(){let e=this._texturesToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];delete this._textures[t],n.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}};hx.prototype.isDestroyed=function(){return!1};hx.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return me(this)};var JG=hx;var yDt=T(S(),1);var AUt=T(S(),1);var XUt=T(S(),1);var SUt=T(S(),1);function hu(e){this.planes=y(e,[])}var QG=[new h,new h,new h];h.clone(h.UNIT_X,QG[0]);h.clone(h.UNIT_Y,QG[1]);h.clone(h.UNIT_Z,QG[2]);var W0=new h,fGe=new h,Cte=new ln(new h(1,0,0),0);hu.fromBoundingSphere=function(e,t){l(t)||(t=new hu);let n=QG.length,i=t.planes;i.length=2*n;let o=e.center,r=e.radius,s=0;for(let a=0;a<n;++a){let c=QG[a],d=i[s],u=i[s+1];l(d)||(d=i[s]=new se),l(u)||(u=i[s+1]=new se),h.multiplyByScalar(c,-r,W0),h.add(o,W0,W0),d.x=c.x,d.y=c.y,d.z=c.z,d.w=-h.dot(c,W0),h.multiplyByScalar(c,r,W0),h.add(o,W0,W0),u.x=-c.x,u.y=-c.y,u.z=-c.z,u.w=-h.dot(h.negate(c,fGe),W0),s+=2}return t};hu.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,o=t.length;i<o;++i){let r=e.intersectPlane(ln.fromCartesian4(t[i],Cte));if(r===Jt.OUTSIDE)return Jt.OUTSIDE;r===Jt.INTERSECTING&&(n=!0)}return n?Jt.INTERSECTING:Jt.INSIDE};hu.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===hu.MASK_OUTSIDE||t===hu.MASK_INSIDE)return t;let n=hu.MASK_INSIDE,i=this.planes;for(let o=0,r=i.length;o<r;++o){let s=o<31?1<<o:0;if(o<31&&!(t&s))continue;let a=e.intersectPlane(ln.fromCartesian4(i[o],Cte));if(a===Jt.OUTSIDE)return hu.MASK_OUTSIDE;a===Jt.INTERSECTING&&(n|=s)}return n};hu.MASK_OUTSIDE=4294967295;hu.MASK_INSIDE=0;hu.MASK_INDETERMINATE=2147483647;var ms=hu;function jh(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new ms,this._orthographicMatrix=new M}function Vte(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=M.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(jh.prototype,{projectionMatrix:{get:function(){return Vte(this),this._orthographicMatrix}}});var pGe=new h,bGe=new h,gGe=new h,TY=new h;jh.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,d=this.far,u=h.cross(t,n,pGe);h.normalize(u,u);let m=bGe;h.multiplyByScalar(t,c,m),h.add(e,m,m);let p=gGe;h.multiplyByScalar(u,a,p),h.add(m,p,p);let g=i[0];return l(g)||(g=i[0]=new se),g.x=u.x,g.y=u.y,g.z=u.z,g.w=-h.dot(u,p),h.multiplyByScalar(u,s,p),h.add(m,p,p),g=i[1],l(g)||(g=i[1]=new se),g.x=-u.x,g.y=-u.y,g.z=-u.z,g.w=-h.dot(h.negate(u,TY),p),h.multiplyByScalar(n,r,p),h.add(m,p,p),g=i[2],l(g)||(g=i[2]=new se),g.x=n.x,g.y=n.y,g.z=n.z,g.w=-h.dot(n,p),h.multiplyByScalar(n,o,p),h.add(m,p,p),g=i[3],l(g)||(g=i[3]=new se),g.x=-n.x,g.y=-n.y,g.z=-n.z,g.w=-h.dot(h.negate(n,TY),p),g=i[4],l(g)||(g=i[4]=new se),g.x=t.x,g.y=t.y,g.z=t.z,g.w=-h.dot(t,m),h.multiplyByScalar(t,d,p),h.add(e,p,p),g=i[5],l(g)||(g=i[5]=new se),g.x=-t.x,g.y=-t.y,g.z=-t.z,g.w=-h.dot(h.negate(t,TY),p),this._cullingVolume};jh.prototype.getPixelDimensions=function(e,t,n,i,o){Vte(this);let r=this.right-this.left,s=this.top-this.bottom,a=i*r/e,c=i*s/t;return o.x=a,o.y=c,o};jh.prototype.clone=function(e){return l(e)||(e=new jh),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};jh.prototype.equals=function(e){return l(e)&&e instanceof jh&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};jh.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof jh&&W.equalsEpsilon(this.right,e.right,t,n)&&W.equalsEpsilon(this.left,e.left,t,n)&&W.equalsEpsilon(this.top,e.top,t,n)&&W.equalsEpsilon(this.bottom,e.bottom,t,n)&&W.equalsEpsilon(this.near,e.near,t,n)&&W.equalsEpsilon(this.far,e.far,t,n)};var Pr=jh;function Tl(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new Pr,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far}Tl.packedLength=4;Tl.pack=function(e,t,n){return n=y(n,0),t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};Tl.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Tl),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function P0(e){let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(Tl.prototype,{projectionMatrix:{get:function(){return P0(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return P0(this),this._offCenterFrustum}}});Tl.prototype.computeCullingVolume=function(e,t,n){return P0(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Tl.prototype.getPixelDimensions=function(e,t,n,i,o){return P0(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Tl.prototype.clone=function(e){return l(e)||(e=new Tl),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};Tl.prototype.equals=function(e){return!l(e)||!(e instanceof Tl)?!1:(P0(this),P0(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Tl.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Tl)?!1:(P0(this),P0(e),W.equalsEpsilon(this.width,e.width,t,n)&&W.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var an=Tl;var HUt=T(S(),1);var SY={};function yGe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var xGe=32.184,_Ge=2451545;function Bte(e,t){t=j.addSeconds(e,xGe,t);let n=j.totalDays(t)-_Ge;return t=j.addSeconds(t,yGe(n),t),t}var BN=new j(2451545,0,Hn.TAI),TGe=1e3,fu=W.RADIANS_PER_DEGREE,sd=W.RADIANS_PER_ARCSECOND,Za=14959787e4,Lte=new $;function Ote(e,t,n,i,o,r,s){n<0&&(n=-n,o+=W.PI);let a=e*(1-t),c=i-o,d=o,u=CGe(r-i,t),m=SGe(t,0);GGe(c,n,d,Lte);let p=a*(1+t),g=Math.cos(u),f=Math.sin(u),x=1+t*g,_=p/x;return l(s)?(s.x=_*g,s.y=_*f,s.z=0):s=new h(_*g,_*f,0),$.multiplyByVector(Lte,s,s)}function SGe(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function CGe(e,t){let n=RGe(e,t);return ZGe(n,t)}var VGe=50,LGe=W.EPSILON8;function RGe(e,t){let n=Math.floor(e/W.TWO_PI);e-=n*W.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),o=Number.MAX_VALUE,r;for(r=0;r<VGe&&Math.abs(o-i)>LGe;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}return o=i+n*W.TWO_PI,o}function ZGe(e,t){let n=Math.floor(e/W.TWO_PI);e-=n*W.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=W.zeroToTwoPi(r),e<0&&(r-=W.TWO_PI),r+=n*W.TWO_PI,r}function GGe(e,t,n,i){let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),d=Math.sin(n);return l(i)?(i[0]=c*o-d*r*s,i[1]=d*o+c*r*s,i[2]=r*a,i[3]=-c*r-d*o*s,i[4]=-d*r+c*o*s,i[5]=o*a,i[6]=d*a,i[7]=-c*a,i[8]=s):i=new $(c*o-d*r*s,-c*r-d*o*s,d*a,d*o+c*r*s,-d*r+c*o*s,-c*a,r*a,o*a,s),i}var EGe=1.0000010178*Za,IGe=100.46645683*fu,XGe=129597742283429e-5*sd,Rte=16002,Zte=21863,Gte=32004,Ete=10931,Ite=14529,Xte=16368,Wte=15318,Pte=32794,WGe=64*1e-7*Za,PGe=-152*1e-7*Za,vGe=62*1e-7*Za,wGe=-8*1e-7*Za,FGe=32*1e-7*Za,AGe=-41*1e-7*Za,MGe=19*1e-7*Za,NGe=-11*1e-7*Za,kGe=-150*1e-7*Za,UGe=-46*1e-7*Za,DGe=68*1e-7*Za,BGe=54*1e-7*Za,OGe=14*1e-7*Za,YGe=24*1e-7*Za,HGe=-28*1e-7*Za,zGe=22*1e-7*Za,vte=10,wte=16002,Fte=21863,Ate=10931,Mte=1473,Nte=32004,kte=4387,Ute=73,KGe=-325*1e-7,JGe=-322*1e-7,QGe=-79*1e-7,jGe=232*1e-7,qGe=-52*1e-7,$Ge=97*1e-7,eEe=55*1e-7,tEe=-41*1e-7,nEe=-105*1e-7,iEe=-137*1e-7,oEe=258*1e-7,rEe=35*1e-7,sEe=-116*1e-7,aEe=-88*1e-7,cEe=-112*1e-7,lEe=-80*1e-7,HS=new j(0,0,Hn.TAI);function dEe(e,t){Bte(e,HS);let i=(HS.dayNumber-BN.dayNumber+(HS.secondsOfDay-BN.secondsOfDay)/zn.SECONDS_PER_DAY)/(zn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=EGe+WGe*Math.cos(Rte*o)+kGe*Math.sin(Rte*o)+PGe*Math.cos(Zte*o)+UGe*Math.sin(Zte*o)+vGe*Math.cos(Gte*o)+DGe*Math.sin(Gte*o)+wGe*Math.cos(Ete*o)+BGe*Math.sin(Ete*o)+FGe*Math.cos(Ite*o)+OGe*Math.sin(Ite*o)+AGe*Math.cos(Xte*o)+YGe*Math.sin(Xte*o)+MGe*Math.cos(Wte*o)+HGe*Math.sin(Wte*o)+NGe*Math.cos(Pte*o)+zGe*Math.sin(Pte*o),s=IGe+XGe*i+KGe*Math.cos(vte*o)+nEe*Math.sin(vte*o)+JGe*Math.cos(wte*o)+iEe*Math.sin(wte*o)+QGe*Math.cos(Fte*o)+oEe*Math.sin(Fte*o)+jGe*Math.cos(Ate*o)+rEe*Math.sin(Ate*o)+qGe*Math.cos(Mte*o)+sEe*Math.sin(Mte*o)+$Ge*Math.cos(Nte*o)+aEe*Math.sin(Nte*o)+eEe*Math.cos(kte*o)+cEe*Math.sin(kte*o)+tEe*Math.cos(Ute*o)+lEe*Math.sin(Ute*o),a=.0167086342-.0004203654*i,c=102.93734808*fu+11612.3529*sd*i,d=469.97289*sd*i,u=174.87317577*fu-8679.27034*sd*i;return Ote(r,a,d,c,u,s,t)}function Yte(e,t){Bte(e,HS);let i=(HS.dayNumber-BN.dayNumber+(HS.secondsOfDay-BN.secondsOfDay)/zn.SECONDS_PER_DAY)/zn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,d=5.15668983*fu,u=-8e-5*i+.02966*o-42e-6*r-13e-8*s,m=83.35324312*fu,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,g=125.04455501*fu,f=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,x=218.31664563*fu,_=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,C=297.85019547*fu+sd*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),V=93.27209062*fu+sd*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),L=134.96340251*fu+sd*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),Z=357.52910918*fu+sd*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),G=310.17137918*fu-sd*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),I=2*C,v=4*C,P=6*C,w=2*L,F=3*L,b=4*L,R=2*V;a+=3400.4*Math.cos(I)-635.6*Math.cos(I-L)-235.6*Math.cos(L)+218.1*Math.cos(I-Z)+181*Math.cos(I+L),c+=.014216*Math.cos(I-L)+.008551*Math.cos(I-w)-.001383*Math.cos(L)+.001356*Math.cos(I+L)-.001147*Math.cos(v-F)-914e-6*Math.cos(v-w)+869e-6*Math.cos(I-Z-L)-627e-6*Math.cos(I)-394e-6*Math.cos(v-b)+282e-6*Math.cos(I-Z-w)-279e-6*Math.cos(C-L)-236e-6*Math.cos(w)+231e-6*Math.cos(v)+229e-6*Math.cos(P-b)-201e-6*Math.cos(w-R),u+=486.26*Math.cos(I-R)-40.13*Math.cos(I)+37.51*Math.cos(R)+25.73*Math.cos(w-R)+19.97*Math.cos(I-Z-R),p+=-55609*Math.sin(I-L)-34711*Math.sin(I-w)-9792*Math.sin(L)+9385*Math.sin(v-F)+7505*Math.sin(v-w)+5318*Math.sin(I+L)+3484*Math.sin(v-b)-3417*Math.sin(I-Z-L)-2530*Math.sin(P-b)-2376*Math.sin(I)-2075*Math.sin(I-F)-1883*Math.sin(w)-1736*Math.sin(P-5*L)+1626*Math.sin(Z)-1370*Math.sin(P-F),f+=-5392*Math.sin(I-R)-540*Math.sin(Z)-441*Math.sin(I)+423*Math.sin(R)-288*Math.sin(w-R),_+=-3332.9*Math.sin(I)+1197.4*Math.sin(I-L)-662.5*Math.sin(Z)+396.3*Math.sin(L)-218*Math.sin(I-Z);let E=2*G,X=3*G;u+=46.997*Math.cos(G)*i-.614*Math.cos(I-R+G)*i+.614*Math.cos(I-R-G)*i-.0297*Math.cos(E)*o-.0335*Math.cos(G)*o+.0012*Math.cos(I-R+E)*o-16e-5*Math.cos(G)*r+4e-5*Math.cos(X)*r+4e-5*Math.cos(E)*r;let A=2.116*Math.sin(G)*i-.111*Math.sin(I-R-G)*i-.0015*Math.sin(G)*o;p+=A,_+=A,f+=-520.77*Math.sin(G)*i+13.66*Math.sin(I-R+G)*i+1.12*Math.sin(I-G)*i-1.06*Math.sin(R-G)*i+.66*Math.sin(E)*o+.371*Math.sin(G)*o-.035*Math.sin(I-R+E)*o-.015*Math.sin(I-R+G)*o+.0014*Math.sin(G)*r-.0011*Math.sin(X)*r-9e-4*Math.sin(E)*r,a*=TGe;let N=d+u*sd,O=m+p*sd,U=x+_*sd,Y=g+f*sd;return Ote(a,c,N,O,Y,U,t)}var Dte=.012300034,uEe=Dte/(Dte+1)*-1;function mEe(e,t){return t=Yte(e,t),h.multiplyByScalar(t,uEe,t)}var Hte=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),jG=new h;SY.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=j.now()),l(t)||(t=new h),jG=dEe(e,jG),t=h.negate(jG,t),mEe(e,jG),h.subtract(t,jG,t),$.multiplyByVector(Hte,t,t),t};SY.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=j.now()),t=Yte(e,t),$.multiplyByVector(Hte,t,t),t};var v0=SY;var KUt=T(S(),1),ON={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};ON.getMorphTime=function(e){return e===ON.SCENE3D?1:e===ON.MORPHING?void 0:0};var oe=Object.freeze(ON);var qUt=T(S(),1);function hEe(e){e=y(e,y.EMPTY_OBJECT),this.color=B.clone(y(e.color,B.WHITE)),this.intensity=y(e.intensity,2)}var Tp=hEe;function zS(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new Ke,this._viewportCartesian4=new se,this._viewportDirty=!1,this._viewportOrthographicMatrix=M.clone(M.IDENTITY),this._viewportTransformation=M.clone(M.IDENTITY),this._model=M.clone(M.IDENTITY),this._view=M.clone(M.IDENTITY),this._inverseView=M.clone(M.IDENTITY),this._projection=M.clone(M.IDENTITY),this._infiniteProjection=M.clone(M.IDENTITY),this._entireFrustum=new D,this._currentFrustum=new D,this._frustumPlanes=new se,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=$.clone(M.IDENTITY),this._view3DDirty=!0,this._view3D=new M,this._inverseView3DDirty=!0,this._inverseView3D=new M,this._inverseModelDirty=!0,this._inverseModel=new M,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new $,this._viewRotation=new $,this._inverseViewRotation=new $,this._viewRotation3D=new $,this._inverseViewRotation3D=new $,this._inverseProjectionDirty=!0,this._inverseProjection=new M,this._modelViewDirty=!0,this._modelView=new M,this._modelView3DDirty=!0,this._modelView3D=new M,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new M,this._inverseModelViewDirty=!0,this._inverseModelView=new M,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new M,this._viewProjectionDirty=!0,this._viewProjection=new M,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new M,this._modelViewProjectionDirty=!0,this._modelViewProjection=new M,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new M,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new M,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new M,this._normalDirty=!0,this._normal=new $,this._normal3DDirty=!0,this._normal3D=new $,this._inverseNormalDirty=!0,this._inverseNormal=new $,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new $,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new On,this._cameraPosition=new h,this._sunPositionWC=new h,this._sunPositionColumbusView=new h,this._sunDirectionWC=new h,this._sunDirectionEC=new h,this._moonDirectionEC=new h,this._lightDirectionWC=new h,this._lightDirectionEC=new h,this._lightColor=new h,this._lightColorHdr=new h,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new h,this._cameraRight=new h,this._cameraUp=new h,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new D,this._eyeEllipsoidNormalEC=new h,this._eyeEllipsoidCurvature=new D,this._modelToEnu=new M,this._enuToModel=new M,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new B,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._fogVisualDensityScalar=void 0,this._fogMinimumBrightness=void 0,this._atmosphereHsbShift=void 0,this._atmosphereLightIntensity=void 0,this._atmosphereRayleighCoefficient=new h,this._atmosphereRayleighScaleHeight=new h,this._atmosphereMieCoefficient=new h,this._atmosphereMieScaleHeight=void 0,this._atmosphereMieAnisotropy=void 0,this._atmosphereDynamicLighting=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(zS.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!Ke.equals(e,this._viewport)){Ke.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return Kte(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Kte(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){M.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,M.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,M.getMatrix3(this.inverseModel,e),$.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return VY(this),this._view3D}},viewRotation:{get:function(){return VY(this),this._viewRotation}},viewRotation3D:{get:function(){return VY(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return jte(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return jte(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return VEe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return LEe(this),this._modelView}},modelView3D:{get:function(){return REe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return WEe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return ZEe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return GEe(this),this._inverseModelView3D}},viewProjection:{get:function(){return EEe(this),this._viewProjection}},inverseViewProjection:{get:function(){return IEe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return XEe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return PEe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return vEe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return wEe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return FEe(this),this._normal}},normal3D:{get:function(){return AEe(this),this._normal3D}},inverseNormal:{get:function(){return MEe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return NEe(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},eyeEllipsoidNormalEC:{get:function(){return this._eyeEllipsoidNormalEC}},eyeEllipsoidCurvature:{get:function(){return this._eyeEllipsoidCurvature}},modelToEnu:{get:function(){return this._modelToEnu}},enuToModel:{get:function(){return this._enuToModel}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return Qte(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return Qte(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},fogVisualDensityScalar:{get:function(){return this._fogVisualDensityScalar}},fogMinimumBrightness:{get:function(){return this._fogMinimumBrightness}},atmosphereHsbShift:{get:function(){return this._atmosphereHsbShift}},atmosphereLightIntensity:{get:function(){return this._atmosphereLightIntensity}},atmosphereRayleighCoefficient:{get:function(){return this._atmosphereRayleighCoefficient}},atmosphereRayleighScaleHeight:{get:function(){return this._atmosphereRayleighScaleHeight}},atmosphereMieCoefficient:{get:function(){return this._atmosphereMieCoefficient}},atmosphereMieScaleHeight:{get:function(){return this._atmosphereMieScaleHeight}},atmosphereMieAnisotropy:{get:function(){return this._atmosphereMieAnisotropy}},atmosphereDynamicLighting:{get:function(){return this._atmosphereDynamicLighting}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return y(this._ellipsoid,ne.default)}}});function fEe(e,t){M.clone(t,e._view),M.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function pEe(e,t){M.clone(t,e._inverseView),M.getMatrix3(t,e._inverseViewRotation)}function bEe(e,t){M.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function gEe(e,t){M.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var zte=new h,yEe=new M;function xEe(e,t){h.clone(t.positionWC,e._cameraPosition),h.clone(t.directionWC,e._cameraDirection),h.clone(t.rightWC,e._cameraRight),h.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,o=t.positionCartographic;if(l(o)?(e._eyeHeight=o.height,e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(o,e._eyeEllipsoidNormalEC),i=h.fromRadians(o.longitude,o.latitude,0,n,zte)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,zte)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=Ft.eastNorthUpToFixedFrame(i,n,yEe);e._enuToModel=M.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=M.inverseTransformation(e._enuToModel,e._modelToEnu),W.equalsEpsilon(n._radii.x,n._radii.y,W.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var CY=new $,_Ee=new he;function TEe(e,t){Ft.computeIcrfToCentralBodyFixedMatrix(t.time,CY);let n=v0.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(CY,n,n),h.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=v0.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(CY,n,n),$.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,_Ee);i.project(r,e._sunPositionColumbusView)}zS.prototype.updateCamera=function(e){fEe(this,e.viewMatrix),pEe(this,e.inverseViewMatrix),xEe(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==oe.SCENE2D&&e.frustum instanceof an};zS.prototype.updateFrustum=function(e){bEe(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&gEe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=W.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};zS.prototype.updatePass=function(e){this._pass=e};var SEe=[],CEe=new Tp;zS.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===oe.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),TEe(this,e);let n=y(e.light,CEe);n instanceof Tp?(this._lightDirectionWC=h.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=h.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=h.normalize(h.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=$.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=h.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=h.multiplyByScalar(o,n.intensity,o);let r=h.maximumComponent(o);r>1?h.divideByScalar(o,r,this._lightColor):h.clone(o,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=y(e.environmentMap,e.context.defaultCubeMap),this._sphericalHarmonicCoefficients=y(e.sphericalHarmonicCoefficients,SEe),this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let c=e.atmosphere;l(c)&&(this._atmosphereHsbShift=h.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=h.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=h.clone(c.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=c.mieScaleHeight,this._atmosphereMieAnisotropy=c.mieAnisotropy,this._atmosphereDynamicLighting=c.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=Ft.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let d=t.frustum.fov,u=this._viewport,m;l(d)?u.height>u.width?m=Math.tan(.5*d)*2/u.height:m=Math.tan(.5*d)*2/u.width:m=1/Math.max(u.width,u.height),this._geometricToleranceOverMeter=m*e.maximumScreenSpaceError,B.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function Kte(e){if(e._viewportDirty){let t=e._viewport;M.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),M.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function VEe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==oe.SCENE2D&&e._mode!==oe.MORPHING&&!e._orthographicIn3D?M.inverse(e._projection,e._inverseProjection):M.clone(M.ZERO,e._inverseProjection))}function LEe(e){e._modelViewDirty&&(e._modelViewDirty=!1,M.multiplyTransformation(e._view,e._model,e._modelView))}function REe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,M.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function ZEe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,M.inverse(e.modelView,e._inverseModelView))}function GEe(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,M.inverse(e.modelView3D,e._inverseModelView3D))}function EEe(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,M.multiply(e._projection,e._view,e._viewProjection))}function IEe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,M.inverse(e.viewProjection,e._inverseViewProjection))}function XEe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,M.multiply(e._projection,e.modelView,e._modelViewProjection))}function WEe(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function PEe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,M.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function vEe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,M.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function wEe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,M.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function FEe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;M.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function AEe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;M.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function MEe(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;M.getMatrix3(e.modelView,t),$.transpose(t,t)}}function NEe(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;M.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var Jte=new h;function Qte(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,M.multiplyByPoint(e.inverseModel,e._cameraPosition,Jte),On.fromCartesian(Jte,e._encodedCameraPositionMC))}var kEe=new h,UEe=new h,DEe=new h,BEe=new h,OEe=new he,YEe=new h,HEe=new M;function zEe(e,t,n,i,o,r,s,a){let c=kEe;c.x=e.y,c.y=e.z,c.z=e.x;let d=UEe;d.x=n.y,d.y=n.z,d.z=n.x;let u=DEe;u.x=i.y,u.y=i.z,u.z=i.x;let m=BEe;m.x=t.y,m.y=t.z,m.z=t.x,r===oe.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,OEe);p.longitude=W.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=W.clamp(p.latitude,-W.PI_OVER_TWO,W.PI_OVER_TWO);let g=s.ellipsoid,f=g.cartographicToCartesian(p,YEe),x=Ft.eastNorthUpToFixedFrame(f,g,HEe);return M.multiplyByPointAsVector(x,d,d),M.multiplyByPointAsVector(x,u,u),M.multiplyByPointAsVector(x,m,m),l(a)||(a=new M),a[0]=d.x,a[1]=u.x,a[2]=-m.x,a[3]=0,a[4]=d.y,a[5]=u.y,a[6]=-m.y,a[7]=0,a[8]=d.z,a[9]=u.z,a[10]=-m.z,a[11]=0,a[12]=-h.dot(d,f),a[13]=-h.dot(u,f),a[14]=h.dot(m,f),a[15]=1,a}function VY(e){e._view3DDirty&&(e._mode===oe.SCENE3D?M.clone(e._view,e._view3D):zEe(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),M.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function jte(e){e._inverseView3DDirty&&(M.inverseTransformation(e.view3D,e._inverseView3D),M.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var qG=zS;function ad(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0}=y(t,{});o.alpha=y(o.alpha,!1),o.stencil=y(o.stencil,!0),o.powerPreference=y(o.powerPreference,"high-performance");let s=l(n)?n(e,o):KEe(e,o,i),c=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=c,this._id=Bn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new KG(this),this._textureCache=new JG;let d=s;this._stencilBits=d.getParameter(d.STENCIL_BITS),Bt._maximumCombinedTextureImageUnits=d.getParameter(d.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Bt._maximumCubeMapSize=d.getParameter(d.MAX_CUBE_MAP_TEXTURE_SIZE),Bt._maximumFragmentUniformVectors=d.getParameter(d.MAX_FRAGMENT_UNIFORM_VECTORS),Bt._maximumTextureImageUnits=d.getParameter(d.MAX_TEXTURE_IMAGE_UNITS),Bt._maximumRenderbufferSize=d.getParameter(d.MAX_RENDERBUFFER_SIZE),Bt._maximumTextureSize=d.getParameter(d.MAX_TEXTURE_SIZE),Bt._maximumVaryingVectors=d.getParameter(d.MAX_VARYING_VECTORS),Bt._maximumVertexAttributes=d.getParameter(d.MAX_VERTEX_ATTRIBS),Bt._maximumVertexTextureImageUnits=d.getParameter(d.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Bt._maximumVertexUniformVectors=d.getParameter(d.MAX_VERTEX_UNIFORM_VECTORS),Bt._maximumSamples=this._webgl2?d.getParameter(d.MAX_SAMPLES):0;let u=d.getParameter(d.ALIASED_LINE_WIDTH_RANGE);Bt._minimumAliasedLineWidth=u[0],Bt._maximumAliasedLineWidth=u[1];let m=d.getParameter(d.ALIASED_POINT_SIZE_RANGE);Bt._minimumAliasedPointSize=m[0],Bt._maximumAliasedPointSize=m[1];let p=d.getParameter(d.MAX_VIEWPORT_DIMS);Bt._maximumViewportWidth=p[0],Bt._maximumViewportHeight=p[1];let g=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_FLOAT);Bt._highpFloatSupported=g.precision!==0;let f=d.getShaderPrecisionFormat(d.FRAGMENT_SHADER,d.HIGH_INT);Bt._highpIntSupported=f.rangeMax!==0,this._antialias=d.getContextAttributes().antialias,this._standardDerivatives=!!xr(d,["OES_standard_derivatives"]),this._blendMinmax=!!xr(d,["EXT_blend_minmax"]),this._elementIndexUint=!!xr(d,["OES_element_index_uint"]),this._depthTexture=!!xr(d,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!xr(d,["EXT_frag_depth"]),this._debugShaders=xr(d,["WEBGL_debug_shaders"]),this._textureFloat=!!xr(d,["OES_texture_float"]),this._textureHalfFloat=!!xr(d,["OES_texture_half_float"]),this._textureFloatLinear=!!xr(d,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!xr(d,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!xr(d,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!xr(d,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!xr(d,["EXT_float_blend"]),this._colorBufferHalfFloat=!!xr(d,["EXT_color_buffer_half_float"]),this._s3tc=!!xr(d,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!xr(d,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!xr(d,["WEBGL_compressed_texture_astc"]),this._etc=!!xr(d,["WEBG_compressed_texture_etc"]),this._etc1=!!xr(d,["WEBGL_compressed_texture_etc1"]),this._bc7=!!xr(d,["EXT_texture_compression_bptc"]),_l.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let x=r?xr(d,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=x,Bt._maximumTextureFilterAnisotropy=l(x)?d.getParameter(x.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let _,C,V,L,Z,G,I,v,P,w;if(c){let E=this;_=function(){return E._gl.createVertexArray()},C=function(X){E._gl.bindVertexArray(X)},V=function(X){E._gl.deleteVertexArray(X)},L=function(X,A,N,O,U){d.drawElementsInstanced(X,A,N,O,U)},Z=function(X,A,N,O){d.drawArraysInstanced(X,A,N,O)},G=function(X,A){d.vertexAttribDivisor(X,A)},I=function(X){d.drawBuffers(X)}}else v=xr(d,["OES_vertex_array_object"]),l(v)&&(_=function(){return v.createVertexArrayOES()},C=function(E){v.bindVertexArrayOES(E)},V=function(E){v.deleteVertexArrayOES(E)}),P=xr(d,["ANGLE_instanced_arrays"]),l(P)&&(L=function(E,X,A,N,O){P.drawElementsInstancedANGLE(E,X,A,N,O)},Z=function(E,X,A,N){P.drawArraysInstancedANGLE(E,X,A,N)},G=function(E,X){P.vertexAttribDivisorANGLE(E,X)}),w=xr(d,["WEBGL_draw_buffers"]),l(w)&&(I=function(E){w.drawBuffersWEBGL(E)});this.glCreateVertexArray=_,this.glBindVertexArray=C,this.glDeleteVertexArray=V,this.glDrawElementsInstanced=L,this.glDrawArraysInstanced=Z,this.glVertexAttribDivisor=G,this.glDrawBuffers=I,this._vertexArrayObject=!!v,this._instancedArrays=!!P,this._drawBuffers=!!w,Bt._maximumDrawBuffers=this.drawBuffers?d.getParameter(ie.MAX_DRAW_BUFFERS):1,Bt._maximumColorAttachments=this.drawBuffers?d.getParameter(ie.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new B(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let F=new qG,b=new ec(this),R=Ue.fromCache();this._defaultPassState=b,this._defaultRenderState=R,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=F,this._currentRenderState=R,this._currentPassState=b,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let E=0;E<Bt._maximumVertexAttributes;E++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:o,allowTextureFilterAnisotropic:r},this.cache={},Ue.apply(d,R,b)}function KEe(e,t,n){if(typeof WebGLRenderingContext>"u")throw new de("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let o=n?"webgl":"webgl2",r=e.getContext(o,t);if(!l(r))throw new de("The browser supports WebGL, but initialization failed.");return r}function JEe(e,t){let n="WebGL Error: ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function QEe(e,t,n,i){let o=`${JEe(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function jEe(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new de(QEe(e,t,n,i))}function qEe(e,t,n){return{get:function(){let i=e[t];return n(e,`get: ${t}`,i),e[t]},set:function(i){e[t]=i,n(e,`set: ${t}`,i)}}}function $Ee(e,t){if(!l(t))return e;function n(o){return function(){let r=o.apply(e,arguments);return t(e,o,arguments),r}}let i={};for(let o in e){let r=e[o];r instanceof Function?i[o]=n(r):Object.defineProperty(i,o,qEe(e,o,t))}return i}function xr(e,t){let n=t.length;for(let i=0;i<n;++i){let o=e.getExtension(t[i]);if(o)return o}}var eIe={};Object.defineProperties(ad.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},textureCache:{get:function(){return this._textureCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},supportsTextureLod:{get:function(){return this._webgl2||this._supportsTextureLod}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=$Ee(this._originalGLContext,e?jEe:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Pt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Pt({context:this,pixelFormat:ot.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new Pt({context:this,pixelFormat:ot.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new yr({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return eIe}}});function qte(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ue.partialApply(e._gl,o,t,r,n,i)}var LY;typeof WebGLRenderingContext<"u"&&(LY=[ie.BACK]);function RY(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=LY;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var tIe=new ei;ad.prototype.clear=function(e,t){e=y(e,tIe),t=y(t,this._defaultPassState);let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;l(o)&&(B.equals(this._clearColor,o)||(B.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),l(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=y(e.renderState,this._defaultRenderState);qte(this,a,t,!0);let c=y(e.framebuffer,t.framebuffer);RY(this,c),n.clear(i)};function nIe(e,t,n,i,o){RY(e,t),qte(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function iIe(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=y(t._modelMatrix,M.IDENTITY),n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let d=r.indexBuffer;l(d)?(s=s*d.bytesPerIndex,l(a)?a=Math.min(a,d.numberOfIndices):a=d.numberOfIndices,c===0?e._gl.drawElements(o,a,d.indexDatatype,s):e.glDrawElementsInstanced(o,a,d.indexDatatype,s,c)):(l(a)?a=Math.min(a,r.numberOfVertices):a=r.numberOfVertices,c===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,c)),r._unBind()}ad.prototype.draw=function(e,t,n,i){t=y(t,this._defaultPassState);let o=y(e._framebuffer,t.framebuffer),r=y(e._renderState,this._defaultRenderState);n=y(n,e._shaderProgram),i=y(i,e._uniformMap),nIe(this,o,t,n,r),iIe(this,e,n,i)};ad.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=LY;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i<n;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)};ad.prototype.readPixels=function(e){let t=this._gl;e=y(e,y.EMPTY_OBJECT);let n=Math.max(y(e.x,0),0),i=Math.max(y(e.y,0),0),o=y(e.width,t.drawingBufferWidth),r=y(e.height,t.drawingBufferHeight),s=e.framebuffer,a=qe.UNSIGNED_BYTE;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype);let c=ot.createTypedArray(ot.RGBA,a,o,r);return RY(this,s),t.readPixels(n,i,o,r,ot.RGBA,qe.toWebGLConstant(a,this),c),c};var $te={position:0,textureCoordinates:1};ad.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new ht({attributes:{position:new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Fe.TRIANGLES});e=ti.fromGeometry({context:this,geometry:t,attributeLocations:$te,bufferUsage:Me.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};ad.prototype.createViewportQuadCommand=function(e,t){return t=y(t,y.EMPTY_OBJECT),new tt({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Fe.TRIANGLES,renderState:t.renderState,shaderProgram:tn.fromCache({context:this,vertexShaderSource:ix,fragmentShaderSource:e,attributeLocations:$te}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};ad.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]};function ZY(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(ZY.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});ZY.prototype.destroy=function(){delete this._pickObjects[this.key]};ad.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new de("Out of unique Pick IDs.");return this._pickObjects[t]=e,new ZY(this._pickObjects,t,B.fromRgba(t))};ad.prototype.isDestroyed=function(){return!1};ad.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),me(this)};ad._deprecationWarning=ls;var $G=ad;var LBt=T(S(),1);var iBt=T(S(),1);function KS(e){e=y(e,y.EMPTY_OBJECT);let{context:t,width:n,height:i,colorRenderbuffers:o,colorTextures:r,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:c}=e;if(this._width=n,this._height=i,l(o)!==l(r))throw new pe("Both color renderbuffer and texture attachments must be provided.");if(l(s)!==l(a))throw new pe("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new Wr({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:c}),this._colorFramebuffer=new Wr({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:c})}KS.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};KS.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};KS.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};KS.prototype.isDestroyed=function(){return!1};KS.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),me(this)};var eE=KS;var hBt=T(S(),1);var sBt=T(S(),1);var Sl={RGBA4:ie.RGBA4,RGBA8:ie.RGBA8,RGBA16F:ie.RGBA16F,RGBA32F:ie.RGBA32F,RGB5_A1:ie.RGB5_A1,RGB565:ie.RGB565,DEPTH_COMPONENT16:ie.DEPTH_COMPONENT16,STENCIL_INDEX8:ie.STENCIL_INDEX8,DEPTH_STENCIL:ie.DEPTH_STENCIL,DEPTH24_STENCIL8:ie.DEPTH24_STENCIL8,validate:function(e){return e===Sl.RGBA4||e===Sl.RGBA8||e===Sl.RGBA16F||e===Sl.RGBA32F||e===Sl.RGB5_A1||e===Sl.RGB565||e===Sl.DEPTH_COMPONENT16||e===Sl.STENCIL_INDEX8||e===Sl.DEPTH_STENCIL||e===Sl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ie.FLOAT?Sl.RGBA32F:e===ie.HALF_FLOAT_OES?Sl.RGBA16F:Sl.RGBA8}},vc=Object.freeze(Sl);function tE(e){e=y(e,y.EMPTY_OBJECT);let n=e.context._gl,i=Bt.maximumRenderbufferSize,o=y(e.format,vc.RGBA4),r=l(e.width)?e.width:n.drawingBufferWidth,s=l(e.height)?e.height:n.drawingBufferHeight,a=y(e.numSamples,1);this._gl=n,this._format=o,this._width=r,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,o,r,s):n.renderbufferStorage(n.RENDERBUFFER,o,r,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(tE.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});tE.prototype._getRenderbuffer=function(){return this._renderbuffer};tE.prototype.isDestroyed=function(){return!1};tE.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),me(this)};var cd=tE;function Ts(e){e=y(e,y.EMPTY_OBJECT),this._numSamples=y(e.numSamples,1),this._colorAttachmentsLength=y(e.colorAttachmentsLength,1),this._color=y(e.color,!0),this._depth=y(e.depth,!1),this._depthStencil=y(e.depthStencil,!1),this._supportsDepthTexture=y(e.supportsDepthTexture,!1),this._createColorAttachments=y(e.createColorAttachments,!0),this._createDepthAttachments=y(e.createDepthAttachments,!0),this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(Ts.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});Ts.prototype.isDirty=function(e,t,n,i,o){n=y(n,1);let r=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(o)&&this._pixelFormat!==o,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||r||s||a||!c||this._color&&!l(this._colorTextures[0])};Ts.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?y(i,1):1,o=y(o,this._color?y(this._pixelDatatype,qe.UNSIGNED_BYTE):void 0),r=y(r,this._color?y(this._pixelFormat,ot.RGBA):void 0),this.isDirty(t,n,i,o,r)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=o,this._pixelFormat=r,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new Pt({context:e,width:t,height:n,pixelFormat:r,pixelDatatype:o,sampler:en.NEAREST}),this._numSamples>1){let a=vc.getColorFormat(o);this._colorRenderbuffers[s]=new cd({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Pt({context:e,width:t,height:n,pixelFormat:ot.DEPTH_STENCIL,pixelDatatype:qe.UNSIGNED_INT_24_8,sampler:en.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new cd({context:e,width:t,height:n,format:vc.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new cd({context:e,width:t,height:n,format:vc.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Pt({context:e,width:t,height:n,pixelFormat:ot.DEPTH_COMPONENT,pixelDatatype:qe.UNSIGNED_INT,sampler:en.NEAREST}):this._depthRenderbuffer=new cd({context:e,width:t,height:n,format:vc.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new eE({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new Wr({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};Ts.prototype.getColorTexture=function(e){return e=y(e,0),this._colorTextures[e]};Ts.prototype.setColorTexture=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};Ts.prototype.getColorRenderbuffer=function(e){return e=y(e,0),this._colorRenderbuffers[e]};Ts.prototype.setColorRenderbuffer=function(e,t){t=y(t,0),this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};Ts.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};Ts.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};Ts.prototype.getDepthTexture=function(){return this._depthTexture};Ts.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};Ts.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};Ts.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};Ts.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};Ts.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};Ts.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};Ts.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};Ts.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};Ts.prototype.destroy=function(){if(this._color){let e=this._colorTextures,t=this._colorRenderbuffers;for(let n=0;n<e.length;++n){let i=e[n];this._createColorAttachments&&l(i)&&!i.isDestroyed()&&i.destroy(),l(i)&&i.isDestroyed()&&(e[n]=void 0);let o=t[n];this._createColorAttachments&&l(o)&&!o.isDestroyed()&&o.destroy(),l(o)&&o.isDestroyed()&&(t[n]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),l(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),l(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),l(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),l(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var fi=Ts;var UBt=T(S(),1);var ZBt=T(S(),1);var fx={VERTEX:0,FRAGMENT:1,BOTH:2};fx.includesVertexShader=function(e){return e===fx.VERTEX||e===fx.BOTH};fx.includesFragmentShader=function(e){return e===fx.FRAGMENT||e===fx.BOTH};var ge=Object.freeze(fx);var EBt=T(S(),1);function GY(e){this.name=e,this.fields=[]}GY.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};GY.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var nE=GY;var XBt=T(S(),1);function EY(e){this.signature=e,this.body=[]}EY.prototype.addLines=function(e){let t=this.body;if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;i++)t.push(` ${e[i]}`)}else t.push(` ${e}`)};EY.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var iE=EY;function wc(){this._positionAttributeLine=void 0,this._nextAttributeLocation=1,this._attributeLocations={},this._attributeLines=[],this._structs={},this._functions={},this._vertexShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]},this._fragmentShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]}}Object.defineProperties(wc.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});wc.prototype.addDefine=function(e,t,n){n=y(n,ge.BOTH);let i=e;l(t)&&(i+=` ${t.toString()}`),ge.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),ge.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};wc.prototype.addStruct=function(e,t,n){this._structs[e]=new nE(t),ge.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),ge.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};wc.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};wc.prototype.addFunction=function(e,t,n){this._functions[e]=new iE(t),ge.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),ge.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};wc.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};wc.prototype.addUniform=function(e,t,n){n=y(n,ge.BOTH);let i=`uniform ${e} ${t};`;ge.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),ge.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};wc.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};wc.prototype.addAttribute=function(e,t){let n=`in ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=rIe(e),i};wc.prototype.addVarying=function(e,t,n){n=l(n)?`${n} `:"";let i=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`${n}out ${i}`),this._fragmentShaderParts.varyingLines.push(`${n}in ${i}`)};wc.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};wc.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};wc.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=oIe(this),i=sIe(this),o=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(`
  3685. `),r=new De({defines:this._vertexShaderParts.defineLines,sources:[o]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(`
  3686. `),a=new De({defines:this._fragmentShaderParts.defineLines,sources:[s]});return tn.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};wc.prototype.clone=function(){return Ye(this,!0)};function oIe(e){let t=[],n=[],i,o=e._vertexShaderParts.structIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),t.push.apply(t,a);for(o=e._fragmentShaderParts.structIds,i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}function rIe(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function sIe(e){let t=[],n=[],i,o=e._vertexShaderParts.functionIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),t.push.apply(t,a);for(o=e._fragmentShaderParts.functionIds,i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}var px=wc;var jBt=T(S(),1);function As(e,t,n,i){let o=As._verifyAttributes(t);n=y(n,0);let r=[],s={},a,c,d=o.length;for(let m=0;m<d;++m){let p=o[m];if(p.vertexBuffer){r.push(p);continue}c=p.usage,a=s[c],l(a)||(a=s[c]=[]),a.push(p)}function u(m,p){return Q.getSizeInBytes(p.componentDatatype)-Q.getSizeInBytes(m.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(u);let m=As._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:m,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:As._createArrayViews(a,m)};this._allBuffers.push(g)}this._size=0,this._instanced=y(i,!1),this._precreated=r,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}As._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let o=e[i],r={index:y(o.index,i),enabled:y(o.enabled,!0),componentsPerAttribute:o.componentsPerAttribute,componentDatatype:y(o.componentDatatype,Q.FLOAT),normalize:y(o.normalize,!1),vertexBuffer:o.vertexBuffer,usage:y(o.usage,Me.STATIC_DRAW)};t.push(r)}let n=new Array(t.length);for(let i=0;i<t.length;++i){let r=t[i].index;n[r]=!0}return t};As._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*Q.getSizeInBytes(a.componentDatatype)}let i=n>0?Q.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};As._createArrayViews=function(e,t){let n=[],i=0,o=e.length;for(let r=0;r<o;++r){let s=e[r],a=s.componentDatatype;n.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:a,normalize:s.normalize,offsetInBytes:i,vertexSizeInComponentType:t/Q.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*Q.getSizeInBytes(a)}return n};As.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){let o=t[n];As._resize(o,this._size),As._appendWriters(this.writers,o)}IY(this)};As._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let r=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c<a;++c)r[c]=s[c]}let i=e.arrayViews,o=i.length;for(let r=0;r<o;++r){let s=i[r];s.view=Q.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var aIe=[function(e,t,n){return function(i,o){t[i*n]=o,e.needsCommit=!0}},function(e,t,n){return function(i,o,r){let s=i*n;t[s]=o,t[s+1]=r,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s){let a=i*n;t[a]=o,t[a+1]=r,t[a+2]=s,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s,a){let c=i*n;t[c]=o,t[c+1]=r,t[c+2]=s,t[c+3]=a,e.needsCommit=!0}}];As._appendWriters=function(e,t){let n=t.arrayViews,i=n.length;for(let o=0;o<i;++o){let r=n[o];e[r.index]=aIe[r.componentsPerAttribute-1](t,r.view,r.vertexSizeInComponentType)}};As.prototype.commit=function(e){let t=!1,n=this._allBuffers,i,o,r;for(o=0,r=n.length;o<r;++o)i=n[o],t=cIe(this,i)||t;if(t||!l(this.va)){IY(this);let s=this.va=[],a=W.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let d=0;d<c;++d){let u=[];for(o=0,r=n.length;o<r;++o){i=n[o];let m=d*(i.vertexSizeInBytes*a);As._appendAttributes(u,i,m,this._instanced)}u=u.concat(this._precreated),s.push({va:new ti({context:this._context,attributes:u,indexBuffer:e}),indicesCount:1.5*(d!==c-1?a:this._size%a)})}}};function cIe(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=l(n);if(!o||n.sizeInBytes<i)return o&&n.destroy(),t.vertexBuffer=xt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}As._appendAttributes=function(e,t,n,i){let o=t.arrayViews,r=o.length;for(let s=0;s<r;++s){let a=o[s];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};As.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)lIe(n[i],e,t)};function lIe(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){let i=e.vertexSizeInBytes*t,o=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,o),i)}}As.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function IY(e){let t=e.va;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}As.prototype.isDestroyed=function(){return!1};As.prototype.destroy=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){let i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return IY(this),me(this)};var Sp=As;var t3t=T(S(),1);function dIe(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[Ee.createIfNeeded(t.positiveX).fetchImage(i),Ee.createIfNeeded(t.negativeX).fetchImage(i),Ee.createIfNeeded(t.positiveY).fetchImage(i),Ee.createIfNeeded(t.negativeY).fetchImage(i),Ee.createIfNeeded(t.positiveZ).fetchImage(i),Ee.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new yr({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var oE=dIe;var b3t=T(S(),1);var d3t=T(S(),1);var r3t=T(S(),1);function w0(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new be,this.setValue(e)}Object.defineProperties(w0.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});w0.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};w0.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",o=n&&typeof e.equals=="function";(!o||!e.equals(t))&&(this._hasClone=i,this._hasEquals=o,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};w0.prototype.equals=function(e){return this===e||e instanceof w0&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};w0.prototype.valueOf=function(){return this._value};w0.prototype.toString=function(){return String(this._value)};var Jn=w0;function uIe(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(r){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),r!==void 0&&(!l(r)||!l(r.getValue))&&l(o)&&(r=o(r)),s!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,s)),l(r)&&l(r.definitionChanged)&&(this[n]=r.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,r,r)},this))}}}function mIe(e){return new Jn(e)}function hIe(e,t,n){return uIe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,y(t,!1),y(n,mIe))}var ue=hIe;function rE(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(rE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),image:ue("image"),scale:ue("scale"),pixelOffset:ue("pixelOffset"),eyeOffset:ue("eyeOffset"),horizontalOrigin:ue("horizontalOrigin"),verticalOrigin:ue("verticalOrigin"),heightReference:ue("heightReference"),color:ue("color"),rotation:ue("rotation"),alignedAxis:ue("alignedAxis"),sizeInMeters:ue("sizeInMeters"),width:ue("width"),height:ue("height"),scaleByDistance:ue("scaleByDistance"),translucencyByDistance:ue("translucencyByDistance"),pixelOffsetScaleByDistance:ue("pixelOffsetScaleByDistance"),imageSubRegion:ue("imageSubRegion"),distanceDisplayCondition:ue("distanceDisplayCondition"),disableDepthTestDistance:ue("disableDepthTestDistance"),splitDirection:ue("splitDirection")});rE.prototype.clone=function(e){return l(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e.splitDirection=this._splitDirection,e):new rE(this)};rE.prototype.merge=function(e){this.show=y(this._show,e.show),this.image=y(this._image,e.image),this.scale=y(this._scale,e.scale),this.pixelOffset=y(this._pixelOffset,e.pixelOffset),this.eyeOffset=y(this._eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this._horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this._verticalOrigin,e.verticalOrigin),this.heightReference=y(this._heightReference,e.heightReference),this.color=y(this._color,e.color),this.rotation=y(this._rotation,e.rotation),this.alignedAxis=y(this._alignedAxis,e.alignedAxis),this.sizeInMeters=y(this._sizeInMeters,e.sizeInMeters),this.width=y(this._width,e.width),this.height=y(this._height,e.height),this.scaleByDistance=y(this._scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this._pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.imageSubRegion=y(this._imageSubRegion,e.imageSubRegion),this.distanceDisplayCondition=y(this._distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this._disableDepthTestDistance,e.disableDepthTestDistance),this.splitDirection=y(this.splitDirection,e.splitDirection)};var tc=rE;var rOt=T(S(),1);var x3t=T(S(),1);function bx(){this._array=[],this._hash={}}Object.defineProperties(bx.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});bx.prototype.contains=function(e){return l(this._hash[e])};bx.prototype.set=function(e,t){let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};bx.prototype.get=function(e){return this._hash[e]};bx.prototype.remove=function(e){let t=this._hash[e],n=l(t);if(n){let i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n};bx.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var Zt=bx;var C3t=T(S(),1);function ld(e,t){e=y(e,0),this._near=e,t=y(t,Number.MAX_VALUE),this._far=t}Object.defineProperties(ld.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}});ld.packedLength=2;ld.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n]=e.far,t};ld.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new ld),n.near=e[t++],n.far=e[t],n};ld.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};ld.clone=function(e,t){if(l(e))return l(t)||(t=new ld),t.near=e.near,t.far=e.far,t};ld.prototype.clone=function(e){return ld.clone(this,e)};ld.prototype.equals=function(e){return ld.equals(this,e)};var At=ld;var Z3t=T(S(),1);function pu(e,t,n,i){this.near=y(e,0),this.nearValue=y(t,0),this.far=y(n,1),this.farValue=y(i,0)}pu.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new pu(e.near,e.nearValue,e.far,e.farValue)};pu.packedLength=4;pu.pack=function(e,t,n){return n=y(n,0),t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};pu.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new pu),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};pu.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};pu.prototype.clone=function(e){return pu.clone(this,e)};pu.prototype.equals=function(e){return pu.equals(this,e)};var Ut=pu;var E3t=T(S(),1),gx={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2,CLAMP_TO_TERRAIN:3,RELATIVE_TO_TERRAIN:4,CLAMP_TO_3D_TILE:5,RELATIVE_TO_3D_TILE:6},Qe=Object.freeze(gx);function bu(e){return e===gx.CLAMP_TO_GROUND||e===gx.CLAMP_TO_3D_TILE||e===gx.CLAMP_TO_TERRAIN}function JS(e){return e===gx.RELATIVE_TO_GROUND||e===gx.RELATIVE_TO_3D_TILE||e===gx.RELATIVE_TO_TERRAIN}var X3t=T(S(),1),fIe={CENTER:0,LEFT:1,RIGHT:-1},gi=Object.freeze(fIe);var P3t=T(S(),1),pIe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},Pn=Object.freeze(pIe);var w3t=T(S(),1),bIe={DONE:0,PENDING:1,FAILED:2},ft=Object.freeze(bIe);var k3t=T(S(),1);function Vm(){pe.throwInstantiationError()}Object.defineProperties(Vm.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});Vm.prototype.getValue=pe.throwInstantiationError;Vm.prototype.equals=pe.throwInstantiationError;Vm.equals=function(e,t){return e===t||l(e)&&e.equals(t)};Vm.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!Vm.equals(e[i],t[i]))return!1;return!0};Vm.isConstant=function(e){return!l(e)||e.isConstant};Vm.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};Vm.getValueOrDefault=function(e,t,n,i){return l(e)?y(e.getValue(t,i),n):n};Vm.getValueOrClonedDefault=function(e,t,n,i){let o;return l(e)&&(o=e.getValue(t,i)),l(o)||(o=n.clone(o)),o};var K=Vm;var D3t=T(S(),1),gIe={LEFT:-1,NONE:0,RIGHT:1},vr=Object.freeze(gIe);var yIe=B.WHITE,xIe=h.ZERO,_Ie=Qe.NONE,TIe=D.ZERO,SIe=1,CIe=0,VIe=h.ZERO,LIe=gi.CENTER,RIe=Pn.CENTER,ZIe=!1,GIe=vr.NONE,EIe=new h,IIe=new B,XIe=new h,WIe=new D,PIe=new Ut,vIe=new Ut,wIe=new Ut,FIe=new Ke,AIe=new At;function ene(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function F0(e,t){t.collectionChanged.addEventListener(F0.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Zt,this._onCollectionChanged(t,t.values,[],[])}F0.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._billboard,c,d=r.billboard,u=s.isShowing&&s.isAvailable(e)&&K.getValueOrDefault(a._show,e,!0),m;if(u&&(m=K.getValueOrUndefined(s._position,e,EIe),c=K.getValueOrUndefined(a._image,e),u=l(m)&&l(c)),!u){XY(r,s,n);continue}K.isConstant(s._position)||(n._clusterDirty=!0),l(d)||(d=n.getBillboard(s),d.id=s,d.image=void 0,r.billboard=d),d.show=u,(!l(d.image)||r.textureValue!==c)&&(d.image=c,r.textureValue=c),d.position=m,d.color=K.getValueOrDefault(a._color,e,yIe,IIe),d.eyeOffset=K.getValueOrDefault(a._eyeOffset,e,xIe,XIe),d.heightReference=K.getValueOrDefault(a._heightReference,e,_Ie),d.pixelOffset=K.getValueOrDefault(a._pixelOffset,e,TIe,WIe),d.scale=K.getValueOrDefault(a._scale,e,SIe),d.rotation=K.getValueOrDefault(a._rotation,e,CIe),d.alignedAxis=K.getValueOrDefault(a._alignedAxis,e,VIe),d.horizontalOrigin=K.getValueOrDefault(a._horizontalOrigin,e,LIe),d.verticalOrigin=K.getValueOrDefault(a._verticalOrigin,e,RIe),d.width=K.getValueOrUndefined(a._width,e),d.height=K.getValueOrUndefined(a._height,e),d.scaleByDistance=K.getValueOrUndefined(a._scaleByDistance,e,PIe),d.translucencyByDistance=K.getValueOrUndefined(a._translucencyByDistance,e,vIe),d.pixelOffsetScaleByDistance=K.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,wIe),d.sizeInMeters=K.getValueOrDefault(a._sizeInMeters,e,ZIe),d.distanceDisplayCondition=K.getValueOrUndefined(a._distanceDisplayCondition,e,AIe),d.disableDepthTestDistance=K.getValueOrUndefined(a._disableDepthTestDistance,e),d.splitDirection=K.getValueOrDefault(a._splitDirection,e,GIe);let p=K.getValueOrUndefined(a._imageSubRegion,e,FIe);l(p)&&d.setImageSubRegion(d._imageId,p)}return!0};F0.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return ft.FAILED;let i=n.billboard;if(i.heightReference===Qe.NONE)t.center=h.clone(i.position,t.center);else{if(!l(i._clampedPosition))return ft.PENDING;t.center=h.clone(i._clampedPosition,t.center)}return t.radius=0,ft.DONE};F0.prototype.isDestroyed=function(){return!1};F0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(F0.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return me(this)};F0.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._billboard)&&l(r._position)&&s.set(r.id,new ene(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._billboard)&&l(r._position)?s.contains(r.id)||s.set(r.id,new ene(r)):(XY(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],XY(s.get(r.id),r,a),s.remove(r.id)};function XY(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var sE=F0;var Atn=T(S(),1);var gOt=T(S(),1);var MIe=new h;function qh(e){e=y(e,y.EMPTY_OBJECT);let t=e.minimum,n=e.maximum;this._min=h.clone(t),this._max=h.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}qh.fromDimensions=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new qh({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};qh.fromAxisAlignedBoundingBox=function(e){return new qh({minimum:e.minimum,maximum:e.maximum})};qh.packedLength=2*h.packedLength+1;qh.pack=function(e,t,n){return n=y(n,0),h.pack(e._min,t,n),h.pack(e._max,t,n+h.packedLength),t[n+h.packedLength*2]=y(e._offsetAttribute,-1),t};var nne=new h,ine=new h,tne={minimum:nne,maximum:ine,offsetAttribute:void 0};qh.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,nne),o=h.unpack(e,t+h.packedLength,ine),r=e[t+h.packedLength*2];return l(n)?(n._min=h.clone(i,n._min),n._max=h.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(tne.offsetAttribute=r===-1?void 0:r,new qh(tne))};qh.createGeometry=function(e){let t=e._min,n=e._max;if(h.equals(t,n))return;let i=new mn,o=new Uint16Array(12*2),r=new Float64Array(8*3);r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=n.x,r[4]=t.y,r[5]=t.z,r[6]=n.x,r[7]=n.y,r[8]=t.z,r[9]=t.x,r[10]=n.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=n.z,r[15]=n.x,r[16]=t.y,r[17]=n.z,r[18]=n.x,r[19]=n.y,r[20]=n.z,r[21]=t.x,r[22]=n.y,r[23]=n.z,i.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:r}),o[0]=4,o[1]=5,o[2]=5,o[3]=6,o[4]=6,o[5]=7,o[6]=7,o[7]=4,o[8]=0,o[9]=1,o[10]=1,o[11]=2,o[12]=2,o[13]=3,o[14]=3,o[15]=0,o[16]=0,o[17]=4,o[18]=1,o[19]=5,o[20]=2,o[21]=6,o[22]=3,o[23]=7;let s=h.subtract(n,t,MIe),a=h.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=r.length,d=e._offsetAttribute===cn.NONE?0:1,u=new Uint8Array(c/3).fill(d);i.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return new ht({attributes:i,indices:o,primitiveType:Fe.LINES,boundingSphere:new ce(h.ZERO,a),offsetAttribute:e._offsetAttribute})};var Lm=qh;var COt=T(S(),1);function QS(e,t,n,i){e=y(e,1),t=y(t,1),n=y(n,1),i=y(i,1),this.value=new Uint8Array([B.floatToByte(e),B.floatToByte(t),B.floatToByte(n),B.floatToByte(i)])}Object.defineProperties(QS.prototype,{componentDatatype:{get:function(){return Q.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});QS.fromColor=function(e){return new QS(e.red,e.green,e.blue,e.alpha)};QS.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};QS.equals=function(e,t){return e===t||l(e)&&l(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var Kt=QS;var GOt=T(S(),1);function aE(e,t){e=y(e,0),t=y(t,Number.MAX_VALUE),this.value=new Float32Array([e,t])}Object.defineProperties(aE.prototype,{componentDatatype:{get:function(){return Q.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});aE.fromDistanceDisplayCondition=function(e){return new aE(e.near,e.far)};aE.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var Nn=aE;var WOt=T(S(),1);function NIe(e){e=y(e,y.EMPTY_OBJECT),this.geometry=e.geometry,this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=y(e.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Gt=NIe;var DOt=T(S(),1);var MOt=T(S(),1);function Jo(e){e=y(e,y.EMPTY_OBJECT),this.start=l(e.start)?j.clone(e.start):new j,this.stop=l(e.stop)?j.clone(e.stop):new j,this.data=e.data,this.isStartIncluded=y(e.isStartIncluded,!0),this.isStopIncluded=y(e.isStopIncluded,!0)}Object.defineProperties(Jo.prototype,{isEmpty:{get:function(){let e=j.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var jS={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Jo.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new pe("options.iso8601 is an invalid ISO 8601 interval.");let i=j.fromIso8601(n[0]),o=j.fromIso8601(n[1]),r=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=e.data;return l(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=s,t.data=a,t):(jS.start=i,jS.stop=o,jS.isStartIncluded=r,jS.isStopIncluded=s,jS.data=a,new Jo(jS))};Jo.toIso8601=function(e,t){return`${j.toIso8601(e.start,t)}/${j.toIso8601(e.stop,t)}`};Jo.clone=function(e,t){if(l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new Jo(e)};Jo.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&j.equals(e.start,t.start)&&j.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};Jo.equalsEpsilon=function(e,t,n,i){return n=y(n,0),e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&j.equalsEpsilon(e.start,t.start,n)&&j.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};Jo.intersect=function(e,t,n,i){if(!l(t))return Jo.clone(Jo.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,c=j.greaterThanOrEquals(s,o)&&j.greaterThanOrEquals(r,s),d=!c&&j.lessThanOrEquals(s,o)&&j.lessThanOrEquals(o,a);if(!c&&!d)return Jo.clone(Jo.EMPTY,n);let u=e.isStartIncluded,m=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,f=j.lessThan(r,a);return l(n)||(n=new Jo),n.start=c?s:o,n.isStartIncluded=u&&p||!j.equals(s,o)&&(c&&p||d&&u),n.stop=f?r:a,n.isStopIncluded=f?m:m&&g||!j.equals(a,r)&&g,n.data=l(i)?i(e.data,t.data):e.data,n};Jo.contains=function(e,t){if(e.isEmpty)return!1;let n=j.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=j.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};Jo.prototype.clone=function(e){return Jo.clone(this,e)};Jo.prototype.equals=function(e,t){return Jo.equals(this,e,t)};Jo.prototype.equalsEpsilon=function(e,t,n){return Jo.equalsEpsilon(this,e,t,n)};Jo.prototype.toString=function(){return Jo.toIso8601(this)};Jo.EMPTY=Object.freeze(new Jo({start:new j,stop:new j,isStartIncluded:!1,isStopIncluded:!1}));var Vn=Jo;var one=Object.freeze(j.fromIso8601("0000-01-01T00:00:00Z")),rne=Object.freeze(j.fromIso8601("9999-12-31T24:00:00Z")),kIe=Object.freeze(new Vn({start:one,stop:rne})),UIe={MINIMUM_VALUE:one,MAXIMUM_VALUE:rne,MAXIMUM_INTERVAL:kIe},Be=UIe;var zOt=T(S(),1);function cE(e,t,n){e=y(e,0),t=y(t,0),n=y(n,0),this.value=new Float32Array([e,t,n])}Object.defineProperties(cE.prototype,{componentDatatype:{get:function(){return Q.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});cE.fromCartesian3=function(e){return new cE(e.x,e.y,e.z)};cE.toValue=function(e,t){return l(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var Qi=cE;var qOt=T(S(),1);function YN(e){e=y(e,!0),this.value=YN.toValue(e)}Object.defineProperties(YN.prototype,{componentDatatype:{get:function(){return Q.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});YN.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var xn=YN;var hzt=T(S(),1);var eYt=T(S(),1),lE=`in vec3 v_positionEC;
  3687. in vec3 v_normalEC;
  3688. in vec3 v_tangentEC;
  3689. in vec3 v_bitangentEC;
  3690. in vec2 v_st;
  3691. void main()
  3692. {
  3693. vec3 positionToEyeEC = -v_positionEC;
  3694. mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);
  3695. vec3 normalEC = normalize(v_normalEC);
  3696. #ifdef FACE_FORWARD
  3697. normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
  3698. #endif
  3699. czm_materialInput materialInput;
  3700. materialInput.normalEC = normalEC;
  3701. materialInput.tangentToEyeMatrix = tangentToEyeMatrix;
  3702. materialInput.positionToEyeEC = positionToEyeEC;
  3703. materialInput.st = v_st;
  3704. czm_material material = czm_getMaterial(materialInput);
  3705. #ifdef FLAT
  3706. out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
  3707. #else
  3708. out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
  3709. #endif
  3710. }
  3711. `;var nYt=T(S(),1),dE=`in vec3 position3DHigh;
  3712. in vec3 position3DLow;
  3713. in vec3 normal;
  3714. in vec3 tangent;
  3715. in vec3 bitangent;
  3716. in vec2 st;
  3717. in float batchId;
  3718. out vec3 v_positionEC;
  3719. out vec3 v_normalEC;
  3720. out vec3 v_tangentEC;
  3721. out vec3 v_bitangentEC;
  3722. out vec2 v_st;
  3723. void main()
  3724. {
  3725. vec4 p = czm_computePosition();
  3726. v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
  3727. v_normalEC = czm_normal * normal; // normal in eye coordinates
  3728. v_tangentEC = czm_normal * tangent; // tangent in eye coordinates
  3729. v_bitangentEC = czm_normal * bitangent; // bitangent in eye coordinates
  3730. v_st = st;
  3731. gl_Position = czm_modelViewProjectionRelativeToEye * p;
  3732. }
  3733. `;var oYt=T(S(),1),uE=`in vec3 v_positionEC;
  3734. in vec3 v_normalEC;
  3735. void main()
  3736. {
  3737. vec3 positionToEyeEC = -v_positionEC;
  3738. vec3 normalEC = normalize(v_normalEC);
  3739. #ifdef FACE_FORWARD
  3740. normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
  3741. #endif
  3742. czm_materialInput materialInput;
  3743. materialInput.normalEC = normalEC;
  3744. materialInput.positionToEyeEC = positionToEyeEC;
  3745. czm_material material = czm_getMaterial(materialInput);
  3746. #ifdef FLAT
  3747. out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
  3748. #else
  3749. out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
  3750. #endif
  3751. }
  3752. `;var sYt=T(S(),1),mE=`in vec3 position3DHigh;
  3753. in vec3 position3DLow;
  3754. in vec3 normal;
  3755. in float batchId;
  3756. out vec3 v_positionEC;
  3757. out vec3 v_normalEC;
  3758. void main()
  3759. {
  3760. vec4 p = czm_computePosition();
  3761. v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
  3762. v_normalEC = czm_normal * normal; // normal in eye coordinates
  3763. gl_Position = czm_modelViewProjectionRelativeToEye * p;
  3764. }
  3765. `;var cYt=T(S(),1),hE=`in vec3 v_positionEC;
  3766. in vec3 v_normalEC;
  3767. in vec2 v_st;
  3768. void main()
  3769. {
  3770. vec3 positionToEyeEC = -v_positionEC;
  3771. vec3 normalEC = normalize(v_normalEC);
  3772. #ifdef FACE_FORWARD
  3773. normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
  3774. #endif
  3775. czm_materialInput materialInput;
  3776. materialInput.normalEC = normalEC;
  3777. materialInput.positionToEyeEC = positionToEyeEC;
  3778. materialInput.st = v_st;
  3779. czm_material material = czm_getMaterial(materialInput);
  3780. #ifdef FLAT
  3781. out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
  3782. #else
  3783. out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
  3784. #endif
  3785. }
  3786. `;var dYt=T(S(),1),fE=`in vec3 position3DHigh;
  3787. in vec3 position3DLow;
  3788. in vec3 normal;
  3789. in vec2 st;
  3790. in float batchId;
  3791. out vec3 v_positionEC;
  3792. out vec3 v_normalEC;
  3793. out vec2 v_st;
  3794. void main()
  3795. {
  3796. vec4 p = czm_computePosition();
  3797. v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
  3798. v_normalEC = czm_normal * normal; // normal in eye coordinates
  3799. v_st = st;
  3800. gl_Position = czm_modelViewProjectionRelativeToEye * p;
  3801. }
  3802. `;var XYt=T(S(),1);var _Yt=T(S(),1);var hYt=T(S(),1);var DIe={ADD:ie.FUNC_ADD,SUBTRACT:ie.FUNC_SUBTRACT,REVERSE_SUBTRACT:ie.FUNC_REVERSE_SUBTRACT,MIN:ie.MIN,MAX:ie.MAX},Ga=Object.freeze(DIe);var bYt=T(S(),1);var BIe={ZERO:ie.ZERO,ONE:ie.ONE,SOURCE_COLOR:ie.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:ie.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:ie.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:ie.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:ie.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:ie.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:ie.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:ie.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:ie.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:ie.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:ie.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:ie.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:ie.SRC_ALPHA_SATURATE},Co=Object.freeze(BIe);var OIe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Ga.ADD,equationAlpha:Ga.ADD,functionSourceRgb:Co.SOURCE_ALPHA,functionSourceAlpha:Co.ONE,functionDestinationRgb:Co.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Ga.ADD,equationAlpha:Ga.ADD,functionSourceRgb:Co.ONE,functionSourceAlpha:Co.ONE,functionDestinationRgb:Co.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Ga.ADD,equationAlpha:Ga.ADD,functionSourceRgb:Co.SOURCE_ALPHA,functionSourceAlpha:Co.ONE,functionDestinationRgb:Co.ONE,functionDestinationAlpha:Co.ONE})},un=Object.freeze(OIe);var CYt=T(S(),1);var YIe={FRONT:ie.FRONT,BACK:ie.BACK,FRONT_AND_BACK:ie.FRONT_AND_BACK},yi=Object.freeze(YIe);function qS(e){e=y(e,y.EMPTY_OBJECT),this.material=e.material,this.translucent=y(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=y(e.closed,!1)}Object.defineProperties(qS.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}});qS.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(`
  3803. `)};qS.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};qS.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Ye(this.renderState,!1);return e?(t.depthMask=!1,t.blending=un.ALPHA_BLEND):t.depthMask=!0,t};qS.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=un.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:yi.BACK}),l(n)&&(i=Tt(n,i,!0)),i};var eo=qS;var ezt=T(S(),1);var PYt=T(S(),1),pE=`uniform sampler2D image;
  3804. czm_material czm_getMaterial(czm_materialInput materialInput)
  3805. {
  3806. czm_material material = czm_getDefaultMaterial(materialInput);
  3807. vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5));
  3808. rampColor = czm_gammaCorrect(rampColor);
  3809. material.diffuse = rampColor.rgb;
  3810. material.alpha = rampColor.a;
  3811. return material;
  3812. }
  3813. `;var wYt=T(S(),1),bE=`uniform sampler2D image;
  3814. uniform float strength;
  3815. uniform vec2 repeat;
  3816. czm_material czm_getMaterial(czm_materialInput materialInput)
  3817. {
  3818. czm_material material = czm_getDefaultMaterial(materialInput);
  3819. vec2 st = materialInput.st;
  3820. vec2 centerPixel = fract(repeat * st);
  3821. float centerBump = texture(image, centerPixel).channel;
  3822. float imageWidth = float(imageDimensions.x);
  3823. vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));
  3824. float rightBump = texture(image, rightPixel).channel;
  3825. float imageHeight = float(imageDimensions.y);
  3826. vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));
  3827. float topBump = texture(image, leftPixel).channel;
  3828. vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));
  3829. vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;
  3830. material.normal = normalEC;
  3831. material.diffuse = vec3(0.01);
  3832. return material;
  3833. }
  3834. `;var AYt=T(S(),1),gE=`uniform vec4 lightColor;
  3835. uniform vec4 darkColor;
  3836. uniform vec2 repeat;
  3837. czm_material czm_getMaterial(czm_materialInput materialInput)
  3838. {
  3839. czm_material material = czm_getDefaultMaterial(materialInput);
  3840. vec2 st = materialInput.st;
  3841. // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights
  3842. float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0); // 0.0 or 1.0
  3843. // Find the distance from the closest separator (region between two colors)
  3844. float scaledWidth = fract(repeat.s * st.s);
  3845. scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));
  3846. float scaledHeight = fract(repeat.t * st.t);
  3847. scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));
  3848. float value = min(scaledWidth, scaledHeight);
  3849. vec4 currentColor = mix(lightColor, darkColor, b);
  3850. vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);
  3851. color = czm_gammaCorrect(color);
  3852. material.diffuse = color.rgb;
  3853. material.alpha = color.a;
  3854. return material;
  3855. }
  3856. `;var NYt=T(S(),1),yE=`uniform vec4 lightColor;
  3857. uniform vec4 darkColor;
  3858. uniform vec2 repeat;
  3859. czm_material czm_getMaterial(czm_materialInput materialInput)
  3860. {
  3861. czm_material material = czm_getDefaultMaterial(materialInput);
  3862. // From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights
  3863. float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); // 0.0 or 1.0
  3864. vec4 color = mix(lightColor, darkColor, b);
  3865. color = czm_gammaCorrect(color);
  3866. material.diffuse = color.rgb;
  3867. material.alpha = color.a;
  3868. return material;
  3869. }
  3870. `;var UYt=T(S(),1),xE=`uniform sampler2D heights;
  3871. uniform sampler2D colors;
  3872. // This material expects heights to be sorted from lowest to highest.
  3873. float getHeight(int idx, float invTexSize)
  3874. {
  3875. vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5);
  3876. #ifdef OES_texture_float
  3877. return texture(heights, uv).x;
  3878. #else
  3879. return czm_unpackFloat(texture(heights, uv));
  3880. #endif
  3881. }
  3882. czm_material czm_getMaterial(czm_materialInput materialInput)
  3883. {
  3884. czm_material material = czm_getDefaultMaterial(materialInput);
  3885. float height = materialInput.height;
  3886. float invTexSize = 1.0 / float(heightsDimensions.x);
  3887. float minHeight = getHeight(0, invTexSize);
  3888. float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize);
  3889. // early-out when outside the height range
  3890. if (height < minHeight || height > maxHeight) {
  3891. material.diffuse = vec3(0.0);
  3892. material.alpha = 0.0;
  3893. return material;
  3894. }
  3895. // Binary search to find heights above and below.
  3896. int idxBelow = 0;
  3897. int idxAbove = heightsDimensions.x;
  3898. float heightBelow = minHeight;
  3899. float heightAbove = maxHeight;
  3900. // while loop not allowed, so use for loop with max iterations.
  3901. // maxIterations of 16 supports a texture size up to 65536 (2^16).
  3902. const int maxIterations = 16;
  3903. for (int i = 0; i < maxIterations; i++) {
  3904. if (idxBelow >= idxAbove - 1) {
  3905. break;
  3906. }
  3907. int idxMid = (idxBelow + idxAbove) / 2;
  3908. float heightTex = getHeight(idxMid, invTexSize);
  3909. if (height > heightTex) {
  3910. idxBelow = idxMid;
  3911. heightBelow = heightTex;
  3912. } else {
  3913. idxAbove = idxMid;
  3914. heightAbove = heightTex;
  3915. }
  3916. }
  3917. float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow);
  3918. vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5);
  3919. vec4 color = texture(colors, colorUv);
  3920. // undo preumultiplied alpha
  3921. if (color.a > 0.0)
  3922. {
  3923. color.rgb /= color.a;
  3924. }
  3925. color.rgb = czm_gammaCorrect(color.rgb);
  3926. material.diffuse = color.rgb;
  3927. material.alpha = color.a;
  3928. return material;
  3929. }
  3930. `;var BYt=T(S(),1),_E=`uniform vec4 color;
  3931. uniform float spacing;
  3932. uniform float width;
  3933. czm_material czm_getMaterial(czm_materialInput materialInput)
  3934. {
  3935. czm_material material = czm_getDefaultMaterial(materialInput);
  3936. float distanceToContour = mod(materialInput.height, spacing);
  3937. #if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
  3938. float dxc = abs(dFdx(materialInput.height));
  3939. float dyc = abs(dFdy(materialInput.height));
  3940. float dF = max(dxc, dyc) * czm_pixelRatio * width;
  3941. float alpha = (distanceToContour < dF) ? 1.0 : 0.0;
  3942. #else
  3943. // If no derivatives available (IE 10?), use pixel ratio
  3944. float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0;
  3945. #endif
  3946. vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a));
  3947. material.diffuse = outColor.rgb;
  3948. material.alpha = outColor.a;
  3949. return material;
  3950. }
  3951. `;var YYt=T(S(),1),TE=`uniform sampler2D image;
  3952. uniform float minimumHeight;
  3953. uniform float maximumHeight;
  3954. czm_material czm_getMaterial(czm_materialInput materialInput)
  3955. {
  3956. czm_material material = czm_getDefaultMaterial(materialInput);
  3957. float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0);
  3958. vec4 rampColor = texture(image, vec2(scaledHeight, 0.5));
  3959. rampColor = czm_gammaCorrect(rampColor);
  3960. material.diffuse = rampColor.rgb;
  3961. material.alpha = rampColor.a;
  3962. return material;
  3963. }
  3964. `;var zYt=T(S(),1),SE=`uniform vec4 fadeInColor;
  3965. uniform vec4 fadeOutColor;
  3966. uniform float maximumDistance;
  3967. uniform bool repeat;
  3968. uniform vec2 fadeDirection;
  3969. uniform vec2 time;
  3970. float getTime(float t, float coord)
  3971. {
  3972. float scalar = 1.0 / maximumDistance;
  3973. float q = distance(t, coord) * scalar;
  3974. if (repeat)
  3975. {
  3976. float r = distance(t, coord + 1.0) * scalar;
  3977. float s = distance(t, coord - 1.0) * scalar;
  3978. q = min(min(r, s), q);
  3979. }
  3980. return clamp(q, 0.0, 1.0);
  3981. }
  3982. czm_material czm_getMaterial(czm_materialInput materialInput)
  3983. {
  3984. czm_material material = czm_getDefaultMaterial(materialInput);
  3985. vec2 st = materialInput.st;
  3986. float s = getTime(time.x, st.s) * fadeDirection.s;
  3987. float t = getTime(time.y, st.t) * fadeDirection.t;
  3988. float u = length(vec2(s, t));
  3989. vec4 color = mix(fadeInColor, fadeOutColor, u);
  3990. color = czm_gammaCorrect(color);
  3991. material.emission = color.rgb;
  3992. material.alpha = color.a;
  3993. return material;
  3994. }
  3995. `;var JYt=T(S(),1),CE=`uniform vec4 color;
  3996. uniform float cellAlpha;
  3997. uniform vec2 lineCount;
  3998. uniform vec2 lineThickness;
  3999. uniform vec2 lineOffset;
  4000. czm_material czm_getMaterial(czm_materialInput materialInput)
  4001. {
  4002. czm_material material = czm_getDefaultMaterial(materialInput);
  4003. vec2 st = materialInput.st;
  4004. float scaledWidth = fract(lineCount.s * st.s - lineOffset.s);
  4005. scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));
  4006. float scaledHeight = fract(lineCount.t * st.t - lineOffset.t);
  4007. scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));
  4008. float value;
  4009. // Fuzz Factor - Controls blurriness of lines
  4010. #if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
  4011. const float fuzz = 1.2;
  4012. vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0;
  4013. // From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13.
  4014. vec2 dx = abs(dFdx(st));
  4015. vec2 dy = abs(dFdy(st));
  4016. vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;
  4017. value = min(
  4018. smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),
  4019. smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));
  4020. #else
  4021. // If no derivatives available (IE 10?), revert to view-dependent fuzz
  4022. const float fuzz = 0.05;
  4023. vec2 range = 0.5 - (lineThickness * 0.05);
  4024. value = min(
  4025. 1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),
  4026. 1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));
  4027. #endif
  4028. // Edges taken from RimLightingMaterial.glsl
  4029. // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html
  4030. float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));
  4031. float sRim = smoothstep(0.8, 1.0, dRim);
  4032. value *= (1.0 - sRim);
  4033. vec4 halfColor;
  4034. halfColor.rgb = color.rgb * 0.5;
  4035. halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value));
  4036. halfColor = czm_gammaCorrect(halfColor);
  4037. material.diffuse = halfColor.rgb;
  4038. material.emission = halfColor.rgb;
  4039. material.alpha = halfColor.a;
  4040. return material;
  4041. }
  4042. `;var jYt=T(S(),1),VE=`uniform sampler2D image;
  4043. uniform float strength;
  4044. uniform vec2 repeat;
  4045. czm_material czm_getMaterial(czm_materialInput materialInput)
  4046. {
  4047. czm_material material = czm_getDefaultMaterial(materialInput);
  4048. vec4 textureValue = texture(image, fract(repeat * materialInput.st));
  4049. vec3 normalTangentSpace = textureValue.channels;
  4050. normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;
  4051. normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);
  4052. normalTangentSpace = normalize(normalTangentSpace);
  4053. vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;
  4054. material.normal = normalEC;
  4055. return material;
  4056. }
  4057. `;var $Yt=T(S(),1),LE=`uniform vec4 color;
  4058. float getPointOnLine(vec2 p0, vec2 p1, float x)
  4059. {
  4060. float slope = (p0.y - p1.y) / (p0.x - p1.x);
  4061. return slope * (x - p0.x) + p0.y;
  4062. }
  4063. czm_material czm_getMaterial(czm_materialInput materialInput)
  4064. {
  4065. czm_material material = czm_getDefaultMaterial(materialInput);
  4066. vec2 st = materialInput.st;
  4067. #if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
  4068. float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio;
  4069. #else
  4070. // If no derivatives available (IE 10?), 2.5% of the line will be the arrow head
  4071. float base = 0.975;
  4072. #endif
  4073. vec2 center = vec2(1.0, 0.5);
  4074. float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);
  4075. float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);
  4076. float halfWidth = 0.15;
  4077. float s = step(0.5 - halfWidth, st.t);
  4078. s *= 1.0 - step(0.5 + halfWidth, st.t);
  4079. s *= 1.0 - step(base, st.s);
  4080. float t = step(base, materialInput.st.s);
  4081. t *= 1.0 - step(ptOnUpperLine, st.t);
  4082. t *= step(ptOnLowerLine, st.t);
  4083. // Find the distance from the closest separator (region between two colors)
  4084. float dist;
  4085. if (st.s < base)
  4086. {
  4087. float d1 = abs(st.t - (0.5 - halfWidth));
  4088. float d2 = abs(st.t - (0.5 + halfWidth));
  4089. dist = min(d1, d2);
  4090. }
  4091. else
  4092. {
  4093. float d1 = czm_infinity;
  4094. if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)
  4095. {
  4096. d1 = abs(st.s - base);
  4097. }
  4098. float d2 = abs(st.t - ptOnUpperLine);
  4099. float d3 = abs(st.t - ptOnLowerLine);
  4100. dist = min(min(d1, d2), d3);
  4101. }
  4102. vec4 outsideColor = vec4(0.0);
  4103. vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));
  4104. vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);
  4105. outColor = czm_gammaCorrect(outColor);
  4106. material.diffuse = outColor.rgb;
  4107. material.alpha = outColor.a;
  4108. return material;
  4109. }
  4110. `;var tHt=T(S(),1),RE=`uniform vec4 color;
  4111. uniform vec4 gapColor;
  4112. uniform float dashLength;
  4113. uniform float dashPattern;
  4114. in float v_polylineAngle;
  4115. const float maskLength = 16.0;
  4116. mat2 rotate(float rad) {
  4117. float c = cos(rad);
  4118. float s = sin(rad);
  4119. return mat2(
  4120. c, s,
  4121. -s, c
  4122. );
  4123. }
  4124. czm_material czm_getMaterial(czm_materialInput materialInput)
  4125. {
  4126. czm_material material = czm_getDefaultMaterial(materialInput);
  4127. vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy;
  4128. // Get the relative position within the dash from 0 to 1
  4129. float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio));
  4130. // Figure out the mask index.
  4131. float maskIndex = floor(dashPosition * maskLength);
  4132. // Test the bit mask.
  4133. float maskTest = floor(dashPattern / pow(2.0, maskIndex));
  4134. vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color;
  4135. if (fragColor.a < 0.005) { // matches 0/255 and 1/255
  4136. discard;
  4137. }
  4138. fragColor = czm_gammaCorrect(fragColor);
  4139. material.emission = fragColor.rgb;
  4140. material.alpha = fragColor.a;
  4141. return material;
  4142. }
  4143. `;var iHt=T(S(),1),ZE=`uniform vec4 color;
  4144. uniform float glowPower;
  4145. uniform float taperPower;
  4146. czm_material czm_getMaterial(czm_materialInput materialInput)
  4147. {
  4148. czm_material material = czm_getDefaultMaterial(materialInput);
  4149. vec2 st = materialInput.st;
  4150. float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);
  4151. if (taperPower <= 0.99999) {
  4152. glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5));
  4153. }
  4154. vec4 fragColor;
  4155. fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb);
  4156. fragColor.a = clamp(0.0, 1.0, glow) * color.a;
  4157. fragColor = czm_gammaCorrect(fragColor);
  4158. material.emission = fragColor.rgb;
  4159. material.alpha = fragColor.a;
  4160. return material;
  4161. }
  4162. `;var rHt=T(S(),1),GE=`uniform vec4 color;
  4163. uniform vec4 outlineColor;
  4164. uniform float outlineWidth;
  4165. in float v_width;
  4166. czm_material czm_getMaterial(czm_materialInput materialInput)
  4167. {
  4168. czm_material material = czm_getDefaultMaterial(materialInput);
  4169. vec2 st = materialInput.st;
  4170. float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;
  4171. float b = step(0.5 - halfInteriorWidth, st.t);
  4172. b *= 1.0 - step(0.5 + halfInteriorWidth, st.t);
  4173. // Find the distance from the closest separator (region between two colors)
  4174. float d1 = abs(st.t - (0.5 - halfInteriorWidth));
  4175. float d2 = abs(st.t - (0.5 + halfInteriorWidth));
  4176. float dist = min(d1, d2);
  4177. vec4 currentColor = mix(outlineColor, color, b);
  4178. vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);
  4179. outColor = czm_gammaCorrect(outColor);
  4180. material.diffuse = outColor.rgb;
  4181. material.alpha = outColor.a;
  4182. return material;
  4183. }
  4184. `;var aHt=T(S(),1),EE=`uniform vec4 color;
  4185. uniform vec4 rimColor;
  4186. uniform float width;
  4187. czm_material czm_getMaterial(czm_materialInput materialInput)
  4188. {
  4189. czm_material material = czm_getDefaultMaterial(materialInput);
  4190. // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html
  4191. float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));
  4192. float s = smoothstep(1.0 - width, 1.0, d);
  4193. vec4 outColor = czm_gammaCorrect(color);
  4194. vec4 outRimColor = czm_gammaCorrect(rimColor);
  4195. material.diffuse = outColor.rgb;
  4196. material.emission = outRimColor.rgb * s;
  4197. material.alpha = mix(outColor.a, outRimColor.a, s);
  4198. return material;
  4199. }
  4200. `;var lHt=T(S(),1),IE=`uniform sampler2D image;
  4201. czm_material czm_getMaterial(czm_materialInput materialInput)
  4202. {
  4203. czm_material material = czm_getDefaultMaterial(materialInput);
  4204. vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5));
  4205. rampColor = czm_gammaCorrect(rampColor);
  4206. material.diffuse = rampColor.rgb;
  4207. material.alpha = rampColor.a;
  4208. return material;
  4209. }
  4210. `;var uHt=T(S(),1),XE=`uniform vec4 evenColor;
  4211. uniform vec4 oddColor;
  4212. uniform float offset;
  4213. uniform float repeat;
  4214. uniform bool horizontal;
  4215. czm_material czm_getMaterial(czm_materialInput materialInput)
  4216. {
  4217. czm_material material = czm_getDefaultMaterial(materialInput);
  4218. // Based on the Stripes Fragment Shader in the Orange Book (11.1.2)
  4219. float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));
  4220. float value = fract((coord - offset) * (repeat * 0.5));
  4221. float dist = min(value, min(abs(value - 0.5), 1.0 - value));
  4222. vec4 currentColor = mix(evenColor, oddColor, step(0.5, value));
  4223. vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);
  4224. color = czm_gammaCorrect(color);
  4225. material.diffuse = color.rgb;
  4226. material.alpha = color.a;
  4227. return material;
  4228. }
  4229. `;var hHt=T(S(),1),WE=`uniform vec4 waterColor;
  4230. uniform vec4 landColor;
  4231. czm_material czm_getMaterial(czm_materialInput materialInput)
  4232. {
  4233. czm_material material = czm_getDefaultMaterial(materialInput);
  4234. vec4 outColor = mix(landColor, waterColor, materialInput.waterMask);
  4235. outColor = czm_gammaCorrect(outColor);
  4236. material.diffuse = outColor.rgb;
  4237. material.alpha = outColor.a;
  4238. return material;
  4239. }
  4240. `;var pHt=T(S(),1),PE=`// Thanks for the contribution Jonas
  4241. // http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog
  4242. uniform sampler2D specularMap;
  4243. uniform sampler2D normalMap;
  4244. uniform vec4 baseWaterColor;
  4245. uniform vec4 blendColor;
  4246. uniform float frequency;
  4247. uniform float animationSpeed;
  4248. uniform float amplitude;
  4249. uniform float specularIntensity;
  4250. uniform float fadeFactor;
  4251. czm_material czm_getMaterial(czm_materialInput materialInput)
  4252. {
  4253. czm_material material = czm_getDefaultMaterial(materialInput);
  4254. float time = czm_frameNumber * animationSpeed;
  4255. // fade is a function of the distance from the fragment and the frequency of the waves
  4256. float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);
  4257. float specularMapValue = texture(specularMap, materialInput.st).r;
  4258. // note: not using directional motion at this time, just set the angle to 0.0;
  4259. vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);
  4260. vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));
  4261. // fade out the normal perturbation as we move further from the water surface
  4262. normalTangentSpace.xy /= fade;
  4263. // attempt to fade out the normal perturbation as we approach non water areas (low specular map value)
  4264. normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);
  4265. normalTangentSpace = normalize(normalTangentSpace);
  4266. // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane
  4267. float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);
  4268. // fade out water effect as specular map value decreases
  4269. material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue;
  4270. // base color is a blend of the water and non-water color based on the value from the specular map
  4271. // may need a uniform blend factor to better control this
  4272. material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);
  4273. // diffuse highlights are based on how perturbed the normal is
  4274. material.diffuse += (0.1 * tsPerturbationRatio);
  4275. material.diffuse = material.diffuse;
  4276. material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);
  4277. material.specular = specularIntensity;
  4278. material.shininess = 10.0;
  4279. return material;
  4280. }
  4281. `;function ze(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=y(e.minificationFilter,$t.LINEAR),this._magnificationFilter=y(e.magnificationFilter,hi.LINEAR),this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,HIe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),l(ze._uniformList[this.type])||(ze._uniformList[this.type]=Object.keys(this._uniforms))}ze._uniformList={};ze.fromType=function(e,t){let n=new ze({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};ze.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){let o=t[i];if(typeof o=="function"?e=e&&o():e=e&&o,!e)break}return e};ze.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,o=i.length;for(t=0;t<o;++t){let c=i[t];n=c.id;let d=c.image,u;Array.isArray(d)&&(u=d.slice(1,d.length).map(function(x){return x.bufferView}),d=d[0]);let m=new en({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(d.internalFormat)?p=new Pt({context:e,pixelFormat:d.internalFormat,width:d.width,height:d.height,source:{arrayBufferView:d.bufferView,mipLevels:u},sampler:m}):p=new Pt({context:e,source:d,sampler:m});let g=this._textures[n];l(g)&&g!==this._defaultTexture&&g.destroy(),this._textures[n]=p;let f=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(f)){let x=this.uniforms[f];x.x=p._width,x.y=p._height}}i.length=0;let r=this._loadedCubeMaps;for(o=r.length,t=0;t<o;++t){let c=r[t];n=c.id;let d=c.images,u=new yr({context:e,source:{positiveX:d[0],negativeX:d[1],positiveY:d[2],negativeY:d[3],positiveZ:d[4],negativeZ:d[5]},sampler:new en({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=u}r.length=0;let s=this._updateFunctions;for(o=s.length,t=0;t<o;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};ze.prototype.isDestroyed=function(){return!1};ze.prototype.destroy=function(){let e=this._textures;for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];i!==this._defaultTexture&&i.destroy()}let t=this.materials;for(let n in t)t.hasOwnProperty(n)&&t[n].destroy();return me(this)};function HIe(e,t){e=y(e,y.EMPTY_OBJECT),t._strict=y(e.strict,!1),t._count=y(e.count,0),t._template=Ye(y(e.fabric,y.EMPTY_OBJECT)),t._template.uniforms=Ye(y(t._template.uniforms,y.EMPTY_OBJECT)),t._template.materials=Ye(y(t._template.materials,y.EMPTY_OBJECT)),t.type=l(t._template.type)?t._template.type:Bn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=ze._materialCache.getMaterial(t.type);if(l(i)){let r=Ye(i.fabric,!0);t._template=Tt(t._template,r,!0),n=i.translucent}QIe(t),l(i)||ze._materialCache.addMaterial(t.type,t),qIe(t),nXe(t),oXe(t);let o=t._translucentFunctions.length===0?!0:void 0;if(n=y(n,o),n=y(e.translucent,n),l(n))if(typeof n=="function"){let r=function(){return n(t)};t._translucentFunctions.push(r)}else t._translucentFunctions.push(n)}function WY(e,t,n,i){if(l(e)){for(let o in e)if(e.hasOwnProperty(o)){let r=t.indexOf(o)!==-1;(i&&!r||!i&&r)&&n(o,t)}}}function sne(e,t){}function zIe(e,t){}var KIe=["type","materials","uniforms","components","source"],JIe=["diffuse","specular","shininess","normal","emission","alpha"];function QIe(e){let t=e._template,n=t.uniforms,i=t.materials,o=t.components;WY(t,KIe,sne,!0),WY(o,JIe,sne,!0);let r=[];for(let s in i)i.hasOwnProperty(s)&&r.push(s);WY(n,r,zIe,!1)}function jIe(e,t){let n=t._template.materials;for(let i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function qIe(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n}
  4282. `;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput)
  4283. {
  4284. `,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput);
  4285. `,l(t)){let i=Object.keys(e._template.materials).length>0;for(let o in t)if(t.hasOwnProperty(o))if(o==="diffuse"||o==="emission"){let s=i&&jIe(t[o],e)?t[o]:`czm_gammaCorrect(${t[o]})`;e.shaderSource+=`material.${o} = ${s};
  4286. `}else o==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha};
  4287. `:e.shaderSource+=`material.${o} = ${t[o]};
  4288. `}e.shaderSource+=`return material;
  4289. }
  4290. `}}var ane={mat2:wi,mat3:$,mat4:M},$Ie=/\.ktx2$/i;function eXe(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!l(r)||r===ze.DefaultImageId;t=r;let c=n._textures[e],d,u;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let p=new en({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Pt({context:i,source:r,sampler:p}),n._textures[e]=c;return}c.copyFrom({source:r})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(r instanceof Pt&&r!==c){n._texturePaths[e]=void 0;let p=n._textures[e];l(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=r,d=`${e}Dimensions`,o.hasOwnProperty(d)&&(u=o[d],u.x=r._width,u.y=r._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0),l(c)||(n._texturePaths[e]=void 0,c=n._textures[e]=n._defaultTexture,d=`${e}Dimensions`,o.hasOwnProperty(d)&&(u=o[d],u.x=c._width,u.y=c._height)),a)return;let m=r instanceof Ee;if(!l(n._texturePaths[e])||m&&r.url!==n._texturePaths[e].url||!m&&r!==n._texturePaths[e]){if(typeof r=="string"||m){let p=m?r:Ee.createIfNeeded(r),g;$Ie.test(p.url)?g=_l(p.url):g=p.fetchImage(),Promise.resolve(g).then(function(f){n._loadedImages.push({id:e,image:f})}).catch(function(){l(c)&&c!==n._defaultTexture&&c.destroy(),n._textures[e]=n._defaultTexture})}else(r instanceof HTMLCanvasElement||r instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:r});n._texturePaths[e]=r}}}function tXe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof yr){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(l(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===ze.DefaultCubeMapId)return;let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){let r=[Ee.createIfNeeded(i.positiveX).fetchImage(),Ee.createIfNeeded(i.negativeX).fetchImage(),Ee.createIfNeeded(i.positiveY).fetchImage(),Ee.createIfNeeded(i.negativeY).fetchImage(),Ee.createIfNeeded(i.positiveZ).fetchImage(),Ee.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(r).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=o}}}function nXe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&cne(e,n)}function cne(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=iXe(o),s;if(r==="channels")s=vE(e,t,o,!1);else{if(r==="sampler2D"){let d=`${t}Dimensions`;rXe(e,d)>0&&(i[d]={type:"ivec3",x:1,y:1},cne(e,d))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let d=`uniform ${r} ${t};`;e.shaderSource=d+e.shaderSource}let c=`${t}_${e._count++}`;if(s=vE(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(eXe(t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(tXe(t));else if(r.indexOf("mat")!==-1){let d=new ane[r];e._uniforms[c]=function(){return ane[r].fromColumnMajorArray(e.uniforms[t],d)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function iXe(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof Ee||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===ze.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let o in e)e.hasOwnProperty(o)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function oXe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new ze({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=Tt(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;vE(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=vE(e,i,a)}}function vE(e,t,n,i){i=y(i,!0);let o=0,r="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+r,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,d,u){return d||u?c:(o+=1,n)}),o}function rXe(e,t,n){return vE(e,t,t,n)}ze._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};ze.DefaultImageId="czm_defaultImage";ze.DefaultCubeMapId="czm_defaultCubeMap";ze.ColorType="Color";ze._materialCache.addMaterial(ze.ColorType,{fabric:{type:ze.ColorType,uniforms:{color:new B(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});ze.ImageType="Image";ze._materialCache.addMaterial(ze.ImageType,{fabric:{type:ze.ImageType,uniforms:{image:ze.DefaultImageId,repeat:new D(1,1),color:new B(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});ze.DiffuseMapType="DiffuseMap";ze._materialCache.addMaterial(ze.DiffuseMapType,{fabric:{type:ze.DiffuseMapType,uniforms:{image:ze.DefaultImageId,channels:"rgb",repeat:new D(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});ze.AlphaMapType="AlphaMap";ze._materialCache.addMaterial(ze.AlphaMapType,{fabric:{type:ze.AlphaMapType,uniforms:{image:ze.DefaultImageId,channel:"a",repeat:new D(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});ze.SpecularMapType="SpecularMap";ze._materialCache.addMaterial(ze.SpecularMapType,{fabric:{type:ze.SpecularMapType,uniforms:{image:ze.DefaultImageId,channel:"r",repeat:new D(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});ze.EmissionMapType="EmissionMap";ze._materialCache.addMaterial(ze.EmissionMapType,{fabric:{type:ze.EmissionMapType,uniforms:{image:ze.DefaultImageId,channels:"rgb",repeat:new D(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});ze.BumpMapType="BumpMap";ze._materialCache.addMaterial(ze.BumpMapType,{fabric:{type:ze.BumpMapType,uniforms:{image:ze.DefaultImageId,channel:"r",strength:.8,repeat:new D(1,1)},source:bE},translucent:!1});ze.NormalMapType="NormalMap";ze._materialCache.addMaterial(ze.NormalMapType,{fabric:{type:ze.NormalMapType,uniforms:{image:ze.DefaultImageId,channels:"rgb",strength:.8,repeat:new D(1,1)},source:VE},translucent:!1});ze.GridType="Grid";ze._materialCache.addMaterial(ze.GridType,{fabric:{type:ze.GridType,uniforms:{color:new B(0,1,0,1),cellAlpha:.1,lineCount:new D(8,8),lineThickness:new D(1,1),lineOffset:new D(0,0)},source:CE},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});ze.StripeType="Stripe";ze._materialCache.addMaterial(ze.StripeType,{fabric:{type:ze.StripeType,uniforms:{horizontal:!0,evenColor:new B(1,1,1,.5),oddColor:new B(0,0,1,.5),offset:0,repeat:5},source:XE},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});ze.CheckerboardType="Checkerboard";ze._materialCache.addMaterial(ze.CheckerboardType,{fabric:{type:ze.CheckerboardType,uniforms:{lightColor:new B(1,1,1,.5),darkColor:new B(0,0,0,.5),repeat:new D(5,5)},source:gE},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});ze.DotType="Dot";ze._materialCache.addMaterial(ze.DotType,{fabric:{type:ze.DotType,uniforms:{lightColor:new B(1,1,0,.75),darkColor:new B(0,1,1,.75),repeat:new D(5,5)},source:yE},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});ze.WaterType="Water";ze._materialCache.addMaterial(ze.WaterType,{fabric:{type:ze.WaterType,uniforms:{baseWaterColor:new B(.2,.3,.6,1),blendColor:new B(0,1,.699,1),specularMap:ze.DefaultImageId,normalMap:ze.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:PE},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});ze.RimLightingType="RimLighting";ze._materialCache.addMaterial(ze.RimLightingType,{fabric:{type:ze.RimLightingType,uniforms:{color:new B(1,0,0,.7),rimColor:new B(1,1,1,.4),width:.3},source:EE},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});ze.FadeType="Fade";ze._materialCache.addMaterial(ze.FadeType,{fabric:{type:ze.FadeType,uniforms:{fadeInColor:new B(1,0,0,1),fadeOutColor:new B(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new D(.5,.5)},source:SE},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});ze.PolylineArrowType="PolylineArrow";ze._materialCache.addMaterial(ze.PolylineArrowType,{fabric:{type:ze.PolylineArrowType,uniforms:{color:new B(1,1,1,1)},source:LE},translucent:!0});ze.PolylineDashType="PolylineDash";ze._materialCache.addMaterial(ze.PolylineDashType,{fabric:{type:ze.PolylineDashType,uniforms:{color:new B(1,0,1,1),gapColor:new B(0,0,0,0),dashLength:16,dashPattern:255},source:RE},translucent:!0});ze.PolylineGlowType="PolylineGlow";ze._materialCache.addMaterial(ze.PolylineGlowType,{fabric:{type:ze.PolylineGlowType,uniforms:{color:new B(0,.5,1,1),glowPower:.25,taperPower:1},source:ZE},translucent:!0});ze.PolylineOutlineType="PolylineOutline";ze._materialCache.addMaterial(ze.PolylineOutlineType,{fabric:{type:ze.PolylineOutlineType,uniforms:{color:new B(1,1,1,1),outlineColor:new B(1,0,0,1),outlineWidth:1},source:GE},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});ze.ElevationContourType="ElevationContour";ze._materialCache.addMaterial(ze.ElevationContourType,{fabric:{type:ze.ElevationContourType,uniforms:{spacing:100,color:new B(1,0,0,1),width:1},source:_E},translucent:!1});ze.ElevationRampType="ElevationRamp";ze._materialCache.addMaterial(ze.ElevationRampType,{fabric:{type:ze.ElevationRampType,uniforms:{image:ze.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:TE},translucent:!1});ze.SlopeRampMaterialType="SlopeRamp";ze._materialCache.addMaterial(ze.SlopeRampMaterialType,{fabric:{type:ze.SlopeRampMaterialType,uniforms:{image:ze.DefaultImageId},source:IE},translucent:!1});ze.AspectRampMaterialType="AspectRamp";ze._materialCache.addMaterial(ze.AspectRampMaterialType,{fabric:{type:ze.AspectRampMaterialType,uniforms:{image:ze.DefaultImageId},source:pE},translucent:!1});ze.ElevationBandType="ElevationBand";ze._materialCache.addMaterial(ze.ElevationBandType,{fabric:{type:ze.ElevationBandType,uniforms:{heights:ze.DefaultImageId,colors:ze.DefaultImageId},source:xE},translucent:!0});ze.WaterMaskType="WaterMask";ze._materialCache.addMaterial(ze.WaterMaskType,{fabric:{type:ze.WaterMaskType,source:WE,uniforms:{waterColor:new B(1,1,1,1),landColor:new B(0,0,0,0)}},translucent:!1});var Oi=ze;function yx(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.materialSupport,yx.MaterialSupport.TEXTURED);this.material=l(e.material)?e.material:Oi.fromType(Oi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,i.vertexShaderSource),this._fragmentShaderSource=y(e.fragmentShaderSource,i.fragmentShaderSource),this._renderState=eo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,!n)}Object.defineProperties(yx.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});yx.prototype.getFragmentShaderSource=eo.prototype.getFragmentShaderSource;yx.prototype.isTranslucent=eo.prototype.isTranslucent;yx.prototype.getRenderState=eo.prototype.getRenderState;yx.MaterialSupport={BASIC:Object.freeze({vertexFormat:We.POSITION_AND_NORMAL,vertexShaderSource:mE,fragmentShaderSource:uE}),TEXTURED:Object.freeze({vertexFormat:We.POSITION_NORMAL_AND_ST,vertexShaderSource:fE,fragmentShaderSource:hE}),ALL:Object.freeze({vertexFormat:We.ALL,vertexShaderSource:dE,fragmentShaderSource:lE})};var oo=yx;var Izt=T(S(),1);var pzt=T(S(),1),wE=`in vec3 v_positionEC;
  4291. in vec3 v_normalEC;
  4292. in vec4 v_color;
  4293. void main()
  4294. {
  4295. vec3 positionToEyeEC = -v_positionEC;
  4296. vec3 normalEC = normalize(v_normalEC);
  4297. #ifdef FACE_FORWARD
  4298. normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
  4299. #endif
  4300. vec4 color = czm_gammaCorrect(v_color);
  4301. czm_materialInput materialInput;
  4302. materialInput.normalEC = normalEC;
  4303. materialInput.positionToEyeEC = positionToEyeEC;
  4304. czm_material material = czm_getDefaultMaterial(materialInput);
  4305. material.diffuse = color.rgb;
  4306. material.alpha = color.a;
  4307. out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
  4308. }
  4309. `;var gzt=T(S(),1),FE=`in vec3 position3DHigh;
  4310. in vec3 position3DLow;
  4311. in vec3 normal;
  4312. in vec4 color;
  4313. in float batchId;
  4314. out vec3 v_positionEC;
  4315. out vec3 v_normalEC;
  4316. out vec4 v_color;
  4317. void main()
  4318. {
  4319. vec4 p = czm_computePosition();
  4320. v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
  4321. v_normalEC = czm_normal * normal; // normal in eye coordinates
  4322. v_color = color;
  4323. gl_Position = czm_modelViewProjectionRelativeToEye * p;
  4324. }
  4325. `;var xzt=T(S(),1),xx=`in vec4 v_color;
  4326. void main()
  4327. {
  4328. out_FragColor = czm_gammaCorrect(v_color);
  4329. }
  4330. `;var Tzt=T(S(),1),AE=`in vec3 position3DHigh;
  4331. in vec3 position3DLow;
  4332. in vec4 color;
  4333. in float batchId;
  4334. out vec4 v_color;
  4335. void main()
  4336. {
  4337. vec4 p = czm_computePosition();
  4338. v_color = color;
  4339. gl_Position = czm_modelViewProjectionRelativeToEye * p;
  4340. }
  4341. `;function Cp(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.closed,!1),i=y(e.flat,!1),o=i?AE:FE,r=i?xx:wE,s=i?Cp.FLAT_VERTEX_FORMAT:Cp.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,o),this._fragmentShaderSource=y(e.fragmentShaderSource,r),this._renderState=eo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=y(e.faceForward,!n)}Object.defineProperties(Cp.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});Cp.VERTEX_FORMAT=We.POSITION_AND_NORMAL;Cp.FLAT_VERTEX_FORMAT=We.POSITION_ONLY;Cp.prototype.getFragmentShaderSource=eo.prototype.getFragmentShaderSource;Cp.prototype.isTranslucent=eo.prototype.isTranslucent;Cp.prototype.getRenderState=eo.prototype.getRenderState;var dn=Cp;var Mzt=T(S(),1);function $S(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties($S.prototype,{isConstant:{get:function(){return K.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color")});$S.prototype.getType=function(e){return"Color"};var sXe=new j;$S.prototype.getValue=function(e,t){return l(e)||(e=j.now(sXe)),l(t)||(t={}),t.color=K.getValueOrClonedDefault(this._color,e,B.WHITE,t.color),t};$S.prototype.equals=function(e){return this===e||e instanceof $S&&K.equals(this._color,e._color)};var Yt=$S;var Cjt=T(S(),1);var njt=T(S(),1);var sKt=T(S(),1);var zzt=T(S(),1);function A0(e){e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,ne.default),this._rectangle=y(e.rectangle,ae.MAX_VALUE),this._projection=new Ri(this._ellipsoid),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1)}Object.defineProperties(A0.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});A0.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};A0.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};A0.prototype.rectangleToNativeRectangle=function(e,t){let n=W.toDegrees(e.west),i=W.toDegrees(e.south),o=W.toDegrees(e.east),r=W.toDegrees(e.north);return l(t)?(t.west=n,t.south=i,t.east=o,t.north=r,t):new ae(n,i,o,r)};A0.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.tileXYToRectangle(e,t,n,i);return o.west=W.toDegrees(o.west),o.south=W.toDegrees(o.south),o.east=W.toDegrees(o.east),o.north=W.toDegrees(o.north),o};A0.prototype.tileXYToRectangle=function(e,t,n,i){let o=this._rectangle,r=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=o.width/r,c=e*a+o.west,d=(e+1)*a+o.west,u=o.height/s,m=o.north-t*u,p=o.north-(t+1)*u;return l(i)||(i=new ae(c,p,d,m)),i.west=c,i.south=p,i.east=d,i.north=m,i};A0.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ae.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),s=i.width/o,a=i.height/r,c=e.longitude;i.east<i.west&&(c+=W.TWO_PI);let d=(c-i.west)/s|0;d>=o&&(d=o-1);let u=(i.north-e.latitude)/a|0;return u>=r&&(u=r-1),l(n)?(n.x=d,n.y=u,n):new D(d,u)};var Yi=A0;var lne=new h,dne=new h,une=new he,PY=new h,aXe=new h,mne=new ce,cXe=new Yi,ME=[new he,new he,new he,new he],NE=new D,zr={};zr.initialize=function(){let e=zr._initPromise;return l(e)||(e=Ee.fetchJson(rn("Assets/approximateTerrainHeights.json")).then(function(t){zr._terrainHeights=t}),zr._initPromise=e),e};zr.getMinimumMaximumHeights=function(e,t){t=y(t,ne.default);let n=hne(e),i=zr._defaultMinTerrainHeight,o=zr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=zr._terrainHeights[r];l(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(ae.northeast(e,une),lne),t.cartographicToCartesian(ae.southwest(e,une),dne),h.midpoint(dne,lne,PY);let a=t.scaleToGeodeticSurface(PY,aXe);if(l(a)){let c=h.distance(PY,a);i=Math.min(i,-c)}else i=zr._defaultMinTerrainHeight}return i=Math.max(zr._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};zr.getBoundingSphere=function(e,t){t=y(t,ne.default);let n=hne(e),i=zr._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=zr._terrainHeights[r];l(s)&&(i=s[1])}let o=ce.fromRectangle3D(e,t,0);return ce.fromRectangle3D(e,t,i,mne),ce.union(o,mne,o)};function hne(e){he.fromRadians(e.east,e.north,0,ME[0]),he.fromRadians(e.west,e.north,0,ME[1]),he.fromRadians(e.east,e.south,0,ME[2]),he.fromRadians(e.west,e.south,0,ME[3]);let t=0,n=0,i=0,o=0,r=zr._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let c=0;c<4;++c){let d=ME[c];if(cXe.positionToTileXY(d,s,NE),c===0)i=NE.x,o=NE.y;else if(i!==NE.x||o!==NE.y){a=!0;break}}if(a)break;t=i,n=o}if(s!==0)return{x:t,y:n,level:s>r?r:s-1}}zr._terrainHeightsMaxLevel=6;zr._defaultMaxTerrainHeight=9e3;zr._defaultMinTerrainHeight=-1e5;zr._terrainHeights=void 0;zr._initPromise=void 0;Object.defineProperties(zr,{initialized:{get:function(){return l(zr._terrainHeights)}}});var li=zr;var BKt=T(S(),1);var RKt=T(S(),1);var mKt=T(S(),1);function Fc(e,t,n){this.minimum=h.clone(y(e,h.ZERO)),this.maximum=h.clone(y(t,h.ZERO)),l(n)?n=h.clone(n):n=h.midpoint(this.minimum,this.maximum,new h),this.center=n}Fc.fromCorners=function(e,t,n){return l(n)||(n=new Fc),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};Fc.fromPoints=function(e,t){if(l(t)||(t=new Fc),!l(e)||e.length===0)return t.minimum=h.clone(h.ZERO,t.minimum),t.maximum=h.clone(h.ZERO,t.maximum),t.center=h.clone(h.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,r=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let m=1;m<c;m++){let p=e[m],g=p.x,f=p.y,x=p.z;n=Math.min(g,n),r=Math.max(g,r),i=Math.min(f,i),s=Math.max(f,s),o=Math.min(x,o),a=Math.max(x,a)}let d=t.minimum;d.x=n,d.y=i,d.z=o;let u=t.maximum;return u.x=r,u.y=s,u.z=a,t.center=h.midpoint(d,u,t.center),t};Fc.clone=function(e,t){if(l(e))return l(t)?(t.minimum=h.clone(e.minimum,t.minimum),t.maximum=h.clone(e.maximum,t.maximum),t.center=h.clone(e.center,t.center),t):new Fc(e.minimum,e.maximum,e.center)};Fc.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&h.equals(e.minimum,t.minimum)&&h.equals(e.maximum,t.maximum)};var HN=new h;Fc.intersectPlane=function(e,t){HN=h.subtract(e.maximum,e.minimum,HN);let n=h.multiplyByScalar(HN,.5,HN),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),r=h.dot(e.center,i)+t.distance;return r-o>0?Jt.INSIDE:r+o<0?Jt.OUTSIDE:Jt.INTERSECTING};Fc.prototype.clone=function(e){return Fc.clone(this,e)};Fc.prototype.intersectPlane=function(e){return Fc.intersectPlane(this,e)};Fc.prototype.equals=function(e){return Fc.equals(this,e)};var M0=Fc;var vY=new se;function $h(e,t){t=y(t,ne.default),e=t.scaleToGeodeticSurface(e);let n=Ft.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=h.fromCartesian4(M.getColumn(n,0,vY)),this._yAxis=h.fromCartesian4(M.getColumn(n,1,vY));let i=h.fromCartesian4(M.getColumn(n,2,vY));this._plane=ln.fromPointNormal(e,i)}Object.defineProperties($h.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var lXe=new M0;$h.fromPoints=function(e,t){let n=M0.fromPoints(e,lXe);return new $h(n.center,t)};var fne=new pn,zN=new h;$h.prototype.projectPointOntoPlane=function(e,t){let n=fne;n.origin=e,h.normalize(e,n.direction);let i=qn.rayPlane(n,this._plane,zN);if(l(i)||(h.negate(n.direction,n.direction),i=qn.rayPlane(n,this._plane,zN)),l(i)){let o=h.subtract(i,this._origin,i),r=h.dot(this._xAxis,o),s=h.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=s,t):new D(r,s)}};$h.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let o=0;o<i;o++){let r=this.projectPointOntoPlane(e[o],t[n]);l(r)&&(t[n]=r,n++)}return t.length=n,t};$h.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new D);let n=fne;n.origin=e,h.clone(this._plane.normal,n.direction);let i=qn.rayPlane(n,this._plane,zN);l(i)||(h.negate(n.direction,n.direction),i=qn.rayPlane(n,this._plane,zN));let o=h.subtract(i,this._origin,i),r=h.dot(this._xAxis,o),s=h.dot(this._yAxis,o);return t.x=r,t.y=s,t};$h.prototype.projectPointsToNearestOnPlane=function(e,t){l(t)||(t=[]);let n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var dXe=new h;$h.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new h);let n=this._ellipsoid,i=this._origin,o=this._xAxis,r=this._yAxis,s=dXe;return h.multiplyByScalar(o,e.x,s),t=h.add(i,s,t),h.multiplyByScalar(r,e.y,s),h.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};$h.prototype.projectPointsOntoEllipsoid=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};var Kr=$h;function Fi(e,t){this.center=h.clone(y(e,h.ZERO)),this.halfAxes=$.clone(y(t,$.ZERO))}Fi.packedLength=h.packedLength+$.packedLength;Fi.pack=function(e,t,n){return n=y(n,0),h.pack(e.center,t,n),$.pack(e.halfAxes,t,n+h.packedLength),t};Fi.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Fi),h.unpack(e,t,n.center),$.unpack(e,t+h.packedLength,n.halfAxes),n};var uXe=new h,mXe=new h,hXe=new h,fXe=new h,pXe=new h,bXe=new h,gXe=new $,yXe={unitary:new $,diagonal:new $};Fi.fromPoints=function(e,t){if(l(t)||(t=new Fi),!l(e)||e.length===0)return t.halfAxes=$.ZERO,t.center=h.ZERO,t;let n,i=e.length,o=h.clone(e[0],uXe);for(n=1;n<i;n++)h.add(o,e[n],o);let r=1/i;h.multiplyByScalar(o,r,o);let s=0,a=0,c=0,d=0,u=0,m=0,p;for(n=0;n<i;n++)p=h.subtract(e[n],o,mXe),s+=p.x*p.x,a+=p.x*p.y,c+=p.x*p.z,d+=p.y*p.y,u+=p.y*p.z,m+=p.z*p.z;s*=r,a*=r,c*=r,d*=r,u*=r,m*=r;let g=gXe;g[0]=s,g[1]=a,g[2]=c,g[3]=a,g[4]=d,g[5]=u,g[6]=c,g[7]=u,g[8]=m;let f=$.computeEigenDecomposition(g,yXe),x=$.clone(f.unitary,t.halfAxes),_=$.getColumn(x,0,fXe),C=$.getColumn(x,1,pXe),V=$.getColumn(x,2,bXe),L=-Number.MAX_VALUE,Z=-Number.MAX_VALUE,G=-Number.MAX_VALUE,I=Number.MAX_VALUE,v=Number.MAX_VALUE,P=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],L=Math.max(h.dot(_,p),L),Z=Math.max(h.dot(C,p),Z),G=Math.max(h.dot(V,p),G),I=Math.min(h.dot(_,p),I),v=Math.min(h.dot(C,p),v),P=Math.min(h.dot(V,p),P);_=h.multiplyByScalar(_,.5*(I+L),_),C=h.multiplyByScalar(C,.5*(v+Z),C),V=h.multiplyByScalar(V,.5*(P+G),V);let w=h.add(_,C,t.center);h.add(w,V,w);let F=hXe;return F.x=L-I,F.y=Z-v,F.z=G-P,h.multiplyByScalar(F,.5,F),$.multiplyByScale(t.halfAxes,F,t.halfAxes),t};var _ne=new h,xXe=new h;function pne(e,t,n,i,o,r,s,a,c,d,u){l(u)||(u=new Fi);let m=u.halfAxes;$.setColumn(m,0,t,m),$.setColumn(m,1,n,m),$.setColumn(m,2,i,m);let p=_ne;p.x=(o+r)/2,p.y=(s+a)/2,p.z=(c+d)/2;let g=xXe;g.x=(r-o)/2,g.y=(a-s)/2,g.z=(d-c)/2;let f=u.center;return p=$.multiplyByVector(m,p,p),h.add(e,p,f),$.multiplyByScale(m,g,m),u}var bne=new he,_Xe=new h,TXe=new he,SXe=new he,CXe=new he,VXe=new he,LXe=new he,RXe=new h,gne=new h,ZXe=new h,yne=new h,GXe=new h,EXe=new D,IXe=new D,XXe=new D,WXe=new D,PXe=new D,vXe=new h,wXe=new h,FXe=new h,AXe=new h,MXe=new D,NXe=new h,kXe=new h,UXe=new h,DXe=new ln(h.UNIT_X,0);Fi.fromRectangle=function(e,t,n,i,o){t=y(t,0),n=y(n,0),i=y(i,ne.default);let r,s,a,c,d,u,m;if(e.width<=W.PI){let v=ae.center(e,bne),P=i.cartographicToCartesian(v,_Xe),w=new Kr(P,i);m=w.plane;let F=v.longitude,b=e.south<0&&e.north>0?0:v.latitude,R=he.fromRadians(F,e.north,n,TXe),E=he.fromRadians(e.west,e.north,n,SXe),X=he.fromRadians(e.west,b,n,CXe),A=he.fromRadians(e.west,e.south,n,VXe),N=he.fromRadians(F,e.south,n,LXe),O=i.cartographicToCartesian(R,RXe),U=i.cartographicToCartesian(E,gne),Y=i.cartographicToCartesian(X,ZXe),k=i.cartographicToCartesian(A,yne),H=i.cartographicToCartesian(N,GXe),J=w.projectPointToNearestOnPlane(O,EXe),te=w.projectPointToNearestOnPlane(U,IXe),z=w.projectPointToNearestOnPlane(Y,XXe),q=w.projectPointToNearestOnPlane(k,WXe),ee=w.projectPointToNearestOnPlane(H,PXe);return r=Math.min(te.x,z.x,q.x),s=-r,c=Math.max(te.y,J.y),a=Math.min(q.y,ee.y),E.height=A.height=t,U=i.cartographicToCartesian(E,gne),k=i.cartographicToCartesian(A,yne),d=Math.min(ln.getPointDistance(m,U),ln.getPointDistance(m,k)),u=n,pne(w.origin,w.xAxis,w.yAxis,w.zAxis,r,s,a,c,d,u,o)}let p=e.south>0,g=e.north<0,f=p?e.south:g?e.north:0,x=ae.center(e,bne).longitude,_=h.fromRadians(x,f,n,i,vXe);_.z=0;let V=Math.abs(_.x)<W.EPSILON10&&Math.abs(_.y)<W.EPSILON10?h.UNIT_X:h.normalize(_,wXe),L=h.UNIT_Z,Z=h.cross(V,L,FXe);m=ln.fromPointNormal(_,V,DXe);let G=h.fromRadians(x+W.PI_OVER_TWO,f,n,i,AXe);s=h.dot(ln.projectPointOntoPlane(m,G,MXe),Z),r=-s,c=h.fromRadians(0,e.north,g?t:n,i,NXe).z,a=h.fromRadians(0,e.south,p?t:n,i,kXe).z;let I=h.fromRadians(e.east,f,n,i,UXe);return d=ln.getPointDistance(m,I),u=0,pne(_,Z,L,V,r,s,a,c,d,u,o)};Fi.fromTransformation=function(e,t){return l(t)||(t=new Fi),t.center=M.getTranslation(e,t.center),t.halfAxes=M.getMatrix3(e,t.halfAxes),t.halfAxes=$.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};Fi.clone=function(e,t){if(l(e))return l(t)?(h.clone(e.center,t.center),$.clone(e.halfAxes,t.halfAxes),t):new Fi(e.center,e.halfAxes)};Fi.intersectPlane=function(e,t){let n=e.center,i=t.normal,o=e.halfAxes,r=i.x,s=i.y,a=i.z,c=Math.abs(r*o[$.COLUMN0ROW0]+s*o[$.COLUMN0ROW1]+a*o[$.COLUMN0ROW2])+Math.abs(r*o[$.COLUMN1ROW0]+s*o[$.COLUMN1ROW1]+a*o[$.COLUMN1ROW2])+Math.abs(r*o[$.COLUMN2ROW0]+s*o[$.COLUMN2ROW1]+a*o[$.COLUMN2ROW2]),d=h.dot(i,n)+t.distance;return d<=-c?Jt.OUTSIDE:d>=c?Jt.INSIDE:Jt.INTERSECTING};var Tne=new h,Sne=new h,Cne=new h,BXe=new h,xne=new h,OXe=new h;Fi.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,_ne),i=e.halfAxes,o=$.getColumn(i,0,Tne),r=$.getColumn(i,1,Sne),s=$.getColumn(i,2,Cne),a=h.magnitude(o),c=h.magnitude(r),d=h.magnitude(s),u=!0,m=!0,p=!0;a>0?h.divideByScalar(o,a,o):u=!1,c>0?h.divideByScalar(r,c,r):m=!1,d>0?h.divideByScalar(s,d,s):p=!1;let g=!u+!m+!p,f,x,_;if(g===1){let Z=o;f=r,x=s,m?p||(Z=s,x=o):(Z=r,f=o),_=h.cross(f,x,xne),Z===o?o=_:Z===r?r=_:Z===s&&(s=_)}else if(g===2){f=o,m?f=r:p&&(f=s);let Z=h.UNIT_Y;Z.equalsEpsilon(f,W.EPSILON3)&&(Z=h.UNIT_X),x=h.cross(f,Z,BXe),h.normalize(x,x),_=h.cross(f,x,xne),h.normalize(_,_),f===o?(r=x,s=_):f===r?(s=x,o=_):f===s&&(o=x,r=_)}else g===3&&(o=h.UNIT_X,r=h.UNIT_Y,s=h.UNIT_Z);let C=OXe;C.x=h.dot(n,o),C.y=h.dot(n,r),C.z=h.dot(n,s);let V=0,L;return C.x<-a?(L=C.x+a,V+=L*L):C.x>a&&(L=C.x-a,V+=L*L),C.y<-c?(L=C.y+c,V+=L*L):C.y>c&&(L=C.y-c,V+=L*L),C.z<-d?(L=C.z+d,V+=L*L):C.z>d&&(L=C.z-d,V+=L*L),V};var YXe=new h,HXe=new h;Fi.computePlaneDistances=function(e,t,n,i){l(i)||(i=new La);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=$.getColumn(a,0,Tne),d=$.getColumn(a,1,Sne),u=$.getColumn(a,2,Cne),m=h.add(c,d,YXe);h.add(m,u,m),h.add(m,s,m);let p=h.subtract(m,t,HXe),g=h.dot(n,p);return o=Math.min(g,o),r=Math.max(g,r),h.add(s,c,m),h.add(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.add(s,c,m),h.subtract(m,d,m),h.add(m,u,m),h.subtract(m,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.add(s,c,m),h.subtract(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.subtract(s,c,m),h.add(m,d,m),h.add(m,u,m),h.subtract(m,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.subtract(s,c,m),h.add(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.subtract(s,c,m),h.subtract(m,d,m),h.add(m,u,m),h.subtract(m,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),h.subtract(s,c,m),h.subtract(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),g=h.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),i.start=o,i.stop=r,i};var zXe=new h,KXe=new h,JXe=new h;Fi.computeCorners=function(e,t){l(t)||(t=[new h,new h,new h,new h,new h,new h,new h,new h]);let n=e.center,i=e.halfAxes,o=$.getColumn(i,0,zXe),r=$.getColumn(i,1,KXe),s=$.getColumn(i,2,JXe);return h.clone(n,t[0]),h.subtract(t[0],o,t[0]),h.subtract(t[0],r,t[0]),h.subtract(t[0],s,t[0]),h.clone(n,t[1]),h.subtract(t[1],o,t[1]),h.subtract(t[1],r,t[1]),h.add(t[1],s,t[1]),h.clone(n,t[2]),h.subtract(t[2],o,t[2]),h.add(t[2],r,t[2]),h.subtract(t[2],s,t[2]),h.clone(n,t[3]),h.subtract(t[3],o,t[3]),h.add(t[3],r,t[3]),h.add(t[3],s,t[3]),h.clone(n,t[4]),h.add(t[4],o,t[4]),h.subtract(t[4],r,t[4]),h.subtract(t[4],s,t[4]),h.clone(n,t[5]),h.add(t[5],o,t[5]),h.subtract(t[5],r,t[5]),h.add(t[5],s,t[5]),h.clone(n,t[6]),h.add(t[6],o,t[6]),h.add(t[6],r,t[6]),h.subtract(t[6],s,t[6]),h.clone(n,t[7]),h.add(t[7],o,t[7]),h.add(t[7],r,t[7]),h.add(t[7],s,t[7]),t};var QXe=new $;Fi.computeTransformation=function(e,t){l(t)||(t=new M);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,QXe);return M.fromRotationTranslation(i,n,t)};var jXe=new ce;Fi.isOccluded=function(e,t){let n=ce.fromOrientedBoundingBox(e,jXe);return!t.isBoundingSphereVisible(n)};Fi.prototype.intersectPlane=function(e){return Fi.intersectPlane(this,e)};Fi.prototype.distanceSquaredTo=function(e){return Fi.distanceSquaredTo(this,e)};Fi.prototype.computePlaneDistances=function(e,t,n){return Fi.computePlaneDistances(this,e,t,n)};Fi.prototype.computeCorners=function(e){return Fi.computeCorners(this,e)};Fi.prototype.computeTransformation=function(e){return Fi.computeTransformation(this,e)};Fi.prototype.isOccluded=function(e){return Fi.isOccluded(this,e)};Fi.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};Fi.prototype.clone=function(e){return Fi.clone(this,e)};Fi.prototype.equals=function(e){return Fi.equals(this,e)};var En=Fi;var KKt=T(S(),1);var KN={};KN.getHeight=function(e,t,n){return(e-n)*t+n};var qXe=new he;KN.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,qXe);if(!l(r))return h.clone(e,o);let s=KN.getHeight(r.height,n,i);return h.fromRadians(r.longitude,r.latitude,s,t,o)};var _r=KN;var M4t=T(S(),1);var QKt=T(S(),1),kE=`in vec3 position3DHigh;
  4342. in vec3 position3DLow;
  4343. in float batchId;
  4344. #ifdef EXTRUDED_GEOMETRY
  4345. in vec3 extrudeDirection;
  4346. uniform float u_globeMinimumAltitude;
  4347. #endif // EXTRUDED_GEOMETRY
  4348. #ifdef PER_INSTANCE_COLOR
  4349. out vec4 v_color;
  4350. #endif // PER_INSTANCE_COLOR
  4351. #ifdef TEXTURE_COORDINATES
  4352. #ifdef SPHERICAL
  4353. out vec4 v_sphericalExtents;
  4354. #else // SPHERICAL
  4355. out vec2 v_inversePlaneExtents;
  4356. out vec4 v_westPlane;
  4357. out vec4 v_southPlane;
  4358. #endif // SPHERICAL
  4359. out vec3 v_uvMinAndSphericalLongitudeRotation;
  4360. out vec3 v_uMaxAndInverseDistance;
  4361. out vec3 v_vMaxAndInverseDistance;
  4362. #endif // TEXTURE_COORDINATES
  4363. void main()
  4364. {
  4365. vec4 position = czm_computePosition();
  4366. #ifdef EXTRUDED_GEOMETRY
  4367. float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz));
  4368. delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0;
  4369. //extrudeDirection is zero for the top layer
  4370. position = position + vec4(extrudeDirection * delta, 0.0);
  4371. #endif
  4372. #ifdef TEXTURE_COORDINATES
  4373. #ifdef SPHERICAL
  4374. v_sphericalExtents = czm_batchTable_sphericalExtents(batchId);
  4375. v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId);
  4376. #else // SPHERICAL
  4377. #ifdef COLUMBUS_VIEW_2D
  4378. vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId);
  4379. vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId);
  4380. // If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w):
  4381. // - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts)
  4382. // - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w)
  4383. // - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow)
  4384. vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w));
  4385. bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0;
  4386. planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w);
  4387. planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w);
  4388. // - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0)
  4389. // - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x)
  4390. // - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow)
  4391. idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0;
  4392. idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x));
  4393. planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x);
  4394. planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x);
  4395. vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz;
  4396. vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz;
  4397. vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz;
  4398. #else // COLUMBUS_VIEW_2D
  4399. // 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction
  4400. vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz;
  4401. vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner;
  4402. vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner;
  4403. #endif // COLUMBUS_VIEW_2D
  4404. vec3 eastWard = southEastCorner - southWestCorner;
  4405. float eastExtent = length(eastWard);
  4406. eastWard /= eastExtent;
  4407. vec3 northWard = northWestCorner - southWestCorner;
  4408. float northExtent = length(northWard);
  4409. northWard /= northExtent;
  4410. v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner));
  4411. v_southPlane = vec4(northWard, -dot(northWard, southWestCorner));
  4412. v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent);
  4413. #endif // SPHERICAL
  4414. vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId);
  4415. vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId);
  4416. v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z);
  4417. v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w);
  4418. v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy;
  4419. #endif // TEXTURE_COORDINATES
  4420. #ifdef PER_INSTANCE_COLOR
  4421. v_color = czm_batchTable_color(batchId);
  4422. #endif
  4423. gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position);
  4424. }
  4425. `;var qKt=T(S(),1),N0=`#ifdef VECTOR_TILE
  4426. uniform vec4 u_highlightColor;
  4427. #endif
  4428. void main(void)
  4429. {
  4430. #ifdef VECTOR_TILE
  4431. out_FragColor = czm_gammaCorrect(u_highlightColor);
  4432. #else
  4433. out_FragColor = vec4(1.0);
  4434. #endif
  4435. czm_writeDepthClamp();
  4436. }
  4437. `;var eJt=T(S(),1),Vne={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};Vne.NUMBER_OF_CLASSIFICATION_TYPES=3;var kn=Object.freeze(Vne);var iJt=T(S(),1);var $Xe={NEVER:ie.NEVER,LESS:ie.LESS,EQUAL:ie.EQUAL,LESS_OR_EQUAL:ie.LEQUAL,GREATER:ie.GREATER,NOT_EQUAL:ie.NOTEQUAL,GREATER_OR_EQUAL:ie.GEQUAL,ALWAYS:ie.ALWAYS},nc=Object.freeze($Xe);var vQt=T(S(),1);var rJt=T(S(),1);function eWe(e,t){let n=[],i=e.length,o=0;for(;o<i;){let r=Math.ceil((i-o)/t--);n.push(e.slice(o,o+r)),o+=r}return n}var UE=eWe;var xJt=T(S(),1);function Vp(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=tWe(t),o=e.floatingPointTexture,r=i===qe.FLOAT&&!o,s=nWe(t,r),a=iWe(s,t,r),c=Math.floor(Bt.maximumTextureSize/a),d=Math.min(n,c),u=a*d,m=Math.ceil(n/d),p=1/u,g=p*.5,f=1/m,x=f*.5;this._textureDimensions=new D(u,m),this._textureStep=new se(p,g,f,x),this._pixelDatatype=r?qe.UNSIGNED_BYTE:i,this._packFloats=r,this._offsets=s,this._stride=a,this._texture=void 0;let _=4*u*m;this._batchValues=i===qe.FLOAT&&!r?new Float32Array(_):new Uint8Array(_),this._batchValuesDirty=!1}Object.defineProperties(Vp.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function tWe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==Q.UNSIGNED_BYTE){t=!0;break}return t?qe.FLOAT:qe.UNSIGNED_BYTE}function Rne(e,t){let n=e[t].componentsPerAttribute;return n===2?D:n===3?h:n===4?se:Number}function nWe(e,t){let n=new Array(e.length),i=0,o=e.length;for(let r=0;r<o;++r){let a=e[r].componentDatatype;n[r]=i,a!==Q.UNSIGNED_BYTE&&t?i+=4:++i}return n}function iWe(e,t,n){let i=e.length,o=e[i-1];return t[i-1].componentDatatype!==Q.UNSIGNED_BYTE&&n?o+4:o+1}var DE=new se;function oWe(e,t,n){let i=se.unpack(e,t,DE),o=se.unpackFloat(i);i=se.unpack(e,t+4,DE);let r=se.unpackFloat(i);i=se.unpack(e,t+8,DE);let s=se.unpackFloat(i);i=se.unpack(e,t+12,DE);let a=se.unpackFloat(i);return se.fromElements(o,r,s,a,n)}function rWe(e,t,n){let i=se.packFloat(e.x,DE);se.pack(i,t,n),i=se.packFloat(e.y,i),se.pack(i,t,n+4),i=se.packFloat(e.z,i),se.pack(i,t,n+8),i=se.packFloat(e.w,i),se.pack(i,t,n+12)}var Lne=new se;Vp.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,o=this._offsets[t],s=4*this._stride*e+4*o,a;this._packFloats&&i[t].componentDatatype!==qe.UNSIGNED_BYTE?a=oWe(this._batchValues,s,Lne):a=se.unpack(this._batchValues,s,Lne);let c=Rne(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var sWe=[void 0,void 0,new D,new h,new se],aWe=new se;Vp.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,o=sWe[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),s=Rne(this._attributes,t);if(l(s.equals)?s.equals(r,n):r===n)return;let c=aWe;c.x=l(n.x)?n.x:n,c.y=l(n.y)?n.y:0,c.z=l(n.z)?n.z:0,c.w=l(n.w)?n.w:0;let d=this._offsets[t],m=4*this._stride*e+4*d;this._packFloats&&i[t].componentDatatype!==qe.UNSIGNED_BYTE?rWe(c,this._batchValues,m):se.pack(c,this._batchValues,m),this._batchValuesDirty=!0};function cWe(e,t){let n=e._textureDimensions;e._texture=new Pt({context:t,pixelFormat:ot.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:en.NEAREST,flipY:!1})}function lWe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Vp.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||cWe(this,e.context),lWe(this))};Vp.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:Tt(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function dWe(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep;
  4438. vec2 computeSt(float batchId)
  4439. {
  4440. float stepX = batchTextureStep.x;
  4441. float centerX = batchTextureStep.y;
  4442. float numberOfAttributes = float(${t});
  4443. return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5);
  4444. }
  4445. `:`uniform vec4 batchTextureStep;
  4446. uniform vec2 batchTextureDimensions;
  4447. vec2 computeSt(float batchId)
  4448. {
  4449. float stepX = batchTextureStep.x;
  4450. float centerX = batchTextureStep.y;
  4451. float stepY = batchTextureStep.z;
  4452. float centerY = batchTextureStep.w;
  4453. float numberOfAttributes = float(${t});
  4454. float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x);
  4455. float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x);
  4456. return vec2(centerX + (xId * stepX), centerY + (yId * stepY));
  4457. }
  4458. `}function uWe(e){return e===1?"float":`vec${e}`}function mWe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function hWe(e,t){let i=e._attributes[t],o=i.componentsPerAttribute,r=i.functionName,s=uWe(o),a=mWe(o),c=e._offsets[t],d=`${s} ${r}(float batchId)
  4459. {
  4460. vec2 st = computeSt(batchId);
  4461. st.x += batchTextureStep.x * float(${c});
  4462. `;return e._packFloats&&i.componentDatatype!==qe.UNSIGNED_BYTE?d+=`vec4 textureValue;
  4463. textureValue.x = czm_unpackFloat(texture(batchTexture, st));
  4464. textureValue.y = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x, 0.0)));
  4465. textureValue.z = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0)));
  4466. textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0)));
  4467. `:d+=` vec4 textureValue = texture(batchTexture, st);
  4468. `,d+=` ${s} value = textureValue${a};
  4469. `,e._pixelDatatype===qe.UNSIGNED_BYTE&&i.componentDatatype===Q.UNSIGNED_BYTE&&!i.normalize?d+=`value *= 255.0;
  4470. `:e._pixelDatatype===qe.FLOAT&&i.componentDatatype===Q.UNSIGNED_BYTE&&i.normalize&&(d+=`value /= 255.0;
  4471. `),d+=` return value;
  4472. }
  4473. `,d}Vp.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture;
  4474. `;t+=`${dWe(this)}
  4475. `;let n=e.length;for(let i=0;i<n;++i)t+=hWe(this,i);return function(i){let o=i.indexOf("void main"),r=i.substring(0,o),s=i.substring(o);return`${r}
  4476. ${t}
  4477. ${s}`}};Vp.prototype.isDestroyed=function(){return!1};Vp.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),me(this)};var _x=Vp;var BJt=T(S(),1);var ZJt=T(S(),1);function Cl(e){this._ellipsoid=y(e,ne.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(Cl.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});Cl.mercatorAngleToGeodeticLatitude=function(e){return W.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};Cl.geodeticLatitudeToMercatorAngle=function(e){e>Cl.MaximumLatitude?e=Cl.MaximumLatitude:e<-Cl.MaximumLatitude&&(e=-Cl.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};Cl.MaximumLatitude=Cl.mercatorAngleToGeodeticLatitude(Math.PI);Cl.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=Cl.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new h(i,o,r)};Cl.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=Cl.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new he(i,o,r)};var Zi=Cl;function fWe(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let s=e[0].modelMatrix;for(r=1;r<o;++r)if(!M.equals(s,e[r].modelMatrix)){i=!0;break}}if(i)for(r=0;r<o;++r)l(e[r].geometry)&&Fn.transformToWorldCoordinates(e[r]);else M.multiplyTransformation(t,e[0].modelMatrix,t)}function wY(e,t){let n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});let r=n.batchId.values;for(let s=0;s<o;++s)r[s]=t}function pWe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?wY(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(wY(i.westHemisphereGeometry,n),wY(i.eastHemisphereGeometry,n))}}function bWe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,r=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,d,u,m=t.length;for(c=0;c<m;++c)if(l(t[c].geometry)){u=t[c].geometry.primitiveType;break}if(fWe(t,a,o),!o)for(c=0;c<m;++c)l(t[c].geometry)&&Fn.splitLongitude(t[c]);if(pWe(t),r)for(c=0;c<m;++c){let g=t[c];l(g.geometry)?(Fn.reorderForPostVertexCache(g.geometry),Fn.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(Fn.reorderForPostVertexCache(g.westHemisphereGeometry),Fn.reorderForPreVertexCache(g.westHemisphereGeometry),Fn.reorderForPostVertexCache(g.eastHemisphereGeometry),Fn.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=Fn.combineInstances(t);for(m=p.length,c=0;c<m;++c){d=p[c];let g=d.attributes;if(o)for(let f in g)g.hasOwnProperty(f)&&g[f].componentDatatype===Q.DOUBLE&&Fn.encodeAttribute(d,f,`${f}3DHigh`,`${f}3DLow`);else for(let f in g)if(g.hasOwnProperty(f)&&g[f].componentDatatype===Q.DOUBLE){let x=`${f}3D`,_=`${f}2D`;Fn.projectTo2D(d,f,x,_,n),l(d.boundingSphere)&&f==="position"&&(d.boundingSphereCV=ce.fromVertices(d.attributes.position2D.values)),Fn.encodeAttribute(d,x,`${x}High`,`${x}Low`),Fn.encodeAttribute(d,_,`${_}High`,`${_}Low`)}s&&Fn.compressVertices(d)}if(!i){let g=[];for(m=p.length,c=0;c<m;++c)d=p[c],g=g.concat(Fn.fitToUnsignedShortIndices(d));p=g}return p}function FY(e,t,n,i){let o,r,s,a=i.length-1;if(a>=0){let d=i[a];o=d.offset+d.count,s=d.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let c=e.length;for(let d=0;d<c;++d){let m=e[d][t];if(!l(m))continue;let p=m.indices.length;o+p>r&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function gWe(e,t){let n=[];return FY(e,"geometry",t,n),FY(e,"westHemisphereGeometry",t,n),FY(e,"eastHemisphereGeometry",t,n),n}var Lp={};Lp.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=bWe(e),t.length>0&&(n=Fn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=gWe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(o),a=!0));let c=new Array(o),d=new Array(o);for(let u=0;u<o;++u){let m=i[u],p=m.geometry;l(p)&&(c[u]=p.boundingSphere,d[u]=p.boundingSphereCV,a&&(s[u]=m.geometry.offsetAttribute));let g=m.eastHemisphereGeometry,f=m.westHemisphereGeometry;l(g)&&l(f)&&(l(g.boundingSphere)&&l(f.boundingSphere)&&(c[u]=ce.union(g.boundingSphere,f.boundingSphere)),l(g.boundingSphereCV)&&l(f.boundingSphereCV)&&(d[u]=ce.union(g.boundingSphereCV,f.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:r,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:d}};function yWe(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];l(o)&&l(o.values)&&t.push(o.values.buffer)}l(e.indices)&&t.push(e.indices.buffer)}function xWe(e,t){let n=e.length;for(let i=0;i<n;++i)yWe(e[i],t)}function _We(e){let t=1,n=e.length;for(let i=0;i<n;i++){let o=e[i];if(++t,!l(o))continue;let r=o.attributes;t+=7+2*ce.packedLength+(l(o.indices)?o.indices.length:0);for(let s in r)if(r.hasOwnProperty(s)&&l(r[s])){let a=r[s];t+=5+a.values.length}}return t}Lp.packCreateGeometryResults=function(e,t){let n=new Float64Array(_We(e)),i=[],o={},r=e.length,s=0;n[s++]=r;for(let a=0;a<r;a++){let c=e[a],d=l(c);if(n[s++]=d?1:0,!d)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=y(c.offsetAttribute,-1);let u=l(c.boundingSphere)?1:0;n[s++]=u,u&&ce.pack(c.boundingSphere,n,s),s+=ce.packedLength;let m=l(c.boundingSphereCV)?1:0;n[s++]=m,m&&ce.pack(c.boundingSphereCV,n,s),s+=ce.packedLength;let p=c.attributes,g=[];for(let x in p)p.hasOwnProperty(x)&&l(p[x])&&(g.push(x),l(o[x])||(o[x]=i.length,i.push(x)));n[s++]=g.length;for(let x=0;x<g.length;x++){let _=g[x],C=p[_];n[s++]=o[_],n[s++]=C.componentDatatype,n[s++]=C.componentsPerAttribute,n[s++]=C.normalize?1:0,n[s++]=C.values.length,n.set(C.values,s),s+=C.values.length}let f=l(c.indices)?c.indices.length:0;n[s++]=f,f>0&&(n.set(c.indices,s),s+=f)}return t.push(n.buffer),{stringTable:i,packedData:n}};Lp.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){o[r++]=void 0;continue}let c=n[s++],d=n[s++],u=n[s++];u===-1&&(u=void 0);let m,p;n[s++]===1&&(m=ce.unpack(n,s)),s+=ce.packedLength,n[s++]===1&&(p=ce.unpack(n,s)),s+=ce.packedLength;let x,_,C,V=new mn,L=n[s++];for(i=0;i<L;i++){let G=t[n[s++]],I=n[s++];C=n[s++];let v=n[s++]!==0;x=n[s++],_=Q.createTypedArray(I,x);for(let P=0;P<x;P++)_[P]=n[s++];V[G]=new Ze({componentDatatype:I,componentsPerAttribute:C,normalize:v,values:_})}let Z;if(x=n[s++],x>0){let G=_.length/C;for(Z=Ae.createTypedArray(G,x),i=0;i<x;i++)Z[i]=n[s++]}o[r++]=new ht({primitiveType:c,geometryType:d,boundingSphere:m,boundingSphereCV:p,indices:Z,attributes:V,offsetAttribute:u})}return o};function TWe(e,t){let n=e.length,i=new Float64Array(1+n*19),o=0;i[o++]=n;for(let r=0;r<n;r++){let s=e[r];if(M.pack(s.modelMatrix,i,o),o+=M.packedLength,l(s.attributes)&&l(s.attributes.offset)){let a=s.attributes.offset.value;i[o]=a[0],i[o+1]=a[1],i[o+2]=a[2]}o+=3}return t.push(i.buffer),i}function SWe(e){let t=e,n=new Array(t[0]),i=0,o=1;for(;o<t.length;){let r=M.unpack(t,o),s;o+=M.packedLength,l(t[o])&&(s={offset:new Qi(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:r,attributes:s}}return n}Lp.packCombineGeometryParameters=function(e,t){let n=e.createGeometryResults,i=n.length;for(let o=0;o<i;o++)t.push(n[o].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:TWe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Ri,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};Lp.unpackCombineGeometryParameters=function(e){let t=SWe(e.packedInstances),n=e.createGeometryResults,i=n.length,o=0;for(let a=0;a<i;a++){let c=Lp.unpackCreateGeometryResults(n[a]),d=c.length;for(let u=0;u<d;u++){let m=c[u],p=t[o];p.geometry=m,++o}}let r=ne.clone(e.ellipsoid),s=e.isGeographic?new Ri(r):new Zi(r);return{instances:t,ellipsoid:r,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:M.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function Zne(e){let t=e.length,n=1+(ce.packedLength+1)*t,i=new Float32Array(n),o=0;i[o++]=t;for(let r=0;r<t;++r){let s=e[r];l(s)?(i[o++]=1,ce.pack(e[r],i,o)):i[o++]=0,o+=ce.packedLength}return i}function Gne(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=ce.unpack(e,i)),++n,i+=ce.packedLength;return t}Lp.packCombineGeometryResults=function(e,t){l(e.geometries)&&xWe(e.geometries,t);let n=Zne(e.boundingSpheres),i=Zne(e.boundingSpheresCV);return t.push(n.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:i}};Lp.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:Gne(e.boundingSpheres),boundingSpheresCV:Gne(e.boundingSpheresCV)}};var Tx=Lp;var YJt=T(S(),1),CWe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},Tr=Object.freeze(CWe);var zJt=T(S(),1),dd={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};dd.NUMBER_OF_SHADOW_MODES=4;dd.castShadows=function(e){return e===dd.ENABLED||e===dd.CAST_ONLY};dd.receiveShadows=function(e){return e===dd.ENABLED||e===dd.RECEIVE_ONLY};dd.fromCastReceive=function(e,t){return e&&t?dd.ENABLED:e?dd.CAST_ONLY:t?dd.RECEIVE_ONLY:dd.DISABLED};var _n=Object.freeze(dd);function Sr(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this._modelMatrix=new M,this.show=y(e.show,!0),this._vertexCacheOptimize=y(e.vertexCacheOptimize,!1),this._interleave=y(e.interleave,!1),this._releaseGeometryInstances=y(e.releaseGeometryInstances,!0),this._allowPicking=y(e.allowPicking,!0),this._asynchronous=y(e.asynchronous,!0),this._compressVertices=y(e.compressVertices,!0),this.cull=y(e.cull,!0),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this.shadows=y(e.shadows,_n.DISABLED),this._translucent=void 0,this._state=Tr.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(Sr.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}}});function VWe(e){let t=e.length,n=[],i=e[0].attributes,o;for(o in i)if(i.hasOwnProperty(o)&&l(i[o])){let r=i[o],s=!0;for(let a=1;a<t;++a){let c=e[a].attributes[o];if(!l(c)||r.componentDatatype!==c.componentDatatype||r.componentsPerAttribute!==c.componentsPerAttribute||r.normalize!==c.normalize){s=!1;break}}s&&n.push(o)}return n}var LWe=new D,RWe=new h,Ane=new se;function Mne(e){let t=e.length;if(t===1)return e[0];if(t===2)return D.unpack(e,0,LWe);if(t===3)return h.unpack(e,0,RWe);if(t===4)return se.unpack(e,0,Ane)}function ZWe(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;let r=VWe(i),s=r.length,a=[],c={},d={},u,p=i[0].attributes,g,f,x;for(g=0;g<s;++g)f=r[g],x=p[f],c[f]=g,a.push({functionName:`czm_batchTable_${f}`,componentDatatype:x.componentDatatype,componentsPerAttribute:x.componentsPerAttribute,normalize:x.normalize});r.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:Q.FLOAT,componentsPerAttribute:1}),d.center3DHigh=a.length-5,d.center3DLow=a.length-4,d.center2DHigh=a.length-3,d.center2DLow=a.length-2,d.radius=a.length-1),r.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:Q.FLOAT,componentsPerAttribute:3}),u=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let _=a.length,C=new _x(t,a,o);for(g=0;g<o;++g){let V=i[g];p=V.attributes;for(let v=0;v<s;++v){f=r[v],x=p[f];let P=Mne(x.value),w=c[f];C.setBatchedAttribute(g,w,P)}let L={primitive:y(V.pickPrimitive,e)};l(V.id)&&(L.id=V.id);let Z=t.createPickId(L);e._pickIds.push(Z);let G=Z.color,I=Ane;I.x=B.floatToByte(G.red),I.y=B.floatToByte(G.green),I.z=B.floatToByte(G.blue),I.w=B.floatToByte(G.alpha),C.setBatchedAttribute(g,_-1,I)}e._batchTable=C,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=d,e._batchTableOffsetAttribute2DIndex=u}function GWe(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Ze({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function EWe(e){let t=e.attributes,n=new mn;for(let o in t)t.hasOwnProperty(o)&&l(t[o])&&(n[o]=GWe(t[o]));let i;if(l(e.indices)){let o=e.indices;Array.isArray(o)?i=o.slice(0):i=new o.constructor(o)}return new ht({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:ce.clone(e.boundingSphere)})}function IWe(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:M.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var XWe=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;Sr._modifyShaderPosition=function(e,t,n){let i,o="",r="",s="";for(;(i=XWe.exec(t))!==null;){let a=i[1],c=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(o+=`${c};
  4478. `),l(e.rtcCenter)?(t=t.replace(/in\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/in\s+vec(?:3|4)\s+position3DLow;/g,""),o+=`uniform mat4 u_modifiedModelView;
  4479. `,r+=`in vec4 position;
  4480. `,s+=`${c}
  4481. {
  4482. return u_modifiedModelView * position;
  4483. }
  4484. `,t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?s+=`${c}
  4485. {
  4486. return czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow);
  4487. }
  4488. `:(r+=`in vec3 ${a}2DHigh;
  4489. in vec3 ${a}2DLow;
  4490. `,s+=`${c}
  4491. {
  4492. vec4 p;
  4493. if (czm_morphTime == 1.0)
  4494. {
  4495. p = czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow);
  4496. }
  4497. else if (czm_morphTime == 0.0)
  4498. {
  4499. p = czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy);
  4500. }
  4501. else
  4502. {
  4503. p = czm_columbusViewMorph(
  4504. czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy),
  4505. czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow),
  4506. czm_morphTime);
  4507. }
  4508. return p;
  4509. }
  4510. `)}return[o,r,t,s].join(`
  4511. `)};Sr._appendShowToShader=function(e,t){return l(e._batchTableAttributeIndices.show)?`${De.replaceMain(t,"czm_non_show_main")}
  4512. void main()
  4513. {
  4514. czm_non_show_main();
  4515. gl_Position *= czm_batchTable_show(batchId);
  4516. }`:t};Sr._updateColorAttribute=function(e,t,n){if(!l(e._batchTableAttributeIndices.color)&&!l(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;let i=t;return i=i.replace(/in\s+vec4\s+color;/g,""),n?i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2"),i};function Ene(e){return`${De.replaceMain(e,"czm_non_pick_main")}
  4517. out vec4 v_pickColor;
  4518. void main()
  4519. {
  4520. czm_non_pick_main();
  4521. v_pickColor = czm_batchTable_pickColor(batchId);
  4522. }`}function Ine(e){return`in vec4 v_pickColor;
  4523. ${e}`}Sr._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2"),t};Sr._appendOffsetToShader=function(e,t){if(!l(e._batchTableAttributeIndices.offset))return t;let n=`in float batchId;
  4524. `;n+="in float applyOffset;";let i=t.replace(/in\s+float\s+batchId;/g,n),o=`vec4 $1 = czm_computePosition();
  4525. `;return o+=` if (czm_sceneMode == czm_sceneMode3D)
  4526. `,o+=` {
  4527. `,o+=" $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",o+=` }
  4528. `,o+=` else
  4529. `,o+=` {
  4530. `,o+=" $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",o+=` }
  4531. `,i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,o),i};Sr._appendDistanceDisplayConditionToShader=function(e,t,n){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=De.replaceMain(t,"czm_non_distanceDisplayCondition_main"),o=`void main()
  4532. {
  4533. czm_non_distanceDisplayCondition_main();
  4534. vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId);
  4535. vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId);
  4536. vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId);
  4537. float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);
  4538. `;return n?o+=` vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);
  4539. `:o+=` vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);
  4540. vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);
  4541. vec4 centerRTE;
  4542. if (czm_morphTime == 1.0)
  4543. {
  4544. centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);
  4545. }
  4546. else if (czm_morphTime == 0.0)
  4547. {
  4548. centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy);
  4549. }
  4550. else
  4551. {
  4552. centerRTE = czm_columbusViewMorph(
  4553. czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy),
  4554. czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow),
  4555. czm_morphTime);
  4556. }
  4557. `,o+=` float radiusSq = boundingSphereRadius * boundingSphereRadius;
  4558. float distanceSq;
  4559. if (czm_sceneMode == czm_sceneMode2D)
  4560. {
  4561. distanceSq = czm_eyeHeight2D.y - radiusSq;
  4562. }
  4563. else
  4564. {
  4565. distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq;
  4566. }
  4567. distanceSq = max(distanceSq, 0.0);
  4568. float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;
  4569. float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;
  4570. float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0;
  4571. gl_Position *= show;
  4572. }`,`${i}
  4573. ${o}`};function Xne(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let o=t.search(/in\s+vec3\s+tangent;/g)!==-1,r=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=o||r?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",d=`in ${a} ${c};`,u="",m="";if(i){u+=`vec2 st;
  4574. `;let f=s>1?`${c}.x`:c;m+=` st = czm_decompressTextureCoordinates(${f});
  4575. `}n&&o&&r?(u+=`vec3 normal;
  4576. vec3 tangent;
  4577. vec3 bitangent;
  4578. `,m+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent);
  4579. `):(n&&(u+=`vec3 normal;
  4580. `,m+=` normal = czm_octDecode(${c}${s>1?`.${i?"y":"x"}`:""});
  4581. `),o&&(u+=`vec3 tangent;
  4582. `,m+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"});
  4583. `),r&&(u+=`vec3 bitangent;
  4584. `,m+=` bitangent = czm_octDecode(${c}.${i&&n?"z":"y"});
  4585. `));let p=t;p=p.replace(/in\s+vec3\s+normal;/g,""),p=p.replace(/in\s+vec2\s+st;/g,""),p=p.replace(/in\s+vec3\s+tangent;/g,""),p=p.replace(/in\s+vec3\s+bitangent;/g,""),p=De.replaceMain(p,"czm_non_compressed_main");let g=`void main()
  4586. {
  4587. ${m} czm_non_compressed_main();
  4588. }`;return[d,u,p,g].join(`
  4589. `)}function WWe(e){let t=De.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
  4590. czm_non_depth_clamp_main();
  4591. gl_Position = czm_depthClamp(gl_Position);}
  4592. `,t}function PWe(e){let t=De.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
  4593. czm_non_depth_clamp_main();
  4594. #if defined(LOG_DEPTH)
  4595. czm_writeLogDepth();
  4596. #else
  4597. czm_writeDepthClamp();
  4598. #endif
  4599. }
  4600. `,t}function Wne(e,t){let n=e.vertexAttributes}function vWe(e,t){return function(){return e[t]}}var AY=Math.max(zt.hardwareConcurrency-1,1),JN,wWe=new bi("combineGeometry");function FWe(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===Tr.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],d=[];for(o=0;o<a;++o)i=n[o].geometry,s.push(n[o].id),d.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i});if(!l(JN))for(JN=new Array(AY),o=0;o<AY;o++)JN[o]=new bi("createGeometry");let u;for(d=UE(d,AY),o=0;o<d.length;o++){let m=0,p=d[o],g=p.length;for(r=0;r<g;++r)u=p[r],i=u.geometry,l(i.constructor.pack)&&(u.offset=m,m+=y(i.constructor.packedLength,i.packedLength));let f;if(m>0){let x=new Float64Array(m);for(f=[x.buffer],r=0;r<g;++r)u=p[r],i=u.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,x,u.offset),u.geometry=x)}c.push(JN[o].scheduleTask({subTasks:d[o]},f))}e._state=Tr.CREATING,Promise.all(c).then(function(m){e._createGeometryResults=m,e._state=Tr.CREATED}).catch(function(m){OE(e,t,Tr.FAILED,m)})}else if(e._state===Tr.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,d=t.mapProjection,u=wWe.scheduleTask(Tx.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:d.ellipsoid,projection:d,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=Tr.COMBINING,Promise.resolve(u).then(function(m){let p=Tx.unpackCombineGeometryResults(m);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=M.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Tr.COMBINED):OE(e,t,Tr.FAILED,void 0)}).catch(function(m){OE(e,t,Tr.FAILED,m)})}}function AWe(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),r=e._instanceIds,s,a,c=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,g;l(p.attributes)&&l(p.primitiveType)?g=EWe(p):g=p.constructor.createGeometry(p),o[c++]=IWe(s,g),r.push(s.id)}o.length=c;let d=t.scene3DOnly,u=t.mapProjection,m=Tx.combineGeometry({instances:o,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:d,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=m.geometries,e._attributeLocations=m.attributeLocations,e.modelMatrix=M.clone(m.modelMatrix,e.modelMatrix),e._pickOffsets=m.pickOffsets,e._offsetInstanceExtend=m.offsetInstanceExtend,e._instanceBoundingSpheres=m.boundingSpheres,e._instanceBoundingSpheresCV=m.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Tr.COMBINED):OE(e,t,Tr.FAILED,void 0)}function MWe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i<s;i++)a[i]=new ce;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let x=a[i],_=e._batchTable.getBatchedAttribute(i,n,new h);x=r[i].clone(x),Dne(x,_,o[i])}let c=[],d=[],u=[];for(i=0;i<s;++i){let x=a[i];x.center.x-x.radius>0||ce.intersectPlane(x,ln.ORIGIN_ZX_PLANE)!==Jt.INTERSECTING?c.push(x):(d.push(x),u.push(x))}let m=c[0],p=u[0],g=d[0];for(i=1;i<c.length;i++)m=ce.union(m,c[i]);for(i=1;i<u.length;i++)p=ce.union(p,u[i]);for(i=1;i<d.length;i++)g=ce.union(g,d[i]);let f=[];for(l(m)&&f.push(m),l(p)&&f.push(p),l(g)&&f.push(g),i=0;i<f.length;i++){let x=f[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=x,e._boundingSphereCV[i]=ce.projectTo2D(x,t.mapProjection,e._boundingSphereCV[i])}Sr._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var Pne=new On,Nne=new he,kne=new h,Une=new ce;function NWe(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,r=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,d=t.mapProjection,u=d.ellipsoid,m=e._batchTable,p=e._instanceBoundingSpheres,g=p.length;for(let f=0;f<g;++f){let x=p[f];if(!l(x))continue;let _=e.modelMatrix;l(_)&&(x=ce.transform(x,_,Une));let C=x.center,V=x.radius,L=On.fromCartesian(C,Pne);if(m.setBatchedAttribute(f,o,L.high),m.setBatchedAttribute(f,r,L.low),!t.scene3DOnly){let Z=u.cartesianToCartographic(C,Nne),G=d.project(Z,kne);L=On.fromCartesian(G,Pne),m.setBatchedAttribute(f,s,L.high),m.setBatchedAttribute(f,a,L.low)}m.setBatchedAttribute(f,c,V)}e._batchTableBoundingSpheresUpdated=!0}var MY=new h,kWe=new h;function vne(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,r=o.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let d=0;d<c;++d){let u=a[d];if(!l(u))continue;let m=s.getBatchedAttribute(d,e._batchTableAttributeIndices.offset);if(h.equals(m,h.ZERO)){s.setBatchedAttribute(d,i,h.ZERO);continue}let p=e.modelMatrix;l(p)&&(u=ce.transform(u,p,Une));let g=u.center;g=r.scaleToGeodeticSurface(g,kWe);let f=r.cartesianToCartographic(g,Nne),x=o.project(f,kne),_=h.add(m,g,MY);f=r.cartesianToCartographic(_,f);let C=o.project(f,MY),V=h.subtract(C,x,MY),L=V.x;V.x=V.z,V.z=V.y,V.y=L,s.setBatchedAttribute(d,i,V)}e._batchTableOffsetsUpdated=!0}function UWe(e,t){let n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,r=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let d=i[c];if(s.push(ti.fromGeometry({context:r,geometry:d,attributeLocations:n,bufferUsage:Me.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,d);else if(e._boundingSpheres.push(ce.clone(d.boundingSphere)),e._boundingSphereWC.push(new ce),!o){let u=d.boundingSphereCV.center,m=u.x,p=u.y,g=u.z;u.x=g,u.y=m,u.z=p,e._boundingSphereCV.push(ce.clone(d.boundingSphereCV)),e._boundingSphere2D.push(new ce),e._boundingSphereMorph.push(new ce)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,OE(e,t,Tr.COMPLETE,void 0)}function DWe(e,t,n,i){let o=n.getRenderState(),r;i?(r=Ye(o,!1),r.cull={enabled:!0,face:yi.BACK},e._frontFaceRS=Ue.fromCache(r),r.cull.face=yi.FRONT,e._backFaceRS=Ue.fromCache(r)):(e._frontFaceRS=Ue.fromCache(o),e._backFaceRS=e._frontFaceRS),r=Ye(o,!1),l(e._depthFailAppearance)&&(r.depthTest.enabled=!1),l(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=Ye(o,!1),r.depthTest.func=nc.GREATER,i?(r.cull={enabled:!0,face:yi.BACK},e._frontFaceDepthFailRS=Ue.fromCache(r),r.cull.face=yi.FRONT,e._backFaceDepthFailRS=Ue.fromCache(r)):(e._frontFaceDepthFailRS=Ue.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function BWe(e,t,n){let i=t.context,o=e._attributeLocations,r=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);r=Sr._appendOffsetToShader(e,r),r=Sr._appendShowToShader(e,r),r=Sr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=Ene(r),r=Sr._updateColorAttribute(e,r,!1),r=Xne(e,r),r=Sr._modifyShaderPosition(e,r,t.scene3DOnly);let s=n.getFragmentShaderSource();s=Ine(s),e._sp=tn.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),Wne(e._sp,o),l(e._depthFailAppearance)&&(r=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),r=Sr._appendShowToShader(e,r),r=Sr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=Ene(r),r=Sr._updateColorAttribute(e,r,!0),r=Xne(e,r),r=Sr._modifyShaderPosition(e,r,t.scene3DOnly),r=WWe(r),s=e._depthFailAppearance.getFragmentShaderSource(),s=Ine(s),s=PWe(s),e._spDepthFail=tn.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),Wne(e._spDepthFail,o))}var BE=new M,wne=new h;function Fne(e,t,n,i){let o=l(n)?n._uniforms:void 0,r={},s=t.uniforms;if(l(s))for(let c in s)s.hasOwnProperty(c)&&(r[c]=vWe(s,c));let a=Tt(r,o);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return M.multiply(c,e._modelMatrix,BE),M.multiplyByPoint(BE,e.rtcCenter,wne),M.setTranslation(BE,wne,BE),BE}),a}function OWe(e,t,n,i,o,r,s,a){let c=Fne(e,t,n,a),d;l(e._depthFailAppearance)&&(d=Fne(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let u=i?Ge.TRANSLUCENT:Ge.OPAQUE,m=o?2:1;m*=l(e._depthFailAppearance)?2:1,r.length=e._va.length*m;let p=r.length,g=0;for(let f=0;f<p;++f){let x;o&&(x=r[f],l(x)||(x=r[f]=new tt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._backFaceRS,x.shaderProgram=e._sp,x.uniformMap=c,x.pass=u,++f),x=r[f],l(x)||(x=r[f]=new tt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._frontFaceRS,x.shaderProgram=e._sp,x.uniformMap=c,x.pass=u,l(e._depthFailAppearance)&&(o&&(++f,x=r[f],l(x)||(x=r[f]=new tt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._backFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=d,x.pass=u),++f,x=r[f],l(x)||(x=r[f]=new tt({owner:e,primitiveType:e._primitiveType})),x.vertexArray=e._va[g],x.renderState=e._frontFaceDepthFailRS,x.shaderProgram=e._spDepthFail,x.uniformMap=d,x.pass=u),++g}}Sr._updateBoundingVolumes=function(e,t,n,i){let o,r,s;if(i||!M.equals(n,e._modelMatrix))for(M.clone(n,e._modelMatrix),r=e._boundingSpheres.length,o=0;o<r;++o)s=e._boundingSpheres[o],l(s)&&(e._boundingSphereWC[o]=ce.transform(s,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=ce.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphere2D[o].center.x=0,e._boundingSphereMorph[o]=ce.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));let a=e.appearance.pixelSize;if(l(a))for(r=e._boundingSpheres.length,o=0;o<r;++o){s=e._boundingSpheres[o];let c=e._boundingSphereWC[o],u=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+u}};function YWe(e,t,n,i,o,r,s,a){Sr._updateBoundingVolumes(e,t,o);let c;t.mode===oe.SCENE3D?c=e._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===oe.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let d=t.commandList,u=t.passes;if(u.render||u.pick){let m=e.allowPicking,p=_n.castShadows(e.shadows),g=_n.receiveShadows(e.shadows),f=n.length,x=a?2:1;x*=l(e._depthFailAppearance)?2:1;for(let _=0;_<f;++_){let C=Math.floor(_/x),V=n[_];V.modelMatrix=o,V.boundingVolume=c[C],V.cull=r,V.debugShowBoundingVolume=s,V.castShadows=p,V.receiveShadows=g,m?V.pickId="v_pickColor":V.pickId=void 0,d.push(V)}}}Sr.prototype.update=function(e){if(!l(this.geometryInstances)&&this._va.length===0||l(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!l(this.appearance)||e.mode!==oe.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===Tr.FAILED)return;let t=e.context;if(l(this._batchTable)||ZWe(this,t),this._batchTable.attributes.length>0){if(Bt.maximumVertexTextureImageUnits===0)throw new de("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==Tr.COMPLETE&&this._state!==Tr.COMBINED&&(this.asynchronous?FWe(this,e):AWe(this,e)),this._state===Tr.COMBINED&&(NWe(this,e),vne(this,e),UWe(this,e)),!this.show||this._state!==Tr.COMPLETE)return;this._batchTableOffsetsUpdated||vne(this,e),this._recomputeBoundingSpheres&&MWe(this,e);let n=this.appearance,i=n.material,o=!1,r=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,r=!0):this._material!==i&&(this._material=i,r=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,o=!0,r=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,r=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);let d=n.closed&&c;o&&y(this._createRenderStatesFunction,DWe)(this,t,n,d),r&&y(this._createShaderProgramFunction,BWe)(this,e,n),(o||r)&&y(this._createCommandsFunction,OWe)(this,n,i,c,d,this._colorCommands,this._pickCommands,e),y(this._updateAndQueueCommandsFunction,YWe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,d)};var HWe=new ce,zWe=new ce;function Dne(e,t,n){if(n===cn.TOP){let i=ce.clone(e,HWe),o=ce.clone(e,zWe);o.center=h.add(o.center,t,o.center),e=ce.union(i,o,e)}else n===cn.ALL&&(e.center=h.add(e.center,t,e.center));return e}function KWe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=Q.createTypedArray(o.componentDatatype,r);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function JWe(e,t,n,i,o){return function(r){let s=Mne(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var QWe=new h;function jWe(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let o=e.modelMatrix,r=t.offset;l(r)&&Dne(i,h.fromArray(r.get(),0,QWe),e._offsetInstanceExtend[n]),l(o)&&(i=ce.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function qWe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}Sr.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let d=0;d<r;++d){let u=(i+d)%r;if(e===o[u]){n=u;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let d in a)if(a.hasOwnProperty(d)){let u=a[d];c[d]={get:KWe(s,n,u),set:JWe(s,n,u,this,d)}}return jWe(this,c,n),qWe(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};Sr.prototype.isDestroyed=function(){return!1};Sr.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();let n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;let i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,me(this)};function OE(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){e._ready=e._state===Tr.COMPLETE||e._state===Tr.FAILED})}var In=Sr;var n4t=T(S(),1);var AQt=T(S(),1);function $We(e){e=y(e,y.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=y(e.normalize,!1),this.value=e.value}var ic=$We;var NQt=T(S(),1),eC=`#ifdef TEXTURE_COORDINATES
  4601. #ifdef SPHERICAL
  4602. in vec4 v_sphericalExtents;
  4603. #else // SPHERICAL
  4604. in vec2 v_inversePlaneExtents;
  4605. in vec4 v_westPlane;
  4606. in vec4 v_southPlane;
  4607. #endif // SPHERICAL
  4608. in vec3 v_uvMinAndSphericalLongitudeRotation;
  4609. in vec3 v_uMaxAndInverseDistance;
  4610. in vec3 v_vMaxAndInverseDistance;
  4611. #endif // TEXTURE_COORDINATES
  4612. #ifdef PER_INSTANCE_COLOR
  4613. in vec4 v_color;
  4614. #endif
  4615. #ifdef NORMAL_EC
  4616. vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) {
  4617. vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth);
  4618. return eyeCoordinate.xyz / eyeCoordinate.w;
  4619. }
  4620. vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) {
  4621. vec2 glFragCoordXY = gl_FragCoord.xy;
  4622. // Sample depths at both offset and negative offset
  4623. float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw));
  4624. float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw));
  4625. // Explicitly evaluate both paths
  4626. // Necessary for multifrustum and for edges of the screen
  4627. bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw);
  4628. float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y);
  4629. float useDownOrLeft = float(useUpOrRight == 0.0);
  4630. vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth);
  4631. vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth);
  4632. return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft;
  4633. }
  4634. #endif // NORMAL_EC
  4635. void main(void)
  4636. {
  4637. #ifdef REQUIRES_EC
  4638. float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw));
  4639. vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
  4640. #endif
  4641. #ifdef REQUIRES_WC
  4642. vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;
  4643. vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;
  4644. #endif
  4645. #ifdef TEXTURE_COORDINATES
  4646. vec2 uv;
  4647. #ifdef SPHERICAL
  4648. // Treat world coords as a sphere normal for spherical coordinates
  4649. vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate);
  4650. sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z;
  4651. sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);
  4652. uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w;
  4653. uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z;
  4654. #else // SPHERICAL
  4655. // Unpack planes and transform to eye space
  4656. uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x;
  4657. uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y;
  4658. #endif // SPHERICAL
  4659. #endif // TEXTURE_COORDINATES
  4660. #ifdef PICK
  4661. #ifdef CULL_FRAGMENTS
  4662. // When classifying translucent geometry, logDepthOrDepth == 0.0
  4663. // indicates a region that should not be classified, possibly due to there
  4664. // being opaque pixels there in another buffer.
  4665. // Check for logDepthOrDepth != 0.0 to make sure this should be classified.
  4666. if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) {
  4667. out_FragColor.a = 1.0; // 0.0 alpha leads to discard from ShaderSource.createPickFragmentShaderSource
  4668. czm_writeDepthClamp();
  4669. }
  4670. #else // CULL_FRAGMENTS
  4671. out_FragColor.a = 1.0;
  4672. #endif // CULL_FRAGMENTS
  4673. #else // PICK
  4674. #ifdef CULL_FRAGMENTS
  4675. // When classifying translucent geometry, logDepthOrDepth == 0.0
  4676. // indicates a region that should not be classified, possibly due to there
  4677. // being opaque pixels there in another buffer.
  4678. if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) {
  4679. discard;
  4680. }
  4681. #endif
  4682. #ifdef NORMAL_EC
  4683. // Compute normal by sampling adjacent pixels in 2x2 block in screen space
  4684. vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0));
  4685. vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0));
  4686. vec3 normalEC = normalize(cross(leftRight, downUp));
  4687. #endif
  4688. #ifdef PER_INSTANCE_COLOR
  4689. vec4 color = czm_gammaCorrect(v_color);
  4690. #ifdef FLAT
  4691. out_FragColor = color;
  4692. #else // FLAT
  4693. czm_materialInput materialInput;
  4694. materialInput.normalEC = normalEC;
  4695. materialInput.positionToEyeEC = -eyeCoordinate.xyz;
  4696. czm_material material = czm_getDefaultMaterial(materialInput);
  4697. material.diffuse = color.rgb;
  4698. material.alpha = color.a;
  4699. out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);
  4700. #endif // FLAT
  4701. // Premultiply alpha. Required for classification primitives on translucent globe.
  4702. out_FragColor.rgb *= out_FragColor.a;
  4703. #else // PER_INSTANCE_COLOR
  4704. // Material support.
  4705. // USES_ is distinct from REQUIRES_, because some things are dependencies of each other or
  4706. // dependencies for culling but might not actually be used by the material.
  4707. czm_materialInput materialInput;
  4708. #ifdef USES_NORMAL_EC
  4709. materialInput.normalEC = normalEC;
  4710. #endif
  4711. #ifdef USES_POSITION_TO_EYE_EC
  4712. materialInput.positionToEyeEC = -eyeCoordinate.xyz;
  4713. #endif
  4714. #ifdef USES_TANGENT_TO_EYE
  4715. materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC);
  4716. #endif
  4717. #ifdef USES_ST
  4718. // Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired
  4719. // texture coordinate system, which typically forms a tight oriented bounding box around the geometry.
  4720. // Shader is provided a set of reference points for remapping.
  4721. materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z;
  4722. materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z;
  4723. #endif
  4724. czm_material material = czm_getMaterial(materialInput);
  4725. #ifdef FLAT
  4726. out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
  4727. #else // FLAT
  4728. out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);
  4729. #endif // FLAT
  4730. // Premultiply alpha. Required for classification primitives on translucent globe.
  4731. out_FragColor.rgb *= out_FragColor.a;
  4732. #endif // PER_INSTANCE_COLOR
  4733. czm_writeDepthClamp();
  4734. #endif // PICK
  4735. }
  4736. `;function gu(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new NY;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new NY;if(o.requiresTextureCoordinates=e,n instanceof dn)i.requiresNormalEC=!n.flat;else{let r=`${n.material.shaderSource}
  4737. ${n.fragmentShaderSource}`;i.normalEC=r.indexOf("materialInput.normalEC")!==-1||r.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=r.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=r.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=r.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=o,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}gu.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof dn&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let o="";return t instanceof dn||(o=t.material.shaderSource),new De({defines:i,sources:[o,eC]})};gu.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new De({defines:n,sources:[eC],pickColorQualifier:"in"})};gu.prototype.createVertexShader=function(e,t,n,i){return Qne(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};gu.prototype.createPickVertexShader=function(e,t,n,i){return Qne(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var Bne=new h,One=new he,Yne={high:0,low:0};function Qne(e,t,n,i,o,r,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let d=One;d.longitude=W.PI,d.latitude=0,d.height=0;let u=s.project(d,Bne),m=On.encode(u.x,Yne);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${m.high.toFixed(`${m.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${m.low.toFixed(`${m.low}`.length+1)}`;let p=One;p.longitude=-W.PI,p.latitude=0,p.height=0;let g=s.project(p,Bne);m=On.encode(g.x,Yne),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${m.high.toFixed(`${m.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${m.low.toFixed(`${m.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(r)&&r instanceof dn&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new De({defines:c,sources:[o]})}function NY(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(NY.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});function Hne(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/D.distance(t,e)}var e2e=[new D,new D,new D,new D];function jne(e,t){let n=e2e,i=D.unpack(t,0,n[0]),o=D.unpack(t,2,n[1]),r=D.unpack(t,4,n[2]);e.uMaxVmax=new ic({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/Hne(i,o,r),a=1/Hne(i,r,o);e.uvMinAndExtents=new ic({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var qne=new he,$ne=new h,t2e=new h,n2e=new h,QN={high:0,low:0};function eie(e,t,n){let i=qne;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,$ne);i.latitude=e.north;let r=t.project(i,t2e);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,n2e),a=[0,0,0,0],c=[0,0,0,0],d=On.encode(o.x,QN);a[0]=d.high,c[0]=d.low,d=On.encode(o.y,QN),a[1]=d.high,c[1]=d.low,d=On.encode(r.y,QN),a[2]=d.high,c[2]=d.low,d=On.encode(s.x,QN),a[3]=d.high,c[3]=d.low,n.planes2D_HIGH=new ic({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new ic({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var i2e=new M,o2e=new M,zne=new h,r2e=new he,s2e=[new he,new he,new he,new he,new he,new he,new he,new he];function a2e(e,t,n,i,o,r){let s=ae.center(e,r2e);s.height=n;let a=he.toCartesian(s,t,zne),c=Ft.eastNorthUpToFixedFrame(a,t,i2e),d=M.inverse(c,o2e),u=e.west,m=e.east,p=e.north,g=e.south,f=s2e;f[0].latitude=g,f[0].longitude=u,f[1].latitude=p,f[1].longitude=u,f[2].latitude=p,f[2].longitude=m,f[3].latitude=g,f[3].longitude=m;let x=(u+m)*.5,_=(p+g)*.5;f[4].latitude=g,f[4].longitude=x,f[5].latitude=p,f[5].longitude=x,f[6].latitude=_,f[6].longitude=u,f[7].latitude=_,f[7].longitude=m;let C=Number.POSITIVE_INFINITY,V=Number.NEGATIVE_INFINITY,L=Number.POSITIVE_INFINITY,Z=Number.NEGATIVE_INFINITY;for(let P=0;P<8;P++){f[P].height=n;let w=he.toCartesian(f[P],t,zne);M.multiplyByPoint(d,w,w),w.z=0,C=Math.min(C,w.x),V=Math.max(V,w.x),L=Math.min(L,w.y),Z=Math.max(Z,w.y)}let G=i;G.x=C,G.y=L,G.z=0,M.multiplyByPoint(c,G,G);let I=o;I.x=V,I.y=L,I.z=0,M.multiplyByPoint(c,I,I),h.subtract(I,G,o);let v=r;v.x=C,v.y=Z,v.z=0,M.multiplyByPoint(c,v,v),h.subtract(v,G,r)}var c2e=new h,l2e=new h,d2e=new On;gu.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=$ne,s=c2e,a=l2e;a2e(e,n,y(o,0),r,s,a);let c={};jne(c,t);let d=On.fromCartesian(r,d2e);return c.southWest_HIGH=new ic({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(d.high,[0,0,0])}),c.southWest_LOW=new ic({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(d.low,[0,0,0])}),c.eastward=new ic({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),c.northward=new ic({componentDatatype:Q.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),eie(e,i,c),c};var u2e=new h;function Kne(e,t,n,i){let o=qne;o.latitude=e,o.longitude=t,o.height=0;let r=he.toCartesian(o,n,u2e),s=Math.sqrt(r.x*r.x+r.y*r.y),a=W.fastApproximateAtan2(s,r.z),c=W.fastApproximateAtan2(r.x,r.y);return i.x=a,i.y=c,i}var Jne=new D;gu.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=Kne(e.south,e.west,n,Jne),r=o.x,s=o.y,a=Kne(e.north,e.east,n,Jne),c=a.x,d=a.y,u=0;s>d&&(u=W.PI-s,s=-W.PI,d+=u),r-=W.EPSILON5,s-=W.EPSILON5,c+=W.EPSILON5,d+=W.EPSILON5;let m=1/(d-s),p=1/(c-r),g={sphericalExtents:new ic({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,m]}),longitudeRotation:new ic({componentDatatype:Q.FLOAT,componentsPerAttribute:1,normalize:!1,value:[u]})};return jne(g,t),eie(e,i,g),g};gu.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};gu.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function m2e(e){return Math.max(e.width,e.height)>gu.MAX_WIDTH_FOR_PLANAR_EXTENTS}gu.shouldUseSphericalCoordinates=function(e){return m2e(e)};gu.MAX_WIDTH_FOR_PLANAR_EXTENTS=W.toRadians(1);var ud=gu;var m4t=T(S(),1);var r4t=T(S(),1);var h2e={NEVER:ie.NEVER,LESS:ie.LESS,EQUAL:ie.EQUAL,LESS_OR_EQUAL:ie.LEQUAL,GREATER:ie.GREATER,NOT_EQUAL:ie.NOTEQUAL,GREATER_OR_EQUAL:ie.GEQUAL,ALWAYS:ie.ALWAYS},Un=Object.freeze(h2e);var c4t=T(S(),1);var f2e={ZERO:ie.ZERO,KEEP:ie.KEEP,REPLACE:ie.REPLACE,INCREMENT:ie.INCR,DECREMENT:ie.DECR,INVERT:ie.INVERT,INCREMENT_WRAP:ie.INCR_WRAP,DECREMENT_WRAP:ie.DECR_WRAP},bt=Object.freeze(f2e);var jN={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};jN.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Un.ALWAYS,frontOperation:{fail:bt.KEEP,zFail:bt.KEEP,zPass:bt.REPLACE},backFunction:Un.ALWAYS,backOperation:{fail:bt.KEEP,zFail:bt.KEEP,zPass:bt.REPLACE},reference:jN.CESIUM_3D_TILE_MASK,mask:jN.CESIUM_3D_TILE_MASK}};var Ot=Object.freeze(jN);function Sx(e){e=y(e,y.EMPTY_OBJECT);let t=e.geometryInstances;this.geometryInstances=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,kn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=y(e._extruded,!1),this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(Sx.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});Sx.isSupported=function(e){return e.context.stencilBuffer};function tC(e,t){let n=t?Un.EQUAL:Un.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:bt.KEEP,zFail:bt.DECREMENT_WRAP,zPass:bt.KEEP},backFunction:n,backOperation:{fail:bt.KEEP,zFail:bt.INCREMENT_WRAP,zPass:bt.KEEP},reference:Ot.CESIUM_3D_TILE_MASK,mask:Ot.CESIUM_3D_TILE_MASK},stencilMask:Ot.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:nc.LESS_OR_EQUAL},depthMask:!1}}function UY(e){return{stencilTest:{enabled:e,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},reference:0,mask:Ot.CLASSIFICATION_MASK},stencilMask:Ot.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND}}var p2e={stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},reference:0,mask:Ot.CLASSIFICATION_MASK},stencilMask:Ot.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function b2e(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ue.fromCache(tC(o,!1)),e._rsStencilDepthPass3DTiles=Ue.fromCache(tC(o,!0)),e._rsColorPass=Ue.fromCache(UY(o,!1)),e._rsPickPass=Ue.fromCache(p2e)}function g2e(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection;
  4738. `,r=` extrudeDirection = czm_octDecode(${n}, 65535.0);
  4739. `,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=De.replaceMain(s,"czm_non_compressed_main");let a=`void main()
  4740. {
  4741. ${r} czm_non_compressed_main();
  4742. }`;return[i,o,s,a].join(`
  4743. `)}}function y2e(e,t){let n=t.context,i=e._primitive,o=kE;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=In._appendDistanceDisplayConditionToShader(i,o),o=In._modifyShaderPosition(e,o,t.scene3DOnly),o=In._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=g2e(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new De({defines:[a],sources:[o]}),d=new De({sources:[N0]}),u=e._primitive._attributeLocations,m=new ud(s,r,e.appearance);if(e._spStencil=tn.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u}),e._primitive.allowPicking){let f=De.createPickVertexShaderSource(o);f=In._appendShowToShader(i,f),f=In._updatePickColorAttribute(f);let x=m.createPickFragmentShader(!1),_=m.createPickVertexShader([a],f,!1,t.mapProjection);if(e._spPick=tn.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:_,fragmentShaderSource:x,attributeLocations:u}),s){let C=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(C)){let V=m.createPickFragmentShader(!0),L=m.createPickVertexShader([a],f,!0,t.mapProjection);C=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:L,fragmentShaderSource:V,attributeLocations:u})}e._spPick2D=C}}else e._spPick=tn.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});o=In._appendShowToShader(i,o),c=new De({defines:[a],sources:[o]}),e._sp=tn.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});let p=m.createFragmentShader(!1),g=m.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=tn.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:u}),s){let f=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(f)){let x=m.createFragmentShader(!0),_=m.createVertexShader([a],o,!0,t.mapProjection);f=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:_,fragmentShaderSource:x,attributeLocations:u})}e._spColor2D=f}}function x2e(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),d=e._needs2DShader;for(o=0;o<i;o+=2){let g=n._va[a++];r=t[o],l(r)||(r=t[o]=new tt({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsStencilDepthPass,r.shaderProgram=e._sp,r.uniformMap=c,r.pass=Ge.TERRAIN_CLASSIFICATION,s=tt.shallowClone(r,r.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,r=t[o+1],l(r)||(r=t[o+1]=new tt({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsColorPass,r.shaderProgram=e._spColor,r.pass=Ge.TERRAIN_CLASSIFICATION;let x=e.appearance.material;if(l(x)&&(c=Tt(c,x._uniforms)),r.uniformMap=c,s=tt.shallowClone(r,r.derivedCommands.tileset),s.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,d){let _=tt.shallowClone(r,r.derivedCommands.appearance2D);_.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=_,_=tt.shallowClone(s,s.derivedCommands.appearance2D),_.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=_}}let u=e._commandsIgnoreShow,m=e._spStencil,p=0;i=u.length=i/2;for(let g=0;g<i;++g){let f=u[g]=tt.shallowClone(t[p],u[g]);f.shaderProgram=m,f.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function _2e(e,t){let n=e._usePickOffsets,i=e._primitive,o=i._va.length*2,r,s=0,a;n&&(r=i._pickOffsets,o=r.length*2),t.length=o;let c,d,u,m=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),g=e._needs2DShader;for(c=0;c<o;c+=2){let f=i._va[m++];if(n&&(a=r[s++],f=i._va[a.index]),d=t[c],l(d)||(d=t[c]=new tt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),d.vertexArray=f,d.renderState=e._rsStencilDepthPass,d.shaderProgram=e._sp,d.uniformMap=p,d.pass=Ge.TERRAIN_CLASSIFICATION,n&&(d.offset=a.offset,d.count=a.count),u=tt.shallowClone(d,d.derivedCommands.tileset),u.renderState=e._rsStencilDepthPass3DTiles,u.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION,d.derivedCommands.tileset=u,d=t[c+1],l(d)||(d=t[c+1]=new tt({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),d.vertexArray=f,d.renderState=e._rsPickPass,d.shaderProgram=e._spPick,d.uniformMap=p,d.pass=Ge.TERRAIN_CLASSIFICATION,n&&(d.offset=a.offset,d.count=a.count),u=tt.shallowClone(d,d.derivedCommands.tileset),u.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION,d.derivedCommands.tileset=u,g){let x=tt.shallowClone(d,d.derivedCommands.pick2D);x.shaderProgram=e._spPick2D,d.derivedCommands.pick2D=x,x=tt.shallowClone(u,u.derivedCommands.pick2D),x.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=x}}}function T2e(e,t,n,i,o,r,s){x2e(e,r),_2e(e,s)}function tie(e,t){return Math.floor(e%t/2)}function kY(e,t,n,i,o,r){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=r,t.commandList.push(e)}function nie(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function S2e(e,t,n,i,o,r,s,a){let c=e._primitive;In._updateBoundingVolumes(c,t,o);let d;t.mode===oe.SCENE3D?d=c._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?d=c._boundingSphereCV:t.mode===oe.SCENE2D&&l(c._boundingSphere2D)?d=c._boundingSphere2D:l(c._boundingSphereMorph)&&(d=c._boundingSphereMorph);let u=e.classificationType,m=u!==kn.CESIUM_3D_TILE,p=u!==kn.TERRAIN,g=t.passes,f,x,_;if(g.render){let C=n.length;for(f=0;f<C;++f)x=d[tie(f,C)],m&&(_=n[f],kY(_,t,o,r,x,s)),p&&(_=n[f].derivedCommands.tileset,kY(_,t,o,r,x,s));if(t.invertClassification){let V=e._commandsIgnoreShow,L=V.length;for(f=0;f<L;++f)x=d[f],_=V[f],kY(_,t,o,r,x,s)}}if(g.pick){let C=i.length,V=c._pickOffsets;for(f=0;f<C;++f){let L=V[tie(f,C)];x=d[L.index],m&&(_=i[f],nie(_,t,o,r,x)),p&&(_=i[f].derivedCommands.tileset,nie(_,t,o,r,x))}}}Sx.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s,a,c,d=!1,u=!0,m,p=!1,g=!1;for(r>0&&(c=o[0].attributes,p=ud.hasAttributesForSphericalExtents(c),g=ud.hasAttributesForTextureCoordinatePlanes(c),m=c.color),s=0;s<r;s++){a=o[s];let x=a.attributes.color;l(x)&&(d=!0),u=u&&l(x)&&Kt.equals(m,x)}if(!u&&!p&&!g)throw new pe("All GeometryInstances must have the same color attribute except via GroundPrimitives");d&&!l(t)&&(t=new dn({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!g,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=d;let f=new Array(r);for(s=0;s<r;++s)a=o[s],f[s]=new Gt({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:y(this._pickPrimitive,n)});i.appearance=t,i.geometryInstances=f,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(x,_){n._createBoundingVolumeFunction(x,_)}),i._createRenderStatesFunction=function(x,_,C,V){b2e(n,_)},i._createShaderProgramFunction=function(x,_,C){y2e(n,_)},i._createCommandsFunction=function(x,_,C,V,L,Z,G){T2e(n,void 0,void 0,!0,!1,Z,G)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(x,_,C,V,L,Z,G,I){n._updateAndQueueCommandsFunction(x,_,C,V,L,Z,G,I)}:i._updateAndQueueCommandsFunction=function(x,_,C,V,L,Z,G,I){S2e(n,_,C,V,L,Z,G,I)},this._primitive=new In(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ue.fromCache(tC(!1,!1)),this._rsStencilDepthPass3DTiles=Ue.fromCache(tC(!1,!0)),this._rsColorPass=Ue.fromCache(UY(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ue.fromCache(tC(!0,!1)),this._rsStencilDepthPass3DTiles=Ue.fromCache(tC(!0,!0)),this._rsColorPass=Ue.fromCache(UY(!0))),this._primitive.appearance!==t&&(this._primitive.appearance=t),this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Sx.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Sx.prototype.isDestroyed=function(){return!1};Sx.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,me(this)};var nC=Sx;var C2e={u_globeMinimumAltitude:function(){return 55e3}};function Vl(e){e=y(e,y.EMPTY_OBJECT);let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let o=Array.isArray(n)?n:[n],r=o.length;for(let s=0;s<r;s++){let a=o[s].attributes;if(l(a)&&l(a.color)){t=new dn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,kn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=li._defaultMaxTerrainHeight,this._minTerrainHeight=li._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:y(e.vertexCacheOptimize,!1),interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:y(e.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:C2e}}Object.defineProperties(Vl.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}}});Vl.isSupported=nC.isSupported;function iie(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function oie(e){return function(t,n){return e._minHeight}}var V2e=new h,L2e=new h,R2e=new h,Z2e=new he,G2e=new ae;function qN(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,r=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY;for(let m=0;m<r;m+=3){let p=h.unpack(i,m,V2e),g=h.unpack(o,m,L2e),f=h.add(p,g,R2e),x=n.cartesianToCartographic(f,Z2e),_=x.latitude,C=x.longitude;s=Math.min(s,_),a=Math.min(a,C),c=Math.max(c,_),d=Math.max(d,C)}let u=G2e;return u.north=c,u.south=s,u.east=d,u.west=a,u}function E2e(e,t,n){let i=li.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function I2e(e,t,n){let i=t.mapProjection.ellipsoid,o=qN(t,n),r=En.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(r),!t.scene3DOnly){let s=t.mapProjection,a=ce.fromRectangleWithHeights2D(o,s,e._maxHeight,e._minHeight);h.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function DY(e,t){return Math.floor(e%t/2)}function BY(e,t,n,i,o,r,s){let a=e._primitive;n.mode!==oe.SCENE3D&&t.shaderProgram===a._spColor&&a._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function rie(e,t,n,i,o,r){let s=e._primitive;n.mode!==oe.SCENE3D&&t.shaderProgram===s._spPick&&s._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,n.commandList.push(t)}function X2e(e,t,n,i,o,r,s,a){let c;t.mode===oe.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let d=e.classificationType,u=d!==kn.CESIUM_3D_TILE,m=d!==kn.TERRAIN,p=t.passes,g=e._primitive,f,x,_;if(p.render){let C=n.length;for(f=0;f<C;++f)x=c[DY(f,C)],u&&(_=n[f],BY(e,_,t,o,r,x,s)),m&&(_=n[f].derivedCommands.tileset,BY(e,_,t,o,r,x,s));if(t.invertClassification){let V=g._commandsIgnoreShow,L=V.length;for(f=0;f<L;++f)x=c[f],_=V[f],BY(e,_,t,o,r,x,s)}}if(p.pick){let C=i.length,V;for(e._useFragmentCulling||(V=g._primitive._pickOffsets),f=0;f<C;++f){if(x=c[DY(f,C)],!e._useFragmentCulling){let L=V[DY(f,C)];x=c[L.index]}u&&(_=i[f],rie(e,_,t,o,r,x)),m&&(_=i[f].derivedCommands.tileset,rie(e,_,t,o,r,x))}}}Vl.initializeTerrainHeights=function(){return li.initialize()};Vl.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!li.initialized){Vl.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,o,r,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=a.length,d=new Array(c),u,m;for(u=0;u<c;++u){o=a[u],r=o.geometry;let x=qN(e,r);l(m)?l(x)&&ae.union(m,x,m):m=ae.clone(x);let _=o.id;if(l(_)&&l(x)){let C=li.getBoundingSphere(x,i);this._boundingSpheresKeys.push(_),this._boundingSpheres.push(C)}s=r.constructor,!l(s)||l(s.createShadowVolume)}E2e(this,m,i);let p=e.verticalExaggeration,g=e.verticalExaggerationRelativeHeight;this._minHeight=_r.getHeight(this._minTerrainHeight,p,g),this._maxHeight=_r.getHeight(this._maxTerrainHeight,p,g);let f=Vl._supportsMaterials(e.context);if(this._useFragmentCulling=f,f){let x,_=!0;for(u=0;u<c;++u)if(o=a[u],r=o.geometry,m=qN(e,r),ud.shouldUseSphericalCoordinates(m)){_=!1;break}for(u=0;u<c;++u){o=a[u],r=o.geometry,s=r.constructor;let C=qN(e,r),V=r.textureCoordinateRotationPoints;_?x=ud.getPlanarTextureCoordinateAttributes(C,V,i,e.mapProjection,this._maxHeight):x=ud.getSphericalExtentGeometryInstanceAttributes(C,V,i,e.mapProjection);let L=o.attributes;for(let Z in L)L.hasOwnProperty(Z)&&(x[Z]=L[Z]);d[u]=new Gt({geometry:s.createShadowVolume(r,oie(this),iie(this)),attributes:x,id:o.id})}}else for(u=0;u<c;++u)o=a[u],r=o.geometry,s=r.constructor,d[u]=new Gt({geometry:s.createShadowVolume(r,oie(this),iie(this)),attributes:o.attributes,id:o.id});n.geometryInstances=d,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(x,_){I2e(t,x,_)},n._updateAndQueueCommandsFunction=function(x,_,C,V,L,Z,G,I){X2e(t,_,C,V,L,Z,G,I)},this._primitive=new nC(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Vl.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Vl.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Vl.prototype.isDestroyed=function(){return!1};Vl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};Vl._supportsMaterials=function(e){return e.depthTexture};Vl.supportsMaterials=function(e){return Vl._supportsMaterials(e.frameState.context)};var Ac=Vl;var ljt=T(S(),1);function iC(){pe.throwInstantiationError()}Object.defineProperties(iC.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});iC.prototype.getType=pe.throwInstantiationError;iC.prototype.getValue=pe.throwInstantiationError;iC.prototype.equals=pe.throwInstantiationError;var W2e=new j;iC.getValue=function(e,t,n){let i;return l(e)||(e=j.now(W2e)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=Oi.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==Oi.ColorType)&&(n=Oi.fromType(Oi.ColorType)),B.clone(B.WHITE,n.uniforms.color),n)};var Qo=iC;function Cx(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}Cx.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!K.getValueOrDefault(t.show,n,!0)};Cx.prototype._setOptions=pe.throwInstantiationError;Cx.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,o=this._orderedGroundPrimitives;n?o.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let r=this._entity,s=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,s,e),this._isHidden(r,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let d=t.fillMaterialProperty,u=d instanceof Yt,m,p=t._getIsClosed(c);if(u)m=new dn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=Qo.getValue(e,d,this._material);this._material=g,m=new oo({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=dn.VERTEX_FORMAT,this._primitive=o.add(new Ac({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:m,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),K.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=m.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);u&&(m.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new In({geometryInstances:g,appearance:m,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let d=this._geometryUpdater.createOutlineGeometryInstance(e),u=K.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new In({geometryInstances:d,appearance:new dn({flat:!0,translucent:d.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(u)}}),asynchronous:!1,shadows:a}))}};Cx.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,o;return l(n)&&n.show&&n.ready&&(o=n.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(ce.clone(o.boundingSphere,e),ft.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(ce.clone(o.boundingSphere,e),ft.DONE):l(n)&&!n.ready||l(i)&&!i.ready?ft.PENDING:ft.FAILED};Cx.prototype.isDestroyed=function(){return!1};Cx.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),me(this)};var ni=Cx;var Hen=T(S(),1);var Een=T(S(),1);var E7t=T(S(),1);var g8t=T(S(),1);var Ljt=T(S(),1),P2e={NONE:0,GEODESIC:1,RHUMB:2},nn=Object.freeze(P2e);var Ijt=T(S(),1);var sie=W.EPSILON10;function v2e(e,t,n,i){if(!l(e))return;n=y(n,!1);let o=l(i),r=e.length;if(r<2)return e;let s,a=e[0],c,d,u=0,m=-1;for(s=1;s<r;++s)c=e[s],t(a,c,sie)?(l(d)||(d=e.slice(0,s),u=s-1,m=0),o&&i.push(s)):(l(d)&&(d.push(c),u=s,o&&(m=i.length)),a=c);return n&&t(e[0],e[r-1],sie)&&(o&&(l(d)?i.splice(m,0,u):i.push(r-1)),l(d)?d.length-=1:d=e.slice(0,-1)),l(d)?d:e}var xo=v2e;var Mjt=T(S(),1);function w2e(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,o=(n-i)/n,r=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-o)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+a*a),d=c*a,u=Math.atan2(a,r),m=c*s,p=m*m,g=1-p,f=Math.sqrt(g),x=t/4,_=x*x,C=_*x,V=_*_,L=1+x-3*_/4+5*C/4-175*V/64,Z=1-x+15*_/8-35*C/8,G=1-3*x+35*_/4,I=1-5*x,v=L*u-Z*Math.sin(2*u)*x/2-G*Math.sin(4*u)*_/16-I*Math.sin(6*u)*C/48-Math.sin(8*u)*5*V/512,P=e._constants;P.a=n,P.b=i,P.f=o,P.cosineHeading=r,P.sineHeading=s,P.tanU=a,P.cosineU=c,P.sineU=d,P.sigma=u,P.sineAlpha=m,P.sineSquaredAlpha=p,P.cosineSquaredAlpha=g,P.cosineAlpha=f,P.u2Over4=x,P.u4Over16=_,P.u6Over64=C,P.u8Over256=V,P.a0=L,P.a1=Z,P.a2=G,P.a3=I,P.distanceRatio=v}function F2e(e,t){return e*t*(4+e*(4-3*t))/16}function aie(e,t,n,i,o,r,s){let a=F2e(e,n);return(1-a)*e*t*(i+a*o*(s+a*r*(2*s*s-1)))}function A2e(e,t,n,i,o,r,s){let a=(t-n)/t,c=r-i,d=Math.atan((1-a)*Math.tan(o)),u=Math.atan((1-a)*Math.tan(s)),m=Math.cos(d),p=Math.sin(d),g=Math.cos(u),f=Math.sin(u),x=m*g,_=m*f,C=p*f,V=p*g,L=c,Z=W.TWO_PI,G=Math.cos(L),I=Math.sin(L),v,P,w,F,b;do{G=Math.cos(L),I=Math.sin(L);let k=_-V*G;w=Math.sqrt(g*g*I*I+k*k),P=C+x*G,v=Math.atan2(w,P);let H;w===0?(H=0,F=1):(H=x*I/w,F=1-H*H),Z=L,b=P-2*C/F,isFinite(b)||(b=0),L=c+aie(a,H,F,v,w,P,b)}while(Math.abs(L-Z)>W.EPSILON12);let R=F*(t*t-n*n)/(n*n),E=1+R*(4096+R*(R*(320-175*R)-768))/16384,X=R*(256+R*(R*(74-47*R)-128))/1024,A=b*b,N=X*w*(b+X*(P*(2*A-1)-X*b*(4*w*w-3)*(4*A-3)/6)/4),O=n*E*(v-N),U=Math.atan2(g*I,_-V*G),Y=Math.atan2(m*I,_*G-V);e._distance=O,e._startHeading=U,e._endHeading=Y,e._uSquared=R}var M2e=new h,OY=new h;function cie(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,OY),M2e),r=h.normalize(i.cartographicToCartesian(n,OY),OY);A2e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=he.clone(t,e._start),e._end=he.clone(n,e._end),e._start.height=0,e._end.height=0,w2e(e)}function YE(e,t,n){let i=y(n,ne.default);this._ellipsoid=i,this._start=new he,this._end=new he,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&cie(this,e,t,i)}Object.defineProperties(YE.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});YE.prototype.setEndPoints=function(e,t){cie(this,e,t,this._ellipsoid)};YE.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};YE.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),r=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),d=Math.sin(6*i),u=Math.sin(8*i),m=i*i,p=i*m,g=n.u8Over256,f=n.u2Over4,x=n.u6Over64,_=n.u4Over16,C=2*p*g*o/3+i*(1-f+7*_/4-15*x/4+579*g/64-(_-15*x/4+187*g/16)*o-(5*x/4-115*g/16)*r-29*g*s/16)+(f/2-_+71*x/32-85*g/16)*a+(5*_/16-5*x/4+383*g/96)*c-m*((x-11*g/2)*a+5*g*c/2)+(29*x/96-29*g/16)*d+539*g*u/1536,V=Math.asin(Math.sin(C)*n.cosineAlpha),L=Math.atan(n.a/n.b*Math.tan(V));C=C-n.sigma;let Z=Math.cos(2*n.sigma+C),G=Math.sin(C),I=Math.cos(C),v=n.cosineU*I,P=n.sineU*G,F=Math.atan2(G*n.sineHeading,v-P*n.cosineHeading)-aie(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,G,I,Z);return l(t)?(t.longitude=this._start.longitude+F,t.latitude=L,t.height=0,t):new he(this._start.longitude+F,L,0)};var Rp=YE;var Hjt=T(S(),1);function HY(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,s=r*i,a=s*i,c=a*i,d=n,u=Math.sin(2*d),m=Math.sin(4*d),p=Math.sin(6*d),g=Math.sin(8*d),f=Math.sin(10*d),x=Math.sin(12*d);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*c/1048576)*d-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*c/524288)*u+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*c/8388608)*m-(35*r/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*g-(693*a/1310720+6237*c/5242880)*f+1001*c/8388608*x)}function N2e(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,c=a*a,d=c*c,u=d*c,m=u*c,p=m*c,g=p*c,f=Math.sin(2*i),x=Math.cos(2*i),_=Math.sin(4*i),C=Math.cos(4*i),V=Math.sin(6*i),L=Math.cos(6*i),Z=Math.sin(8*i),G=Math.cos(8*i),I=Math.sin(10*i),v=Math.cos(10*i),P=Math.sin(12*i);return i+i*c/4+7*i*d/64+15*i*u/256+579*i*m/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*d/16+45*i*u/256-i*(32*o-561)*m/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*g/5242880)*x+(21*i*u/256+483*i*m/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*g/1048576)*C+(151*i*m/4096+4681*i*p/65536+1479*i*g/16384-453*r*g/32768)*L+(1097*i*p/65536+42783*i*g/1048576)*G+8011*i*g/1048576*v+(3*c/8+3*d/16+213*u/2048-3*o*u/64+255*m/4096-33*o*m/512+20861*p/524288-33*o*p/512+s*p/1024+28273*g/1048576-471*o*g/8192+9*s*g/4096)*f+(21*d/256+21*u/256+533*m/8192-21*o*m/512+197*p/4096-315*o*p/4096+584039*g/16777216-12517*o*g/131072+7*s*g/2048)*_+(151*u/6144+151*m/4096+5019*p/131072-453*o*p/16384+26965*g/786432-8607*o*g/131072)*V+(1097*m/131072+1097*p/65536+225797*g/10485760-1097*o*g/65536)*Z+(8011*p/2621440+8011*g/1048576)*I+293393*g/251658240*P}function oC(e,t){if(e===0)return Math.log(Math.tan(.5*(W.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(W.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function k2e(e,t,n,i,o){let r=oC(e._ellipticity,n),s=oC(e._ellipticity,o);return Math.atan2(W.negativePiToPi(i-t),s-r)}function U2e(e,t,n,i,o,r,s){let a=e._heading,c=r-i,d=0;if(W.equalsEpsilon(Math.abs(a),W.PI_OVER_TWO,W.EPSILON8))if(t===n)d=t*Math.cos(o)*W.negativePiToPi(c);else{let u=Math.sin(o);d=t*Math.cos(o)*W.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*u*u)}else{let u=HY(e._ellipticity,t,o);d=(HY(e._ellipticity,t,s)-u)/Math.cos(a)}return Math.abs(d)}var D2e=new h,YY=new h;function lie(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,YY),D2e),r=h.normalize(i.cartographicToCartesian(n,YY),YY),s=i.maximumRadius,a=i.minimumRadius,c=s*s,d=a*a;e._ellipticitySquared=(c-d)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=he.clone(t,e._start),e._start.height=0,e._end=he.clone(n,e._end),e._end.height=0,e._heading=k2e(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=U2e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function die(e,t,n,i,o,r){if(n===0)return he.clone(e,r);let s=o*o,a,c,d;if(Math.abs(W.PI_OVER_TWO-Math.abs(t))>W.EPSILON8){let u=HY(o,i,e.latitude),m=n*Math.cos(t),p=u+m;if(c=N2e(p,o,i),Math.abs(t)<W.EPSILON10)a=W.negativePiToPi(e.longitude);else{let g=oC(o,e.latitude),f=oC(o,c);d=Math.tan(t)*(f-g),a=W.negativePiToPi(e.longitude+d)}}else{c=e.latitude;let u;if(o===0)u=i*Math.cos(e.latitude);else{let m=Math.sin(e.latitude);u=i*Math.cos(e.latitude)/Math.sqrt(1-s*m*m)}d=n/u,t>0?a=W.negativePiToPi(e.longitude+d):a=W.negativePiToPi(e.longitude-d)}return l(r)?(r.longitude=a,r.latitude=c,r.height=0,r):new he(a,c,0)}function Zp(e,t,n){let i=y(n,ne.default);this._ellipsoid=i,this._start=new he,this._end=new he,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&lie(this,e,t,i)}Object.defineProperties(Zp.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});Zp.fromStartHeadingDistance=function(e,t,n,i,o){let r=y(i,ne.default),s=r.maximumRadius,a=r.minimumRadius,c=s*s,d=a*a,u=Math.sqrt((c-d)/c);t=W.negativePiToPi(t);let m=die(e,t,n,r.maximumRadius,u);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new Zp(e,m,r):(o.setEndPoints(e,m),o)};Zp.prototype.setEndPoints=function(e,t){lie(this,e,t,this._ellipsoid)};Zp.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};Zp.prototype.interpolateUsingSurfaceDistance=function(e,t){return die(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};Zp.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=W.negativePiToPi(e),W.equalsEpsilon(Math.abs(e),Math.PI,W.EPSILON14)&&(e=W.sign(r.longitude)*Math.PI),l(t)||(t=new he),Math.abs(W.PI_OVER_TWO-o)<=W.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(W.equalsEpsilon(Math.abs(W.PI_OVER_TWO-o),W.PI_OVER_TWO,W.EPSILON8))return W.equalsEpsilon(e,r.longitude,W.EPSILON12)?void 0:(t.longitude=e,t.latitude=W.PI_OVER_TWO*W.sign(W.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),c=Math.tan(.5*(W.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),d=(1+a)/(1-a),u=r.latitude,m;do{m=u;let p=n*Math.sin(m),g=(1+p)/(1-p);u=2*Math.atan(c*Math.pow(g/d,n/2))-W.PI_OVER_TWO}while(!W.equalsEpsilon(u,m,W.EPSILON12));return t.longitude=e,t.latitude=u,t.height=0,t};Zp.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,o=this._start;if(W.equalsEpsilon(Math.abs(i),W.PI_OVER_TWO,W.EPSILON8))return;let r=oC(n,o.latitude),s=oC(n,e),a=Math.tan(i)*(s-r),c=W.negativePiToPi(o.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new he(c,e,0)};var Ea=Zp;var eH=[Ri,Zi],B2e=eH.length,Iie=Math.cos(W.toRadians(30)),uie=Math.cos(W.toRadians(150)),Xie=0,Wie=1e3;function U0(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions;this.width=y(e.width,1),this._positions=t,this.granularity=y(e.granularity,9999),this.loop=y(e.loop,!1),this.arcType=y(e.arcType,nn.GEODESIC),this._ellipsoid=ne.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(U0.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ne.packedLength+1+1}}});U0.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<B2e;i++)if(t instanceof eH[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var O2e=new h,mie=new h,hie=new h;function $Y(e,t,n,i,o){let r=Mc(i,e,0,O2e),s=Mc(i,e,n,mie),a=Mc(i,t,0,hie),c=Gp(s,r,mie),d=Gp(a,r,hie);return h.cross(d,c,o),h.normalize(o,o)}var Y2e=new he,H2e=new h,z2e=new h,K2e=new h;function zY(e,t,n,i,o,r,s,a,c,d,u){if(o===0)return;let m;r===nn.GEODESIC?m=new Rp(e,t,s):r===nn.RHUMB&&(m=new Ea(e,t,s));let p=m.surfaceDistance;if(p<o)return;let g=$Y(e,t,i,s,K2e),f=Math.ceil(p/o),x=p/f,_=x,C=f-1,V=a.length;for(let L=0;L<C;L++){let Z=m.interpolateUsingSurfaceDistance(_,Y2e),G=Mc(s,Z,n,H2e),I=Mc(s,Z,i,z2e);h.pack(g,a,V),h.pack(G,c,V),h.pack(I,d,V),u.push(Z.latitude),u.push(Z.longitude),V+=3,_+=x}}var KY=new he;function Mc(e,t,n,i){return he.clone(t,KY),KY.height=n,he.toCartesian(KY,e,i)}U0.pack=function(e,t,n){let i=y(n,0),o=e._positions,r=o.length;t[i++]=r;for(let s=0;s<r;++s){let a=o[s];h.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,ne.pack(e._ellipsoid,t,i),i+=ne.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};U0.unpack=function(e,t,n){let i=y(t,0),o=e[i++],r=new Array(o);for(let p=0;p<o;p++)r[p]=h.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],d=ne.unpack(e,i);i+=ne.packedLength;let u=e[i++],m=e[i++]===1;return l(n)||(n=new U0({positions:r})),n._positions=r,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=d,n._projectionIndex=u,n._scene3DOnly=m,n};function Gp(e,t,n){return h.subtract(e,t,n),h.normalize(n,n),n}function fie(e,t,n,i){return i=Gp(e,t,i),i=h.cross(i,n,i),i=h.normalize(i,i),i=h.cross(n,i,i),i}var J2e=new h,Q2e=new h,j2e=new h,Pie=new h,q2e=0,$2e=-1;function JY(e,t,n,i,o){let r=Gp(n,t,Pie),s=fie(e,t,r,J2e),a=fie(i,t,r,Q2e);if(W.equalsEpsilon(h.dot(s,a),$2e,W.EPSILON5))return o=h.cross(r,s,o),o=h.normalize(o,o),o;o=h.add(a,s,o),o=h.normalize(o,o);let c=h.cross(r,o,j2e);return h.dot(a,c)<q2e&&(o=h.negate(o,o)),o}var n5=ln.fromPointNormal(h.ZERO,h.UNIT_Y),ePe=new h,tPe=new h,nPe=new h,iPe=new h,oPe=new h,$N=new h,e5=new he,pie=new he,bie=new he;U0.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,o=e.granularity,r=e.arcType,s=new eH[e._projectionIndex](i),a=Xie,c=Wie,d,u,m=e._positions,p=m.length;p===2&&(n=!1);let g,f,x,_,C=new Ea(void 0,void 0,i),V,L,Z,G=[m[0]];for(u=0;u<p-1;u++)g=m[u],f=m[u+1],V=qn.lineSegmentPlane(g,f,n5,$N),l(V)&&!h.equalsEpsilon(V,g,W.EPSILON7)&&!h.equalsEpsilon(V,f,W.EPSILON7)&&(e.arcType===nn.GEODESIC?G.push(h.clone(V)):e.arcType===nn.RHUMB&&(Z=i.cartesianToCartographic(V,e5).longitude,x=i.cartesianToCartographic(g,e5),_=i.cartesianToCartographic(f,pie),C.setEndPoints(x,_),L=C.findIntersectionWithLongitude(Z,bie),V=i.cartographicToCartesian(L,$N),l(V)&&!h.equalsEpsilon(V,g,W.EPSILON7)&&!h.equalsEpsilon(V,f,W.EPSILON7)&&G.push(h.clone(V)))),G.push(f);n&&(g=m[p-1],f=m[0],V=qn.lineSegmentPlane(g,f,n5,$N),l(V)&&!h.equalsEpsilon(V,g,W.EPSILON7)&&!h.equalsEpsilon(V,f,W.EPSILON7)&&(e.arcType===nn.GEODESIC?G.push(h.clone(V)):e.arcType===nn.RHUMB&&(Z=i.cartesianToCartographic(V,e5).longitude,x=i.cartesianToCartographic(g,e5),_=i.cartesianToCartographic(f,pie),C.setEndPoints(x,_),L=C.findIntersectionWithLongitude(Z,bie),V=i.cartographicToCartesian(L,$N),l(V)&&!h.equalsEpsilon(V,g,W.EPSILON7)&&!h.equalsEpsilon(V,f,W.EPSILON7)&&G.push(h.clone(V)))));let I=G.length,v=new Array(I);for(u=0;u<I;u++){let J=he.fromCartesian(G[u],i);J.height=0,v[u]=J}if(v=xo(v,he.equalsEpsilon),I=v.length,I<2)return;let P=[],w=[],F=[],b=[],R=ePe,E=tPe,X=nPe,A=iPe,N=oPe,O=v[0],U=v[1],Y=v[I-1];for(R=Mc(i,Y,a,R),A=Mc(i,U,a,A),E=Mc(i,O,a,E),X=Mc(i,O,c,X),n?N=JY(R,E,X,A,N):N=$Y(O,U,c,i,N),h.pack(N,w,0),h.pack(E,F,0),h.pack(X,b,0),P.push(O.latitude),P.push(O.longitude),zY(O,U,a,c,o,r,i,w,F,b,P),u=1;u<I-1;++u){R=h.clone(E,R),E=h.clone(A,E);let J=v[u];Mc(i,J,c,X),Mc(i,v[u+1],a,A),JY(R,E,X,A,N),d=w.length,h.pack(N,w,d),h.pack(E,F,d),h.pack(X,b,d),P.push(J.latitude),P.push(J.longitude),zY(v[u],v[u+1],a,c,o,r,i,w,F,b,P)}let k=v[I-1],H=v[I-2];if(E=Mc(i,k,a,E),X=Mc(i,k,c,X),n){let J=v[0];R=Mc(i,H,a,R),A=Mc(i,J,a,A),N=JY(R,E,X,A,N)}else N=$Y(H,k,c,i,N);if(d=w.length,h.pack(N,w,d),h.pack(E,F,d),h.pack(X,b,d),P.push(k.latitude),P.push(k.longitude),n){for(zY(k,O,a,c,o,r,i,w,F,b,P),d=w.length,u=0;u<3;++u)w[d+u]=w[u],F[d+u]=F[u],b[d+u]=b[u];P.push(O.latitude),P.push(O.longitude)}return IPe(n,s,F,b,w,P,t)};var rPe=new h,sPe=new $,aPe=new we;function gie(e,t,n,i){let o=Gp(n,t,rPe),r=h.dot(o,e);if(r>Iie||r<uie){let s=Gp(i,n,Pie),a=r<uie?W.PI_OVER_TWO:-W.PI_OVER_TWO,c=we.fromAxisAngle(s,a,aPe),d=$.fromQuaternion(c,sPe);return $.multiplyByVector(d,e,e),!0}return!1}var yie=new he,cPe=new h,xie=new h;function HE(e,t,n,i,o){let r=he.toCartesian(t,e._ellipsoid,cPe),s=h.add(r,n,xie),a=!1,c=e._ellipsoid,d=c.cartesianToCartographic(s,yie);Math.abs(t.longitude-d.longitude)>W.PI_OVER_TWO&&(a=!0,s=h.subtract(r,n,xie),d=c.cartesianToCartographic(s,yie)),d.height=0;let u=e.project(d,o);return o=h.subtract(u,i,o),o.z=0,o=h.normalize(o,o),a&&h.negate(o,o),o}var lPe=new h,_ie=new h;function Tie(e,t,n,i,o,r){let s=h.subtract(t,e,lPe);h.normalize(s,s);let a=n-Xie,c=h.multiplyByScalar(s,a,_ie);h.add(e,c,o);let d=i-Wie;c=h.multiplyByScalar(s,d,_ie),h.add(t,c,r)}var dPe=new h;function t5(e,t){let n=ln.getPointDistance(n5,e),i=ln.getPointDistance(n5,t),o=dPe;W.equalsEpsilon(n,0,W.EPSILON2)?(o=Gp(t,e,o),h.multiplyByScalar(o,W.EPSILON2,o),h.add(e,o,e)):W.equalsEpsilon(i,0,W.EPSILON2)&&(o=Gp(e,t,o),h.multiplyByScalar(o,W.EPSILON2,o),h.add(t,o,t))}function uPe(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(W.equalsEpsilon(n,W.PI,W.EPSILON11)){let o=W.sign(t.longitude);return e.longitude=o*(n-W.EPSILON11),1}else if(W.equalsEpsilon(i,W.PI,W.EPSILON11)){let o=W.sign(e.longitude);return t.longitude=o*(i-W.EPSILON11),2}return 0}var vie=new he,wie=new he,Sie=new h,QY=new h,Cie=new h,Vie=new h,mPe=new h,Lie=new h,hPe=[vie,wie],fPe=new ae,pPe=new h,bPe=new h,gPe=new h,yPe=new h,xPe=new h,_Pe=new h,jY=new h,qY=new h,TPe=new h,SPe=new h,CPe=new h,Rie=new h,VPe=new h,LPe=new h,RPe=new On,ZPe=new On,Zie=new h,GPe=new h,Gie=new h,EPe=[new ce,new ce],Fie=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],Eie=Fie.length;function IPe(e,t,n,i,o,r,s){let a,c,d=t._ellipsoid,u=n.length/3-1,m=u*8,p=m*4,g=u*36,f=m>65535?new Uint32Array(g):new Uint16Array(g),x=new Float64Array(m*3),_=new Float32Array(p),C=new Float32Array(p),V=new Float32Array(p),L=new Float32Array(p),Z=new Float32Array(p),G,I,v,P;s&&(G=new Float32Array(p),I=new Float32Array(p),v=new Float32Array(p),P=new Float32Array(m*2));let w=r.length/2,F=0,b=vie;b.height=0;let R=wie;R.height=0;let E=Sie,X=QY;if(s)for(c=0,a=1;a<w;a++)b.latitude=r[c],b.longitude=r[c+1],R.latitude=r[c+2],R.longitude=r[c+3],E=t.project(b,E),X=t.project(R,X),F+=h.distance(E,X),c+=2;let A=i.length/3;X=h.unpack(i,0,X);let N=0;for(c=3,a=1;a<A;a++)E=h.clone(X,E),X=h.unpack(i,c,X),N+=h.distance(E,X),c+=3;let O;c=3;let U=0,Y=0,k=0,H=0,J=!1,te=h.unpack(n,0,Vie),z=h.unpack(i,0,QY),q=h.unpack(o,0,Lie);if(e){let Le=h.unpack(n,n.length-6,Cie);gie(q,Le,te,z)&&(q=h.negate(q,q))}let ee=0,fe=0,_e=0;for(a=0;a<u;a++){let Le=h.clone(te,Cie),ke=h.clone(z,Sie),Oe=h.clone(q,mPe);J&&(Oe=h.negate(Oe,Oe)),te=h.unpack(n,c,Vie),z=h.unpack(i,c,QY),q=h.unpack(o,c,Lie),J=gie(q,Le,te,z),b.latitude=r[U],b.longitude=r[U+1],R.latitude=r[U+2],R.longitude=r[U+3];let at,Mt,Lt,Ie;if(s){let Qn=uPe(b,R);at=t.project(b,xPe),Mt=t.project(R,_Pe);let xs=Gp(Mt,at,Zie);xs.y=Math.abs(xs.y),Lt=jY,Ie=qY,Qn===0||h.dot(xs,h.UNIT_Y)>Iie?(Lt=HE(t,b,Oe,at,jY),Ie=HE(t,R,q,Mt,qY)):Qn===1?(Ie=HE(t,R,q,Mt,qY),Lt.x=0,Lt.y=W.sign(b.longitude-Math.abs(R.longitude)),Lt.z=0):(Lt=HE(t,b,Oe,at,jY),Ie.x=0,Ie.y=W.sign(b.longitude-R.longitude),Ie.z=0)}let je=h.distance(ke,z),et=On.fromCartesian(Le,RPe),He=h.subtract(te,Le,TPe),Dt=h.normalize(He,Rie),Ce=h.subtract(ke,Le,SPe);Ce=h.normalize(Ce,Ce);let Ve=h.cross(Dt,Ce,Rie);Ve=h.normalize(Ve,Ve);let ct=h.cross(Ce,Oe,VPe);ct=h.normalize(ct,ct);let Di=h.subtract(z,te,CPe);Di=h.normalize(Di,Di);let mt=h.cross(q,Di,LPe);mt=h.normalize(mt,mt);let _o=je/N,fr=ee/N,Zc=0,Zr,ss,Ne,ut=0,Je=0;if(s){Zc=h.distance(at,Mt),Zr=On.fromCartesian(at,ZPe),ss=h.subtract(Mt,at,Zie),Ne=h.normalize(ss,GPe);let Qn=Ne.x;Ne.x=Ne.y,Ne.y=-Qn,ut=Zc/F,Je=fe/F}for(O=0;O<8;O++){let Qn=H+O*4,xs=Y+O*2,Gr=Qn+3,hl=O<4?1:-1,To=O===2||O===3||O===6||O===7?1:-1;h.pack(et.high,_,Qn),_[Gr]=He.x,h.pack(et.low,C,Qn),C[Gr]=He.y,h.pack(ct,V,Qn),V[Gr]=He.z,h.pack(mt,L,Qn),L[Gr]=_o*hl,h.pack(Ve,Z,Qn);let Hr=fr*To;Hr===0&&To<0&&(Hr=9),Z[Gr]=Hr,s&&(G[Qn]=Zr.high.x,G[Qn+1]=Zr.high.y,G[Qn+2]=Zr.low.x,G[Qn+3]=Zr.low.y,v[Qn]=-Lt.y,v[Qn+1]=Lt.x,v[Qn+2]=Ie.y,v[Qn+3]=-Ie.x,I[Qn]=ss.x,I[Qn+1]=ss.y,I[Qn+2]=Ne.x,I[Qn+3]=Ne.y,P[xs]=ut*hl,Hr=Je*To,Hr===0&&To<0&&(Hr=9),P[xs+1]=Hr)}let $e=gPe,pt=yPe,It=pPe,yn=bPe,po=ae.fromCartographicArray(hPe,fPe),rr=li.getMinimumMaximumHeights(po,d),Oa=rr.minimumTerrainHeight,Ya=rr.maximumTerrainHeight;_e+=Math.abs(Oa),_e+=Math.abs(Ya),Tie(Le,ke,Oa,Ya,$e,It),Tie(te,z,Oa,Ya,pt,yn);let as=h.multiplyByScalar(Ve,W.EPSILON5,Gie);h.add($e,as,$e),h.add(pt,as,pt),h.add(It,as,It),h.add(yn,as,yn),t5($e,pt),t5(It,yn),h.pack($e,x,k),h.pack(pt,x,k+3),h.pack(yn,x,k+6),h.pack(It,x,k+9),as=h.multiplyByScalar(Ve,-2*W.EPSILON5,Gie),h.add($e,as,$e),h.add(pt,as,pt),h.add(It,as,It),h.add(yn,as,yn),t5($e,pt),t5(It,yn),h.pack($e,x,k+12),h.pack(pt,x,k+15),h.pack(yn,x,k+18),h.pack(It,x,k+21),U+=2,c+=3,Y+=16,k+=24,H+=32,ee+=je,fe+=Zc}c=0;let le=0;for(a=0;a<u;a++){for(O=0;O<Eie;O++)f[c+O]=Fie[O]+le;le+=8,c+=Eie}let ye=EPe;ce.fromVertices(n,h.ZERO,3,ye[0]),ce.fromVertices(i,h.ZERO,3,ye[1]);let Te=ce.fromBoundingSpheres(ye);Te.radius+=_e/(u*2);let Xe={position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,normalize:!1,values:x}),startHiAndForwardOffsetX:k0(_),startLoAndForwardOffsetY:k0(C),startNormalAndForwardOffsetZ:k0(V),endNormalAndTextureCoordinateNormalizationX:k0(L),rightNormalAndTextureCoordinateNormalizationY:k0(Z)};return s&&(Xe.startHiLo2D=k0(G),Xe.offsetAndRight2D=k0(I),Xe.startEndNormals2D=k0(v),Xe.texcoordNormalization2D=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,normalize:!1,values:P})),new ht({attributes:Xe,indices:f,boundingSphere:Te})}function k0(e){return new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}U0._projectNormal=HE;var Vx=U0;var x8t=T(S(),1),zE=`in vec4 v_startPlaneNormalEcAndHalfWidth;
  4744. in vec4 v_endPlaneNormalEcAndBatchId;
  4745. in vec4 v_rightPlaneEC; // Technically can compute distance for this here
  4746. in vec4 v_endEcAndStartEcX;
  4747. in vec4 v_texcoordNormalizationAndStartEcYZ;
  4748. #ifdef PER_INSTANCE_COLOR
  4749. in vec4 v_color;
  4750. #endif
  4751. void main(void)
  4752. {
  4753. float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));
  4754. vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw);
  4755. // Discard for sky
  4756. if (logDepthOrDepth == 0.0) {
  4757. #ifdef DEBUG_SHOW_VOLUME
  4758. out_FragColor = vec4(1.0, 0.0, 0.0, 0.5);
  4759. return;
  4760. #else // DEBUG_SHOW_VOLUME
  4761. discard;
  4762. #endif // DEBUG_SHOW_VOLUME
  4763. }
  4764. vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
  4765. eyeCoordinate /= eyeCoordinate.w;
  4766. float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);
  4767. // Check distance of the eye coordinate against the right-facing plane
  4768. float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);
  4769. // Check eye coordinate against the mitering planes
  4770. float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz);
  4771. float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz);
  4772. if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {
  4773. #ifdef DEBUG_SHOW_VOLUME
  4774. out_FragColor = vec4(1.0, 0.0, 0.0, 0.5);
  4775. return;
  4776. #else // DEBUG_SHOW_VOLUME
  4777. discard;
  4778. #endif // DEBUG_SHOW_VOLUME
  4779. }
  4780. // Check distance of the eye coordinate against start and end planes with normals in the right plane.
  4781. // For computing unskewed lengthwise texture coordinate.
  4782. // Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking.
  4783. // aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward"
  4784. vec3 alignedPlaneNormal;
  4785. // start aligned plane
  4786. alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz);
  4787. alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));
  4788. distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz);
  4789. // end aligned plane
  4790. alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz);
  4791. alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));
  4792. distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz);
  4793. #ifdef PER_INSTANCE_COLOR
  4794. out_FragColor = czm_gammaCorrect(v_color);
  4795. #else // PER_INSTANCE_COLOR
  4796. // Clamp - distance to aligned planes may be negative due to mitering,
  4797. // so fragment texture coordinate might be out-of-bounds.
  4798. float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0);
  4799. s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y;
  4800. float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth);
  4801. czm_materialInput materialInput;
  4802. materialInput.s = s;
  4803. materialInput.st = vec2(s, t);
  4804. materialInput.str = vec3(s, t, 0.0);
  4805. czm_material material = czm_getMaterial(materialInput);
  4806. out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
  4807. #endif // PER_INSTANCE_COLOR
  4808. // Premultiply alpha. Required for classification primitives on translucent globe.
  4809. out_FragColor.rgb *= out_FragColor.a;
  4810. czm_writeDepthClamp();
  4811. }
  4812. `;var T8t=T(S(),1),KE=`in vec3 v_forwardDirectionEC;
  4813. in vec3 v_texcoordNormalizationAndHalfWidth;
  4814. in float v_batchId;
  4815. #ifdef PER_INSTANCE_COLOR
  4816. in vec4 v_color;
  4817. #else
  4818. in vec2 v_alignedPlaneDistances;
  4819. in float v_texcoordT;
  4820. #endif
  4821. float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) {
  4822. // We don't expect the ray to ever be parallel to the plane
  4823. return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction);
  4824. }
  4825. void main(void)
  4826. {
  4827. vec4 eyeCoordinate = gl_FragCoord;
  4828. eyeCoordinate /= eyeCoordinate.w;
  4829. #ifdef PER_INSTANCE_COLOR
  4830. out_FragColor = czm_gammaCorrect(v_color);
  4831. #else // PER_INSTANCE_COLOR
  4832. // Use distances for planes aligned with segment to prevent skew in dashing
  4833. float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x);
  4834. float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y);
  4835. // Clamp - distance to aligned planes may be negative due to mitering
  4836. distanceFromStart = max(0.0, distanceFromStart);
  4837. distanceFromEnd = max(0.0, distanceFromEnd);
  4838. float s = distanceFromStart / (distanceFromStart + distanceFromEnd);
  4839. s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y;
  4840. czm_materialInput materialInput;
  4841. materialInput.s = s;
  4842. materialInput.st = vec2(s, v_texcoordT);
  4843. materialInput.str = vec3(s, v_texcoordT, 0.0);
  4844. czm_material material = czm_getMaterial(materialInput);
  4845. out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
  4846. #endif // PER_INSTANCE_COLOR
  4847. }
  4848. `;var C8t=T(S(),1),JE=`in vec3 position3DHigh;
  4849. in vec3 position3DLow;
  4850. in vec4 startHiAndForwardOffsetX;
  4851. in vec4 startLoAndForwardOffsetY;
  4852. in vec4 startNormalAndForwardOffsetZ;
  4853. in vec4 endNormalAndTextureCoordinateNormalizationX;
  4854. in vec4 rightNormalAndTextureCoordinateNormalizationY;
  4855. in vec4 startHiLo2D;
  4856. in vec4 offsetAndRight2D;
  4857. in vec4 startEndNormals2D;
  4858. in vec2 texcoordNormalization2D;
  4859. in float batchId;
  4860. out vec3 v_forwardDirectionEC;
  4861. out vec3 v_texcoordNormalizationAndHalfWidth;
  4862. out float v_batchId;
  4863. // For materials
  4864. #ifdef WIDTH_VARYING
  4865. out float v_width;
  4866. #endif
  4867. #ifdef ANGLE_VARYING
  4868. out float v_polylineAngle;
  4869. #endif
  4870. #ifdef PER_INSTANCE_COLOR
  4871. out vec4 v_color;
  4872. #else
  4873. out vec2 v_alignedPlaneDistances;
  4874. out float v_texcoordT;
  4875. #endif
  4876. // Morphing planes using SLERP or NLERP doesn't seem to work, so instead draw the material directly on the shadow volume.
  4877. // Morph views are from very far away and aren't meant to be used precisely, so this should be sufficient.
  4878. void main()
  4879. {
  4880. v_batchId = batchId;
  4881. // Start position
  4882. vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw));
  4883. vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz);
  4884. vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);
  4885. vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;
  4886. vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;
  4887. vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;
  4888. // Start plane
  4889. vec4 startPlane2D;
  4890. vec4 startPlane3D;
  4891. startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);
  4892. startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;
  4893. startPlane2D.w = -dot(startPlane2D.xyz, posEc2D);
  4894. startPlane3D.w = -dot(startPlane3D.xyz, posEc3D);
  4895. // Right plane
  4896. vec4 rightPlane2D;
  4897. vec4 rightPlane3D;
  4898. rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);
  4899. rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;
  4900. rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D);
  4901. rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D);
  4902. // End position
  4903. posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0);
  4904. posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0);
  4905. posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);
  4906. posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;
  4907. posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;
  4908. vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;
  4909. vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w));
  4910. vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy));
  4911. // End plane
  4912. vec4 endPlane2D;
  4913. vec4 endPlane3D;
  4914. endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);
  4915. endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;
  4916. endPlane2D.w = -dot(endPlane2D.xyz, posEc2D);
  4917. endPlane3D.w = -dot(endPlane3D.xyz, posEc3D);
  4918. // Forward direction
  4919. v_forwardDirectionEC = normalize(endEC - startEC);
  4920. vec2 cleanTexcoordNormalization2D;
  4921. cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x);
  4922. cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y));
  4923. vec2 cleanTexcoordNormalization3D;
  4924. cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w);
  4925. cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w;
  4926. cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y));
  4927. v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime);
  4928. #ifdef PER_INSTANCE_COLOR
  4929. v_color = czm_batchTable_color(batchId);
  4930. #else // PER_INSTANCE_COLOR
  4931. // For computing texture coordinates
  4932. v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC);
  4933. v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC);
  4934. #endif // PER_INSTANCE_COLOR
  4935. #ifdef WIDTH_VARYING
  4936. float width = czm_batchTable_width(batchId);
  4937. float halfWidth = width * 0.5;
  4938. v_width = width;
  4939. v_texcoordNormalizationAndHalfWidth.z = halfWidth;
  4940. #else
  4941. float halfWidth = 0.5 * czm_batchTable_width(batchId);
  4942. v_texcoordNormalizationAndHalfWidth.z = halfWidth;
  4943. #endif
  4944. // Compute a normal along which to "push" the position out, extending the miter depending on view distance.
  4945. // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes.
  4946. // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.
  4947. // Since this is morphing, compute both 3D and 2D positions and then blend.
  4948. // ****** 3D ******
  4949. // Check distance to the end plane and start plane, pick the plane that is closer
  4950. vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition
  4951. float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz));
  4952. float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz));
  4953. vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz);
  4954. vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.
  4955. vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too.
  4956. // Nudge the top vertex upwards to prevent flickering
  4957. vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D));
  4958. geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0);
  4959. geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
  4960. positionEc3D.xyz += geodeticSurfaceNormal;
  4961. // Determine if this vertex is on the "left" or "right"
  4962. normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);
  4963. // A "perfect" implementation would push along normals according to the angle against forward.
  4964. // In practice, just pushing the normal out by halfWidth is sufficient for morph views.
  4965. positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)
  4966. // ****** 2D ******
  4967. // Check distance to the end plane and start plane, pick the plane that is closer
  4968. vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition
  4969. absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz));
  4970. absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz));
  4971. planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz);
  4972. upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.
  4973. normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too.
  4974. // Nudge the top vertex upwards to prevent flickering
  4975. geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D));
  4976. geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0);
  4977. geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
  4978. positionEc2D.xyz += geodeticSurfaceNormal;
  4979. // Determine if this vertex is on the "left" or "right"
  4980. normalEC *= sign(texcoordNormalization2D.x);
  4981. #ifndef PER_INSTANCE_COLOR
  4982. // Use vertex's sidedness to compute its texture coordinate.
  4983. v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0);
  4984. #endif
  4985. // A "perfect" implementation would push along normals according to the angle against forward.
  4986. // In practice, just pushing the normal out by halfWidth is sufficient for morph views.
  4987. positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)
  4988. // Blend for actual position
  4989. gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime);
  4990. #ifdef ANGLE_VARYING
  4991. // Approximate relative screen space direction of the line.
  4992. vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y));
  4993. approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);
  4994. v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);
  4995. #endif
  4996. }
  4997. `;var L8t=T(S(),1),QE=`in vec3 position3DHigh;
  4998. in vec3 position3DLow;
  4999. // In 2D and in 3D, texture coordinate normalization component signs encodes:
  5000. // * X sign - sidedness relative to right plane
  5001. // * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume
  5002. #ifndef COLUMBUS_VIEW_2D
  5003. in vec4 startHiAndForwardOffsetX;
  5004. in vec4 startLoAndForwardOffsetY;
  5005. in vec4 startNormalAndForwardOffsetZ;
  5006. in vec4 endNormalAndTextureCoordinateNormalizationX;
  5007. in vec4 rightNormalAndTextureCoordinateNormalizationY;
  5008. #else
  5009. in vec4 startHiLo2D;
  5010. in vec4 offsetAndRight2D;
  5011. in vec4 startEndNormals2D;
  5012. in vec2 texcoordNormalization2D;
  5013. #endif
  5014. in float batchId;
  5015. out vec4 v_startPlaneNormalEcAndHalfWidth;
  5016. out vec4 v_endPlaneNormalEcAndBatchId;
  5017. out vec4 v_rightPlaneEC;
  5018. out vec4 v_endEcAndStartEcX;
  5019. out vec4 v_texcoordNormalizationAndStartEcYZ;
  5020. // For materials
  5021. #ifdef WIDTH_VARYING
  5022. out float v_width;
  5023. #endif
  5024. #ifdef ANGLE_VARYING
  5025. out float v_polylineAngle;
  5026. #endif
  5027. #ifdef PER_INSTANCE_COLOR
  5028. out vec4 v_color;
  5029. #endif
  5030. void main()
  5031. {
  5032. #ifdef COLUMBUS_VIEW_2D
  5033. vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz;
  5034. vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy);
  5035. vec3 ecEnd = forwardDirectionEC + ecStart;
  5036. forwardDirectionEC = normalize(forwardDirectionEC);
  5037. // Right plane
  5038. v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);
  5039. v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);
  5040. // start plane
  5041. vec4 startPlaneEC;
  5042. startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);
  5043. startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);
  5044. // end plane
  5045. vec4 endPlaneEC;
  5046. endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);
  5047. endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);
  5048. v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x);
  5049. v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y;
  5050. #else // COLUMBUS_VIEW_2D
  5051. vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz;
  5052. vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w);
  5053. vec3 ecEnd = ecStart + offset;
  5054. vec3 forwardDirectionEC = normalize(offset);
  5055. // start plane
  5056. vec4 startPlaneEC;
  5057. startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;
  5058. startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);
  5059. // end plane
  5060. vec4 endPlaneEC;
  5061. endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;
  5062. endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);
  5063. // Right plane
  5064. v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;
  5065. v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);
  5066. v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w);
  5067. v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w;
  5068. #endif // COLUMBUS_VIEW_2D
  5069. v_endEcAndStartEcX.xyz = ecEnd;
  5070. v_endEcAndStartEcX.w = ecStart.x;
  5071. v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz;
  5072. #ifdef PER_INSTANCE_COLOR
  5073. v_color = czm_batchTable_color(batchId);
  5074. #endif // PER_INSTANCE_COLOR
  5075. // Compute a normal along which to "push" the position out, extending the miter depending on view distance.
  5076. // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes.
  5077. // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.
  5078. vec4 positionRelativeToEye = czm_computePosition();
  5079. // Check distance to the end plane and start plane, pick the plane that is closer
  5080. vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition
  5081. float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz));
  5082. float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz));
  5083. vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz);
  5084. vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.
  5085. vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too.
  5086. // Extrude bottom vertices downward for far view distances, like for GroundPrimitives
  5087. upOrDown = cross(forwardDirectionEC, normalEC);
  5088. upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown;
  5089. upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown;
  5090. upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown;
  5091. positionEC.xyz += upOrDown;
  5092. v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y));
  5093. // Determine distance along normalEC to push for a volume of appropriate width.
  5094. // Make volumes about double pixel width for a conservative fit - in practice the
  5095. // extra cost here is minimal compared to the loose volume heights.
  5096. //
  5097. // N = normalEC (guaranteed "right-facing")
  5098. // R = rightEC
  5099. // p = angle between N and R
  5100. // w = distance to push along R if R == N
  5101. // d = distance to push along N
  5102. //
  5103. // N R
  5104. // { p| } * cos(p) = dot(N, R) = w / d
  5105. // d | |w * d = w / dot(N, R)
  5106. // { | }
  5107. // o---------- polyline segment ---->
  5108. //
  5109. float width = czm_batchTable_width(batchId);
  5110. #ifdef WIDTH_VARYING
  5111. v_width = width;
  5112. #endif
  5113. v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz;
  5114. v_startPlaneNormalEcAndHalfWidth.w = width * 0.5;
  5115. v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz;
  5116. v_endPlaneNormalEcAndBatchId.w = batchId;
  5117. width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R
  5118. width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N
  5119. // Determine if this vertex is on the "left" or "right"
  5120. #ifdef COLUMBUS_VIEW_2D
  5121. normalEC *= sign(texcoordNormalization2D.x);
  5122. #else
  5123. normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);
  5124. #endif
  5125. positionEC.xyz += width * normalEC;
  5126. gl_Position = czm_depthClamp(czm_projection * positionEC);
  5127. #ifdef ANGLE_VARYING
  5128. // Approximate relative screen space direction of the line.
  5129. vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y));
  5130. approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);
  5131. v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);
  5132. #endif
  5133. }
  5134. `;var M8t=T(S(),1);var Z8t=T(S(),1),jE=`in vec3 position3DHigh;
  5135. in vec3 position3DLow;
  5136. in vec3 prevPosition3DHigh;
  5137. in vec3 prevPosition3DLow;
  5138. in vec3 nextPosition3DHigh;
  5139. in vec3 nextPosition3DLow;
  5140. in vec2 expandAndWidth;
  5141. in vec4 color;
  5142. in float batchId;
  5143. out vec4 v_color;
  5144. void main()
  5145. {
  5146. float expandDir = expandAndWidth.x;
  5147. float width = abs(expandAndWidth.y) + 0.5;
  5148. bool usePrev = expandAndWidth.y < 0.0;
  5149. vec4 p = czm_computePosition();
  5150. vec4 prev = czm_computePrevPosition();
  5151. vec4 next = czm_computeNextPosition();
  5152. float angle;
  5153. vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);
  5154. gl_Position = czm_viewportOrthographic * positionWC;
  5155. v_color = color;
  5156. }
  5157. `;var E8t=T(S(),1),md=`void clipLineSegmentToNearPlane(
  5158. vec3 p0,
  5159. vec3 p1,
  5160. out vec4 positionWC,
  5161. out bool clipped,
  5162. out bool culledByNearPlane,
  5163. out vec4 clippedPositionEC)
  5164. {
  5165. culledByNearPlane = false;
  5166. clipped = false;
  5167. vec3 p0ToP1 = p1 - p0;
  5168. float magnitude = length(p0ToP1);
  5169. vec3 direction = normalize(p0ToP1);
  5170. // Distance that p0 is behind the near plane. Negative means p0 is
  5171. // in front of the near plane.
  5172. float endPoint0Distance = czm_currentFrustum.x + p0.z;
  5173. // Camera looks down -Z.
  5174. // When moving a point along +Z: LESS VISIBLE
  5175. // * Points in front of the camera move closer to the camera.
  5176. // * Points behind the camrea move farther away from the camera.
  5177. // When moving a point along -Z: MORE VISIBLE
  5178. // * Points in front of the camera move farther away from the camera.
  5179. // * Points behind the camera move closer to the camera.
  5180. // Positive denominator: -Z, becoming more visible
  5181. // Negative denominator: +Z, becoming less visible
  5182. // Nearly zero: parallel to near plane
  5183. float denominator = -direction.z;
  5184. if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7)
  5185. {
  5186. // p0 is behind the near plane and the line to p1 is nearly parallel to
  5187. // the near plane, so cull the segment completely.
  5188. culledByNearPlane = true;
  5189. }
  5190. else if (endPoint0Distance > 0.0)
  5191. {
  5192. // p0 is behind the near plane, and the line to p1 is moving distinctly
  5193. // toward or away from it.
  5194. // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction)
  5195. float t = endPoint0Distance / denominator;
  5196. if (t < 0.0 || t > magnitude)
  5197. {
  5198. // Near plane intersection is not between the two points.
  5199. // We already confirmed p0 is behind the naer plane, so now
  5200. // we know the entire segment is behind it.
  5201. culledByNearPlane = true;
  5202. }
  5203. else
  5204. {
  5205. // Segment crosses the near plane, update p0 to lie exactly on it.
  5206. p0 = p0 + t * direction;
  5207. // Numerical noise might put us a bit on the wrong side of the near plane.
  5208. // Don't let that happen.
  5209. p0.z = min(p0.z, -czm_currentFrustum.x);
  5210. clipped = true;
  5211. }
  5212. }
  5213. clippedPositionEC = vec4(p0, 1.0);
  5214. positionWC = czm_eyeToWindowCoordinates(clippedPositionEC);
  5215. }
  5216. vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle)
  5217. {
  5218. // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC.
  5219. #ifdef POLYLINE_DASH
  5220. // Compute the window coordinates of the points.
  5221. vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);
  5222. vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);
  5223. vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);
  5224. // Determine the relative screen space direction of the line.
  5225. vec2 lineDir;
  5226. if (usePrevious) {
  5227. lineDir = normalize(positionWindow.xy - previousWindow.xy);
  5228. }
  5229. else {
  5230. lineDir = normalize(nextWindow.xy - positionWindow.xy);
  5231. }
  5232. angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0)
  5233. // Quantize the angle so it doesn't change rapidly between segments.
  5234. angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour;
  5235. #endif
  5236. vec4 clippedPrevWC, clippedPrevEC;
  5237. bool prevSegmentClipped, prevSegmentCulled;
  5238. clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC);
  5239. vec4 clippedNextWC, clippedNextEC;
  5240. bool nextSegmentClipped, nextSegmentCulled;
  5241. clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC);
  5242. bool segmentClipped, segmentCulled;
  5243. vec4 clippedPositionWC, clippedPositionEC;
  5244. clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC);
  5245. if (segmentCulled)
  5246. {
  5247. return vec4(0.0, 0.0, 0.0, 1.0);
  5248. }
  5249. vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy);
  5250. vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy);
  5251. // If a segment was culled, we can't use the corresponding direction
  5252. // computed above. We should never see both of these be true without
  5253. // \`segmentCulled\` above also being true.
  5254. if (prevSegmentCulled)
  5255. {
  5256. directionToPrevWC = -directionToNextWC;
  5257. }
  5258. else if (nextSegmentCulled)
  5259. {
  5260. directionToNextWC = -directionToPrevWC;
  5261. }
  5262. vec2 thisSegmentForwardWC, otherSegmentForwardWC;
  5263. if (usePrevious)
  5264. {
  5265. thisSegmentForwardWC = -directionToPrevWC;
  5266. otherSegmentForwardWC = directionToNextWC;
  5267. }
  5268. else
  5269. {
  5270. thisSegmentForwardWC = directionToNextWC;
  5271. otherSegmentForwardWC = -directionToPrevWC;
  5272. }
  5273. vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x);
  5274. vec2 leftWC = thisSegmentLeftWC;
  5275. float expandWidth = width * 0.5;
  5276. // When lines are split at the anti-meridian, the position may be at the
  5277. // same location as the next or previous position, and we need to handle
  5278. // that to avoid producing NaNs.
  5279. if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1))
  5280. {
  5281. vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x);
  5282. vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC;
  5283. float leftSumLength = length(leftSumWC);
  5284. leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength);
  5285. // The sine of the angle between the two vectors is given by the formula
  5286. // |a x b| = |a||b|sin(theta)
  5287. // which is
  5288. // float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0)));
  5289. // Because the z components of both vectors are zero, the x and y coordinate will be zero.
  5290. // Therefore, the sine of the angle is just the z component of the cross product.
  5291. vec2 u = -thisSegmentForwardWC;
  5292. vec2 v = leftWC;
  5293. float sinAngle = abs(u.x * v.y - u.y * v.x);
  5294. expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);
  5295. }
  5296. vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio;
  5297. return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w;
  5298. }
  5299. vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle)
  5300. {
  5301. vec4 positionEC = czm_modelViewRelativeToEye * position;
  5302. vec4 prevEC = czm_modelViewRelativeToEye * previous;
  5303. vec4 nextEC = czm_modelViewRelativeToEye * next;
  5304. return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle);
  5305. }
  5306. `;var tH=`${md}
  5307. ${jE}`,XPe=xx;zt.isInternetExplorer()||(tH=`#define CLIP_POLYLINE
  5308. ${tH}`);function Lx(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=Lx.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,tH),this._fragmentShaderSource=y(e.fragmentShaderSource,XPe),this._renderState=eo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Lx.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});Lx.VERTEX_FORMAT=We.POSITION_ONLY;Lx.prototype.getFragmentShaderSource=eo.prototype.getFragmentShaderSource;Lx.prototype.isTranslucent=eo.prototype.isTranslucent;Lx.prototype.getRenderState=eo.prototype.getRenderState;var Jr=Lx;var $8t=T(S(),1);var k8t=T(S(),1),qE=`in vec3 position3DHigh;
  5309. in vec3 position3DLow;
  5310. in vec3 prevPosition3DHigh;
  5311. in vec3 prevPosition3DLow;
  5312. in vec3 nextPosition3DHigh;
  5313. in vec3 nextPosition3DLow;
  5314. in vec2 expandAndWidth;
  5315. in vec2 st;
  5316. in float batchId;
  5317. out float v_width;
  5318. out vec2 v_st;
  5319. out float v_polylineAngle;
  5320. void main()
  5321. {
  5322. float expandDir = expandAndWidth.x;
  5323. float width = abs(expandAndWidth.y) + 0.5;
  5324. bool usePrev = expandAndWidth.y < 0.0;
  5325. vec4 p = czm_computePosition();
  5326. vec4 prev = czm_computePrevPosition();
  5327. vec4 next = czm_computeNextPosition();
  5328. float angle;
  5329. vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);
  5330. gl_Position = czm_viewportOrthographic * positionWC;
  5331. v_width = width;
  5332. v_st.s = st.s;
  5333. v_st.t = czm_writeNonPerspective(st.t, gl_Position.w);
  5334. v_polylineAngle = angle;
  5335. }
  5336. `;var D8t=T(S(),1),Rx=`#ifdef VECTOR_TILE
  5337. uniform vec4 u_highlightColor;
  5338. #endif
  5339. in vec2 v_st;
  5340. void main()
  5341. {
  5342. czm_materialInput materialInput;
  5343. vec2 st = v_st;
  5344. st.t = czm_readNonPerspective(st.t, gl_FragCoord.w);
  5345. materialInput.s = st.s;
  5346. materialInput.st = st;
  5347. materialInput.str = vec3(st, 0.0);
  5348. czm_material material = czm_getMaterial(materialInput);
  5349. out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
  5350. #ifdef VECTOR_TILE
  5351. out_FragColor *= u_highlightColor;
  5352. #endif
  5353. czm_writeLogDepth();
  5354. }
  5355. `;var nH=`${md}
  5356. ${qE}`,WPe=Rx;zt.isInternetExplorer()||(nH=`#define CLIP_POLYLINE
  5357. ${nH}`);function Zx(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=!1,i=Zx.VERTEX_FORMAT;this.material=l(e.material)?e.material:Oi.fromType(Oi.ColorType),this.translucent=t,this._vertexShaderSource=y(e.vertexShaderSource,nH),this._fragmentShaderSource=y(e.fragmentShaderSource,WPe),this._renderState=eo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Zx.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH
  5358. ${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});Zx.VERTEX_FORMAT=We.POSITION_AND_ST;Zx.prototype.getFragmentShaderSource=eo.prototype.getFragmentShaderSource;Zx.prototype.isTranslucent=eo.prototype.isTranslucent;Zx.prototype.getRenderState=eo.prototype.getRenderState;var sa=Zx;function Ep(e){e=y(e,y.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new sa),this.appearance=t,this.show=y(e.show,!0),this.classificationType=y(e.classificationType,kn.BOTH),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._debugShowShadowVolume=y(e.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:y(e.interleave,!1),releaseGeometryInstances:y(e.releaseGeometryInstances,!0),allowPicking:y(e.allowPicking,!0),asynchronous:y(e.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=Aie(!1),this._renderState3DTiles=Aie(!0),this._renderStateMorph=Ue.fromCache({cull:{enabled:!0,face:yi.FRONT},depthTest:{enabled:!0},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(Ep.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});Ep.initializeTerrainHeights=function(){return li.initialize()};function PPe(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(QE);s=In._appendShowToShader(o,s),s=In._appendDistanceDisplayConditionToShader(o,s),s=In._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(JE);a=In._appendShowToShader(o,a),a=In._appendDistanceDisplayConditionToShader(o,a),a=In._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(zE),d=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],u="",m="";l(n.material)?(m=l(n.material)?n.material.shaderSource:"",m.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&d.push("ANGLE_VARYING"),m.search(/in\s+float\s+v_width;/g)!==-1&&d.push("WIDTH_VARYING")):u="PER_INSTANCE_COLOR",d.push(u);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",u]:[u],g=new De({defines:d,sources:[s]}),f=new De({defines:p,sources:[m,c]});e._sp=tn.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:g,fragmentShaderSource:f,attributeLocations:r});let x=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(x)){let C=new De({defines:d.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});x=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:C,fragmentShaderSource:f,attributeLocations:r})}e._sp2D=x;let _=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(_)){let C=new De({defines:d.concat([`MAX_TERRAIN_HEIGHT ${li._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(KE);let V=new De({defines:p,sources:[m,c]});_=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:C,fragmentShaderSource:V,attributeLocations:r})}e._spMorph=_}function Aie(e){return Ue.fromCache({cull:{enabled:!0},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Un.EQUAL,frontOperation:{fail:bt.KEEP,zFail:bt.KEEP,zPass:bt.KEEP},backFunction:Un.EQUAL,backOperation:{fail:bt.KEEP,zFail:bt.KEEP,zPass:bt.KEEP},reference:Ot.CESIUM_3D_TILE_MASK,mask:Ot.CESIUM_3D_TILE_MASK}})}function vPe(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let d=t instanceof Jr?{}:n._uniforms,u=s._batchTable.getUniformMapCallback()(d);for(let m=0;m<a;m++){let p=s._va[m],g=o[m];l(g)||(g=o[m]=new tt({owner:e,primitiveType:s._primitiveType})),g.vertexArray=p,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=u,g.pass=Ge.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let f=tt.shallowClone(g,g.derivedCommands.tileset);f.renderState=e._renderState3DTiles,f.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=f;let x=tt.shallowClone(g,g.derivedCommands.color2D);x.shaderProgram=e._sp2D,g.derivedCommands.color2D=x;let _=tt.shallowClone(f,f.derivedCommands.color2D);_.shaderProgram=e._sp2D,f.derivedCommands.color2D=_;let C=tt.shallowClone(g,g.derivedCommands.colorMorph);C.renderState=e._renderStateMorph,C.shaderProgram=e._spMorph,C.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=C}}function Mie(e,t,n,i,o,r,s){n.mode===oe.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==oe.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function wPe(e,t,n,i,o,r,s){let a=e._primitive;In._updateBoundingVolumes(a,t,o);let c;t.mode===oe.SCENE3D?c=a._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===oe.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let d=t.mode===oe.MORPHING,u=e.classificationType,m=u!==kn.CESIUM_3D_TILE,p=u!==kn.TERRAIN&&!d,g,f=t.passes;if(f.render||f.pick&&a.allowPicking){let x=n.length;for(let _=0;_<x;++_){let C=c[_];m&&(g=n[_],Mie(e,g,t,o,r,C,s)),p&&(g=n[_].derivedCommands.tileset,Mie(e,g,t,o,r,C,s))}}}Ep.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!li.initialized){Ep.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s=new Array(r),a;for(t=0;t<r;++t)if(a=o[t].attributes,!l(a)||!l(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<r;++t){let c=o[t];a={};let d=c.attributes;for(let u in d)d.hasOwnProperty(u)&&(a[u]=d[u]);l(a.width)||(a.width=new ic({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,Vx.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new Gt({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,d,u){PPe(n,d,u)},i._createCommandsFunction=function(c,d,u,m,p,g,f){vPe(n,d,u,m,g,f)},i._updateAndQueueCommandsFunction=function(c,d,u,m,p,g,f,x){wPe(n,d,u,m,p,g,f)},this._primitive=new In(i)}if(this.appearance instanceof Jr&&!this._hasPerInstanceColors)throw new pe("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Ep.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Ep.isSupported=function(e){return e.frameState.context.depthTexture};Ep.prototype.isDestroyed=function(){return!1};Ep.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,me(this)};var Rm=Ep;var $7t=T(S(),1);var H7t=T(S(),1);var N7t=T(S(),1);var FPe=new D(1,1),APe=!1,MPe=B.WHITE;function rC(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(rC.prototype,{isConstant:{get:function(){return K.isConstant(this._image)&&K.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:ue("image"),repeat:ue("repeat"),color:ue("color"),transparent:ue("transparent")});rC.prototype.getType=function(e){return"Image"};var NPe=new j;rC.prototype.getValue=function(e,t){return l(e)||(e=j.now(NPe)),l(t)||(t={}),t.image=K.getValueOrUndefined(this._image,e),t.repeat=K.getValueOrClonedDefault(this._repeat,e,FPe,t.repeat),t.color=K.getValueOrClonedDefault(this._color,e,MPe,t.color),K.getValueOrDefault(this._transparent,e,APe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};rC.prototype.equals=function(e){return this===e||e instanceof rC&&K.equals(this._image,e._image)&&K.equals(this._repeat,e._repeat)&&K.equals(this._color,e._color)&&K.equals(this._transparent,e._transparent)};var D0=rC;function kPe(e){if(e instanceof B)return new Yt(e);if(typeof e=="string"||e instanceof Ee||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new D0;return t.image=e,t}}function UPe(e,t){return ue(e,t,kPe)}var Io=UPe;function $E(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties($E.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),dimensions:ue("dimensions"),heightReference:ue("heightReference"),fill:ue("fill"),material:Io("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});$E.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new $E(this)};$E.prototype.merge=function(e){this.show=y(this.show,e.show),this.dimensions=y(this.dimensions,e.dimensions),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Gx=$E;var y6t=T(S(),1);var t6t=T(S(),1),DPe={FIXED:0,INERTIAL:1},Ai=Object.freeze(DPe);var l6t=T(S(),1);function sC(){pe.throwInstantiationError()}Object.defineProperties(sC.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError},referenceFrame:{get:pe.throwInstantiationError}});sC.prototype.getValue=pe.throwInstantiationError;sC.prototype.getValueInReferenceFrame=pe.throwInstantiationError;sC.prototype.equals=pe.throwInstantiationError;var Nie=new $;sC.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new h),n===i)return h.clone(t,o);let r=Ft.computeIcrfToCentralBodyFixedMatrix(e,Nie);if(n===Ai.INERTIAL)return $.multiplyByVector(r,t,o);if(n===Ai.FIXED)return $.multiplyByVector($.transpose(r,Nie),t,o)};var Zm=sC;function Ex(e,t){this._definitionChanged=new be,this._value=h.clone(e),this._referenceFrame=y(t,Ai.FIXED)}Object.defineProperties(Ex.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Ai.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var BPe=new j;Ex.prototype.getValue=function(e,t){return l(e)||(e=j.now(BPe)),this.getValueInReferenceFrame(e,Ai.FIXED,t)};Ex.prototype.setValue=function(e,t){let n=!1;h.equals(this._value,e)||(n=!0,this._value=h.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};Ex.prototype.getValueInReferenceFrame=function(e,t,n){return Zm.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};Ex.prototype.equals=function(e){return this===e||e instanceof Ex&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var Nc=Ex;var L6t=T(S(),1);function eI(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(eI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),positions:ue("positions"),width:ue("width"),height:ue("height"),heightReference:ue("heightReference"),extrudedHeight:ue("extrudedHeight"),extrudedHeightReference:ue("extrudedHeightReference"),cornerType:ue("cornerType"),granularity:ue("granularity"),fill:ue("fill"),material:Io("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex")});eI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new eI(this)};eI.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var Ix=eI;var G6t=T(S(),1);function OPe(e){return e}function YPe(e,t){return ue(e,t,OPe)}var Ll=YPe;var w6t=T(S(),1);function tI(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(tI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),length:ue("length"),topRadius:ue("topRadius"),bottomRadius:ue("bottomRadius"),heightReference:ue("heightReference"),fill:ue("fill"),material:Io("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),numberOfVerticalLines:ue("numberOfVerticalLines"),slices:ue("slices"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});tI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new tI(this)};tI.prototype.merge=function(e){this.show=y(this.show,e.show),this.length=y(this.length,e.length),this.topRadius=y(this.topRadius,e.topRadius),this.bottomRadius=y(this.bottomRadius,e.bottomRadius),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.slices=y(this.slices,e.slices),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Xx=tI;var D6t=T(S(),1);function nI(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(nI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),semiMajorAxis:ue("semiMajorAxis"),semiMinorAxis:ue("semiMinorAxis"),height:ue("height"),heightReference:ue("heightReference"),extrudedHeight:ue("extrudedHeight"),extrudedHeightReference:ue("extrudedHeightReference"),rotation:ue("rotation"),stRotation:ue("stRotation"),granularity:ue("granularity"),fill:ue("fill"),material:Io("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),numberOfVerticalLines:ue("numberOfVerticalLines"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex")});nI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new nI(this)};nI.prototype.merge=function(e){this.show=y(this.show,e.show),this.semiMajorAxis=y(this.semiMajorAxis,e.semiMajorAxis),this.semiMinorAxis=y(this.semiMinorAxis,e.semiMinorAxis),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.numberOfVerticalLines=y(this.numberOfVerticalLines,e.numberOfVerticalLines),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var Wx=nI;var J6t=T(S(),1);function iI(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(iI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),radii:ue("radii"),innerRadii:ue("innerRadii"),minimumClock:ue("minimumClock"),maximumClock:ue("maximumClock"),minimumCone:ue("minimumCone"),maximumCone:ue("maximumCone"),heightReference:ue("heightReference"),fill:ue("fill"),material:Io("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),stackPartitions:ue("stackPartitions"),slicePartitions:ue("slicePartitions"),subdivisions:ue("subdivisions"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});iI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new iI(this)};iI.prototype.merge=function(e){this.show=y(this.show,e.show),this.radii=y(this.radii,e.radii),this.innerRadii=y(this.innerRadii,e.innerRadii),this.minimumClock=y(this.minimumClock,e.minimumClock),this.maximumClock=y(this.maximumClock,e.maximumClock),this.minimumCone=y(this.minimumCone,e.minimumCone),this.maximumCone=y(this.maximumCone,e.maximumCone),this.heightReference=y(this.heightReference,e.heightReference),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.stackPartitions=y(this.stackPartitions,e.stackPartitions),this.slicePartitions=y(this.slicePartitions,e.slicePartitions),this.subdivisions=y(this.subdivisions,e.subdivisions),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Px=iI;var tqt=T(S(),1);function oI(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(oI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),text:ue("text"),font:ue("font"),style:ue("style"),scale:ue("scale"),showBackground:ue("showBackground"),backgroundColor:ue("backgroundColor"),backgroundPadding:ue("backgroundPadding"),pixelOffset:ue("pixelOffset"),eyeOffset:ue("eyeOffset"),horizontalOrigin:ue("horizontalOrigin"),verticalOrigin:ue("verticalOrigin"),heightReference:ue("heightReference"),fillColor:ue("fillColor"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),translucencyByDistance:ue("translucencyByDistance"),pixelOffsetScaleByDistance:ue("pixelOffsetScaleByDistance"),scaleByDistance:ue("scaleByDistance"),distanceDisplayCondition:ue("distanceDisplayCondition"),disableDepthTestDistance:ue("disableDepthTestDistance")});oI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new oI(this)};oI.prototype.merge=function(e){this.show=y(this.show,e.show),this.text=y(this.text,e.text),this.font=y(this.font,e.font),this.style=y(this.style,e.style),this.scale=y(this.scale,e.scale),this.showBackground=y(this.showBackground,e.showBackground),this.backgroundColor=y(this.backgroundColor,e.backgroundColor),this.backgroundPadding=y(this.backgroundPadding,e.backgroundPadding),this.pixelOffset=y(this.pixelOffset,e.pixelOffset),this.eyeOffset=y(this.eyeOffset,e.eyeOffset),this.horizontalOrigin=y(this.horizontalOrigin,e.horizontalOrigin),this.verticalOrigin=y(this.verticalOrigin,e.verticalOrigin),this.heightReference=y(this.heightReference,e.heightReference),this.fillColor=y(this.fillColor,e.fillColor),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.translucencyByDistance=y(this.translucencyByDistance,e.translucencyByDistance),this.pixelOffsetScaleByDistance=y(this.pixelOffsetScaleByDistance,e.pixelOffsetScaleByDistance),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance)};var Gm=oI;var Pqt=T(S(),1);var bqt=T(S(),1);var aqt=T(S(),1);var HPe=new h(1,1,1),zPe=h.ZERO,KPe=we.IDENTITY;function kie(e,t,n){this.translation=h.clone(y(e,zPe)),this.rotation=we.clone(y(t,KPe)),this.scale=h.clone(y(n,HPe))}kie.prototype.equals=function(e){return this===e||l(e)&&h.equals(this.translation,e.translation)&&we.equals(this.rotation,e.rotation)&&h.equals(this.scale,e.scale)};var B0=kie;var iH=new B0;function rI(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(rI.prototype,{isConstant:{get:function(){return K.isConstant(this._translation)&&K.isConstant(this._rotation)&&K.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:ue("translation"),rotation:ue("rotation"),scale:ue("scale")});var JPe=new j;rI.prototype.getValue=function(e,t){return l(e)||(e=j.now(JPe)),l(t)||(t=new B0),t.translation=K.getValueOrClonedDefault(this._translation,e,iH.translation,t.translation),t.rotation=K.getValueOrClonedDefault(this._rotation,e,iH.rotation,t.rotation),t.scale=K.getValueOrClonedDefault(this._scale,e,iH.scale,t.scale),t};rI.prototype.equals=function(e){return this===e||e instanceof rI&&K.equals(this._translation,e._translation)&&K.equals(this._rotation,e._rotation)&&K.equals(this._scale,e._scale)};var vx=rI;var Lqt=T(S(),1);function Ip(e,t){this._propertyNames=[],this._definitionChanged=new be,l(e)&&this.merge(e,t)}Object.defineProperties(Ip.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!K.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});Ip.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function QPe(e){return new Jn(e)}Ip.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,ue(e,!0,y(n,QPe))),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};Ip.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var jPe=new j;Ip.prototype.getValue=function(e,t){l(e)||(e=j.now(jPe)),l(t)||(t={});let n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){let r=n[i];t[r]=K.getValueOrUndefined(this[r],e,t[r])}return t};Ip.prototype.merge=function(e,t){let n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let o=0,r=i.length;o<r;o++){let s=i[o],a=this[s],c=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),c!==void 0&&(a!==void 0?l(a)&&l(a.merge)&&a.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[s]=c.clone():this[s]=c)}};function qPe(e,t){let n=e._propertyNames,i=t._propertyNames,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;++r){let s=n[r];if(i.indexOf(s)===-1||!K.equals(e[s],t[s]))return!1}return!0}Ip.prototype.equals=function(e){return this===e||e instanceof Ip&&qPe(this,e)};var Rl=Ip;function Uie(e){return new vx(e)}function $Pe(e){return new Rl(e,Uie)}function eve(e){return new Rl(e)}function sI(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._hasVerticalExaggeration=void 0,this._hasVerticalExaggerationSubscription=void 0,this._enableVerticalExaggeration=void 0,this._enableVerticalExaggerationSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(sI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),uri:ue("uri"),scale:ue("scale"),enableVerticalExaggeration:ue("enableVerticalExaggeration"),minimumPixelSize:ue("minimumPixelSize"),maximumScale:ue("maximumScale"),incrementallyLoadTextures:ue("incrementallyLoadTextures"),runAnimations:ue("runAnimations"),clampAnimations:ue("clampAnimations"),shadows:ue("shadows"),heightReference:ue("heightReference"),silhouetteColor:ue("silhouetteColor"),silhouetteSize:ue("silhouetteSize"),color:ue("color"),colorBlendMode:ue("colorBlendMode"),colorBlendAmount:ue("colorBlendAmount"),imageBasedLightingFactor:ue("imageBasedLightingFactor"),lightColor:ue("lightColor"),distanceDisplayCondition:ue("distanceDisplayCondition"),nodeTransformations:ue("nodeTransformations",void 0,$Pe),articulations:ue("articulations",void 0,eve),clippingPlanes:ue("clippingPlanes"),customShader:ue("customShader")});sI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.enableVerticalExaggeration=this.enableVerticalExaggeration,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e.customShader=this.customShader,e):new sI(this)};sI.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.scale=y(this.scale,e.scale),this.enableVerticalExaggeration=y(this.enableVerticalExaggeration,e.enableVerticalExaggeration),this.minimumPixelSize=y(this.minimumPixelSize,e.minimumPixelSize),this.maximumScale=y(this.maximumScale,e.maximumScale),this.incrementallyLoadTextures=y(this.incrementallyLoadTextures,e.incrementallyLoadTextures),this.runAnimations=y(this.runAnimations,e.runAnimations),this.clampAnimations=y(this.clampAnimations,e.clampAnimations),this.shadows=y(this.shadows,e.shadows),this.heightReference=y(this.heightReference,e.heightReference),this.silhouetteColor=y(this.silhouetteColor,e.silhouetteColor),this.silhouetteSize=y(this.silhouetteSize,e.silhouetteSize),this.color=y(this.color,e.color),this.colorBlendMode=y(this.colorBlendMode,e.colorBlendMode),this.colorBlendAmount=y(this.colorBlendAmount,e.colorBlendAmount),this.imageBasedLightingFactor=y(this.imageBasedLightingFactor,e.imageBasedLightingFactor),this.lightColor=y(this.lightColor,e.lightColor),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.clippingPlanes=y(this.clippingPlanes,e.clippingPlanes),this.customShader=y(this.customShader,e.customShader);let t=e.nodeTransformations;if(l(t)){let i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new Rl(t,Uie)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new Rl(n)}};var Xp=sI;var Nqt=T(S(),1);function aI(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(aI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),uri:ue("uri"),maximumScreenSpaceError:ue("maximumScreenSpaceError")});aI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new aI(this)};aI.prototype.merge=function(e){this.show=y(this.show,e.show),this.uri=y(this.uri,e.uri),this.maximumScreenSpaceError=y(this.maximumScreenSpaceError,e.maximumScreenSpaceError)};var wx=aI;var Hqt=T(S(),1);function cI(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(cI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),leadTime:ue("leadTime"),trailTime:ue("trailTime"),width:ue("width"),resolution:ue("resolution"),material:Io("material"),distanceDisplayCondition:ue("distanceDisplayCondition")});cI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new cI(this)};cI.prototype.merge=function(e){this.show=y(this.show,e.show),this.leadTime=y(this.leadTime,e.leadTime),this.trailTime=y(this.trailTime,e.trailTime),this.width=y(this.width,e.width),this.resolution=y(this.resolution,e.resolution),this.material=y(this.material,e.material),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Wp=cI;var $qt=T(S(),1);function lI(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(lI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),plane:ue("plane"),dimensions:ue("dimensions"),fill:ue("fill"),material:Io("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});lI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new lI(this)};lI.prototype.merge=function(e){this.show=y(this.show,e.show),this.plane=y(this.plane,e.plane),this.dimensions=y(this.dimensions,e.dimensions),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var dI=lI;var r$t=T(S(),1);function uI(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(uI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),pixelSize:ue("pixelSize"),heightReference:ue("heightReference"),color:ue("color"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),scaleByDistance:ue("scaleByDistance"),translucencyByDistance:ue("translucencyByDistance"),distanceDisplayCondition:ue("distanceDisplayCondition"),disableDepthTestDistance:ue("disableDepthTestDistance"),splitDirection:ue("splitDirection")});uI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e.splitDirection=this.splitDirection,e):new uI(this)};uI.prototype.merge=function(e){this.show=y(this.show,e.show),this.pixelSize=y(this.pixelSize,e.pixelSize),this.heightReference=y(this.heightReference,e.heightReference),this.color=y(this.color,e.color),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.scaleByDistance=y(this.scaleByDistance,e.scaleByDistance),this.translucencyByDistance=y(this._translucencyByDistance,e.translucencyByDistance),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.disableDepthTestDistance=y(this.disableDepthTestDistance,e.disableDepthTestDistance),this.splitDirection=y(this.splitDirection,e.splitDirection)};var Fx=uI;var g$t=T(S(),1);var c$t=T(S(),1);function tve(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Ia=tve;function nve(e){return Array.isArray(e)&&(e=new Ia(e)),new Jn(e)}function mI(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(mI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),hierarchy:ue("hierarchy",void 0,nve),height:ue("height"),heightReference:ue("heightReference"),extrudedHeight:ue("extrudedHeight"),extrudedHeightReference:ue("extrudedHeightReference"),stRotation:ue("stRotation"),granularity:ue("granularity"),fill:ue("fill"),material:Io("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),perPositionHeight:ue("perPositionHeight"),closeTop:ue("closeTop"),closeBottom:ue("closeBottom"),arcType:ue("arcType"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex"),textureCoordinates:ue("textureCoordinates")});mI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new mI(this)};mI.prototype.merge=function(e){this.show=y(this.show,e.show),this.hierarchy=y(this.hierarchy,e.hierarchy),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.perPositionHeight=y(this.perPositionHeight,e.perPositionHeight),this.closeTop=y(this.closeTop,e.closeTop),this.closeBottom=y(this.closeBottom,e.closeBottom),this.arcType=y(this.arcType,e.arcType),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex),this.textureCoordinates=y(this.textureCoordinates,e.textureCoordinates)};var Em=mI;var V$t=T(S(),1);function hI(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(hI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),positions:ue("positions"),width:ue("width"),granularity:ue("granularity"),material:Io("material"),depthFailMaterial:Io("depthFailMaterial"),arcType:ue("arcType"),clampToGround:ue("clampToGround"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex")});hI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new hI(this)};hI.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.width=y(this.width,e.width),this.granularity=y(this.granularity,e.granularity),this.material=y(this.material,e.material),this.depthFailMaterial=y(this.depthFailMaterial,e.depthFailMaterial),this.arcType=y(this.arcType,e.arcType),this.clampToGround=y(this.clampToGround,e.clampToGround),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var oc=hI;var X$t=T(S(),1);function fI(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(fI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),positions:ue("positions"),shape:ue("shape"),cornerType:ue("cornerType"),granularity:ue("granularity"),fill:ue("fill"),material:Io("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});fI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new fI(this)};fI.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.shape=y(this.shape,e.shape),this.cornerType=y(this.cornerType,e.cornerType),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Ax=fI;var M$t=T(S(),1);function pI(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(pI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),coordinates:ue("coordinates"),height:ue("height"),heightReference:ue("heightReference"),extrudedHeight:ue("extrudedHeight"),extrudedHeightReference:ue("extrudedHeightReference"),rotation:ue("rotation"),stRotation:ue("stRotation"),granularity:ue("granularity"),fill:ue("fill"),material:Io("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition"),classificationType:ue("classificationType"),zIndex:ue("zIndex")});pI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new pI(this)};pI.prototype.merge=function(e){this.show=y(this.show,e.show),this.coordinates=y(this.coordinates,e.coordinates),this.height=y(this.height,e.height),this.heightReference=y(this.heightReference,e.heightReference),this.extrudedHeight=y(this.extrudedHeight,e.extrudedHeight),this.extrudedHeightReference=y(this.extrudedHeightReference,e.extrudedHeightReference),this.rotation=y(this.rotation,e.rotation),this.stRotation=y(this.stRotation,e.stRotation),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition),this.classificationType=y(this.classificationType,e.classificationType),this.zIndex=y(this.zIndex,e.zIndex)};var Im=pI;var Y$t=T(S(),1);function bI(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(y(e,y.EMPTY_OBJECT))}Object.defineProperties(bI.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:ue("show"),positions:ue("positions"),minimumHeights:ue("minimumHeights"),maximumHeights:ue("maximumHeights"),granularity:ue("granularity"),fill:ue("fill"),material:Io("material"),outline:ue("outline"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth"),shadows:ue("shadows"),distanceDisplayCondition:ue("distanceDisplayCondition")});bI.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new bI(this)};bI.prototype.merge=function(e){this.show=y(this.show,e.show),this.positions=y(this.positions,e.positions),this.minimumHeights=y(this.minimumHeights,e.minimumHeights),this.maximumHeights=y(this.maximumHeights,e.maximumHeights),this.granularity=y(this.granularity,e.granularity),this.fill=y(this.fill,e.fill),this.material=y(this.material,e.material),this.outline=y(this.outline,e.outline),this.outlineColor=y(this.outlineColor,e.outlineColor),this.outlineWidth=y(this.outlineWidth,e.outlineWidth),this.shadows=y(this.shadows,e.shadows),this.distanceDisplayCondition=y(this.distanceDisplayCondition,e.distanceDisplayCondition)};var Pp=bI;var ive=new he,oH=[];function ove(e){return new Nc(e)}function rve(e){return ue(e,void 0,ove)}function Ms(e,t){return ue(e,void 0,function(n){return n instanceof t?n:new t(n)})}function yu(e){e=y(e,y.EMPTY_OBJECT);let t=e.id;l(t)||(t=Bn()),this._availability=void 0,this._id=t,this._definitionChanged=new be,this._name=e.name,this._show=y(e.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall",...oH],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function rH(e,t,n){let i=t.length;for(let o=0;o<i;o++){let r=t[o],s=r._show;(!n&&s)!==(n&&s)&&rH(r,r._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(yu.prototype,{availability:Ll("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:Ll("name"),show:{get:function(){return this._show},set:function(e){if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&rH(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},isShowing:{get:function(){return this._show&&(!l(this.entityCollection)||this.entityCollection.show)&&(!l(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){let t=this._parent;if(t===e)return;let n=this.isShowing;if(l(t)){let o=t._children.indexOf(this);t._children.splice(o,1)}this._parent=e,l(e)&&e._children.push(this);let i=this.isShowing;n!==i&&rH(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Ms("billboard",tc),box:Ms("box",Gx),corridor:Ms("corridor",Ix),cylinder:Ms("cylinder",Xx),description:ue("description"),ellipse:Ms("ellipse",Wx),ellipsoid:Ms("ellipsoid",Px),label:Ms("label",Gm),model:Ms("model",Xp),tileset:Ms("tileset",wx),orientation:ue("orientation"),path:Ms("path",Wp),plane:Ms("plane",dI),point:Ms("point",Fx),polygon:Ms("polygon",Em),polyline:Ms("polyline",oc),polylineVolume:Ms("polylineVolume",Ax),properties:Ms("properties",Rl),position:rve("position"),rectangle:Ms("rectangle",Im),viewFrom:ue("viewFrom"),wall:Ms("wall",Pp)});yu.registerEntityType=function(e,t){Object.defineProperties(yu.prototype,{[e]:Ms(e,t)}),oH.includes(e)||oH.push(e)};yu.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};yu.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,Ll(e,!0))};yu.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};yu.prototype.merge=function(e){this.name=y(this.name,e.name),this.availability=y(this.availability,e.availability);let t=this._propertyNames,n=l(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r==="parent"||r==="name"||r==="availability"||r==="children")continue;let s=this[r],a=e[r];!l(s)&&t.indexOf(r)===-1&&this.addProperty(r),l(a)&&(l(s)?l(s.merge)&&s.merge(a):l(a.merge)&&l(a.clone)?this[r]=a.clone():this[r]=a)}};var Die=new $,Bie=new h,Oie=new we;yu.prototype.computeModelMatrix=function(e,t){let n=K.getValueOrUndefined(this._position,e,Bie);if(!l(n))return;let i=K.getValueOrUndefined(this._orientation,e,Oie);return l(i)?t=M.fromRotationTranslation($.fromQuaternion(i,Die),n,t):t=Ft.eastNorthUpToFixedFrame(n,void 0,t),t};yu.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){let r=K.getValueOrDefault(t,e,Qe.NONE),s=K.getValueOrUndefined(this._position,e,Bie);if(r===Qe.NONE||!l(s)||h.equalsEpsilon(s,h.ZERO,W.EPSILON8))return this.computeModelMatrix(e,o);let a=i.cartesianToCartographic(s,ive);bu(r)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=K.getValueOrUndefined(this._orientation,e,Oie);return l(c)?o=M.fromRotationTranslation($.fromQuaternion(c,Die),s,o):o=Ft.eastNorthUpToFixedFrame(s,void 0,o),o};yu.supportsMaterialsforEntitiesOnTerrain=function(e){return Ac.supportsMaterials(e)};yu.supportsPolylinesOnTerrain=function(e){return Rm.isSupported(e)};var jo=yu;var sve=new Yt(B.WHITE),ave=new Jn(!0),cve=new Jn(!0),lve=new Jn(!1),dve=new Jn(B.BLACK),uve=new Jn(_n.DISABLED),mve=new Jn(new At),hve=new Jn(kn.BOTH);function kc(e){let t=e.entity,n=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new be,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=n,this._id=`${n}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=jo.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(kc.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&K.isConstant(this._showProperty)&&K.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!l(this._entity.availability)&&K.isConstant(this._showProperty)&&K.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}});kc.prototype.isOutlineVisible=function(e){let t=this._entity,n=this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e);return y(n,!1)};kc.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e);return y(n,!1)};kc.prototype.createFillGeometryInstance=pe.throwInstantiationError;kc.prototype.createOutlineGeometryInstance=pe.throwInstantiationError;kc.prototype.isDestroyed=function(){return!1};kc.prototype.destroy=function(){me(this)};kc.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(Be.MINIMUM_VALUE)};kc.prototype._isOnTerrain=function(e,t){return!1};kc.prototype._getIsClosed=function(e){return!0};kc.prototype._isDynamic=pe.throwInstantiationError;kc.prototype._setStaticOptions=pe.throwInstantiationError;kc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.fill,s=l(r)&&r.isConstant?r.getValue(Be.MINIMUM_VALUE):!0,a=o.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(Be.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let d=o.show;if(this._isHidden(e,o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=y(o.material,sve),this._fillProperty=y(r,cve),this._showProperty=y(d,ave),this._showOutlineProperty=y(o.outline,lve),this._outlineColorProperty=c?y(o.outlineColor,dve):void 0,this._shadowsProperty=y(o.shadows,uve),this._distanceDisplayConditionProperty=y(o.distanceDisplayCondition,mve),this._classificationTypeProperty=y(o.classificationType,hve),this._fillEnabled=s;let u=this._isOnTerrain(e,o)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Yt);if(c&&u&&(St(St.geometryOutlines),c=!1),this._onTerrain=u,this._outlineEnabled=c,this._isDynamic(e,o))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,o),this._isClosed=this._getIsClosed(this._options);let m=o.outlineWidth;this._outlineWidth=l(m)?m.getValue(Be.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};kc.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var ii=kc;var ptn=T(S(),1);var jen=T(S(),1);function aC(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(aC.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var fve=new j;aC.prototype.getValue=function(e,t){return l(e)||(e=j.now(fve)),this._callback(e,t)};aC.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};aC.prototype.equals=function(e){return this===e||e instanceof aC&&this._callback===e._callback&&this._isConstant===e._isConstant};var Xm=aC;var ltn=T(S(),1);var Yie=new h;function cC(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new h,this._cartographicPosition=new he,this._normal=new h,this._definitionChanged=new be,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let o=this;if(l(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){o._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){o._updateClamping()})),t.isConstant){let r=t.getValue(Be.MINIMUM_VALUE,Yie);if(!l(r)||h.equals(r,h.ZERO)||!l(e.globe))return;this._position=h.clone(r,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(r,this._normal)}}Object.defineProperties(cC.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});cC.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(h.equals(t,h.ZERO)){this._terrainHeight=0;return}let i=e.ellipsoid.cartesianToCartographic(t,this._cartographicPosition),o=e.getHeight(i,this._heightReference);l(o)?this._terrainHeight=o:this._terrainHeight=0;let r=s=>{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,r,this._heightReference)};var pve=new j;cC.prototype.getValue=function(e,t){l(e)||(e=j.now(pve));let n=K.getValueOrDefault(this._heightReference,e,Qe.NONE),i=K.getValueOrDefault(this._extrudedHeightReference,e,Qe.NONE);if(n===Qe.NONE&&!JS(i))return this._position=h.clone(h.ZERO,this._position),h.clone(h.ZERO,t);if(this._positionProperty.isConstant)return h.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,Yie);if(!l(r)||h.equals(r,h.ZERO)||!l(o.globe))return h.clone(h.ZERO,t);if(h.equalsEpsilon(this._position,r,W.EPSILON10))return h.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=h.clone(r,this._position),this._updateClamping();let s=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);return h.multiplyByScalar(s,this._terrainHeight,t)};cC.prototype.isDestroyed=function(){return!1};cC.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),me(this)};var Mx=cC;function bve(e,t,n,i){if(ii.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference;if(l(r)){let s=new Xm(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Mx(this._scene,s,r)}}var vp=bve;var Hie=h.ZERO,zie=new h,gve=new h,Kie=new B;function yve(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function hd(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new yve(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(hd.prototype=Object.create(ii.prototype),hd.prototype.constructor=hd);Object.defineProperties(hd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});hd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Nn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Yt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Kie)),l(a)||(a=B.WHITE),s.color=Kt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Qi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,Hie,zie))),new Gt({id:t,geometry:Ra.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};hd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,Kie),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Qi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,Hie,zie))),new Gt({id:t,geometry:Lm.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};hd.prototype._computeCenter=function(e,t){return K.getValueOrUndefined(this._entity.position,e,t)};hd.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||ii.prototype._isHidden.call(this,e,t)};hd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!K.isConstant(e.orientation)||!t.dimensions.isConstant||!K.isConstant(t.outlineWidth)};hd.prototype._setStaticOptions=function(e,t){let n=K.getValueOrDefault(t.heightReference,Be.MINIMUM_VALUE,Qe.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Yt?dn.VERTEX_FORMAT:oo.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Be.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==Qe.NONE?cn.ALL:void 0};hd.prototype._onEntityPropertyChanged=vp;hd.DynamicGeometryUpdater=lC;function lC(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(lC.prototype=Object.create(ni.prototype),lC.prototype.constructor=lC);lC.prototype._isHidden=function(e,t,n){let i=K.getValueOrUndefined(e.position,n,gve),o=this._options.dimensions;return!l(i)||!l(o)||ni.prototype._isHidden.call(this,e,t,n)};lC.prototype._setOptions=function(e,t,n){let i=K.getValueOrDefault(t.heightReference,n,Qe.NONE),o=this._options;o.dimensions=K.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==Qe.NONE?cn.ALL:void 0};var gI=hd;var Ytn=T(S(),1);function Nx(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=y(n,Ai.FIXED),this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(Nx.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var xve=new j;Nx.prototype.getValue=function(e,t){return l(e)||(e=j.now(xve)),this.getValueInReferenceFrame(e,Ai.FIXED,t)};Nx.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Nx.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return Zm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Nx.prototype.equals=function(e){return this===e||e instanceof Nx&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var yI=Nx;var dYn=T(S(),1);var $On=T(S(),1);var Qtn=T(S(),1),Qie=T(Jie(),1);var _ve=0,cH={};function ef(e,t){let n,i=e;l(cH[i])?n=cH[i]:(n=_ve++,cH[i]=n),t=y(t,!1),this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(ef.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen},set:function(e){this._showOnScreen=e}},element:{get:function(){if(!l(this._element)){let e=Qie.default.sanitize(this._html),t=document.createElement("div");t.className="cesium-credit-wrapper",t._creditId=this._id,t.style.display="inline",t.innerHTML=e;let n=t.querySelectorAll("a");for(let i=0;i<n.length;i++)n[i].setAttribute("target","_blank");this._element=t}return this._element}}});ef.equals=function(e,t){return e===t||l(e)&&l(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};ef.prototype.equals=function(e){return ef.equals(this,e)};ef.prototype.isIon=function(){return this.html.indexOf("ion-credit.png")!==-1};ef.getIonCredit=function(e){let t=l(e.collapsible)&&!e.collapsible;return new ef(e.html,t)};ef.clone=function(e){if(l(e))return new ef(e.html,e.showOnScreen)};var Et=ef;var fnn=T(S(),1);var ann=T(S(),1);function kx(e){this._url=e,this._cubeMapBuffers=void 0,this._texture=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new be}Object.defineProperties(kx.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});kx.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function lH(e){e._cubeMapBuffers=void 0}kx.prototype.update=function(e){let{context:t}=e;if(!kx.isSupported(t))return;if(l(this._texture)){lH(this);return}if(!l(this._texture)&&!this._loading){let u=t.textureCache.getTexture(this._url);l(u)&&(lH(this),this._texture=u,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let u=this;_l(this._url).then(function(m){u._cubeMapBuffers=m,u._loading=!1}).catch(function(m){u.isDestroyed()||u._errorEvent.raiseEvent(m)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;l(i)||(i=t.halfFloatingPointTexture?qe.HALF_FLOAT:qe.FLOAT);let o=ot.RGBA,r=n.length;this._maximumMipmapLevel=r-1;let s=n[0].positiveX.width,a=Math.log2(s)+1;if(r!==a){let u={};Object.values(yr.FaceName).forEach(m=>{u[m]=void 0});for(let m=r;m<a;m++)n.push(u)}let c=new en({minificationFilter:$t.LINEAR_MIPMAP_LINEAR}),d=new yr({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:o,sampler:c});d.loadMipmaps(n.slice(1)),this._texture=d,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};kx.prototype.isDestroyed=function(){return!1};kx.prototype.destroy=function(){return lH(this),this._texture=this._texture&&this._texture.destroy(),me(this)};var Wm=kx;function xI(e){e=y(e,y.EMPTY_OBJECT);let t=l(e.imageBasedLightingFactor)?D.clone(e.imageBasedLightingFactor):new D(1,1);this._imageBasedLightingFactor=t;let n=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=n,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentCubeMap=void 0,this._specularEnvironmentCubeMapDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousImageBasedLightingFactor=D.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(xI.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=D.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=D.clone(e,this._imageBasedLightingFactor)}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients,this._sphericalHarmonicCoefficients=e}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){e!==this._specularEnvironmentMaps&&(this._specularEnvironmentCubeMapDirty=this._specularEnvironmentCubeMapDirty||e!==this._specularEnvironmentMaps,this._specularEnvironmentMapLoaded=!1),this._specularEnvironmentMaps=e}},enabled:{get:function(){return this._imageBasedLightingFactor.x>0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},specularEnvironmentCubeMap:{get:function(){return this._specularEnvironmentCubeMap}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function Tve(e,t){if(Wm.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new Wm(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}xI.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=e.frameNumber;let t=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;D.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=D.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&(Tve(this,t),this._specularEnvironmentCubeMapDirty=!1),l(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};xI.prototype.isDestroyed=function(){return!1};xI.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),me(this)};var Ux=xI;var Znn=T(S(),1),uH=T(id(),1);var xnn=T(S(),1);var dH,jie="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJiZjBmMDE4Ny05M2JlLTRlMzgtYjIxYi05YmJjM2QwMzJkYWMiLCJpZCI6MjU5LCJpYXQiOjE3MzA0NjY3MDl9.t-7gCGPUe-oGCyCoeXPtYmlMVdgqUQD9mn-Da23yUoI",i5={};i5.defaultAccessToken=jie;i5.defaultServer=new Ee({url:"https://api.cesium.com/"});i5.getDefaultTokenCredit=function(e){if(e===jie){if(!l(dH)){let t=`<b> This application is using Cesium's default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i> with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>`;dH=new Et(t,!0)}return dH}};var Pm=i5;function Uc(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:Sve};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new de("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");Ee.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new uH.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o}l(Object.create)&&(Uc.prototype=Object.create(Ee.prototype),Uc.prototype.constructor=Uc);Uc.fromAssetId=function(e,t){let n=Uc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Uc(i,n)})};Object.defineProperties(Uc.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=Uc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Uc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(Et.getIonCredit),i=Pm.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(Et.clone(i)),n};Uc.prototype.clone=function(e){let t=y(this._ionRoot,this);return l(e)||(e=new Uc(t._ionEndpoint,t._ionEndpointResource)),e=Ee.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Uc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return Ee.prototype.fetchImage.call(this,e)};Uc.prototype._makeRequest=function(e){return this._isExternal||new uH.default(this.url).authority()!==this._ionEndpointDomain?Ee.prototype._makeRequest.call(this,e):(l(e.headers)||(e.headers={}),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,e.headers["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e.headers["X-Cesium-Client-Version"]=CESIUM_VERSION),Ee.prototype._makeRequest.call(this,e))};Uc._createEndpointResource=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.server,Pm.defaultServer),i=y(t.accessToken,Pm.defaultAccessToken);n=Ee.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function Sve(e,t){let n=y(e._ionRoot,e),i=n._ionEndpointResource,o=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(o&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(r){return n._ionEndpoint=r,r}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var fd=Uc;var Inn=T(S(),1);function tf(e){e=y(e,0),this._array=new Array(e),this._length=e}Object.defineProperties(tf.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(e<n)for(let i=e;i<n;++i)t[i]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});tf.prototype.get=function(e){return this._array[e]};tf.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};tf.prototype.peek=function(){return this._array[this._length-1]};tf.prototype.push=function(e){let t=this.length++;this._array[t]=e};tf.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};tf.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};tf.prototype.resize=function(e){this.length=e};tf.prototype.trim=function(e){e=y(e,this._length),this._array.length=e};var Dc=tf;var vnn=T(S(),1);var wp={X:0,Y:1,Z:2};wp.Y_UP_TO_Z_UP=M.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));wp.Z_UP_TO_Y_UP=M.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));wp.X_UP_TO_Z_UP=M.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));wp.Z_UP_TO_X_UP=M.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));wp.X_UP_TO_Y_UP=M.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));wp.Y_UP_TO_X_UP=M.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));wp.fromName=function(e){return wp[e]};var Xo=Object.freeze(wp);var fBn=T(S(),1);var Ann=T(S(),1);function qie(e){e=y(e,y.EMPTY_OBJECT),this._metadata=e.metadata}Object.defineProperties(qie.prototype,{metadata:{get:function(){return this._metadata}}});var Dx=qie;var UNn=T(S(),1);var $nn=T(S(),1);var Ynn=T(S(),1);var Unn=T(S(),1);function O0(e,t,n){return t=y(t,0),n=y(n,e.byteLength-t),e=e.subarray(t,t+n),O0.decode(e)}O0.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};O0.decodeWithFromCharCode=function(e){let t="",n=Cve(e),i=n.length;for(let o=0;o<i;++o){let r=n[o];r<=65535?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return t};function _I(e,t,n){return t<=e&&e<=n}function Cve(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let c=0;c<a;++c){let d=e[c];if(i===0){if(_I(d,0,127)){s.push(d);continue}if(_I(d,194,223)){i=1,t=d&31;continue}if(_I(d,224,239)){d===224&&(o=160),d===237&&(r=159),i=2,t=d&15;continue}if(_I(d,240,244)){d===240&&(o=144),d===244&&(r=143),i=3,t=d&7;continue}throw new de("String decoding failed.")}if(!_I(d,o,r)){t=i=n=0,o=128,r=191,--c;continue}o=128,r=191,t=t<<6|d&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?O0.decode=O0.decodeWithTextDecoder:O0.decode=O0.decodeWithFromCharCode;var Zl=O0;function Vve(e,t){return t=y(t,0),Zl(e,t,Math.min(4,e.length))}var vm=Vve;function xu(e,t,n,i){this._tileset=e,this._tile=t,this._resource=n,l(i)||(i=[]),this._contents=i,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(xu.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].metadata=e}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].group=e}}});var TI=Uint32Array.BYTES_PER_ELEMENT;xu.fromTileType=async function(e,t,n,i,o,r){o=y(o,0);let s=new Uint8Array(i),a=new DataView(i);o+=TI;let c=a.getUint32(o,!0);if(c!==1)throw new de(`Only Composite Tile version 1 is supported. Version ${c} is not.`);o+=TI,o+=TI;let d=a.getUint32(o,!0);o+=TI;let u=n.queryParameters.compositeIndex;l(u)?u=`${u}_`:u="";let m=[];m.length=d;for(let f=0;f<d;++f){let x=vm(s,o),_=a.getUint32(o+TI*2,!0),C=r[x],V=`${u}${f}`,L=n.getDerivedResource({queryParameters:{compositeIndex:V}});if(l(C))m[f]=Promise.resolve(C(e,t,L,i,o));else throw new de(`Unknown tile content type, ${x}, inside Composite tile`);o+=_}let p=await Promise.all(m);return new xu(e,t,n,p)};xu.prototype.hasProperty=function(e,t){return!1};xu.prototype.getFeature=function(e){};xu.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};xu.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};xu.prototype.update=function(e,t){let n=this._contents,i=n.length,o=!0;for(let r=0;r<i;++r)n[r].update(e,t),o=o&&n[r].ready;!this._ready&&o&&(this._ready=!0)};xu.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let c=r[a].pick(e,t,n);if(!l(c))continue;let d=h.distance(e.origin,c);d<o&&(i=c,o=d)}if(l(i))return n};xu.prototype.isDestroyed=function(){return!1};xu.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return me(this)};var SI=xu;var Wrn=T(S(),1);var nin=T(S(),1);function Lve(e,t,n){return JSON.parse(Zl(e,t,n))}var Wo=Lve;var con=T(S(),1);var pin=T(S(),1);function rc(e){this._id=Bn();let t=e.featuresLength;this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[];let n,i;if(t>0){let o=Math.min(t,Bt.maximumTextureSize),r=Math.ceil(t/Bt.maximumTextureSize),s=1/o,a=s*.5,c=1/r,d=c*.5;n=new D(o,r),i=new se(s,a,c,d)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(rc.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});rc.DEFAULT_COLOR_VALUE=B.WHITE;rc.DEFAULT_SHOW_VALUE=!0;function $ie(e){let t=e._textureDimensions;return t.x*t.y*4}function eoe(e){if(!l(e._batchValues)){let t=$ie(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function toe(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}rc.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=toe(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=eoe(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};rc.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};rc.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var Rve=new Array(4);rc.prototype.setColor=function(e,t){if(B.equals(t,rc.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(Rve),i=n[3],o=eoe(this),r=e*4,s=toe(this),a=e*2;if(o[r]!==n[0]||o[r+1]!==n[1]||o[r+2]!==n[2]||s[a+1]!==i){o[r]=n[0],o[r+1]=n[1],o[r+2]=n[2];let c=s[a+1]!==255,d=s[a]!==0;o[r+3]=d?i:0,s[a+1]=i;let u=i!==255;u&&!c?++this._translucentFeaturesLength:!u&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};rc.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};rc.prototype.getColor=function(e,t){if(!l(this._batchValues))return B.clone(rc.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,o=this._showAlphaProperties,r=e*2;return B.fromBytes(n[i],n[i+1],n[i+2],o[r+1],t)};rc.prototype.getPickColor=function(e){return this._pickIds[e]};function noe(e,t,n){let i=e._textureDimensions;return new Pt({context:t,pixelFormat:ot.RGBA,pixelDatatype:qe.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:en.NEAREST})}function Zve(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,o=$ie(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let d=t.createPickId(s.getFeature(c));i.push(d);let u=d.color,m=c*4;r[m]=B.floatToByte(u.red),r[m+1]=B.floatToByte(u.green),r[m+2]=B.floatToByte(u.blue),r[m+3]=B.floatToByte(u.alpha)}e._pickTexture=noe(e,t,r),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function Gve(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}rc.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&Zve(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=noe(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),Gve(this))};rc.prototype.isDestroyed=function(){return!1};rc.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();let e=this._pickIds,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return me(this)};var Bc=rc;var vin=T(S(),1);var Vin=T(S(),1);var Eve={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ive={SCALAR:void 0,VEC2:D,VEC3:h,VEC4:se,MAT2:wi,MAT3:$,MAT4:M};function Xve(e){let t=e.componentType,n;typeof t=="string"?n=Q.fromName(t):n=t;let i=Eve[e.type],o=Ive[e.type];return{componentsPerAttribute:i,classType:o,createArrayBufferView:function(r,s,a){return Q.createArrayBufferView(n,r,s,i*a)}}}var pd=Xve;function Fp(e){this._classes=void 0,this._classIds=void 0,this._classIndexes=void 0,this._parentCounts=void 0,this._parentIndexes=void 0,this._parentIds=void 0,this._byteLength=0,Wve(this,e.extension,e.binaryBody)}Object.defineProperties(Fp.prototype,{byteLength:{get:function(){return this._byteLength}}});function Wve(e,t,n){let i,o,r,s=t.instancesLength,a=t.classes,c=t.classIds,d=t.parentCounts,u=t.parentIds,m=s,p=0;l(c.byteOffset)&&(c.componentType=y(c.componentType,Q.UNSIGNED_SHORT),c.type=sn.SCALAR,r=pd(c),c=r.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let g;if(l(d)){for(l(d.byteOffset)&&(d.componentType=y(d.componentType,Q.UNSIGNED_SHORT),d.type=sn.SCALAR,r=pd(d),d=r.createArrayBufferView(n.buffer,n.byteOffset+d.byteOffset,s),p+=d.byteLength),g=new Uint16Array(s),m=0,i=0;i<s;++i)g[i]=m,m+=d[i];p+=g.byteLength}l(u)&&l(u.byteOffset)&&(u.componentType=y(u.componentType,Q.UNSIGNED_SHORT),u.type=sn.SCALAR,r=pd(u),u=r.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,m),p+=u.byteLength);let f=a.length;for(i=0;i<f;++i){let C=a[i].length,V=a[i].instances,L=Pve(C,V,n);p+=vve(L),a[i].instances=Tt(L,V)}let x=new Array(f).fill(0),_=new Uint16Array(s);for(i=0;i<s;++i)o=c[i],_[i]=x[o],++x[o];p+=_.byteLength,e._classes=a,e._classIds=c,e._classIndexes=_,e._parentCounts=d,e._parentIndexes=g,e._parentIds=u,e._byteLength=p}function Pve(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(l(s)){let a=r.componentType,c=r.type;if(!l(a))throw new de("componentType is required.");if(!l(c))throw new de("type is required.");if(!l(n))throw new de(`Property ${o} requires a batch table binary.`);let d=pd(r),u=d.componentsPerAttribute,m=d.classType,p=d.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:u,type:m}}}return i}function vve(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var wve=[],Fve=[],Ave=0;function Mve(e,t,n){let i=e._classIds,o=e._parentCounts,r=e._parentIds,s=e._parentIndexes,a=i.length,c=wve;c.length=Math.max(c.length,a);let d=++Ave,u=Fve;for(u.length=0,u.push(t);u.length>0;){if(t=u.pop(),c[t]===d)continue;c[t]=d;let m=n(e,t);if(l(m))return m;let p=o[t],g=s[t];for(let f=0;f<p;++f){let x=r[g+f];x!==t&&u.push(x)}}}function Nve(e,t,n){let i=!0;for(;i;){let o=n(e,t);if(l(o))return o;let r=e._parentIds[t];i=r!==t,t=r}}function CI(e,t,n){let i=e._parentCounts,o=e._parentIds;if(l(o)){if(l(i))return Mve(e,t,n)}else return n(e,t);return Nve(e,t,n)}Fp.prototype.hasProperty=function(e,t){let n=CI(this,e,function(i,o){let r=i._classIds[o],s=i._classes[r].instances;if(l(s[t]))return!0});return l(n)};Fp.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let o=t[i].instances;if(l(o[e]))return!0}return!1};Fp.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,CI(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o].instances;for(let s in r)r.hasOwnProperty(s)&&t.indexOf(s)===-1&&t.push(s)}),t};Fp.prototype.getProperty=function(e,t){return CI(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o],s=n._classIndexes[i],a=r.instances[t];if(l(a))return l(a.typedArray)?kve(a,s):Ye(a[s],!0)})};function kve(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}Fp.prototype.setProperty=function(e,t,n){let i=CI(this,e,function(o,r){let s=o._classIds[r],a=o._classes[s],c=o._classIndexes[r],d=a.instances[t];if(l(d))return l(d.typedArray)?Uve(d,c,n):d[c]=Ye(n,!0),!0});return l(i)};function Uve(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}Fp.prototype.isClass=function(e,t){let n=CI(this,e,function(i,o){let r=i._classIds[o];if(i._classes[r].name===t)return!0});return l(n)};Fp.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var Bx=Fp;var Fin=T(S(),1),Dve={HIGHLIGHT:0,REPLACE:1,MIX:2},Gl=Object.freeze(Dve);var mH=Bc.DEFAULT_COLOR_VALUE,hH=Bc.DEFAULT_SHOW_VALUE;function uo(e,t,n,i,o){this.featuresLength=t;let r;l(n)&&(r=n.extensions),this._extensions=y(r,{});let s=Bve(n);this._properties=s,this._batchTableHierarchy=Ove(this,n,i);let a=ooe(t,s,i);this._binaryPropertiesByteLength=Yve(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new Bc({featuresLength:t,colorChangedCallback:o,owner:e,statistics:e.tileset.statistics})}uo._deprecationWarning=ls;Object.defineProperties(uo.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function Bve(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Ye(e[n],!0));return t}function Ove(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],o=t.HIERARCHY;if(l(o)&&(uo._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),e._extensions["3DTILES_batch_table_hierarchy"]=o,i=o),!!l(i))return new Bx({extension:i,binaryBody:n})}function ooe(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(l(s)){let a=r.componentType,c=r.type;if(!l(a))throw new de("componentType is required.");if(!l(c))throw new de("type is required.");if(!l(n))throw new de(`Property ${o} requires a batch table binary.`);let d=pd(r),u=d.componentsPerAttribute,m=d.classType,p=d.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:u,type:m}}}return i}function Yve(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}uo.getBinaryProperties=function(e,t,n){return ooe(e,t,n)};uo.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};uo.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};uo.prototype.getShow=function(e){return this._batchTexture.getShow(e)};uo.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};uo.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};uo.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};uo.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var Hve=new B;uo.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(mH),this.setAllShow(hH);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let o=t.getFeature(i),r=l(e.color)?y(e.color.evaluateColor(o,Hve),mH):mH,s=l(e.show)?y(e.show.evaluate(o),hH):hH;this.setColor(i,r),this.setShow(i,s)}};function zve(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function Kve(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}uo.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};uo.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};uo.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};uo.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};uo.prototype.hasPropertyBySemantic=function(){return!1};uo.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);return t.push.apply(t,n),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,n)),t};uo.prototype.getPropertyBySemantic=function(e,t){};uo.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return zve(i,e)}let n=this._properties[t];if(l(n))return Ye(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};uo.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let r=this._batchTableBinaryProperties[t];if(l(r)){Kve(r,e,n);return}}if(l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let o=this._properties[t];l(o)||(this._properties[t]=new Array(i),o=this._properties[t]),o[e]=Ye(n,!0)};function Jve(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep;
  5359. vec2 computeSt(float batchId)
  5360. {
  5361. float stepX = tile_textureStep.x;
  5362. float centerX = tile_textureStep.y;
  5363. return vec2(centerX + (batchId * stepX), 0.5);
  5364. }
  5365. `:`uniform vec4 tile_textureStep;
  5366. uniform vec2 tile_textureDimensions;
  5367. vec2 computeSt(float batchId)
  5368. {
  5369. float stepX = tile_textureStep.x;
  5370. float centerX = tile_textureStep.y;
  5371. float stepY = tile_textureStep.z;
  5372. float centerY = tile_textureStep.w;
  5373. float xId = mod(batchId, tile_textureDimensions.x);
  5374. float yId = floor(batchId / tile_textureDimensions.x);
  5375. return vec2(centerX + (xId * stepX), centerY + (yId * stepY));
  5376. }
  5377. `}uo.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(o){let r=roe(o,n,!1),s;return Bt.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand;
  5378. `),s+=`uniform sampler2D tile_batchTexture;
  5379. out vec4 tile_featureColor;
  5380. out vec2 tile_featureSt;
  5381. void main()
  5382. {
  5383. vec2 st = computeSt(${t});
  5384. vec4 featureProperties = texture(tile_batchTexture, st);
  5385. tile_color(featureProperties);
  5386. float show = ceil(featureProperties.a);
  5387. gl_Position *= show;
  5388. `,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0);
  5389. if (czm_pass == czm_passTranslucent)
  5390. {
  5391. if (!isStyleTranslucent && !tile_translucentCommand)
  5392. {
  5393. gl_Position *= 0.0;
  5394. }
  5395. }
  5396. else
  5397. {
  5398. if (isStyleTranslucent)
  5399. {
  5400. gl_Position *= 0.0;
  5401. }
  5402. }
  5403. `),s+=` tile_featureColor = featureProperties;
  5404. tile_featureSt = st;
  5405. }`):s=`out vec2 tile_featureSt;
  5406. void main()
  5407. {
  5408. tile_color(vec4(1.0));
  5409. tile_featureSt = computeSt(${t});
  5410. }`,`${r}
  5411. ${Jve(i)}${s}`}};function ioe(e,t){return e=De.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend;
  5412. void tile_color(vec4 tile_featureColor)
  5413. {
  5414. tile_main();
  5415. tile_featureColor = czm_gammaCorrect(tile_featureColor);
  5416. out_FragColor.a *= tile_featureColor.a;
  5417. float highlight = ceil(tile_colorBlend);
  5418. out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight);
  5419. }
  5420. `:`${e}void tile_color(vec4 tile_featureColor)
  5421. {
  5422. tile_main();
  5423. }
  5424. `}function Qve(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let d=o;d<e.length;++d){let u=e.charAt(d);if(u==="(")++s;else if(u===")"&&(--s,s===0)){r=d+1;break}}let c=`tile_diffuse_final(${e.slice(o,r)}, tile_diffuse)`;e=e.slice(0,o)+c+e.slice(r),i=o+c.length,o=e.indexOf(n,i)}return e}function roe(e,t,n){if(!l(t))return ioe(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),o=e.match(i);if(!l(o))return ioe(e,n);let r=o[0],s=o[2];e=De.replaceMain(e,"tile_main"),e=e.replace(r,"");let a=`bool isWhite(vec3 color)
  5425. {
  5426. return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));
  5427. }
  5428. vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse)
  5429. {
  5430. vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend);
  5431. vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse;
  5432. return vec4(diffuse.rgb, sourceDiffuse.a);
  5433. }
  5434. `,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor);
  5435. out_FragColor.a *= tile_featureColor.a;
  5436. float highlight = ceil(tile_colorBlend);
  5437. out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight);
  5438. `,d;if(s==="vec3"||s==="vec4"){let u=s==="vec3"?`vec4(${t}, 1.0)`:t,m=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,m),d=` vec4 source = ${u};
  5439. tile_diffuse = tile_diffuse_final(source, tile_featureColor);
  5440. tile_main();
  5441. `}else s==="sampler2D"&&(e=Qve(e,t),d=` tile_diffuse = tile_featureColor;
  5442. tile_main();
  5443. `);return e=`uniform float tile_colorBlend;
  5444. vec4 tile_diffuse = vec4(1.0);
  5445. ${a}${r}
  5446. ${e}
  5447. void tile_color(vec4 tile_featureColor)
  5448. {
  5449. ${d}`,n&&(e+=c),e+=`}
  5450. `,e}uo.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=roe(i,t,!0),Bt.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture;
  5451. in vec2 tile_featureSt;
  5452. in vec4 tile_featureColor;
  5453. void main()
  5454. {
  5455. tile_color(tile_featureColor);
  5456. `,n&&(i+=` out_FragColor.rgb *= out_FragColor.a;
  5457. `),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand;
  5458. `),i+=`uniform sampler2D tile_pickTexture;
  5459. uniform sampler2D tile_batchTexture;
  5460. in vec2 tile_featureSt;
  5461. void main()
  5462. {
  5463. vec4 featureProperties = texture(tile_batchTexture, tile_featureSt);
  5464. if (featureProperties.a == 0.0) {
  5465. discard;
  5466. }
  5467. `,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0);
  5468. if (czm_pass == czm_passTranslucent)
  5469. {
  5470. if (!isStyleTranslucent && !tile_translucentCommand)
  5471. {
  5472. discard;
  5473. }
  5474. }
  5475. else
  5476. {
  5477. if (isStyleTranslucent)
  5478. {
  5479. discard;
  5480. }
  5481. }
  5482. `),i+=` tile_color(featureProperties);
  5483. `,n&&(i+=` out_FragColor.rgb *= out_FragColor.a;
  5484. `),i+=`}
  5485. `),i}};uo.prototype.getClassificationFragmentShaderCallback=function(){if(this.featuresLength!==0)return function(e){return e=De.replaceMain(e,"tile_main"),Bt.maximumVertexTextureImageUnits>0?e+=`uniform sampler2D tile_pickTexture;
  5486. in vec2 tile_featureSt;
  5487. in vec4 tile_featureColor;
  5488. void main()
  5489. {
  5490. tile_main();
  5491. out_FragColor = tile_featureColor;
  5492. out_FragColor.rgb *= out_FragColor.a;
  5493. }`:e+=`uniform sampler2D tile_batchTexture;
  5494. uniform sampler2D tile_pickTexture;
  5495. in vec2 tile_featureSt;
  5496. void main()
  5497. {
  5498. tile_main();
  5499. vec4 featureProperties = texture(tile_batchTexture, tile_featureSt);
  5500. if (featureProperties.a == 0.0) {
  5501. discard;
  5502. }
  5503. out_FragColor = featureProperties;
  5504. out_FragColor.rgb *= out_FragColor.a;
  5505. }
  5506. `,e}};function jve(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Gl.HIGHLIGHT)return 0;if(n===Gl.REPLACE)return 1;if(n===Gl.MIX)return W.clamp(i,W.EPSILON4,1)}uo.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return Tt(t,{tile_batchTexture:function(){return y(e._batchTexture.batchTexture,e._batchTexture.defaultTexture)},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return jve(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};uo.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var Y0={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};uo.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,o=this._content._tile,r=o._finalResolution,s=o.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=qve(this);for(let d=t;d<i;++d){let u=n[d];if(u.pass===Ge.COMPUTE)continue;let m=u.derivedCommands.tileset;(!l(m)||u.dirty)&&(m={},u.derivedCommands.tileset=m,m.originalCommand=$ve(u),u.dirty=!1);let p=m.originalCommand;c!==Y0.ALL_OPAQUE&&u.pass!==Ge.TRANSLUCENT&&(l(m.translucent)||(m.translucent=ewe(p))),c!==Y0.ALL_TRANSLUCENT&&u.pass!==Ge.TRANSLUCENT&&(l(m.opaque)||(m.opaque=twe(p)),a&&(r||(l(m.zback)||(m.zback=iwe(e.context,p)),s._backfaceCommands.push(m.zback)),(!l(m.stencil)||o._selectionDepth!==rwe(m.stencil))&&(u.renderState.depthMask?m.stencil=owe(p,o._selectionDepth):m.stencil=m.opaque)));let g=a?m.stencil:m.opaque,f=m.translucent;u.pass!==Ge.TRANSLUCENT?(c===Y0.ALL_OPAQUE&&(n[d]=g),c===Y0.ALL_TRANSLUCENT&&(n[d]=f),c===Y0.OPAQUE_AND_TRANSLUCENT&&(n[d]=g,n.push(f))):n[d]=p}};function qve(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?Y0.ALL_OPAQUE:t===e.featuresLength?Y0.ALL_TRANSLUCENT:Y0.OPAQUE_AND_TRANSLUCENT}function $ve(e){let t=tt.shallowClone(e),n=t.pass===Ge.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function ewe(e){let t=tt.shallowClone(e);return t.pass=Ge.TRANSLUCENT,t.renderState=swe(e.renderState),t}function twe(e){let t=tt.shallowClone(e);return t.renderState=awe(e.renderState),t}function nwe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!l(n)){let i=t.fragmentShaderSource.clone();i.defines=l(i.defines)?i.defines.slice(0):[],i.defines.push("POLYGON_OFFSET"),n=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}return n}function iwe(e,t){let n=tt.shallowClone(t),i=Ye(n.renderState,!0);i.cull.enabled=!0,i.cull.face=yi.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=Ot.setCesium3DTileBit(),i.stencilMask=Ot.CESIUM_3D_TILE_MASK,n.renderState=Ue.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Ye(t.uniformMap);let o=new D(5,5);return n.uniformMap.u_polygonOffset=function(){return o},n.shaderProgram=nwe(e,t.shaderProgram),n}function owe(e,t){let n=tt.shallowClone(e),i=Ye(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=Ot.SKIP_LOD_MASK,i.stencilTest.reference=Ot.CESIUM_3D_TILE_MASK|t<<Ot.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=Un.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=bt.REPLACE,i.stencilTest.backFunction=Un.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=bt.REPLACE,i.stencilMask=Ot.CESIUM_3D_TILE_MASK|Ot.SKIP_LOD_MASK,n.renderState=Ue.fromCache(i),n}function rwe(e){return(e.renderState.stencilTest.reference&Ot.SKIP_LOD_MASK)>>>Ot.SKIP_LOD_BIT_SHIFT}function swe(e){let t=Ye(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=un.ALPHA_BLEND,t.stencilTest=Ot.setCesium3DTileBit(),t.stencilMask=Ot.CESIUM_3D_TILE_MASK,Ue.fromCache(t)}function awe(e){let t=Ye(e,!0);return t.stencilTest=Ot.setCesium3DTileBit(),t.stencilMask=Ot.CESIUM_3D_TILE_MASK,Ue.fromCache(t)}uo.prototype.update=function(e,t){this._batchTexture.update(e,t)};uo.prototype.isDestroyed=function(){return!1};uo.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),me(this)};var Ap=uo;var Trn=T(S(),1);var don=T(S(),1);function cwe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var nf=cwe;var crn=T(S(),1);var mon=T(S(),1),dC=`in vec3 position;
  5507. in float a_batchId;
  5508. uniform mat4 u_modifiedModelViewProjection;
  5509. void main()
  5510. {
  5511. gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0));
  5512. }
  5513. `;var bon=T(S(),1);function _u(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(_u.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return l(this._color)||(this._color=new B),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}});_u.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};_u.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};_u.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};_u.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(l(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let o=e.metadata;if(l(o)){if(o.hasPropertyBySemantic(n))return o.getPropertyBySemantic(n);if(o.hasProperty(n))return o.getProperty(n)}let r=e.tile,s=r.metadata;if(l(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(l(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),l(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let c=l(e.group)?e.group.metadata:void 0;if(l(c)){if(c.hasPropertyBySemantic(n))return c.getPropertyBySemantic(n);if(c.hasProperty(n))return c.getProperty(n)}let d=e.tileset.metadata;if(l(d)){if(d.hasPropertyBySemantic(n))return d.getPropertyBySemantic(n);if(d.hasProperty(n))return d.getProperty(n)}};_u.prototype.getPropertyInherited=function(e){return _u.getPropertyInherited(this._content,this._batchId,e)};_u.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};_u.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};_u.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};_u.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Ns=_u;var Won=T(S(),1);var xon=T(S(),1),fH=class{add(t,n,i){if(typeof arguments[0]!="string")for(let o in arguments[0])this.add(o,arguments[0][o],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(o){this[o]=this[o]||[],n&&this[o][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},pH=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},El=class e{static get version(){return"1.3.9"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,i){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,i?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(e.hooks[t]){let i={context:this,node:n};return e.hooks.run(t,i),i.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,o;for(;this.index<this.expr.length;)if(i=this.code,i===e.SEMCOL_CODE||i===e.COMMA_CODE)this.index++;else if(o=this.gobbleExpression())n.push(o);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),n=t.length;for(;n>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,o,r,s,a,c,d;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(r={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),o=[s,r,a];n=this.gobbleBinaryOp();){if(i=e.binaryPrecedence(n),i===0){this.index-=n.length;break}r={value:n,prec:i,right_a:e.right_associative.has(n)},d=n;let u=m=>r.right_a&&m.right_a?i>m.prec:i<=m.prec;for(;o.length>2&&u(o[o.length-2]);)a=o.pop(),n=o.pop().value,s=o.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+d),o.push(r,t)}for(c=o.length-1,t=o[c];c>1;)t={type:e.BINARY_EXP,operator:o[c-1].value,left:o[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)o=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let r=this.gobbleToken();return r||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:n,argument:r,prefix:!0})}n=n.substr(0,--i)}e.isIdentifierStart(t)?(o=this.gobbleIdentifier(),e.literals.hasOwnProperty(o.name)?o={type:e.LITERAL,value:e.literals[o.name],raw:o.name}:o.name===e.this_str&&(o={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(o=this.gobbleGroup())}return o?(o=this.gobbleTokenProperty(o),this.runHook("after-token",o)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let i;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),n=this.code,n!==e.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(n===e.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,e.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===e.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:e.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),o=!1;for(;this.index<this.expr.length;){let r=this.expr.charAt(this.index++);if(r===i){o=!0;break}else if(r==="\\")switch(r=this.expr.charAt(this.index++),r){case"n":t+=`
  5514. `;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=r}else t+=r}return o||this.throwError('Unclosed quote after "'+t+'"'),{type:e.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,o=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let r=this.code;if(r===t){i=!0,this.index++,t===e.CPAREN_CODE&&o&&o>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(r===e.COMMA_CODE){if(this.index++,o++,o!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s<o;s++)n.push(null)}}else if(n.length!==o&&o!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===e.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return i||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(e.CPAREN_CODE);if(this.code===e.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:e.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:e.ARRAY_EXP,elements:this.gobbleArguments(e.CBRACK_CODE)}}},lwe=new fH;Object.assign(El,{hooks:lwe,plugins:new pH(El),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},right_associative:new Set,additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});El.max_unop_len=El.getMaxKeyLen(El.unary_ops);El.max_binop_len=El.getMaxKeyLen(El.binary_ops);var H0=e=>new El(e).parse(),dwe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(El).filter(e=>!dwe.includes(e)&&H0[e]===void 0).forEach(e=>{H0[e]=El[e]});H0.Jsep=El;var uwe="ConditionalExpression",mwe={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let r=this.gobbleExpression();if(r||this.throwError("Expected expression"),n.node={type:uwe,test:i,consequent:o,alternate:r},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};H0.plugins.register(mwe);var Ton=T(S(),1),hwe={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},gt=Object.freeze(hwe);function wm(e,t){this._expression=e,e=Rwe(e,t),e=Gwe(Zwe(e)),H0.addBinaryOp("=~",0),H0.addBinaryOp("!~",0);let n;try{n=H0(e)}catch(i){throw new de(i)}this._runtimeAst=Si(this,n)}Object.defineProperties(wm.prototype,{expression:{get:function(){return this._expression}}});var vn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new D],cartesian3Array:[new h],cartesian4Array:[new se],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new D),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new h),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new se),this.cartesian4Array[this.cartesian4Index++]}};wm.prototype.evaluate=function(e,t){vn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof B&&n instanceof se?B.fromCartesian4(n,t):n instanceof D||n instanceof h||n instanceof se?n.clone(t):n};wm.prototype.evaluateColor=function(e,t){vn.reset();let n=this._runtimeAst.evaluate(e);return B.fromCartesian4(n,t)};wm.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e}
  5515. {
  5516. return ${o};
  5517. }
  5518. `,o};wm.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};wm.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var fwe=["!","-","+"],soe=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],s5=/\${(.*?)}/g,pwe=/\\/g,bwe="@#%",gwe=/@#%/g,a5=new B,c5={abs:ks(Math.abs),sqrt:ks(Math.sqrt),cos:ks(Math.cos),sin:ks(Math.sin),tan:ks(Math.tan),acos:ks(Math.acos),asin:ks(Math.asin),atan:ks(Math.atan),radians:ks(W.toRadians),degrees:ks(W.toDegrees),sign:ks(W.sign),floor:ks(Math.floor),ceil:ks(Math.ceil),round:ks(Math.round),exp:ks(Math.exp),exp2:ks(xwe),log:ks(Math.log),log2:ks(_we),fract:ks(ywe),length:Twe,normalize:Swe},l5={atan2:o5(Math.atan2,!1),pow:o5(Math.pow,!1),min:o5(Math.min,!0),max:o5(Math.max,!0),distance:Cwe,dot:Vwe,cross:Lwe},yH={clamp:aoe(W.clamp,!0),mix:aoe(W.lerp,!0)};function ywe(e){return e-Math.floor(e)}function xwe(e){return Math.pow(2,e)}function _we(e){return W.log2(e)}function ks(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof D)return D.fromElements(e(n.x),e(n.y),vn.getCartesian2());if(n instanceof h)return h.fromElements(e(n.x),e(n.y),e(n.z),vn.getCartesian3());if(n instanceof se)return se.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),vn.getCartesian4());throw new de(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function o5(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof D)return D.fromElements(e(i.x,o),e(i.y,o),vn.getCartesian2());if(i instanceof h)return h.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),vn.getCartesian3());if(i instanceof se)return se.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),vn.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof D&&o instanceof D)return D.fromElements(e(i.x,o.x),e(i.y,o.y),vn.getCartesian2());if(i instanceof h&&o instanceof h)return h.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),vn.getCartesian3());if(i instanceof se&&o instanceof se)return se.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),vn.getCartesian4());throw new de(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function aoe(e,t){return function(n,i,o,r){if(t&&typeof r=="number"){if(typeof i=="number"&&typeof o=="number")return e(i,o,r);if(i instanceof D&&o instanceof D)return D.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),vn.getCartesian2());if(i instanceof h&&o instanceof h)return h.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),vn.getCartesian3());if(i instanceof se&&o instanceof se)return se.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),e(i.w,o.w,r),vn.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof D&&o instanceof D&&r instanceof D)return D.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),vn.getCartesian2());if(i instanceof h&&o instanceof h&&r instanceof h)return h.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),vn.getCartesian3());if(i instanceof se&&o instanceof se&&r instanceof se)return se.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),e(i.w,o.w,r.w),vn.getCartesian4());throw new de(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function Twe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof D)return D.magnitude(t);if(t instanceof h)return h.magnitude(t);if(t instanceof se)return se.magnitude(t);throw new de(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function Swe(e,t){if(typeof t=="number")return 1;if(t instanceof D)return D.normalize(t,vn.getCartesian2());if(t instanceof h)return h.normalize(t,vn.getCartesian3());if(t instanceof se)return se.normalize(t,vn.getCartesian4());throw new de(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function Cwe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof D&&n instanceof D)return D.distance(t,n);if(t instanceof h&&n instanceof h)return h.distance(t,n);if(t instanceof se&&n instanceof se)return se.distance(t,n);throw new de(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function Vwe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof D&&n instanceof D)return D.dot(t,n);if(t instanceof h&&n instanceof h)return h.dot(t,n);if(t instanceof se&&n instanceof se)return se.dot(t,n);throw new de(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function Lwe(e,t,n){if(t instanceof h&&n instanceof h)return h.cross(t,n,vn.getCartesian3());throw new de(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Ct(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,Mwe(this)}function Rwe(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),o=`(${t[n]})`;l(o)&&(e=e.replace(i,o))}return e}function Zwe(e){return e.replace(pwe,bwe)}function gH(e){return e.replace(gwe,"\\")}function Gwe(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),s;if(o>=0&&o<i)s=t.indexOf("'",o+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else if(r>=0&&r<i)s=t.indexOf('"',r+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else{n+=t.substr(0,i);let a=t.indexOf("}");if(a<0)throw new de("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function Ewe(e){let t=typeof e.value;if(e.value===null)return new Ct(gt.LITERAL_NULL,null);if(t==="boolean")return new Ct(gt.LITERAL_BOOLEAN,e.value);if(t==="number")return new Ct(gt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Ct(gt.VARIABLE_IN_STRING,e.value):new Ct(gt.LITERAL_STRING,gH(e.value))}function Iwe(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let c=t.callee.object;if(o==="test"||o==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new de(`${o} is not a function.`);return i===0?o==="test"?new Ct(gt.LITERAL_BOOLEAN,!1):new Ct(gt.LITERAL_NULL,null):(s=Si(e,c),a=Si(e,n[0]),new Ct(gt.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=Si(e,c),new Ct(gt.FUNCTION_CALL,o,r);throw new de(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Ct(gt.LITERAL_COLOR,o);if(r=Si(e,n[0]),l(n[1])){let c=Si(e,n[1]);return new Ct(gt.LITERAL_COLOR,o,[r,c])}return new Ct(gt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new de(`${o} requires three arguments.`);return r=[Si(e,n[0]),Si(e,n[1]),Si(e,n[2])],new Ct(gt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new de(`${o} requires four arguments.`);return r=[Si(e,n[0]),Si(e,n[1]),Si(e,n[2]),Si(e,n[3])],new Ct(gt.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let c=0;c<i;++c)r[c]=Si(e,n[c]);return new Ct(gt.LITERAL_VECTOR,o,r)}else{if(o==="isNaN"||o==="isFinite")return i===0?o==="isNaN"?new Ct(gt.LITERAL_BOOLEAN,!0):new Ct(gt.LITERAL_BOOLEAN,!1):(r=Si(e,n[0]),new Ct(gt.UNARY,o,r));if(o==="isExactClass"||o==="isClass"){if(i<1||i>1)throw new de(`${o} requires exactly one argument.`);return r=Si(e,n[0]),new Ct(gt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new de(`${o} does not take any argument.`);return new Ct(gt.UNARY,o)}else if(l(c5[o])){if(i!==1)throw new de(`${o} requires exactly one argument.`);return r=Si(e,n[0]),new Ct(gt.UNARY,o,r)}else if(l(l5[o])){if(i!==2)throw new de(`${o} requires exactly two arguments.`);return s=Si(e,n[0]),a=Si(e,n[1]),new Ct(gt.BINARY,o,s,a)}else if(l(yH[o])){if(i!==3)throw new de(`${o} requires exactly three arguments.`);s=Si(e,n[0]),a=Si(e,n[1]);let c=Si(e,n[2]);return new Ct(gt.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new Ct(gt.LITERAL_BOOLEAN,!1):(r=Si(e,n[0]),new Ct(gt.UNARY,o,r));if(o==="Number")return i===0?new Ct(gt.LITERAL_NUMBER,0):(r=Si(e,n[0]),new Ct(gt.UNARY,o,r));if(o==="String")return i===0?new Ct(gt.LITERAL_STRING,""):(r=Si(e,n[0]),new Ct(gt.UNARY,o,r));if(o==="regExp")return Xwe(e,t)}}throw new de(`Unexpected function call "${o}".`)}function Xwe(e,t){let n=t.arguments;if(n.length===0)return new Ct(gt.LITERAL_REGEX,new RegExp);let i=Si(e,n[0]),o;if(n.length>1){let r=Si(e,n[1]);if(bH(i)&&bH(r)){try{o=new RegExp(gH(String(i._value)),r._value)}catch(s){throw new de(s)}return new Ct(gt.LITERAL_REGEX,o)}return new Ct(gt.REGEX,i,r)}if(bH(i)){try{o=new RegExp(gH(String(i._value)))}catch(r){throw new de(r)}return new Ct(gt.LITERAL_REGEX,o)}return new Ct(gt.REGEX,i)}function Wwe(e){if(Fwe(e.name)){let t=Awe(e.name);return t.substr(0,8)==="tiles3d_"?new Ct(gt.BUILTIN_VARIABLE,t):new Ct(gt.VARIABLE,t)}else{if(e.name==="NaN")return new Ct(gt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Ct(gt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Ct(gt.LITERAL_UNDEFINED,void 0)}throw new de(`${e.name} is not defined.`)}function Pwe(e){let t=e.property.name;if(t==="PI")return new Ct(gt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Ct(gt.LITERAL_NUMBER,Math.E)}function vwe(e){if(e.property.name==="POSITIVE_INFINITY")return new Ct(gt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function wwe(e,t){if(t.object.name==="Math")return Pwe(t);if(t.object.name==="Number")return vwe(t);let n,i=Si(e,t.object);return t.computed?(n=Si(e,t.property),new Ct(gt.MEMBER,"brackets",i,n)):(n=new Ct(gt.LITERAL_STRING,t.property.name),new Ct(gt.MEMBER,"dot",i,n))}function bH(e){return e._type>=gt.LITERAL_NULL}function Fwe(e){return e.substr(0,4)==="czm_"}function Awe(e){return e.substr(4)}function Si(e,t){let n,i,o,r;if(t.type==="Literal")n=Ewe(t);else if(t.type==="CallExpression")n=Iwe(e,t);else if(t.type==="Identifier")n=Wwe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Si(e,t.argument);if(fwe.indexOf(i)>-1)n=new Ct(gt.UNARY,i,s);else throw new de(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=Si(e,t.left),r=Si(e,t.right),soe.indexOf(i)>-1)n=new Ct(gt.BINARY,i,o,r);else throw new de(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=Si(e,t.left),r=Si(e,t.right),soe.indexOf(i)>-1&&(n=new Ct(gt.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=Si(e,t.test);o=Si(e,t.consequent),r=Si(e,t.alternate),n=new Ct(gt.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=wwe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=Si(e,t.elements[a]);n=new Ct(gt.ARRAY,s)}else throw t.type==="Compound"?new de("Provide exactly one expression."):new de("Cannot parse expression.");return n}function Mwe(e){e._type===gt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===gt.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===gt.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:l(c5[e._value])&&(e.evaluate=kwe(e._value)):e._type===gt.BINARY?e._value==="+"?e.evaluate=e._evaluatePlus:e._value==="-"?e.evaluate=e._evaluateMinus:e._value==="*"?e.evaluate=e._evaluateTimes:e._value==="/"?e.evaluate=e._evaluateDivide:e._value==="%"?e.evaluate=e._evaluateMod:e._value==="==="?e.evaluate=e._evaluateEqualsStrict:e._value==="!=="?e.evaluate=e._evaluateNotEqualsStrict:e._value==="<"?e.evaluate=e._evaluateLessThan:e._value==="<="?e.evaluate=e._evaluateLessThanOrEquals:e._value===">"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(l5[e._value])&&(e.evaluate=Uwe(e._value)):e._type===gt.TERNARY?e.evaluate=Dwe(e._value):e._type===gt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===gt.ARRAY?e.evaluate=e._evaluateArray:e._type===gt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===gt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===gt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===gt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===gt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===gt.REGEX?e.evaluate=e._evaluateRegExp:e._type===gt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=Nwe):e.evaluate=e._evaluateLiteral}function Nwe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function kwe(e){let t=c5[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function Uwe(e){let t=l5[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function Dwe(e){let t=yH[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n),r=this._test.evaluate(n);return t(e,i,o,r)}}function d5(e,t){if(l(e))return e.getPropertyInherited(t)}Ct.prototype._evaluateLiteral=function(){return this._value};Ct.prototype._evaluateLiteralColor=function(e){let t=a5,n=this._left;if(this._value==="color")l(n)?n.length>1?(B.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):B.fromCssColorString(n[0].evaluate(e),t):B.fromBytes(255,255,255,255,t);else if(this._value==="rgb")B.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;B.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?B.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&B.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return se.fromColor(t,vn.getCartesian4())};Ct.prototype._evaluateLiteralVector=function(e){let t=vn.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a<o;++a){let c=i[a].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof D)t.push(c.x,c.y);else if(c instanceof h)t.push(c.x,c.y,c.z);else if(c instanceof se)t.push(c.x,c.y,c.z,c.w);else throw new de(`${n} argument must be a vector or number. Argument is ${c}.`)}let r=t.length,s=parseInt(n.charAt(3));if(r===0)throw new de(`Invalid ${n} constructor. No valid arguments.`);if(r<s&&r>1)throw new de(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new de(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return D.fromArray(t,0,vn.getCartesian2());if(n==="vec3")return h.fromArray(t,0,vn.getCartesian3());if(n==="vec4")return se.fromArray(t,0,vn.getCartesian4())};Ct.prototype._evaluateLiteralString=function(){return this._value};Ct.prototype._evaluateVariableString=function(e){let t=this._value,n=s5.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=d5(e,o);l(r)||(r=""),t=t.replace(i,r),n=s5.exec(t)}return t};Ct.prototype._evaluateVariable=function(e){return d5(e,this._value)};function Ox(e){return e._value==="feature"}Ct.prototype._evaluateMemberDot=function(e){if(Ox(this._left))return d5(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof D||t instanceof h||t instanceof se){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};Ct.prototype._evaluateMemberBrackets=function(e){if(Ox(this._left))return d5(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof D||t instanceof h||t instanceof se){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};Ct.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Ct.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new de(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};Ct.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof D)return D.negate(t,vn.getCartesian2());if(t instanceof h)return h.negate(t,vn.getCartesian3());if(t instanceof se)return se.negate(t,vn.getCartesian4());if(typeof t=="number")return-t;throw new de(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Ct.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof D||t instanceof h||t instanceof se||typeof t=="number"))throw new de(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Ct.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new de(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};Ct.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new de(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};Ct.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new de(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Ct.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new de(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Ct.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new de(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new de(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Ct.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new de(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new de(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Ct.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.add(t,n,vn.getCartesian2());if(n instanceof h&&t instanceof h)return h.add(t,n,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.add(t,n,vn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new de(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Ct.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.subtract(t,n,vn.getCartesian2());if(n instanceof h&&t instanceof h)return h.subtract(t,n,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.subtract(t,n,vn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new de(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Ct.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.multiplyComponents(t,n,vn.getCartesian2());if(n instanceof D&&typeof t=="number")return D.multiplyByScalar(n,t,vn.getCartesian2());if(t instanceof D&&typeof n=="number")return D.multiplyByScalar(t,n,vn.getCartesian2());if(n instanceof h&&t instanceof h)return h.multiplyComponents(t,n,vn.getCartesian3());if(n instanceof h&&typeof t=="number")return h.multiplyByScalar(n,t,vn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.multiplyByScalar(t,n,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.multiplyComponents(t,n,vn.getCartesian4());if(n instanceof se&&typeof t=="number")return se.multiplyByScalar(n,t,vn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.multiplyByScalar(t,n,vn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new de(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Ct.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.divideComponents(t,n,vn.getCartesian2());if(t instanceof D&&typeof n=="number")return D.divideByScalar(t,n,vn.getCartesian2());if(n instanceof h&&t instanceof h)return h.divideComponents(t,n,vn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.divideByScalar(t,n,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.divideComponents(t,n,vn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.divideByScalar(t,n,vn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new de(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Ct.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof D&&t instanceof D)return D.fromElements(t.x%n.x,t.y%n.y,vn.getCartesian2());if(n instanceof h&&t instanceof h)return h.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,vn.getCartesian3());if(n instanceof se&&t instanceof se)return se.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,vn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new de(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Ct.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof D&&t instanceof D||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?t.equals(n):t===n};Ct.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof D&&t instanceof D||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?!t.equals(n):t!==n};Ct.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new de(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Ct.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Ct.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Ct.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Ct.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Ct.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Ct.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Ct.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Ct.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Ct.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new de(o)}return i};Ct.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new de(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};Ct.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new de(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Ct.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new de(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Ct.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new de(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};Ct.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof D||t instanceof h||t instanceof se)return String(t);throw new de(`Unexpected function call "${this._value}".`)};function coe(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==gt.LITERAL_NUMBER)return;let i=t[0]._value,o=t[1]._value,r=t[2]._value,s=n===4?t[3]._value:1;return B.fromHsl(i,o,r,s,a5)}function loe(e){let t=e._left,n=t.length;for(let o=0;o<n;++o)if(t[o]._type!==gt.LITERAL_NUMBER)return;let i=a5;return i.red=t[0]._value/255,i.green=t[1]._value/255,i.blue=t[2]._value/255,i.alpha=n===4?t[3]._value:1,i}function z0(e){return e%1===0?e.toFixed(1):e.toString()}function Bwe(e){let t=z0(e.red),n=z0(e.green),i=z0(e.blue);return`vec3(${t}, ${n}, ${i})`}function r5(e){let t=z0(e.red),n=z0(e.green),i=z0(e.blue),o=z0(e.alpha);return`vec4(${t}, ${n}, ${i}, ${o})`}function doe(e,t,n,i){let o=e.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=e[s].getShaderExpression(t,n,i);return r}function uoe(e,t){return l(t[e])?t[e]:wm.NULL_SENTINEL}wm.NULL_SENTINEL="czm_infinity";Ct.prototype.getShaderExpression=function(e,t,n){let i,o,r,s,a=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?o=doe(this._left,e,t,this):o=this._left.getShaderExpression(e,t,this)),l(this._right)&&(r=this._right.getShaderExpression(e,t,this)),l(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=doe(this._value,e,t,this));let d,u,m;switch(a){case gt.VARIABLE:return Ox(this)?void 0:uoe(c,e);case gt.UNARY:if(c==="Boolean")return`bool(${o})`;if(c==="Number")return`float(${o})`;if(c==="round")return`floor(${o} + 0.5)`;if(l(c5[c]))return`${c}(${o})`;if(c==="isNaN")return`(${o} != ${o})`;if(c==="isFinite")return`(abs(${o}) < czm_infinity)`;if(c==="String"||c==="isExactClass"||c==="isClass"||c==="getExactClassName")throw new de(`Error generating style shader: "${c}" is not supported.`);return c+o;case gt.BINARY:return c==="%"?`mod(${o}, ${r})`:c==="==="?`(${o} == ${r})`:c==="!=="?`(${o} != ${r})`:c==="atan2"?`atan(${o}, ${r})`:l(l5[c])?`${c}(${o}, ${r})`:`(${o} ${c} ${r})`;case gt.TERNARY:if(l(yH[c]))return`${c}(${o}, ${r}, ${s})`;break;case gt.CONDITIONAL:return`(${s} ? ${o} : ${r})`;case gt.MEMBER:return Ox(this._left)?uoe(r,e):r==="r"||r==="x"||r==="0.0"?`${o}[0]`:r==="g"||r==="y"||r==="1.0"?`${o}[1]`:r==="b"||r==="z"||r==="2.0"?`${o}[2]`:r==="a"||r==="w"||r==="3.0"?`${o}[3]`:`${o}[int(${r})]`;case gt.FUNCTION_CALL:throw new de(`Error generating style shader: "${c}" is not supported.`);case gt.ARRAY:if(c.length===4)return`vec4(${c[0]}, ${c[1]}, ${c[2]}, ${c[3]})`;if(c.length===3)return`vec3(${c[0]}, ${c[1]}, ${c[2]})`;if(c.length===2)return`vec2(${c[0]}, ${c[1]})`;throw new de("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case gt.REGEX:throw new de("Error generating style shader: Regular expressions are not supported.");case gt.VARIABLE_IN_STRING:throw new de("Error generating style shader: Converting a variable to a string is not supported.");case gt.LITERAL_NULL:return wm.NULL_SENTINEL;case gt.LITERAL_BOOLEAN:return c?"true":"false";case gt.LITERAL_NUMBER:return z0(c);case gt.LITERAL_STRING:if(l(n)&&n._type===gt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||Ox(n._left)))return c;if(i=B.fromCssColorString(c,a5),l(i))return Bwe(i);throw new de("Error generating style shader: String literals are not supported.");case gt.LITERAL_COLOR:if(d=o,c==="color"){if(l(d)){if(d.length>1){let p=d[0],g=d[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${d[0]}, 1.0)`}else{if(c==="rgb")return i=loe(this),l(i)?r5(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, 1.0)`;if(c==="rgba")return d[3]!=="1.0"&&(t.translucent=!0),i=loe(this),l(i)?r5(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, ${d[3]})`;if(c==="hsl")return i=coe(this),l(i)?r5(i):`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), 1.0)`;if(c==="hsla")return i=coe(this),l(i)?(i.alpha!==1&&(t.translucent=!0),r5(i)):(d[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), ${d[3]})`)}break;case gt.LITERAL_VECTOR:u=o.length,m=`${c}(`;for(let p=0;p<u;++p)m+=o[p],p<u-1&&(m+=", ");return m+=")",m;case gt.LITERAL_REGEX:throw new de("Error generating style shader: Regular expressions are not supported.");case gt.LITERAL_UNDEFINED:return wm.NULL_SENTINEL;case gt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};Ct.prototype.getVariables=function(e,t){let n,i,o,r=this._type,s=this._value;if(l(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);else this._left.getVariables(e,this);if(l(this._right)&&this._right.getVariables(e,this),l(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);let a;switch(r){case gt.VARIABLE:Ox(this)||e.push(s);break;case gt.VARIABLE_IN_STRING:for(a=s5.exec(s);a!==null;)e.push(a[1]),a=s5.exec(s);break;case gt.LITERAL_STRING:l(t)&&t._type===gt.MEMBER&&Ox(t._left)&&e.push(s);break}};var Tu=wm;function Mp(e){e=y(e,y.EMPTY_OBJECT),this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=y(e.center,h.ZERO),this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=B.clone(B.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=y(e.classificationType,kn.BOTH),this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};let t=this._batchIds.length;for(let n=0;n<t;++n){let i=this._batchIds[n];this._batchIdLookUp[i]=n}}Object.defineProperties(Mp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var Owe={position:0,a_batchId:1};function Ywe(e,t){if(l(e._va))return;let n=xt.createVertexBuffer({context:t,typedArray:e._positions,usage:Me.STATIC_DRAW}),i=xt.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Me.STATIC_DRAW}),o=xt.createIndexBuffer({context:t,typedArray:e._indices,usage:Me.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Ae.UNSIGNED_SHORT:Ae.UNSIGNED_INT}),r=[{index:0,vertexBuffer:n,componentDatatype:Q.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:Q.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new ti({context:t,attributes:r,indexBuffer:o}),t.webgl2&&(e._vaSwap=new ti({context:t,attributes:r,indexBuffer:xt.createIndexBuffer({context:t,sizeInBytes:o.sizeInBytes,usage:Me.DYNAMIC_DRAW,indexDatatype:o.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function Hwe(e,t){if(l(e._sp))return;let n=e._batchTable,i=y(e._attributeLocations,Owe),o=e._pickId,r=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(r)){e._sp=tn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=De.replaceMain(s,"czm_non_pick_main"),s=`${s}void main()
  5519. {
  5520. czm_non_pick_main();
  5521. out_FragColor = ${o};
  5522. }
  5523. `,e._spPick=tn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(dC),c=n.getFragmentShaderCallback(!1,void 0,!0)(N0);o=n.getPickId();let d=new De({sources:[a]}),u=new De({defines:["VECTOR_TILE"],sources:[c]});e._sp=tn.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:u,attributeLocations:i}),d=new De({sources:[dC]}),u=new De({defines:["VECTOR_TILE"],sources:[N0]}),e._spStencil=tn.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:u,attributeLocations:i}),c=De.replaceMain(c,"czm_non_pick_main"),c=`${c}
  5524. void main()
  5525. {
  5526. czm_non_pick_main();
  5527. out_FragColor = ${o};
  5528. }
  5529. `;let m=new De({sources:[a]}),p=new De({defines:["VECTOR_TILE"],sources:[c]});e._spPick=tn.fromCache({context:t,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:i})}function moe(e){let t=e?Un.EQUAL:Un.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:bt.KEEP,zFail:bt.DECREMENT_WRAP,zPass:bt.KEEP},backFunction:t,backOperation:{fail:bt.KEEP,zFail:bt.INCREMENT_WRAP,zPass:bt.KEEP},reference:Ot.CESIUM_3D_TILE_MASK,mask:Ot.CESIUM_3D_TILE_MASK},stencilMask:Ot.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:nc.LESS_OR_EQUAL},depthMask:!1}}var zwe={stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},reference:0,mask:Ot.CLASSIFICATION_MASK},stencilMask:Ot.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND},Kwe={stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},reference:0,mask:Ot.CLASSIFICATION_MASK},stencilMask:Ot.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function Jwe(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ue.fromCache(moe(!1)),e._rsStencilDepthPass3DTiles=Ue.fromCache(moe(!0)),e._rsColorPass=Ue.fromCache(zwe),e._rsPickPass=Ue.fromCache(Kwe))}var Yx=new M,hoe=new h;function Qwe(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return M.clone(i,Yx),M.multiplyByPoint(Yx,e._center,hoe),M.setTranslation(Yx,hoe,Yx),M.multiply(o,Yx,Yx),Yx},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function xH(e,t,n,i,o,r,s){let a=e.constructor.BYTES_PER_ELEMENT,c=r.length;for(let d=0;d<c;++d){let u=r[d],m=s[u],p=i[m],g=o[m],f=new e.constructor(e.buffer,a*p,g);t.set(f,n),i[m]=n,n+=g}return n}function jwe(e,t){let n=e._indices,i=e._indexOffsets,o=e._indexCounts,r=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],d=xH(n,s,0,i,o,a.batchIds,r);for(a.offset=0,a.count=d;t.length>0;){let u=t.pop();if(B.equals(u.color,a.color))d=xH(n,s,d,i,o,u.batchIds,r),a.batchIds=a.batchIds.concat(u.batchIds),a.count=d-a.offset;else{let m=d;d=xH(n,s,d,i,o,u.batchIds,r),u.offset=m,u.count=d-m,c.push(u),a=u}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function _H(e,t,n,i,o,r,s){let a=e.bytesPerIndex,c=r.length;for(let d=0;d<c;++d){let u=r[d],m=s[u],p=i[m],g=o[m];t.copyFromBuffer(e,p*a,n*a,g*a),i[m]=n,n+=g}return n}function qwe(e,t){let n=e._indexOffsets,i=e._indexCounts,o=e._batchIdLookUp,r=t.pop(),s=[r],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,d=_H(a,c,0,n,i,r.batchIds,o);for(r.offset=0,r.count=d;t.length>0;){let m=t.pop();if(B.equals(m.color,r.color))d=_H(a,c,d,n,i,m.batchIds,o),r.batchIds=r.batchIds.concat(m.batchIds),r.count=d-r.offset;else{let p=d;d=_H(a,c,d,n,i,m.batchIds,o),m.offset=p,m.count=d-p,s.push(m),r=m}}let u=e._va;e._va=e._vaSwap,e._vaSwap=u,e._batchedIndices=s}function $we(e,t){return t.color.toRgba()-e.color.toRgba()}function eFe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let s=0;s<i;++s){let c=n[s].color.toRgba();if(l(r[c])){o=!0;break}else r[c]=!0}if(!o)return e._batchDirty=!1,!1;if(o&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort($we),t.webgl2?qwe(e,n):jwe(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function tFe(e,t){let n=eFe(e,t),i=e._commands,o=e._batchedIndices,r=o.length,s=r*2;if(l(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,d=y(e._modelMatrix,M.IDENTITY),u=e._uniformMap,m=e._boundingVolume;for(let p=0;p<r;++p){let g=o[p].offset,f=o[p].count,x=i[p*2];l(x)||(x=i[p*2]=new tt({owner:e})),x.vertexArray=a,x.modelMatrix=d,x.offset=g,x.count=f,x.renderState=e._rsStencilDepthPass,x.shaderProgram=c,x.uniformMap=u,x.boundingVolume=m,x.cull=!1,x.pass=Ge.TERRAIN_CLASSIFICATION;let _=tt.shallowClone(x,x.derivedCommands.tileset);_.renderState=e._rsStencilDepthPass3DTiles,_.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION,x.derivedCommands.tileset=_;let C=i[p*2+1];l(C)||(C=i[p*2+1]=new tt({owner:e})),C.vertexArray=a,C.modelMatrix=d,C.offset=g,C.count=f,C.renderState=e._rsColorPass,C.shaderProgram=c,C.uniformMap=u,C.boundingVolume=m,C.cull=!1,C.pass=Ge.TERRAIN_CLASSIFICATION;let V=tt.shallowClone(C,C.derivedCommands.tileset);V.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION,C.derivedCommands.tileset=V}e._commandsDirty=!0}function nFe(e,t){if(e.classificationType===kn.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,o=e._spStencil,r=n.length,s=i.length=r/2,a=0;for(let c=0;c<s;++c){let d=i[c]=tt.shallowClone(n[a],i[c]);d.shaderProgram=o,d.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function iFe(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,o=e._spStencil,r=e._spPick,s=y(e._modelMatrix,M.IDENTITY),a=e._uniformMap;for(let c=0;c<t;++c){let d=e._indexOffsets[c],u=e._indexCounts[c],m=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new tt({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=d,p.count=u,p.renderState=e._rsStencilDepthPass,p.shaderProgram=o,p.uniformMap=a,p.boundingVolume=m,p.pass=Ge.TERRAIN_CLASSIFICATION;let g=tt.shallowClone(p,p.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=g;let f=n[c*2+1];l(f)||(f=n[c*2+1]=new tt({owner:e,pickOnly:!0})),f.vertexArray=i,f.modelMatrix=s,f.offset=d,f.count=u,f.renderState=e._rsPickPass,f.shaderProgram=r,f.uniformMap=a,f.boundingVolume=m,f.pass=Ge.TERRAIN_CLASSIFICATION;let x=tt.shallowClone(f,f.derivedCommands.tileset);x.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION,f.derivedCommands.tileset=x}e._pickCommandsDirty=!1}Mp.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new Ns(e,r)}};Mp.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function oFe(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,o;for(o=0;o<i;++o){let s=n[o],a=t[s];a.show=!0,a.color=B.WHITE}let r=e._batchedIndices;for(i=r.length,o=0;o<i;++o)r[o].color=B.clone(B.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var rFe=new B,sFe=B.WHITE,aFe=!0,cFe=/\$/;Mp.prototype.applyStyle=function(e,t){if(!l(e)){oFe(this,t);return}let n=e.color,i=n instanceof Tu&&!cFe.test(n.expression);this._updatingAllCommands=i;let o=this._batchIds,r=o.length,s;for(s=0;s<r;++s){let a=o[s],c=t[a];c.color=l(e.color)?e.color.evaluateColor(c,rFe):sFe,c.show=l(e.show)?e.show.evaluate(c):aFe}if(i){let a=this._batchedIndices;for(r=a.length,s=0;s<r;++s)a[s].color=B.clone(B.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};Mp.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let o=this._indexOffsets,r=this._indexCounts,s=o[i],a=r[i],c=this._batchedIndices,d=c.length,u;for(u=0;u<d;++u){let x=c[u].offset,_=c[u].count;if(s>=x&&s<x+_)break}c.push(new nf({color:B.clone(t),offset:s,count:a,batchIds:[e]}));let m=[],p=[],g=c[u].batchIds,f=g.length;for(let x=0;x<f;++x){let _=g[x];if(_===e)continue;let C=n[_];o[C]<s?m.push(_):p.push(_)}p.length!==0&&c.push(new nf({color:B.clone(c[u].color),offset:s+a,count:c[u].offset+c[u].count-(s+a),batchIds:p})),m.length!==0?(c[u].count=s-c[u].offset,c[u].batchIds=m):c.splice(u,1),this._batchDirty=!0};function foe(e,t,n,i){let o=e.classificationType,r=o!==kn.CESIUM_3D_TILE,s=o!==kn.TERRAIN,a=t.commandList,c=n.length,d,u;for(u=0;u<c;++u)r&&(d=n[u],d.pass=Ge.TERRAIN_CLASSIFICATION,a.push(d)),s&&(d=n[u].derivedCommands.tileset,d.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION,a.push(d));if(!(!t.invertClassification||!l(i)))for(c=i.length,u=0;u<c;++u)a.push(i[u])}function lFe(e,t){let n=e.commandList,i=t.length;for(let o=0;o<i;o+=2){let r=t[o+1];r.pass=Ge.OPAQUE,n.push(r)}}function dFe(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=Ue.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Fe.LINES):(n=e._rsColorPass,i=Fe.TRIANGLES);let o=e._commands,r=o.length;for(let s=0;s<r;s+=2){let a=o[s+1];a.renderState=n,a.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}Mp.prototype.update=function(e){let t=e.context;Ywe(this,t),Hwe(this,t),Jwe(this),Qwe(this,t);let n=e.passes;n.render&&(tFe(this,t),nFe(this,e),dFe(this),this._debugWireframe?lFe(e,this._commands):foe(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(iFe(this),foe(this,e,this._pickCommands))};Mp.prototype.isDestroyed=function(){return!1};Mp.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),me(this)};var Hx=Mp;function bd(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,l(this._center)||(l(this._boundingVolume)?this._center=h.clone(this._boundingVolume.center):this._center=h.clone(h.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=kn.BOTH}Object.defineProperties(bd.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});bd.packedBoxLength=M.packedLength+h.packedLength;bd.packedCylinderLength=M.packedLength+2;bd.packedEllipsoidLength=M.packedLength+h.packedLength;bd.packedSphereLength=h.packedLength+1;function uFe(e){let t=new Float64Array(M.packedLength+h.packedLength),n=0;return h.pack(e._center,t,n),n+=h.packedLength,M.pack(e._modelMatrix,t,n),t}function mFe(e,t){let n=0,i=t[n++],o=t[n++],r=e._boundingVolumes=new Array(o);for(let c=0;c<o;++c)r[c]=ce.unpack(t,n),n+=ce.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let d=B.unpack(t,n);n+=B.packedLength;let u=t[n++],m=t[n++],p=t[n++],g=new Array(p);for(let f=0;f<p;++f)g[f]=t[n++];a[c]=new nf({color:d,offset:u,count:m,batchIds:g})}return i}var hFe=new bi("createVectorTileGeometries",5),fFe=new B;function pFe(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,o=e._cylinderBatchIds,r=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,d=e._batchTableColors,u=e._packedBuffer;if(!l(d)){let f=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),f+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),o=e._cylinderBatchIds=o.slice(),f+=o.length),l(e._ellipsoids)&&(r=e._ellipsoids=r.slice(),s=e._ellipsoidBatchIds=s.slice(),f+=s.length),l(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),f+=c.length),d=e._batchTableColors=new Uint32Array(f);let x=e._batchTable;for(let _=0;_<f;++_){let C=x.getColor(_,fFe);d[_]=C.toRgba()}u=e._packedBuffer=uFe(e)}let m=[];l(t)&&m.push(t.buffer,n.buffer),l(i)&&m.push(i.buffer,o.buffer),l(r)&&m.push(r.buffer,s.buffer),l(a)&&m.push(a.buffer,c.buffer),m.push(d.buffer,u.buffer);let p={boxes:l(t)?t.buffer:void 0,boxBatchIds:l(t)?n.buffer:void 0,cylinders:l(i)?i.buffer:void 0,cylinderBatchIds:l(i)?o.buffer:void 0,ellipsoids:l(r)?r.buffer:void 0,ellipsoidBatchIds:l(r)?s.buffer:void 0,spheres:l(a)?a.buffer:void 0,sphereBatchIds:l(a)?c.buffer:void 0,batchTableColors:d.buffer,packedBuffer:u.buffer},g=e._verticesPromise=hFe.scheduleTask(p,m);return l(g)?g.then(function(f){if(e.isDestroyed())return;let x=new Float64Array(f.packedBuffer);mFe(e,x)===2?e._indices=new Uint16Array(f.indices):e._indices=new Uint32Array(f.indices),e._indexOffsets=new Uint32Array(f.indexOffsets),e._indexCounts=new Uint32Array(f.indexCounts),e._positions=new Float32Array(f.positions),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds),e._batchIds=new Uint16Array(f.batchIds),bFe(e),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)}):void 0}}function bFe(e){l(e._primitive)||(e._primitive=new Hx({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:y(e._pickObject,e)}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}bd.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};bd.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};bd.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};bd.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};bd.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=pFe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};bd.prototype.isDestroyed=function(){return!1};bd.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};var Np=bd;function of(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,xFe(this,i,o)}Object.defineProperties(of.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return l(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function gFe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function yFe(e,t){let n,i,o,r,s,a=y(e.BOXES_LENGTH,0),c=y(e.CYLINDERS_LENGTH,0),d=y(e.ELLIPSOIDS_LENGTH,0),u=y(e.SPHERES_LENGTH,0);if(a>0&&l(e.BOX_BATCH_IDS)){let f=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,f,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let f=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,f,c)}if(d>0&&l(e.ELLIPSOID_BATCH_IDS)){let f=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,f,d)}if(u>0&&l(e.SPHERE_BATCH_IDS)){let f=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,f,u)}let m=l(n)||l(i)||l(o)||l(r),p=a>0&&!l(n)||c>0&&!l(i)||d>0&&!l(o)||u>0&&!l(r);if(m&&p)throw new de("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)&&!l(r)){let f=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=f++;if(!l(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=f++;if(!l(o)&&d>0)for(o=new Uint16Array(d),s=0;s<d;++s)o[s]=f++;if(!l(r)&&u>0)for(r=new Uint16Array(u),s=0;s<u;++s)r[s]=f++}return{boxes:n,cylinders:i,ellipsoids:o,spheres:r}}var zx=Uint32Array.BYTES_PER_ELEMENT;function xFe(e,t,n){n=y(n,0);let i=new Uint8Array(t),o=new DataView(t);n+=zx;let r=o.getUint32(n,!0);if(r!==1)throw new de(`Only Geometry tile version 1 is supported. Version ${r} is not.`);n+=zx;let s=o.getUint32(n,!0);if(n+=zx,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=zx,a===0)throw new de("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=zx;let d=o.getUint32(n,!0);n+=zx;let u=o.getUint32(n,!0);n+=zx;let m=Wo(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let g,f;d>0&&(g=Wo(i,n,d),n+=d,u>0&&(f=new Uint8Array(t,n,u),f=new Uint8Array(f)));let x=y(m.BOXES_LENGTH,0),_=y(m.CYLINDERS_LENGTH,0),C=y(m.ELLIPSOIDS_LENGTH,0),V=y(m.SPHERES_LENGTH,0),L=x+_+C+V,Z=new Ap(e,L,g,f,gFe(e));if(e._batchTable=Z,L===0)return;let G=e.tile.computedTransform,I;l(m.RTC_CENTER)&&(I=h.unpack(m.RTC_CENTER),M.multiplyByPoint(G,I,I));let v=yFe(m,p);if(x>0||_>0||C>0||V>0){let P,w,F,b;if(x>0){let R=p.byteOffset+m.BOXES.byteOffset;P=new Float32Array(p.buffer,R,Np.packedBoxLength*x)}if(_>0){let R=p.byteOffset+m.CYLINDERS.byteOffset;w=new Float32Array(p.buffer,R,Np.packedCylinderLength*_)}if(C>0){let R=p.byteOffset+m.ELLIPSOIDS.byteOffset;F=new Float32Array(p.buffer,R,Np.packedEllipsoidLength*C)}if(V>0){let R=p.byteOffset+m.SPHERES.byteOffset;b=new Float32Array(p.buffer,R,Np.packedSphereLength*V)}return e._geometries=new Np({boxes:P,boxBatchIds:v.boxes,cylinders:w,cylinderBatchIds:v.cylinders,ellipsoids:F,ellipsoidBatchIds:v.ellipsoids,spheres:b,sphereBatchIds:v.spheres,center:I,modelMatrix:G,batchTable:Z,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function poe(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}of.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};of.prototype.getFeature=function(e){return poe(this),this._features[e]};of.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};of.prototype.applyStyle=function(e){poe(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};of.prototype.update=function(e,t){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0)};of.prototype.pick=function(e,t,n){};of.prototype.isDestroyed=function(){return!1};of.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),me(this)};var VI=of;var bfn=T(S(),1);var vrn=T(S(),1);var TH={};TH.encode2D=function(e,t,n){let i=Math.pow(2,e),o={x:t,y:n},r,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)r=(o.x&a)>0?1:0,s=(o.y&a)>0?1:0,c+=BigInt((3*r^s)*a*a),boe(i,o,r,s);return c};TH.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},o,r,s,a;for(s=1,a=t;s<n;s*=2)o=1&Number(a/BigInt(2)),r=1&Number(a^BigInt(o)),boe(s,i,o,r),i.x+=s*o,i.y+=s*r,a/=BigInt(4);return[i.x,i.y]};function boe(e,t,n,i){if(i!==0)return;n===1&&(t.x=e-1-t.x,t.y=e-1-t.y);let o=t.x;t.x=t.y,t.y=o}var uC=TH;var Drn=T(S(),1);var Kx=30,_Fe=1<<Kx,TFe=1<<Kx+1>>>0,SH=2*Kx+1,K0=4,xoe=[],_oe=[],SFe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],J0=1,mC=2,u5=[J0,0,0,J0|mC];function Qr(e){if(!zt.supportsBigInt())throw new de("S2 required BigInt support");this._cellId=e,this._level=Qr.getLevel(e)}Qr.fromToken=function(e){return new Qr(Qr.getIdFromToken(e))};Qr.isValidId=function(e){return!(e<=0||e>>BigInt(SH)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};Qr.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?Qr.isValidId(Qr.getIdFromToken(e)):!1};Qr.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};Qr.getTokenFromId=function(e){let t=Math.floor(WFe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};Qr.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return Kx-(t>>1)};Qr.prototype.getChild=function(e){let t=Coe(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new Qr(n)};Qr.prototype.getParent=function(){let e=Coe(this._cellId)<<BigInt(2);return new Qr(this._cellId&~e+BigInt(1)|e)};Qr.prototype.getParentAtLevel=function(e){let t=IFe(e);return new Qr(this._cellId&-t|t)};Qr.prototype.getCenter=function(e){e=y(e,ne.WGS84);let t=CFe(this._cellId,this._level);t=h.normalize(t,t);let n=new he.fromCartesian(t,ne.UNIT_SPHERE);return he.toCartesian(n,e,new h)};Qr.prototype.getVertex=function(e,t){t=y(t,ne.WGS84);let n=VFe(this._cellId,this._level,e);n=h.normalize(n,n);let i=new he.fromCartesian(n,ne.UNIT_SPHERE);return he.toCartesian(i,t,new h)};Qr.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),o=t.toString(2),r=Array(2*n-o.length+1).join("0"),s=Array(SH-2*n).join("0"),a=BigInt(`0b${i}${r}${o}1${s}`);return new Qr(a)};function CFe(e,t){let n=LFe(e,t);return RFe(n[0],n[1],n[2])}function VFe(e,t,n){let i=Toe(e,t),o=ZFe([i[1],i[2]],t),r=n>>1&1;return Soe(i[0],o[0][r^n&1],o[1][r])}function LFe(e,t){let n=Toe(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,d=(o<<1)+c,u=(r<<1)+c;return[i,d,u]}function Toe(e){xoe.length===0&&EFe();let t=Number(e>>BigInt(SH)),n=t&J0,i=(1<<K0)-1,o=0,r=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?Kx-7*K0:K0))-1;n+=Number(e>>BigInt(s*2*K0+1)&BigInt(c))<<2,n=_oe[n];let d=s*K0;o+=n>>K0+2<<d,r+=(n>>2&i)<<d,n&=J0|mC}return[t,o,r]}function RFe(e,t,n){let i=goe(t),o=goe(n),r=m5(i),s=m5(o);return Soe(e,r,s)}function Soe(e,t,n){switch(e){case 0:return new h(1,t,n);case 1:return new h(-t,1,n);case 2:return new h(-t,-n,1);case 3:return new h(-1,-n,-t);case 4:return new h(n,-1,-t);default:return new h(n,t,-1)}}function m5(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function goe(e){return 1/TFe*e}function ZFe(e,t){let n=[[],[]],i=GFe(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=m5(yoe(r)),n[o][1]=m5(yoe(s))}return n}function GFe(e){return 1<<Kx-e>>>0}function yoe(e){return 1/_Fe*e}function Q0(e,t,n,i,o,r){if(e===K0){let s=(t<<K0)+n;xoe[(s<<2)+i]=(o<<2)+r,_oe[(o<<2)+i]=(s<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let s=SFe[r];Q0(e,t+(s[0]>>1),n+(s[0]&1),i,o,r^u5[0]),Q0(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^u5[1]),Q0(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^u5[2]),Q0(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^u5[3])}}function EFe(){Q0(0,0,0,0,0,0),Q0(0,0,0,J0,0,J0),Q0(0,0,0,mC,0,mC),Q0(0,0,0,J0|mC,0,J0|mC)}function Coe(e){return e&~e+BigInt(1)}function IFe(e){return BigInt(1)<<BigInt(2*(Kx-e))}var XFe=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];function WFe(e){return XFe[(-e&e)%BigInt(67)]}var kp=Qr;var Khn=T(S(),1);var Yrn=T(S(),1);function PFe(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var oi=PFe;var Qrn=T(S(),1);function CH(e){let t=e.lengthBits,n=e.availableCount,i=e.constant,o=e.bitstream;if(l(i))n=t;else{let r=Math.ceil(t/8);if(o.length!==r)throw new de(`Availability bitstream must be exactly ${r} bytes long to store ${t} bits. Actual bitstream was ${o.length} bytes long.`);let s=y(e.computeAvailableCountEnabled,!1);!l(n)&&s&&(n=vFe(o,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=o}function vFe(e,t){let n=0;for(let i=0;i<t;i++){let o=i>>3,r=i%8;n+=e[o]>>r&1}return n}Object.defineProperties(CH.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});CH.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var hC=CH;var $rn=T(S(),1);function Up(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataTable,n=e.class,i=e.entityId,o=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=o.extensions,this._extras=o.extras}Object.defineProperties(Up.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Up.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};Up.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Up.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Up.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Up.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Up.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Up.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var fC=Up;var tsn=T(S(),1);var h5={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};h5.getBranchingFactor=function(e){switch(e){case h5.OCTREE:return 8;case h5.QUADTREE:return 4}};var jr=Object.freeze(h5);var usn=T(S(),1);var ssn=T(S(),1);function aa(){}Object.defineProperties(aa.prototype,{class:{get:function(){pe.throwInstantiationError()}}});aa.prototype.hasProperty=function(e){pe.throwInstantiationError()};aa.prototype.hasPropertyBySemantic=function(e){pe.throwInstantiationError()};aa.prototype.getPropertyIds=function(e){pe.throwInstantiationError()};aa.prototype.getProperty=function(e){pe.throwInstantiationError()};aa.prototype.setProperty=function(e,t){pe.throwInstantiationError()};aa.prototype.getPropertyBySemantic=function(e){pe.throwInstantiationError()};aa.prototype.setPropertyBySemantic=function(e,t){pe.throwInstantiationError()};aa.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let o=i[e];return!!(l(o)&&l(o.default))};aa.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};aa.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let o in e)e.hasOwnProperty(o)&&l(e[o])&&n.push(o);let i=t.properties;if(l(i))for(let o in i)i.hasOwnProperty(o)&&!l(e[o])&&l(i[o].default)&&n.push(o);return n};aa.getProperty=function(e,t,n){let i=n.properties[e],o=t[e];Array.isArray(o)&&(o=o.slice());let r=!0;if(o=i.handleNoData(o),!l(o)&&l(i.default))return o=Ye(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(l(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};aa.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let o,r=i.properties;return l(r)&&(o=r[e]),l(o)&&(t=o.packVectorAndMatrixTypes(t,!0),t=o.unapplyValueTransform(t),t=o.unnormalize(t)),n[e]=t,!0};aa.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return aa.getProperty(o.id,t,n)};aa.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?aa.setProperty(r.id,t,n,i):!1};var Mn=aa;function Dp(e){e=y(e,y.EMPTY_OBJECT);let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Dp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Dp.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,this._class)};Dp.prototype.hasPropertyBySemantic=function(e){return Mn.hasPropertyBySemantic(e,this._properties,this._class)};Dp.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,this._class,e)};Dp.prototype.getProperty=function(e){return Mn.getProperty(e,this._properties,this._class)};Dp.prototype.setProperty=function(e,t){return Mn.setProperty(e,t,this._properties,this._class)};Dp.prototype.getPropertyBySemantic=function(e){return Mn.getPropertyBySemantic(e,this._properties,this._class)};Dp.prototype.setPropertyBySemantic=function(e,t){return Mn.setPropertyBySemantic(e,t,this._properties,this._class)};var LI=Dp;var nan=T(S(),1);var Jsn=T(S(),1);var bsn=T(S(),1);var Nt={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Nt.getMinimum=function(e){switch(e){case Nt.INT8:return-128;case Nt.UINT8:return 0;case Nt.INT16:return-32768;case Nt.UINT16:return 0;case Nt.INT32:return-2147483648;case Nt.UINT32:return 0;case Nt.INT64:return zt.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Nt.UINT64:return zt.supportsBigInt()?BigInt(0):0;case Nt.FLOAT32:return-34028234663852886e22;case Nt.FLOAT64:return-Number.MAX_VALUE}};Nt.getMaximum=function(e){switch(e){case Nt.INT8:return 127;case Nt.UINT8:return 255;case Nt.INT16:return 32767;case Nt.UINT16:return 65535;case Nt.INT32:return 2147483647;case Nt.UINT32:return 4294967295;case Nt.INT64:return zt.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Nt.UINT64:return zt.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Nt.FLOAT32:return 34028234663852886e22;case Nt.FLOAT64:return Number.MAX_VALUE}};Nt.isIntegerType=function(e){switch(e){case Nt.INT8:case Nt.UINT8:case Nt.INT16:case Nt.UINT16:case Nt.INT32:case Nt.UINT32:case Nt.INT64:case Nt.UINT64:return!0;default:return!1}};Nt.isUnsignedIntegerType=function(e){switch(e){case Nt.UINT8:case Nt.UINT16:case Nt.UINT32:case Nt.UINT64:return!0;default:return!1}};Nt.isVectorCompatible=function(e){switch(e){case Nt.INT8:case Nt.UINT8:case Nt.INT16:case Nt.UINT16:case Nt.INT32:case Nt.UINT32:case Nt.FLOAT32:case Nt.FLOAT64:return!0;default:return!1}};Nt.normalize=function(e,t){return Math.max(Number(e)/Number(Nt.getMaximum(t)),-1)};Nt.unnormalize=function(e,t){let n=Nt.getMaximum(t),i=Nt.isUnsignedIntegerType(t)?0:-n;return e=W.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Nt.INT64||t===Nt.UINT64)&&zt.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};Nt.applyValueTransform=function(e,t,n){return n*e+t};Nt.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};Nt.getSizeInBytes=function(e){switch(e){case Nt.INT8:case Nt.UINT8:return 1;case Nt.INT16:case Nt.UINT16:return 2;case Nt.INT32:case Nt.UINT32:return 4;case Nt.INT64:case Nt.UINT64:return 8;case Nt.FLOAT32:return 4;case Nt.FLOAT64:return 8}};Nt.fromComponentDatatype=function(e){switch(e){case Q.BYTE:return Nt.INT8;case Q.UNSIGNED_BYTE:return Nt.UINT8;case Q.SHORT:return Nt.INT16;case Q.UNSIGNED_SHORT:return Nt.UINT16;case Q.INT:return Nt.INT32;case Q.UNSIGNED_INT:return Nt.UINT32;case Q.FLOAT:return Nt.FLOAT32;case Q.DOUBLE:return Nt.FLOAT64}};Nt.toComponentDatatype=function(e){switch(e){case Nt.INT8:return Q.BYTE;case Nt.UINT8:return Q.UNSIGNED_BYTE;case Nt.INT16:return Q.SHORT;case Nt.UINT16:return Q.UNSIGNED_SHORT;case Nt.INT32:return Q.INT;case Nt.UINT32:return Q.UNSIGNED_INT;case Nt.FLOAT32:return Q.FLOAT;case Nt.FLOAT64:return Q.DOUBLE}};var Ht=Object.freeze(Nt);var Asn=T(S(),1);var Vsn=T(S(),1);var Mo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};Mo.isVectorType=function(e){switch(e){case Mo.VEC2:case Mo.VEC3:case Mo.VEC4:return!0;default:return!1}};Mo.isMatrixType=function(e){switch(e){case Mo.MAT2:case Mo.MAT3:case Mo.MAT4:return!0;default:return!1}};Mo.getComponentCount=function(e){switch(e){case Mo.SCALAR:case Mo.STRING:case Mo.ENUM:case Mo.BOOLEAN:return 1;case Mo.VEC2:return 2;case Mo.VEC3:return 3;case Mo.VEC4:return 4;case Mo.MAT2:return 4;case Mo.MAT3:return 9;case Mo.MAT4:return 16}};Mo.getMathType=function(e){switch(e){case Mo.VEC2:return D;case Mo.VEC3:return h;case Mo.VEC4:return se;case Mo.MAT2:return wi;case Mo.MAT3:return $;case Mo.MAT4:return M;default:return}};var Rt=Object.freeze(Mo);function Xa(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.type,i=e.componentType,o=e.enumType,r=l(i)&&Ht.isIntegerType(i)&&y(e.normalized,!1);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=o,this._valueType=l(o)?o.valueType:i,this._isArray=y(e.isArray,!1),this._isVariableLengthArray=y(e.isVariableLengthArray,!1),this._arrayLength=e.arrayLength,this._min=Ye(e.min,!0),this._max=Ye(e.max,!0),this._normalized=r;let s=Ye(e.offset,!0),a=Ye(e.scale,!0),c=l(s)||l(a),d=!0;l(s)||(s=this.expandConstant(0,d)),l(a)||(a=this.expandConstant(1,d)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=Ye(e.noData,!0),this._default=Ye(e.default,!0),this._required=y(e.required,!0),this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}Xa.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.property,i=wFe(n),o=FFe(n,e.enums),r;return l(i)?i?r=l(n.optional)?!n.optional:!0:r=y(n.required,!1):r=!1,new Xa({id:t,type:o.type,componentType:o.componentType,enumType:o.enumType,isArray:o.isArray,isVariableLengthArray:o.isVariableLengthArray,arrayLength:o.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:r,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:i})};Object.defineProperties(Xa.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function wFe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===Rt.SCALAR||Rt.isMatrixType(t)||Rt.isVectorType(t))return!1;if(l(Ht[t]))return!0;if(l(e.noData)||l(e.scale)||l(e.offset)||l(e.required)||l(e.count)||l(e.array)||l(e.optional))return!1}function FFe(e,t){let n=e.type,i=e.componentType,o=n==="ARRAY",r,s,a;o?(r=!0,s=e.componentCount,a=!l(s)):e.array?(r=!0,s=e.count,a=!l(e.count)):(r=!1,s=void 0,a=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===Rt.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&i===Rt.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===Rt.SCALAR||Rt.isMatrixType(n)||Rt.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===Rt.BOOLEAN||n===Rt.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&(i===Rt.BOOLEAN||i===Rt.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(Ht[i]))return{type:Rt.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(Ht[n]))return{type:Rt.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:a,arrayLength:s}}Xa.prototype.normalize=function(e){return this._normalized?VH(e,this._valueType,Ht.normalize):e};Xa.prototype.unnormalize=function(e){return this._normalized?VH(e,this._valueType,Ht.unnormalize):e};Xa.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Xa.valueTransformInPlace(e,this._offset,this._scale,Ht.applyValueTransform)};Xa.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Xa.valueTransformInPlace(e,this._offset,this._scale,Ht.unapplyValueTransform)};Xa.prototype.expandConstant=function(e,t){t=y(t,!1);let n=this._isArray,i=this._arrayLength,o=Rt.getComponentCount(this._type),r=n&&o>1;if(!n&&o===1)return e;if(!n)return new Array(o).fill(e);if(!r)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*o).fill(e);let s=new Array(o).fill(e);return new Array(this._arrayLength).fill(s)};Xa.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!Zoe(e,t))return e};function Zoe(e,t){if(!Array.isArray(e))return e===t;if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Zoe(e[n],t[n]))return!1;return!0}Xa.prototype.unpackVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=Rt.getMathType(this._type),i=this._isArray,o=Rt.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};Xa.prototype.packVectorAndMatrixTypes=function(e,t){t=y(t,!1);let n=Rt.getMathType(this._type),i=this._isArray,o=Rt.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};Xa.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?AFe(this,e):Goe(this,e)};function AFe(e,t){if(!Array.isArray(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i<n;i++){let o=Goe(e,t[i]);if(l(o))return o}}function Goe(e,t){let n=e._type,i=e._componentType,o=e._enumType,r=e._normalized;return Rt.isVectorType(n)?MFe(t,n,i):Rt.isMatrixType(n)?NFe(t,n,i):n===Rt.STRING?kFe(t):n===Rt.BOOLEAN?UFe(t):n===Rt.ENUM?DFe(t,o):BFe(t,i,r)}function MFe(e,t,n){if(!Ht.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===Rt.VEC2&&!(e instanceof D))return`vector value ${e} must be a Cartesian2`;if(t===Rt.VEC3&&!(e instanceof h))return`vector value ${e} must be a Cartesian3`;if(t===Rt.VEC4&&!(e instanceof se))return`vector value ${e} must be a Cartesian4`}function NFe(e,t,n){if(!Ht.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===Rt.MAT2&&!(e instanceof wi))return`matrix value ${e} must be a Matrix2`;if(t===Rt.MAT3&&!(e instanceof $))return`matrix value ${e} must be a Matrix3`;if(t===Rt.MAT4&&!(e instanceof M))return`matrix value ${e} must be a Matrix4`}function kFe(e){if(typeof e!="string")return f5(e,Rt.STRING)}function UFe(e){if(typeof e!="boolean")return f5(e,Rt.BOOLEAN)}function DFe(e,t){let n=typeof e;if(l(t))return n!=="string"||!l(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function BFe(e,t,n){let i=typeof e;switch(t){case Ht.INT8:case Ht.UINT8:case Ht.INT16:case Ht.UINT16:case Ht.INT32:case Ht.UINT32:case Ht.FLOAT32:case Ht.FLOAT64:return i!=="number"?f5(e,t):isFinite(e)?Loe(e,t,n):Roe(e,t);case Ht.INT64:case Ht.UINT64:return i!=="number"&&i!=="bigint"?f5(e,t):i==="number"&&!isFinite(e)?Roe(e,t):Loe(e,t,n)}}function f5(e,t){return`value ${e} does not match type ${t}`}function Voe(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function Loe(e,t,n){if(n){let i=Ht.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?Voe(e,t,n):void 0}if(e<Ht.getMinimum(t)||e>Ht.getMaximum(t))return Voe(e,t,n)}function Roe(e,t){return`value ${e} of type ${t} must be finite`}function VH(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=VH(e[i],t,n);return e}Xa.valueTransformInPlace=function(e,t,n,i){if(!Array.isArray(e))return i(e,t,n);for(let o=0;o<e.length;o++)e[o]=Xa.valueTransformInPlace(e[o],t[o],n[o],i);return e};var j0=Xa;function RI(e){e=y(e,y.EMPTY_OBJECT);let t=e.count,n=e.property,i=e.classProperty,o=e.bufferViews,r=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,d=i.enumType,u=r===Rt.STRING,m=r===Rt.BOOLEAN,p=0,g;if(a){let b=y(n.arrayOffsetType,n.offsetType);b=y(Ht[b],Ht.UINT32);let R=y(n.arrayOffsets,n.arrayOffsetBufferView);g=new LH(o[R],b,t+1),p+=g.typedArray.byteLength}let f=Rt.getComponentCount(r),x;a?x=g.get(t)-g.get(0):s?x=t*i.arrayLength:x=t;let _=f*x,C;if(u){let b=y(n.stringOffsetType,n.offsetType);b=y(Ht[b],Ht.UINT32);let R=y(n.stringOffsets,n.stringOffsetBufferView);C=new LH(o[R],b,_+1),p+=C.typedArray.byteLength}(u||m)&&(c=Ht.UINT8);let V;u?V=C.get(_)-C.get(0):m?V=Math.ceil(_/8):V=_;let L=y(n.values,n.bufferView),Z=new LH(o[L],c,V);p+=Z.typedArray.byteLength;let G=n.offset,I=n.scale,v=i.hasValueTransform||l(G)||l(I);G=y(G,i.offset),I=y(I,i.scale),G=Eoe(G),I=Eoe(I);let P,w,F=this;u?P=function(b){return HFe(b,F._values,F._stringOffsets)}:m?(P=function(b){return zFe(b,F._values)},w=function(b,R){KFe(b,F._values,R)}):l(d)?(P=function(b){let R=F._values.get(b);return d.namesByValue[R]},w=function(b,R){let E=d.valuesByName[R];F._values.set(b,E)}):(P=function(b){return F._values.get(b)},w=function(b,R){F._values.set(b,R)}),this._arrayOffsets=g,this._stringOffsets=C,this._values=Z,this._classProperty=i,this._count=t,this._vectorComponentCount=f,this._min=n.min,this._max=n.max,this._offset=G,this._scale=I,this._hasValueTransform=v,this._getValue=P,this._setValue=w,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(RI.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}}});RI.prototype.get=function(e){let t=OFe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=nAe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};RI.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=iAe(this,t),t=n.unnormalize(t),YFe(this,e,t)};RI.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function Eoe(e){if(!Array.isArray(e))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?t.push.apply(t,i):t.push(i)}return t}function OFe(e,t){Xoe(e)&&Woe(e);let n=e._classProperty,i=n.isArray,o=n.type,r=Rt.getComponentCount(o);if(l(e._unpackedValues)){let s=e._unpackedValues[t];return i?Ye(s,!0):s}return!i&&r===1?e._getValue(t):Ioe(e,n,t)}function Ioe(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let s=Rt.getComponentCount(t.type);i*=s,o*=s}else{let a=y(t.arrayLength,1)*e._vectorComponentCount;i=n*a,o=a}let r=new Array(o);for(let s=0;s<o;s++)r[s]=e._getValue(i+s);return r}function YFe(e,t,n){eAe(e,t,n)&&Woe(e);let i=e._classProperty,o=i.isArray,r=i.type,s=Rt.getComponentCount(r);if(l(e._unpackedValues)){i.isArray&&(n=Ye(n,!0)),e._unpackedValues[t]=n;return}if(!o&&s===1){e._setValue(t,n);return}let a,c;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-a;else{let u=y(i.arrayLength,1)*e._vectorComponentCount;a=t*u,c=u}for(let d=0;d<c;++d)e._setValue(a+d,n[d])}function HFe(e,t,n){let i=n.get(e),o=n.get(e+1)-i;return Zl(t.typedArray,i,o)}function zFe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function KFe(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<<o:t.typedArray[i]&=~(1<<o)}function JFe(e,t){let n=t.dataView,i=e*8,o=0,r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=c*Math.pow(256,a)}return r&&(o=-o),o}function QFe(e,t){let n=t.dataView,i=e*8,o=BigInt(0),r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=BigInt(c)*(BigInt(1)<<BigInt(a*8))}return r&&(o=-o),o}function jFe(e,t){let n=t.dataView,i=e*8,o=n.getUint32(i,!0),r=n.getUint32(i+4,!0);return o+4294967296*r}function qFe(e,t){let n=t.dataView,i=e*8,o=BigInt(n.getUint32(i,!0)),r=BigInt(n.getUint32(i+4,!0));return o+BigInt(4294967296)*r}function $Fe(e){switch(e){case Ht.INT8:return Q.BYTE;case Ht.UINT8:return Q.UNSIGNED_BYTE;case Ht.INT16:return Q.SHORT;case Ht.UINT16:return Q.UNSIGNED_SHORT;case Ht.INT32:return Q.INT;case Ht.UINT32:return Q.UNSIGNED_INT;case Ht.FLOAT32:return Q.FLOAT;case Ht.FLOAT64:return Q.DOUBLE}}function Xoe(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===Rt.STRING||i===Ht.INT64&&!zt.supportsBigInt64Array()||i===Ht.UINT64&&!zt.supportsBigUint64Array()}function eAe(e,t,n){if(Xoe(e))return!0;let i=e._arrayOffsets;if(l(i)){let o=i.get(t+1)-i.get(t),r=n.length;if(o!==r)return!0}return!1}function Woe(e){e._unpackedValues=tAe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function tAe(e){let t=e._count,n=new Array(t),i=e._classProperty,o=i.isArray,r=i.type,s=Rt.getComponentCount(r);if(!o&&s===1){for(let a=0;a<t;++a)n[a]=e._getValue(a);return n}for(let a=0;a<t;a++)n[a]=Ioe(e,i,a);return n}function nAe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:j0.valueTransformInPlace(t,e._offset,e._scale,Ht.applyValueTransform)}function iAe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:j0.valueTransformInPlace(t,e._offset,e._scale,Ht.unapplyValueTransform)}function LH(e,t,n){let i=this,o,r,s;if(t===Ht.INT64)zt.supportsBigInt()?zt.supportsBigInt64Array()?(o=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return QFe(a,i)}):(St("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return JFe(a,i)});else if(t===Ht.UINT64)zt.supportsBigInt()?zt.supportsBigUint64Array()?(o=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return qFe(a,i)}):(St("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return jFe(a,i)});else{let a=$Fe(t);o=Q.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,d){i.typedArray[c]=d}}l(r)||(r=function(a){return i.typedArray[a]}),this.typedArray=o,this.dataView=new DataView(o.buffer,o.byteOffset),this.get=r,this.set=s,this._componentType=t}var ZI=RI;function Fm(e){e=y(e,y.EMPTY_OBJECT);let t=e.count,n=e.class,i=0,o={};if(l(e.properties)){for(let r in e.properties)if(e.properties.hasOwnProperty(r)){let s=new ZI({count:t,property:e.properties[r],classProperty:n.properties[r],bufferViews:e.bufferViews});o[r]=s,i+=s.byteLength}}this._count=t,this._class=n,this._properties=o,this._byteLength=i}Object.defineProperties(Fm.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}});Fm.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,this._class)};Fm.prototype.hasPropertyBySemantic=function(e){return Mn.hasPropertyBySemantic(e,this._properties,this._class)};Fm.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,this._class,e)};Fm.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=oAe(this._class,t),i};Fm.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};Fm.prototype.getPropertyBySemantic=function(e,t){let n,i=this._class.propertiesBySemantic;if(l(i)&&(n=i[t]),l(n))return this.getProperty(e,n.id)};Fm.prototype.setPropertyBySemantic=function(e,t,n){let i,o=this._class.propertiesBySemantic;return l(o)&&(i=o[t]),l(i)?this.setProperty(e,i.id,n):!1};Fm.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};Fm.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function oAe(e,t){let n=e.properties;if(!l(n))return;let i=n[t];if(l(i)&&l(i.default)){let o=i.default;return i.isArray&&(o=Ye(o,!0)),o=i.normalize(o),i.unpackVectorAndMatrixTypes(o)}}var Il=Fm;var vhn=T(S(),1);var ban=T(S(),1);var can=T(S(),1);function q0(){}Object.defineProperties(q0.prototype,{cacheKey:{get:function(){pe.throwInstantiationError()}}});q0.prototype.load=function(){pe.throwInstantiationError()};q0.prototype.unload=function(){};q0.prototype.process=function(e){return!1};q0.prototype.getError=function(e,t){l(t)&&l(t.message)&&(e+=`
  5530. ${t.message}`);let n=new de(e);return l(t)&&(n.stack=`Original stack:
  5531. ${t.stack}
  5532. Handler stack:
  5533. ${n.stack}`),n};q0.prototype.isDestroyed=function(){return!1};q0.prototype.destroy=function(){return this.unload(),me(this)};var Hi=q0;var dan=T(S(),1),rAe={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},yt=Object.freeze(rAe);function Bp(e){e=y(e,y.EMPTY_OBJECT);let t=e.typedArray,n=e.resource,i=e.cacheKey;this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(Bp.prototype=Object.create(Hi.prototype),Bp.prototype.constructor=Bp);Object.defineProperties(Bp.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});Bp.prototype.load=async function(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=sAe(this),this._promise)};async function sAe(e){let t=e._resource;e._state=yt.LOADING;try{let n=await Bp._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=yt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=yt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}Bp._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()};Bp.prototype.unload=function(){this._typedArray=void 0};var Jx=Bp;var Uan=T(S(),1);var Ean=T(S());var xan=T(S()),gan=function(){var e="b9H79TebbbeJq9Geueu9Geub9Gbb9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiKLdilevlevlooroowwvwbDDbelve9Weiiviebeoweuec:G:Qdkr;RiOo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbe8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbdE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UbiY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbl8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbv8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UboE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbra9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbwL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbDK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbqL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbkE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9Wbsa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbzK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbHl79IV9RbODwebcekdQXq;A9pLdbk;QqeKu8Jjjjjbcjo9Rgv8Kjjjjbcbhodnalcefae0mbabcbRbN:kjjbc:GeV86bbavcjdfcbcjdzNjjjb8AdnaiTmbavcjdfadalz:tjjjb8Akabaefhrabcefhwavalfcbcbcjdal9RalcFe0EzNjjjb8Aavavcjdfalz:tjjjbhDcj;abal9Uc;WFbGgecjdaecjd6Ehqcbhkindndnaiak9nmbaDcjlfcbcjdzNjjjb8Aaqaiak9Rakaqfai6Egxcsfgecl4cifcd4hmadakal2fhPdndndnaec9WGgsTmbcbhzaPhHawhOxekdnaxmbalheinaraw9Ram6miawcbamzNjjjbamfhwaecufgembxvkkcbhAaPhOinaDaAfRbbhCaDcjlfheaOhoaxhXinaeaoRbbgQaC9RgCcetaCcKtcK91cr4786bbaoalfhoaecefheaQhCaXcufgXmbkaraw9Ram6mdaOcefhOawcbamzNjjjbamfhwaAcefgAal9hmbxlkkindnaxTmbaDazfRbbhCaDcjlfheaHhoaxhXinaeaoRbbgQaC9RgCcetaCcKtcK91cr4786bbaoalfhoaecefheaQhCaXcufgXmbkkaraO9Ram6mearaOcbamzNjjjbgLamfgw9RcK6mecbhKaDcjlfhOinaDcjlfaKfhYcwhAczhQceheindndnaegXce9hmbcuhoaYRbbmecbhodninaogecsSmeaecefhoaOaefcefRbbTmbkkcucbaecs6EhoxekaXcethocuaXtc;:bGcFb7hCcbheinaoaCaOaefRbb9nfhoaecefgecz9hmbkkaoaQaoaQ6geEhQaXaAaeEhAaXcetheaXcl6mbkdndndndnaAcufPdiebkaLaKco4fgeaeRbbcdciaAclSEaKci4coGtV86bbaAcw9hmeawaY8Pbb83bbawcwfaYcwf8Pbb83bbawczfhwxdkaLaKco4fgeaeRbbceaKci4coGtV86bbkdncwaA9Tg8Ambinawcb86bbawcefhwxbkkcuaAtcu7hYcbhEaOh3ina3hea8AhCcbhoinaeRbbgQaYcFeGgXaQaX6EaoaAtVhoaecefheaCcufgCmbkawao86bba3a8Afh3awcefhwaEa8AfgEcz6mbkcbheindnaOaefRbbgoaX6mbawao86bbawcefhwkaecefgecz9hmbkkdnaKczfgKas9pmbaOczfhOaraw9RcL0mekkaKas6meawTmeaHcefhHawhOazcefgzalSmixbkkcbhoxikcbhoaraw9Ralcaalca0E6mddnalc8F0mbawcbcaal9RgezNjjjbaefhwkawaDcjdfalz:tjjjbalfab9RhoxdkaDaPaxcufal2falz:tjjjb8Aaxakfhkawmbkcbhokavcjof8Kjjjjbaok9heeuaecaaeca0Eabcj;abae9Uc;WFbGgdcjdadcjd6Egdfcufad9Uae2adcl4cifcd4adV2fcefkmbcbabBdN:kjjbk:zse5u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbyd:e:kjjbgrc;GeV86bbalc;abfcFecjezNjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgLydbhKaLcwfydbhYaLclfydbh8AcbhEdndndninalc;abfavcsGcitfgoydlh3dndndnaoydbgoaK9hmba3a8ASmekdnaoa8A9hmba3aY9hmbaEcefhExekaoaY9hmea3aK9hmeaEcdfhEkaEc870mdaXcufhvaLaEciGcx2goc:y1jjbfydbcdtfydbh3aLaocN1jjbfydbcdtfydbh8AaLaoc:q1jjbfydbcdtfydbhKcbhodnindnalavcsGcdtfydba39hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaOa3aOSgvaYce9iaYaH9oVgoGfhOdndndncbcsavEaYaoEgvcs9hmbarce9imba3a3aAa3cefaASgvEgAcefSmecmcsavEhvkasavaEcdtc;WeGV86bbavcs9hmea3aA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbka3hAxvkcPhvasaEcdtcPV86bba3hAkavTmiavaH9omicdhocehEaQhYxlkavcufhvaEclfgEc;ab9hmbkkdnaLceaYaOSceta8AaOSEcx2gvc:q1jjbfydbcdtfydbgKTaLavcN1jjbfydbcdtfydbg8AceSGaLavc:y1jjbfydbcdtfydbg3cdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhYxdkcuhYaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydba39hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaKaOSg8EfhLdndnaYcm0mbaYcefhYxekcbcsa8AaLSgvEhYaLavfhLkdndnaEcm0mbaEcefhExekcbcsa3aLSgvEhEaLavfhLkc9:cua8EEh8FcbhvaEaYcltVgacFeGhodndndninavcj1jjbfRbbaoSmeavcefgvcz9hmbxdkka5aKaO9havcm0VVmbasavc;WeV86bbxekasa8F86bbaeaa86bbaecefhekdna8EmbaKaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaKhAkdnaYcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmba3aA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka3hAkalaXcdtfaKBdbaXcefcsGhvdndnaYPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfa3BdbavcefcsGhvkcihoalc;abfaQcitfgEaKBdlaEa8ABdbaQcefcsGhYcdhEavhXaLhOxekcdhoalaXcdtfa3BdbcehEaXcefcsGhXaQhYkalc;abfaYcitfgva8ABdlava3Bdbalc;abfaQaEfcsGcitfgva3BdlavaKBdbascefhsaQaofcsGhQaCcifgCai6mbkkcbhvaeaP0mbcbhvinaeavfavcj1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd:e:kjjbk:ydewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRb:e:kjjbc;qeV86bbal9cb83iwabcefhoabaefc98fhrdnaiTmbcbhwcbhDindnaoar6mbcbskadaDcdtfydbgqalcwfawaqav9Rgvavc8F91gv7av9Rc507gwcdtfgkydb9Rgvc8E91c9:Gavcdt7awVhvinaoavcFb0gecrtavcFbGV86bbavcr4hvaocefhoaembkakaqBdbaqhvaDcefgDai9hmbkkcbhvaoar0mbaocbBbbaoab9RclfhvkavkBeeucbhddninadcefgdc8F0meceadtae6mbkkadcwfcFeGcr9Uab2cvfk:bvli99dui99ludnaeTmbcuadcetcuftcu7:Yhvdndncuaicuftcu7:YgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhrdndnakJbbbb9GTmbaxhqxekJbbjZar:l:tgqaq:maxJbbbb9GEhqJbbjZax:l:tgxax:marJbbbb9GEhrkdndnalcxfIdbgxJbbj:;axJbbj:;9GEgkJbbjZakJbbjZ9FEavNJbbbZJbbb:;axJbbbb9GEMgx:lJbbb9p9DTmbax:Ohmxekcjjjj94hmkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEaoNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaifgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaDfgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkalczfhlaiclfhiaDcwfhDaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:YgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoalaicd7cdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNaoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk;3viDue99eu8Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndndnavcd9hmbadcl6meaohwarhDinawc:CuBdbawclfhwaDcufgDmbkaeTmiadcl6mdarcdthqalhkcbhxinaohwakhDarhminawawydbgPcbaDIdbgs:8cL4cFeGc:cufasJbbbb9BEgzaPaz9kEBdbaDclfhDawclfhwamcufgmmbkakaqfhkaxcefgxaeSmixbkkaeTmdxekaeTmekarcdthkavce9hhqadcl6hdcbhxindndndnaqmbadmdc:CuhDalhwarhminaDcbawIdbgs:8cL4cFeGc:cufasJbbbb9BEgPaDaP9kEhDawclfhwamcufgmmbxdkkc:CuhDdndnavPleddbdkadmdaohwalhmarhPinawcbamIdbgs:8cL4cFeGgzc;:bazc;:b9kEc:cufasJbbbb9BEBdbamclfhmawclfhwaPcufgPmbxdkkadmecbhwarhminaoawfcbalawfIdbgs:8cL4cFeGgPc8AaPc8A9kEc:cufasJbbbb9BEBdbawclfhwamcufgmmbkkadmbcbhwarhPinaDhmdnavceSmbaoawfydbhmkdndnalawfIdbgscjjj;8iamai9RcefgmcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:Ohzxekcjjjj94hzkabawfazcFFFrGamcKtVBdbawclfhwaPcufgPmbkkabakfhbalakfhlaxcefgxae9hmbkkaocjdf8Kjjjjbk;HqdCui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;KbzNjjjb8AcbhodnadTmbcbhoaiTmbdnabae9hmbavcuadcdtgradcFFFFi0Ecbyd:m:kjjbHjjjjbbgeBd:SeavceBd:mdaeabarz:tjjjb8Akavc:GefcwfcbBdbav9cb83i:Geavc:Gefaeadaiavc:Sefz:njjjbavyd:Gehwadci9UgDcbyd:m:kjjbHjjjjbbhravc:Sefavyd:mdgqcdtfarBdbavaqcefgkBd:mdarcbaDzNjjjbhxavc:SefakcdtfcuaicdtaicFFFFi0Ecbyd:m:kjjbHjjjjbbgmBdbavaqcdfgPBd:mdawhramhkinakalIdbalarydbgscwascw6Ecdtfc;ebfIdbMUdbarclfhrakclfhkaicufgimbkavc:SefaPcdtfcuaDcdtadcFFFF970Ecbyd:m:kjjbHjjjjbbgPBdbdnadci6mbaehraPhkaDhiinakamarydbcdtfIdbamarclfydbcdtfIdbMamarcwfydbcdtfIdbMUdbarcxfhrakclfhkaicufgimbkkaqcifhoavc;qbfhzavhravyd:KehHavyd:OehOcbhscbhkcbhAcehCinarhXcihQaeakci2gLcdtfgrydbhdarclfydbhqabaAcx2fgicwfarcwfydbgKBdbaiclfaqBdbaiadBdbaxakfce86bbazaKBdwazaqBdlazadBdbaPakcdtfcbBdbdnasTmbcihQaXhiinazaQcdtfaiydbgrBdbaQaraK9harad9haraq9hGGfhQaiclfhiascufgsmbkkaAcefhAcbhsinaOaHaeasaLfcdtfydbcdtgifydbcdtfgKhrawaifgqydbgdhidnadTmbdninarydbakSmearclfhraicufgiTmdxbkkaraKadcdtfc98fydbBdbaqaqydbcufBdbkascefgsci9hmbkdndnaQTmbcuhkJbbbbhYcbhqavyd:KehKavyd:OehLindndnawazaqcdtfydbcdtgsfydbgrmbaqcefhqxekaqcs0hiamasfgdIdbh8AadalcbaqcefgqaiEcdtfIdbalarcwarcw6Ecdtfc;ebfIdbMgEUdbaEa8A:thEarcdthiaLaKasfydbcdtfhrinaParydbgscdtfgdaEadIdbMg8AUdba8AaYaYa8A9DgdEhYasakadEhkarclfhraic98fgimbkkaqaQ9hmbkakcu9hmekaCaD9pmdindnaxaCfRbbmbaChkxdkaDaCcefgC9hmbxikkaQczaQcz6EhsazhraXhzakcu9hmbkkaocdtavc:Seffc98fhrdninaoTmearydbcbyd1:kjjbH:bjjjbbarc98fhraocufhoxbkkavc:qdf8Kjjjjbk;IlevucuaicdtgvaicFFFFi0Egocbyd:m:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavzNjjjb8Aadci9UhDdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic:01jjbz:mjjjbkQbabaeadaic:C:jjjbz:mjjjbk9DeeuabcFeaicdtzNjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Wkivuo99lu8Jjjjjbc;W;Gb9Rgl8Kjjjjbcbhvalcj;Gbfcbc;KbzNjjjb8AalcuadcdtadcFFFFi0Egocbyd:m:kjjbHjjjjbbgrBdj9GalceBd;G9GalcFFF;7rBdwal9cFFF;7;3FF:;Fb83dbalcFFF97Bd;S9Gal9cFFF;7FFF:;u83d;K9Gaicd4hwdndnadmbJFFuFhDJFFuuhqJFFuuhkJFFuFhxJFFuuhmJFFuFhPxekawcdthsaehzincbhiinalaifgHazaifIdbgDaHIdbgxaxaD9EEUdbalc;K;GbfaifgHaDaHIdbgxaxaD9DEUdbaiclfgicx9hmbkazasfhzavcefgvad9hmbkalIdwhqalId;S9GhDalIdlhkalId;O9GhxalIdbhmalId;K9GhPkdndnadTmbJbbbbJbbjZJbbbbaPam:tgPaPJbbbb9DEgPaxak:tgxaxaP9DEgxaDaq:tgDaDax9DEgD:vaDJbbbb9BEhDawcdthsarhHadhzindndnaDaeIdbam:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcv2c;j:KM;jbGhvdndnaDaeclfIdbak:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcq2cM;j:KMeGavVhvdndnaDaecwfIdbaq:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaHavaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcC2c:KM;j:KdGVBdbaeasfheaHclfhHazcufgzmbkalcbcj;GbzNjjjbhiarhHadheinaiaHydbgzcFrGcx2fgvavydbcefBdbaiazcq4cFrGcx2fgvavydlcefBdlaiazcC4cFrGcx2fgzazydwcefBdwaHclfhHaecufgembxdkkalcbcj;GbzNjjjb8AkcbhHcbhzcbhecbhvinalaHfgiydbhsaiazBdbaicwfgwydbhOawavBdbaiclfgiydbhwaiaeBdbasazfhzaOavfhvawaefheaHcxfgHcj;Gb9hmbkcbhHalaocbyd:m:kjjbHjjjjbbgiBd:e9GdnadTmbabhzinazaHBdbazclfhzadaHcefgH9hmbkabhHadhzinalaraHydbgecdtfydbcFrGcx2fgvavydbgvcefBdbaiavcdtfaeBdbaHclfhHazcufgzmbkaihHadhzinalaraHydbgecdtfydbcq4cFrGcx2fgvavydlgvcefBdlabavcdtfaeBdbaHclfhHazcufgzmbkabhHadhzinalaraHydbgecdtfydbcC4cFrGcx2fgvavydwgvcefBdwaiavcdtfaeBdbaHclfhHazcufgzmbkcbhHinabaiydbcdtfaHBdbaiclfhiadaHcefgH9hmbkkclhidninaic98Smealcj;Gbfaifydbcbyd1:kjjbH:bjjjbbaic98fhixbkkalc;W;Gbf8Kjjjjbk9teiucbcbyd:q:kjjbgeabcifc98GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:kjjbgeabcrfc94GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:q:kjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:q:kjjbfgdBd:q:kjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk:Iddbcjwk:edb4:h9w9N94:P:gW:j9O:ye9Pbbbbbbebbbdbbbebbbdbbbbbbbdbbbbbbbebbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:bc:eqkzebbbebbbdbbba:vbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(g){n=g.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(0),n.exports.meshopt_encodeIndexVersion(1)});function o(g){for(var f=new Uint8Array(g.length),x=0;x<g.length;++x){var _=g.charCodeAt(x);f[x]=_>96?_-97:_>64?_-39:_+4}for(var C=0,x=0;x<g.length;++x)f[C++]=f[x]<60?t[f[x]]:(f[x]-60)*64+f[++x];return f.buffer.slice(0,C)}function r(g){if(!g)throw new Error("Assertion failed")}function s(g){return new Uint8Array(g.buffer,g.byteOffset,g.byteLength)}function a(g,f,x,_){var C=n.exports.sbrk,V=C(f.length*4),L=C(x*4),Z=new Uint8Array(n.exports.memory.buffer),G=s(f);Z.set(G,V),_&&_(V,V,f.length,x);var I=g(L,V,f.length,x);Z=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(x);new Uint8Array(v.buffer).set(Z.subarray(L,L+x*4)),G.set(Z.subarray(V,V+f.length*4)),C(V-C(0));for(var P=0;P<f.length;++P)f[P]=v[f[P]];return[v,I]}function c(g,f,x,_){var C=n.exports.sbrk,V=C(x*4),L=C(x*_),Z=new Uint8Array(n.exports.memory.buffer);Z.set(s(f),L),g(V,L,x,_),Z=new Uint8Array(n.exports.memory.buffer);var G=new Uint32Array(x);return new Uint8Array(G.buffer).set(Z.subarray(V,V+x*4)),C(V-C(0)),G}function d(g,f,x,_,C){var V=n.exports.sbrk,L=V(f),Z=V(_*C),G=new Uint8Array(n.exports.memory.buffer);G.set(s(x),Z);var I=g(L,f,Z,_,C),v=new Uint8Array(I);return v.set(G.subarray(L,L+I)),V(L-V(0)),v}function u(g){for(var f=0,x=0;x<g.length;++x){var _=g[x];f=f<_?_:f}return f}function m(g,f){if(r(f==2||f==4),f==4)return new Uint32Array(g.buffer,g.byteOffset,g.byteLength/4);var x=new Uint16Array(g.buffer,g.byteOffset,g.byteLength/2);return new Uint32Array(x)}function p(g,f,x,_,C,V,L){var Z=n.exports.sbrk,G=Z(x*_),I=Z(x*V),v=new Uint8Array(n.exports.memory.buffer);v.set(s(f),I),g(G,x,_,C,I,L);var P=new Uint8Array(x*_);return P.set(v.subarray(G,G+x*_)),Z(G-Z(0)),P}return{ready:i,supported:!0,reorderMesh:function(g,f,x){var _=f?x?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(n.exports.meshopt_optimizeVertexFetchRemap,g,u(g)+1,_)},reorderPoints:function(g,f){return r(g instanceof Float32Array),r(g.length%f==0),r(f>=3),c(n.exports.meshopt_spatialSortRemap,g,g.length/f,f*4)},encodeVertexBuffer:function(g,f,x){r(x>0&&x<=256),r(x%4==0);var _=n.exports.meshopt_encodeVertexBufferBound(f,x);return d(n.exports.meshopt_encodeVertexBuffer,_,g,f,x)},encodeIndexBuffer:function(g,f,x){r(x==2||x==4),r(f%3==0);var _=m(g,x),C=n.exports.meshopt_encodeIndexBufferBound(f,u(_)+1);return d(n.exports.meshopt_encodeIndexBuffer,C,_,f,4)},encodeIndexSequence:function(g,f,x){r(x==2||x==4);var _=m(g,x),C=n.exports.meshopt_encodeIndexSequenceBound(f,u(_)+1);return d(n.exports.meshopt_encodeIndexSequence,C,_,f,4)},encodeGltfBuffer:function(g,f,x,_){var C={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(C[_]),C[_](g,f,x)},encodeFilterOct:function(g,f,x,_){return r(x==4||x==8),r(_>=1&&_<=16),p(n.exports.meshopt_encodeFilterOct,g,f,x,_,16)},encodeFilterQuat:function(g,f,x,_){return r(x==8),r(_>=4&&_<=16),p(n.exports.meshopt_encodeFilterQuat,g,f,x,_,16)},encodeFilterExp:function(g,f,x,_,C){r(x>0&&x%4==0),r(_>=1&&_<=24);var V={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return p(n.exports.meshopt_encodeFilterExp,g,f,x,_,x,C?V[C]:1)}}}();var Tan=T(S()),Poe=function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q:Odkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;w8Wqdbk;esezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9Uc;WFbGgocjdaocjd6EhDaicefhocbhqdnindndndnaeaq9nmbaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxalc9WGgmTmecbhPawcjdfhsaohzinaraz9Rax6mvarazaxfgo9RcK6mvczhlcbhHinalgic9WfgOawcj;cbffhldndndndndnazaOco4fRbbaHcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgOco4gAaAciSgAE86bbawcj;cbfaifglcGfaoclfaAfgARbbaOcl4ciGgCaCciSgCE86bbalcVfaAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc7faAaCfgARbbaOciGgOaOciSgOE86bbalctfaAaOfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgOcl4gAaAcsSgAE86bbawcj;cbfaifglcGfaocwfaAfgARbbaOcsGgOaOcsSgOE86bbalcVfaAaOfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaHcdfhHaiczfhlarao9RcL0mekkaiam6mvaoTmvdnakTmbawaPfRbbhHawcj;cbfhlashiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkkascefhsaohzaPcefgPad9hmbxikkcbc99arao9Radcaadca0ESEhoxlkaoaxad2fhCdnakmbadhlinaoTmlarao9Rax6mlaoaxfhoalcufglmbkaChoxekcbhmawcjdfhAinarao9Rax6miawamfRbbhHawcj;cbfhlaAhiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkaAcefhAaoaxfhoamcefgmad9hmbkaChokabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekc9:hokavcj;ebf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklzNbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q:6dkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq:p9sqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:N8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhlaicefhodnaeTmbadTmbalc;WFbGglcjdalcjd6EhwcbhDinawaeaD9RaDawfae6Egqcsfglc9WGgkci2hxakcethmalcl4cifcd4hPabaDad2fhsakc;ab6hzcbhHincbhOaohAdndninaraA9RaP6meavcj;cbfaOak2fhCaAaPfhocbhidnazmbarao9Rc;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G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9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklaaoczfhokdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaoclfaYpQbfaXc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaocwfaYpQbfaXc:q:yjjbfRbbfhoxekaiaopbbbpkl8Waoczfhokalc;abfhialcjefak0meaihlarao9Rc;Fb0mbkkdnaiak9pmbaici4hlinarao9RcK6miaCaifhXdndndndndnaAaico4fRbbalcoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpkbbxikaXaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaXaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaXaopbbbpkbbaoczfhokalcdfhlaiczfgiak6mbkkaoTmeaohAaOcefgOclSmdxbkkc9:hoxlkdnakTmbavcjdfaHfhiavaHfpbdbhYcbhXinaiavcj;cbfaXfglpblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLalakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEalamfpblbg3cep9Ta3aQp9op9Hp9rg3alaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfhiaXczfgXak6mbkkaHclfgHad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfgDae6mbkkcbc99arao9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var o=WebAssembly.validate(n)?a(t):a(e),r,s=WebAssembly.instantiate(o,{}).then(function(C){r=C.instance,r.exports.__wasm_call_ctors()});function a(C){for(var V=new Uint8Array(C.length),L=0;L<C.length;++L){var Z=C.charCodeAt(L);V[L]=Z>96?Z-97:Z>64?Z-39:Z+4}for(var G=0,L=0;L<C.length;++L)V[G++]=V[L]<60?i[V[L]]:(V[L]-60)*64+V[++L];return V.buffer.slice(0,G)}function c(C,V,L,Z,G,I,v){var P=C.exports.sbrk,w=Z+3&-4,F=P(w*G),b=P(I.length),R=new Uint8Array(C.exports.memory.buffer);R.set(I,b);var E=V(F,Z,G,b,I.length);if(E==0&&v&&v(F,w,G),L.set(R.subarray(F,F+Z*G)),P(F-P(0)),E!=0)throw new Error("Malformed buffer data: "+E)}var d={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},u={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},m=[],p=0;function g(C){var V={object:new Worker(C),pending:0,requests:{}};return V.object.onmessage=function(L){var Z=L.data;V.pending-=Z.count,V.requests[Z.id][Z.action](Z.value),delete V.requests[Z.id]},V}function f(C){for(var V="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(o)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+_.name+";"+c.toString()+_.toString(),L=new Blob([V],{type:"text/javascript"}),Z=URL.createObjectURL(L),G=m.length;G<C;++G)m[G]=g(Z);for(var G=C;G<m.length;++G)m[G].object.postMessage({});m.length=C,URL.revokeObjectURL(Z)}function x(C,V,L,Z,G){for(var I=m[0],v=1;v<m.length;++v)m[v].pending<I.pending&&(I=m[v]);return new Promise(function(P,w){var F=new Uint8Array(L),b=++p;I.pending+=C,I.requests[b]={resolve:P,reject:w},I.object.postMessage({id:b,count:C,size:V,source:F,mode:Z,filter:G},[F.buffer])})}function _(C){var V=C.data;if(!V.id)return self.close();self.ready.then(function(L){try{var Z=new Uint8Array(V.count*V.size);c(L,L.exports[V.mode],Z,V.count,V.size,V.source,L.exports[V.filter]),self.postMessage({id:V.id,count:V.count,action:"resolve",value:Z},[Z.buffer])}catch(G){self.postMessage({id:V.id,count:V.count,action:"reject",value:G})}})}return{ready:s,supported:!0,useWorkers:function(C){f(C)},decodeVertexBuffer:function(C,V,L,Z,G){c(r,r.exports.meshopt_decodeVertexBuffer,C,V,L,Z,r.exports[d[G]])},decodeIndexBuffer:function(C,V,L,Z){c(r,r.exports.meshopt_decodeIndexBuffer,C,V,L,Z)},decodeIndexSequence:function(C,V,L,Z){c(r,r.exports.meshopt_decodeIndexSequence,C,V,L,Z)},decodeGltfBuffer:function(C,V,L,Z,G,I){c(r,r.exports[u[G]],C,V,L,Z,r.exports[d[I]])},decodeGltfBufferAsync:function(C,V,L,Z,G){return m.length>0?x(C,V,L,u[Z],d[G]):s.then(function(){var I=new Uint8Array(C*V);return c(r,r.exports[u[Z]],I,C,V,L,r.exports[d[G]]),I})}}}();var Van=T(S()),San=function(){var e="b9H79Tebbbe9Hk9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gvuuuuue999Gquuuuuuu99uueu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9GiuuueuizsdilvoirwDbqqbeqlve9Weiiviebeoweuecj:Pdkr:Tewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bl8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bvQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7boX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbra9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbwl79IV9RbDDwebcekdmxq;UMesdbk:kfvKue99euY99Qu8Jjjjjbc;W;qb9Rgs8Kjjjjbcbhzascxfcbc;Kbz:ljjjb8AdnabaeSmbabaeadcdtz:kjjjb8AkdnamcdGTmbalcrfci4gHcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhAcbhlcbhednadTmbcbhlabheadhHinaAaeydbgOci4fgCaCRbbgCceaOcrGgOtV86bbaCcu7aO4ceGalfhlaeclfheaHcufgHmbkcualcdtalcFFFFi0Ehekaecbyd;S1jjbHjjjjbbhzascxfasyd2gecdtfazBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhQdnadTmbaecufhCcbhLinabaXcdtfgKydbgAc:v;t;h;Ev2hOcbhedndninaQaOaCGgOcdtfgYydbgHcuSmeazaHcdtfydbaASmdaecefgeaOfhOaeaC9nmbxdkkazaLcdtfaABdbaYaLBdbaLhHaLcefhLkaKaHBdbaXcefgXad9hmbkkaQcbyd;O1jjbH:bjjjbbasasyd2cufBd2kcualcefgecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbh8Aascxfasyd2gecdtfa8ABdbasa8ABdlasaecefBd2cuadcitadcFFFFe0Ecbyd;S1jjbHjjjjbbhEascxfasyd2gecdtfaEBdbasaEBdwasaecefBd2asclfabadalcbz:cjjjbcualcdtg3alcFFFFi0Eg5cbyd;S1jjbHjjjjbbhQascxfasyd2gecdtfaQBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Eascxfasyd2gecdtfa8EBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhLcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhXdnalTmbavcd4hCaecufhHinaLhednazTmbazaLcdtfydbhekaiaeaC2cdtfgeydlgOcH4aO7c:F:b:DD2aeydbgOcH4aO7c;D;O:B8J27aeydwgecH4ae7c:3F;N8N27aHGheaLcdth8FdndndndndnazTmbaza8FfhKcbhOinaXaecdtfgYydbgAcuSmlaiazaAcdtfydbaC2cdtfaiaKydbaC2cdtfcxz:ojjjbTmiaOcefgOaefaHGheaOaH9nmbxdkkaiaLaC2cdtfhKcbhOinaXaecdtfgYydbgAcuSmiaiaAaC2cdtfaKcxz:ojjjbTmdaOcefgOaefaHGheaOaH9nmbkkcbhYkaYydbgecu9hmekaYaLBdbaLhekaQa8FfaeBdbaLcefgLal9hmbkcbhea8EhHinaHaeBdbaHclfhHalaecefge9hmbkcbheaQhHa8EhOindnaeaHydbgCSmbaOa8EaCcdtfgCydbBdbaCaeBdbkaHclfhHaOclfhOalaecefge9hmbkkcbhaaXcbyd;O1jjbH:bjjjbbasasyd2cufBd2alcbyd;S1jjbHjjjjbbhXascxfasyd2gecdtfaXBdbasaecefBd2a5cbyd;S1jjbHjjjjbbheascxfasyd2gHcdtfaeBdbasaHcefBd2a5cbyd;S1jjbHjjjjbbhHascxfasyd2gOcdtfaHBdbasaOcefBd2aecFea3z:ljjjbhhaHcFea3z:ljjjbhgdnalTmbaEcwfh8Jindna8AaagOcefgacdtfydbgCa8AaOcdtgefydbgHSmbaCaH9Rh8FaEaHcitfh3agaefh8KahaefhLcbhAindndna3aAcitfydbgYaO9hmbaLaOBdba8KaOBdbxekdna8AaYcdtg8LfgeclfydbgHaeydbgeSmbaEaecitgCfydbaOSmeaHae9Rh8Maecu7aHfhKa8JaCfhHcbheinaKaeSmeaecefheaHydbhCaHcwfhHaCaO9hmbkaea8M6mekaga8LfgeaOaYaeydbcuSEBdbaLaYaOaLydbcuSEBdbkaAcefgAa8F9hmbkkaaal9hmbkaQhHa8EhOaghCahhAcbheindndnaeaHydbgY9hmbdnaeaOydbgY9hmbaAydbhYdnaCydbgKcu9hmbaYcu9hmbaXaefcb86bbxikaXaefhLdnaeaKSmbaeaYSmbaLce86bbxikaLcl86bbxdkdnaea8EaYcdtgKfydb9hmbdnaCydbgLcuSmbaeaLSmbaAydbg8FcuSmbaea8FSmbagaKfydbg3cuSmba3aYSmbahaKfydbgKcuSmbaKaYSmbdnaQaLcdtfydbgYaQaKcdtfydb9hmbaYaQa8FcdtfydbgKSmbaKaQa3cdtfydb9hmbaXaefcd86bbxlkaXaefcl86bbxikaXaefcl86bbxdkaXaefcl86bbxekaXaefaXaYfRbb86bbkaHclfhHaOclfhOaCclfhCaAclfhAalaecefge9hmbkdnaqTmbdndnazTmbazheaQhHalhOindnaqaeydbfRbbTmbaXaHydbfcl86bbkaeclfheaHclfhHaOcufgOmbxdkkaQhealhHindnaqRbbTmbaXaeydbfcl86bbkaqcefhqaeclfheaHcufgHmbkkaQhealhOaXhHindnaXaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaOcufgOmbkkamceGTmbaXhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcualcx2alc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhaascxfasyd2gecdtfaaBdbasaecefBd2aaaialavazz:djjjbh8NdndnaDmbcbhycbh8Jxekcbh8JawhecbhHindnaeIdbJbbbb9ETmbasc;Wbfa8JcdtfaHBdba8Jcefh8JkaeclfheaDaHcefgH9hmbkcua8Jal2gecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbhyascxfasyd2gecdtfayBdbasaecefBd2alTmba8JTmbarcd4hLdnazTmba8Jcdthicbh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mbJbbbbh8ZcbhJcbhocbhCxekcbhea5cbyd;S1jjbHjjjjbbhCascxfasyd2gHcdtfaCBdbasaHcefBd2dnalTmbaChHinaHaeBdbaHclfhHalaecefge9hmbkkdnaOmbcbhiinabaicdtfhLcbhKinaQaLaKcdtgec:G1jjbfydbcdtfydbcdtfydbhHdnaCaQaLaefydbcdtfydbgOcdtfgAydbgeaOSmbinaAaCaegOcdtfgYydbgeBdbaYhAaOae9hmbkkdnaCaHcdtfgAydbgeaHSmbinaAaCaegHcdtfgYydbgeBdbaYhAaHae9hmbkkdnaOaHSmbaCaOaHaOaH0EcdtfaOaHaOaH6EBdbkaKcefgKci9hmbkaicifgiad6mbkkcbhJdnalTmbcbhYindnaQaYcdtgefydbaY9hmbaYhHdnaCaefgKydbgeaYSmbaKhOinaOaCaegHcdtfgAydbgeBdbaAhOaHae9hmbkkaKaHBdbkaYcefgYal9hmbkcbheaQhOaChHcbhJindndnaeaOydbgA9hmbdnaeaHydbgA9hmbaHaJBdbaJcefhJxdkaHaCaAcdtfydbBdbxekaHaCaAcdtfydbBdbkaOclfhOaHclfhHalaecefge9hmbkkcuaJcltgeaJcjjjjiGEcbyd;S1jjbHjjjjbbhoascxfasyd2gHcdtfaoBdbasaHcefBd2aocbaez:ljjjbhAdnalTmbaChOaahealhYinaecwfIdbh8SaeclfIdbhIaAaOydbcltfgHaeIdbaHIdbMUdbaHclfgKaIaKIdbMUdbaHcwfgKa8SaKIdbMUdbaHcxfgHaHIdbJbbjZMUdbaOclfhOaecxfheaYcufgYmbkkdnaJTmbaAheaJhHinaecxfgOIdbh8SaOcbBdbaeaeIdbJbbbbJbbjZa8S:va8SJbbbb9BEg8SNUdbaeclfgOa8SaOIdbNUdbaecwfgOa8SaOIdbNUdbaeczfheaHcufgHmbkkdnalTmbaChOaahealhYinaAaOydbcltfgHcxfgKaecwfIdbaHcwfIdb:tg8Sa8SNaeIdbaHIdb:tg8Sa8SNaeclfIdbaHclfIdb:tg8Sa8SNMMg8SaKIdbgIaIa8S9DEUdbaOclfhOaecxfheaYcufgYmbkkdnaJmbcbhJJFFuuh8ZxekaAcxfheaAhHaJhOinaHaeIdbUdbaeczfheaHclfhHaOcufgOmbkJFFuuh8ZaAheaJhHinaeIdbg8Sa8Za8Za8S9EEh8ZaeclfheaHcufgHmbkkasydlh9ednalTmba9eclfhea9eydbhAaXhHalhYcbhOincbaeydbgKaA9RaHRbbcpeGEaOfhOaHcefhHaeclfheaKhAaYcufgYmbkaOce4h8Fkcuada8F9RcifgTcx2aTc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhDascxfasyd2gecdtfaDBdbasaecefBd2cuaTcdtaTcFFFFi0Ecbyd;S1jjbHjjjjbbhSascxfasyd2gecdtfaSBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Mascxfasyd2gecdtfa8MBdbasaecefBd2alcbyd;S1jjbHjjjjbbh9hascxfasyd2gecdtfa9hBdbasaecefBd2axaxNa8NJbbjZamclGEg83a83N:vhcJbbbbhndnadak9nmbdnaTci6mba8Jclth9iaDcwfh6JbbbbhBJbbbbhninasclfabadalaQz:cjjjbabh8FcbhEcbh5inaba5cdtfh3cbheindnaQa8FaefydbgOcdtgifydbgYaQa3aec:W1jjbfydbcdtfydbgHcdtgwfydbgKSmbaXaHfRbbgLcv2aXaOfRbbgAfc;a1jjbfRbbg8AaAcv2aLfg8Lc;a1jjbfRbbg8KVcFeGTmbdnaKaY9nmba8Lcj1jjbfRbbcFeGmekaAcufhYdnaAaL9hmbaYcFeGce0mbahaifydbaH9hmekdndnaAclSmbaLcl9hmekdnaYcFeGce0mbahaifydbaH9hmdkaLcufcFeGce0mbagawfydbaO9hmekaDaEcx2fgAaHaOa8KcFeGgYEBdlaAaOaHaYEBdbaAaYa8AGcb9hBdwaEcefhEkaeclfgecx9hmbkdna5cifg5ad9pmba8Fcxfh8FaEcifaT9nmekkaETmdcbhiinJbbbbJbbjZaqaQaDaicx2fgAydlgKaAydbgYaAydwgHEgLcdtfydbc8S2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bgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOagaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkkaBana8JEhBcbhYabhecbhKindna8MaeydbcdtfydbgHa8MaeclfydbcdtfydbgOSmbaHa8MaecwfydbcdtfydbgASmbaOaASmbabaYcdtfgLaHBdbaLcwfaABdbaLclfaOBdbaYcifhYkaecxfheaKcifgKad6mbkdndna9cTmbaYak9nmba8ZaB9FTmbcbhdabhecbhHindnaoaCaeydbgOcdtfydbcdtfIdbaB9ETmbabadcdtfgAaOBdbaAclfaeclfydbBdbaAcwfaecwfydbBdbadcifhdkaecxfheaHcifgHaY6mbkJFFuuh8ZaJTmeaoheaJhHJFFuuh8SinaeIdbgIa8Sa8SaI9EEg8Va8SaIaB9EgOEh8Sa8Va8ZaOEh8ZaeclfheaHcufgHmbxdkkaYhdkadak0mbxdkkasclfabadalaQz:cjjjbkdndnadak0mbadhOxekdna9cmbadhOxekdna8Zac9FmbadhOxekina8ZJbb;aZNg8Saca8Sac9DEh8VJbbbbh8SdnaJTmbaoheaJhHinaeIdbgIa8SaIa8V9FEa8SaIa8S9EEh8SaeclfheaHcufgHmbkkcbhOabhecbhHindnaoaCaeydbgAcdtfydbcdtfIdba8V9ETmbabaOcdtfgYaABdbaYclfaeclfydbBdbaYcwfaecwfydbBdbaOcifhOkaecxfheaHcifgHad6mbkJFFuuh8ZdnaJTmbaoheaJhHJFFuuhIinaeIdbgRaIaIaR9EEg8PaIaRa8V9EgAEhIa8Pa8ZaAEh8ZaeclfheaHcufgHmbkkdnaOad9hmbadhOxdka8Sanana8S9DEhnaOak9nmeaOhda8Zac9FmbkkdnamcjjjjlGTmbazmbaOTmbcbhQabheinaXaeydbgAfRbbc3thKaecwfgLydbhHdndnahaAcdtg8FfydbaeclfgiydbgCSmbcbhYagaCcdtfydbaA9hmekcjjjj94hYkaeaKaYVaAVBdbaXaCfRbbc3thKdndnahaCcdtfydbaHSmbcbhYagaHcdtfydbaC9hmekcjjjj94hYkaiaKaYVaCVBdbaXaHfRbbc3thYdndnahaHcdtfydbaASmbcbhCaga8FfydbaH9hmekcjjjj94hCkaLaYaCVaHVBdbaecxfheaQcifgQaO6mbkkdnazTmbaOTmbaOheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPa83an:rNUdbkasyd2gecdtascxffc98fhHdninaeTmeaHydbcbyd;O1jjbH:bjjjbbaHc98fhHaecufhexbkkasc;W;qbf8KjjjjbaOk;Yieouabydlhvabydbclfcbaicdtz:ljjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk;Podvuv998Jjjjjbca9RgvcFFF;7rBd3av9cFFF;7;3FF:;Fb83dCavcFFF97Bdzav9cFFF;7FFF:;u83dwdnadTmbaicd4hodnabmbdnalTmbcbhrinaealarcdtfydbao2cdtfhwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxikkaocdthrcbhwincbhiinavcCfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbxdkkdnalTmbcbhrinabarcx2fgiaealarcdtfydbao2cdtfgwIdbUdbaiawIdlUdlaiawIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxdkkaocdthlcbhraehwinabarcx2fgiaearao2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawalfhwarcefgrad9hmbkkJbbbbavIdwavIdCgk:tgqaqJbbbb9DEgqavIdxavIdKgx:tgmamaq9DEgqavIdzavId3gm:tgPaPaq9DEhPdnabTmbadTmbJbbbbJbbjZaP:vaPJbbbb9BEhqinabaqabIdbak:tNUdbabclfgvaqavIdbax:tNUdbabcwfgvaqavIdbam:tNUdbabcxfhbadcufgdmbkkaPk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbk:nCoDud99rue99lul998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:ljjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbgqBdxawceBd2aqaeadaicbz:djjjb8AawcuadcdtadcFFFFi0Egkcbyd;S1jjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd;S1jjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhmcbhCadhXcbhQinaChLaeamgKcufaeaK9iEaPgDcefaeaD9kEhYdndnadTmbaYcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbh5cbh8Eindna3axa8EcdtfydbgCcm4aC7c:v;t;h;Ev2gics4ai7aAGgmcdtfgEydbgecuSmbaeaCSmbcehiina3amaifaAGgmcdtfgEydbgecuSmeaicefhiaeaC9hmbkkaEaCBdba5aecuSfh5a8Ecefg8Ead9hmbxdkkazcFeasz:ljjjb8Acbh5kaDaYa5ar0giEhPaLa5aiEhCdna5arSmbaYaKaiEgmaP9Rcd9imbdndnaQcl0mbdnaX:ZgOaL:Zg8A:taY:Yg8FaD:Y:tgaa8FaK:Y:tgha5:ZggaH:tNNNaOaH:tahNa8Aag:tNa8AaH:taaNagaO:tNM:va8FMJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPamfcd9Theka5aXaiEhXaQcefgQcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd;S1jjbHjjjjbbg8EBdKawclBd2aPcuf:Yh8AdndnadTmbaqhiaxheadhmindndnaiIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbhDcbh5inaxa5cdtgYfydbgCcm4aC7c:v;t;h;Ev2gics4ai7hecbhidndnina3aeaAGgmcdtfgEydbgecuSmednaxaecdtgEfydbaCSmbaicefgiamfheaiaA9nmekka8EaEfydbhixekaEa5BdbaDhiaDcefhDka8EaYfaiBdba5cefg5ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:ljjjb8AcbhDcbhekawaecbyd;S1jjbHjjjjbbgeBd3awcvBd2aecbaiz:ljjjbhEavcd4hxdnadTmbdnalTmbaxcdth3a8EhCalheaqhmadhAinaEaCydbc32fgiamIdbaiIdbMUdbaiamclfIdbaiIdlMUdlaiamcwfIdbaiIdwMUdwaiaeIdbaiIdxMUdxaiaeclfIdbaiIdzMUdzaiaecwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaCclfhCaea3fheamcxfhmaAcufgAmbxdkka8EhmaqheadhCinaEamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaCcufgCmbkkdnaDTmbaEhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhCawcuaDcdtgYaDcFFFFi0Egicbyd;S1jjbHjjjjbbgeBdaawcoBd2awaicbyd;S1jjbHjjjjbbg3Bd8KaecFeaYz:ljjjbh5dnadTmbJbbjZJbbjZa8A:vaPceSEaoNgOaONh8Aaxcdthxalheina8Aaec;C1jjbalEgmIdwaEa8EydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna5aAcdtgifgmydbcuSmba3aifIdbaO9ETmekamaCBdba3aifaOUdbka8Eclfh8EaeaxfheaqcxfhqadaCcefgC9hmbkkaba5aYz:kjjjb8AcrhikaicdthiinaiTmeaic98fgiawcxffydbcbyd;O1jjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Odieui99iu8Jjjjjbca9RgicFFF;7rBd3ai9cFFF;7;3FF:;Fb83dCaicFFF97Bdzai9cFFF;7FFF:;u83dwdndnaembJbbjFhlJbbjFhvJbbjFhoxekadcd4cdthrcbhwincbhdinaicCfadfgDabadfIdbglaDIdbgvaval9EEUdbaicwfadfgDalaDIdbgvaval9DEUdbadclfgdcx9hmbkabarfhbawcefgwae9hmbkaiIdzaiId3:thoaiIdxaiIdK:thvaiIdwaiIdC:thlkJbbbbalalJbbbb9DEglavaval9DEglaoaoal9DEk9DeeuabcFeaicdtz:ljjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcifc98GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcrfc94GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;W1jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;W1jjbfgdBd;W1jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:bedbcjwk9Oeeebeebebbeeebebbbbbebebbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbbbbbbbbbbc;OwkxebbbdbbbjNbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(f){n=f.instance,n.exports.__wasm_call_ctors()});function o(f){for(var x=new Uint8Array(f.length),_=0;_<f.length;++_){var C=f.charCodeAt(_);x[_]=C>96?C-97:C>64?C-39:C+4}for(var V=0,_=0;_<f.length;++_)x[V++]=x[_]<60?t[x[_]]:(x[_]-60)*64+x[++_];return x.buffer.slice(0,V)}function r(f){if(!f)throw new Error("Assertion failed")}function s(f){return new Uint8Array(f.buffer,f.byteOffset,f.byteLength)}function a(f,x,_){var C=n.exports.sbrk,V=C(x.length*4),L=C(_*4),Z=new Uint8Array(n.exports.memory.buffer),G=s(x);Z.set(G,V);var I=f(L,V,x.length,_);Z=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(_);new Uint8Array(v.buffer).set(Z.subarray(L,L+_*4)),G.set(Z.subarray(V,V+x.length*4)),C(V-C(0));for(var P=0;P<x.length;++P)x[P]=v[x[P]];return[v,I]}function c(f){for(var x=0,_=0;_<f.length;++_){var C=f[_];x=x<C?C:x}return x}function d(f,x,_,C,V,L,Z,G,I){var v=n.exports.sbrk,P=v(4),w=v(_*4),F=v(V*L),b=v(_*4),R=new Uint8Array(n.exports.memory.buffer);R.set(s(C),F),R.set(s(x),b);var E=f(w,b,_,F,V,L,Z,G,I,P);R=new Uint8Array(n.exports.memory.buffer);var X=new Uint32Array(E);s(X).set(R.subarray(w,w+E*4));var A=new Float32Array(1);return s(A).set(R.subarray(P,P+4)),v(P-v(0)),[X,A[0]]}function u(f,x,_,C,V,L,Z,G,I,v,P,w,F){var b=n.exports.sbrk,R=b(4),E=b(_*4),X=b(V*L),A=b(V*G),N=b(I.length*4),O=b(_*4),U=v?b(V):0,Y=new Uint8Array(n.exports.memory.buffer);Y.set(s(C),X),Y.set(s(Z),A),Y.set(s(I),N),Y.set(s(x),O),v&&Y.set(s(v),U);var k=f(E,O,_,X,V,L,A,G,N,I.length,U,P,w,F,R);Y=new Uint8Array(n.exports.memory.buffer);var H=new Uint32Array(k);s(H).set(Y.subarray(E,E+k*4));var J=new Float32Array(1);return s(J).set(Y.subarray(R,R+4)),b(R-b(0)),[H,J[0]]}function m(f,x,_,C){var V=n.exports.sbrk,L=V(_*C),Z=new Uint8Array(n.exports.memory.buffer);Z.set(s(x),L);var G=f(L,_,C);return V(L-V(0)),G}function p(f,x,_,C,V,L,Z,G){var I=n.exports.sbrk,v=I(G*4),P=I(_*C),w=I(_*L),F=new Uint8Array(n.exports.memory.buffer);F.set(s(x),P),V&&F.set(s(V),w);var b=f(v,P,_,C,w,L,Z,G);F=new Uint8Array(n.exports.memory.buffer);var R=new Uint32Array(b);return s(R).set(F.subarray(v,v+b*4)),I(v-I(0)),R}var g={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,_InternalDebug:1<<30};return{ready:i,supported:!0,useExperimentalFeatures:!1,compactMesh:function(f){r(f instanceof Uint32Array||f instanceof Int32Array||f instanceof Uint16Array||f instanceof Int16Array),r(f.length%3==0);var x=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f);return a(n.exports.meshopt_optimizeVertexFetchRemap,x,c(f)+1)},simplify:function(f,x,_,C,V,L){r(f instanceof Uint32Array||f instanceof Int32Array||f instanceof Uint16Array||f instanceof Int16Array),r(f.length%3==0),r(x instanceof Float32Array),r(x.length%_==0),r(_>=3),r(C>=0&&C<=f.length),r(C%3==0),r(V>=0);for(var Z=0,G=0;G<(L?L.length:0);++G)r(L[G]in g),r(this.useExperimentalFeatures||L[G]!="Prune"),Z|=g[L[G]];var I=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f),v=d(n.exports.meshopt_simplify,I,f.length,x,x.length/_,_*4,C,V,Z);return v[0]=f instanceof Uint32Array?v[0]:new f.constructor(v[0]),v},simplifyWithAttributes:function(f,x,_,C,V,L,Z,G,I,v){r(this.useExperimentalFeatures),r(f instanceof Uint32Array||f instanceof Int32Array||f instanceof Uint16Array||f instanceof Int16Array),r(f.length%3==0),r(x instanceof Float32Array),r(x.length%_==0),r(_>=3),r(C instanceof Float32Array),r(C.length%V==0),r(V>=0),r(Z==null||Z instanceof Uint8Array),r(Z==null||Z.length==x.length/_),r(G>=0&&G<=f.length),r(G%3==0),r(I>=0),r(Array.isArray(L)),r(V>=L.length),r(L.length<=32);for(var P=0;P<L.length;++P)r(L[P]>=0);for(var w=0,P=0;P<(v?v.length:0);++P)r(v[P]in g),w|=g[v[P]];var F=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f),b=u(n.exports.meshopt_simplifyWithAttributes,F,f.length,x,x.length/_,_*4,C,V*4,new Float32Array(L),Z?new Uint8Array(Z):null,G,I,w);return b[0]=f instanceof Uint32Array?b[0]:new f.constructor(b[0]),b},getScale:function(f,x){return r(f instanceof Float32Array),r(f.length%x==0),r(x>=3),m(n.exports.meshopt_simplifyScale,f,f.length/x,x*4)},simplifyPoints:function(f,x,_,C,V,L){return r(this.useExperimentalFeatures),r(f instanceof Float32Array),r(f.length%x==0),r(x>=3),r(_>=0&&_<=f.length/x),C?(r(C instanceof Float32Array),r(C.length%V==0),r(V>=3),r(f.length/x==C.length/V),p(n.exports.meshopt_simplifyPoints,f,f.length/x,x*4,C,V*4,L,_)):p(n.exports.meshopt_simplifyPoints,f,f.length/x,x*4,void 0,0,0,_)}}}();var Zan=T(S()),Lan=function(){var e="b9H79Tebbbefx9Geueu9Geub9Gbb9Giuuueu9Gkuuuuuuuuuu99eu9Gvuuuuueu9Gkuuuuuuuuu9999eu9Gruuuuuuub9Gkuuuuuuuuuuueu9Gouuuuuub9Giuuub9GluuuubiOHdilvorwDqrkbiibeilve9Weiiviebeoweuec:q:Odkr:Yewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeX9TW79O9V9Wt9F9I919P29K9nW79O2Wt7bd39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7br39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bDL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2Wtbql79IV9RbkDwebcekdsPq;L9kHdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:oAlPue99eux998Jjjjjbc:We9Rgk8Kjjjjbakc;mbfcbc;Kbz:njjjb8AakcuaocdtgxaocFFFFi0Egmcbyd:e1jjbHjjjjbbgPBd9makceBd:SeakaPBdnakamcbyd:e1jjbHjjjjbbgsBd9qakcdBd:SeakasBd9eakcualcdtalcFFFFi0Ecbyd:e1jjbHjjjjbbgzBd9uakazBd9iakciBd:SeaPcbaxz:njjjbhHalci9UhOdnalTmbaihPalhAinaHaPydbcdtfgCaCydbcefBdbaPclfhPaAcufgAmbkkdnaoTmbcbhPashAaHhCaohXinaAaPBdbaAclfhAaCydbaPfhPaCclfhCaXcufgXmbkkdnalci6mbcbhPaihAinaAcwfydbhCaAclfydbhXasaAydbcdtfgQaQydbgQcefBdbazaQcdtfaPBdbasaXcdtfgXaXydbgXcefBdbazaXcdtfaPBdbasaCcdtfgCaCydbgCcefBdbazaCcdtfaPBdbaAcxfhAaOaPcefgP9hmbkkdnaoTmbaHhAashPaohCinaPaPydbaAydb9RBdbaAclfhAaPclfhPaCcufgCmbkkakamcbyd:e1jjbHjjjjbbgPBd9yakclBd:SeaPaHaxz:mjjjbhmakaOcbyd:e1jjbHjjjjbbgPBd9CakcvBd:SeaPcbaOz:njjjbhLakcuaOcK2alcjjjjd0Ecbyd:e1jjbHjjjjbbgKBd9GakcoBd:SeJbbbbhYdnalci6g8Ambarcd4hxaihAaKhPaOhrJbbbbhEinavaAclfydbax2cdtfgCIdlh3avaAydbax2cdtfgXIdlhYavaAc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fz:fjjjbakydwgCcuSmekdnakc8WfaiaCcx2fgOydbgPaOclfydbgAaOcwfydbgXarabaeadalawaDz:gjjjbTmbalcefhlJbbbbhEJbbbbh5Jbbbbh8EJbbbbhYJbbbbh8FJbbbbhgkamaPcdtfgPaPydbcufBdbamaAcdtfgPaPydbcufBdbamaXcdtfgPaPydbcufBdbcbhXinazasaOaXcdtfydbcdtgAfydbcdtfgxhPaHaAfgvydbgQhAdnaQTmbdninaPydbaCSmeaPclfhPaAcufgATmdxbkkaPaxaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbkaKaCcK2fgPIdbh3aPIdlhaaPIdwhhaPIdxh8JaPIdzh8KaPIdCh8LaLaCfce86bbaga8LMhga8Fa8KMh8FaYa8JMhYa8EahMh8Ea5aaMh5aEa3MhEakyd88hPxekkdnaPTmbdnakyd80gAaPci2fgCciGTmbadaCfcbaPaAcu7fciGcefz:njjjb8AkabalcltfgPak8Pi8W83dbaPcwfakc8Wfcwf8Pib83dbalcefhlkcahPdninaPc98Smeakc;mbfaPfydbcbydj1jjbH:bjjjbbaPc98fhPxbkkakc:Wef8Kjjjjbalk;3vivuv99lu8Jjjjjbca9Rgv8Kjjjjbdndnalcw0mbaiydbhoaeabcitfgralcdtcufBdlaraoBdbdnalcd6mbaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkkalabfhrxekcbhDavczfcwfcbBdbav9cb83izavcwfcbBdbav9cb83ibJbbjZhqJbbjZhkinadaiaDcdtfydbcK2fhwcbhrinavczfarfgoawarfIdbgxaoIdbgm:tgPakNamMgmUdbavarfgoaPaxam:tNaoIdbMUdbarclfgrcx9hmbkJbbjZaqJbbjZMgq:vhkaDcefgDal9hmbkcbhoadcbcecdavIdlgxavIdwgm9GEgravIdbgPam9GEaraPax9GEgscdtgrfhzavczfarfIdbhxaihralhwinaiaocdtfgDydbhHaDarydbgOBdbaraHBdbarclfhraoazaOcK2fIdbax9Dfhoawcufgwmbkaeabcitfhrdndnaocv6mbaoalc98f6mekaraiydbBdbaralcdtcufBdlaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkalabfhrxekaraxUdbaeabcitfgrarydlc98GasVBdlabcefaeadaiaoz:djjjbhwararydlciGawabcu7fcdtVBdlawaeadaiaocdtfalao9Rz:djjjbhrkavcaf8Kjjjjbark;Bloeue99vue99Due99dndnaembcuhkxekJbbjZaq:thxaiabcdtfhmavydbhPavydlhsavydwhzcbhHJFFuuhOcvhbcuhkindnaPamaHcdtfydbcdtgvfydbgATmbazasavfydbcdtfhiindndnawalaiydbgCcx2fgvclfydbgXfRbbcFeSawavydbgQfRbbcFeSfawavcwfydbgLfRbbcFeSfgKmbcbhvxekcehvaraQcdtfydbgYceSmbcehvaraXcdtfydbg8AceSmbcehvaraLcdtfydbgEceSmbdna8AcdSaYcdSfaEcdSfcd6mbaKcefhvxekaKcdfhvkdnavab9kmbdndnadTmbaoaCcK2fgQIdwadIdw:tg3a3NaQIdbadIdb:tg3a3NaQIdladIdl:tg3a3NMM:raD:vaxNJbbjZMJ9VO:d86JbbjZaQIdCadIdCNaQIdxadIdxNaQIdzadIdzNMMaqN:tg3a3J9VO:d869DENh3xekaraQcdtfydbaraXcdtfydbfaraLcdtfydbfc99f:Zh3kaCakavab6a3aO9DVgQEhkavabaQEhba3aOaQEhOkaiclfhiaAcufgAmbkkaHcefgHae9hmbkkakk;bddlue99dndndnabaecitfgrydlgwciGgDci9hmbarclfhqxekinabcbawcd4gwalaDcdtfIdbabaecitfIdb:tgkJbbbb9FEgDaecefgefadaialavaoz:fjjjbak:laoIdb9FTmdabaDaw7aefgecitfgrydlgwciGgDci9hmbkarclfhqkabaecitfhecuhbindnaiaeydbgDfRbbmbadaDcK2fgrIdwalIdw:tgkakNarIdbalIdb:tgkakNarIdlalIdl:tgkakNMM:rgkaoIdb9DTmbaoakUdbavaDBdbaqydbhwkaecwfheabcefgbawcd46mbkkk;yleoudnaladfgkRbbcFeSalaefgxRbbgmcFeSfabydwgPfalaifgsRbbcFeSfaD0abydxaq9pVgzce9hmbavawcltfgmab8Pdb83dbamcwfabcwfgm8Pdb83dbdndnamydbmbcbhqxekcbhDaohminalamabydbcdtfydbfcFe86bbamclfhmaDcefgDabydwgq6mbkkdnabydxglci2gDabydlgmfgPciGTmbaraPfcbalamcu7fciGcefz:njjjb8Aabydxci2hDabydlhmabydwhqkab9cb83dwababydbaqfBdbabaDcifc98GamfBdlaxRbbhmcbhPkdnamcFeGcFe9hmbaxaP86bbababydwgmcefBdwaoabydbcdtfamcdtfaeBdbkdnakRbbcFe9hmbakabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfadBdbkdnasRbbcFe9hmbasabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfaiBdbkarabydlfabydxci2faxRbb86bbarabydlfabydxci2fcefakRbb86bbarabydlfabydxci2fcdfasRbb86bbababydxcefBdxazk;Ckovud99euv99eul998Jjjjjbc:G;ae9Rgo8KjjjjbdndnadTmbavcd4hrcbhwcbhDindnaiaeclfydbar2cdtfgvIdbaiaeydbar2cdtfgqIdbgk:tgxaiaecwfydbar2cdtfgmIdlaqIdlgP:tgsNamIdbak:tgzavIdlaP:tgPN:tgkakNaPamIdwaqIdwgH:tgONasavIdwaH:tgHN:tgPaPNaHazNaOaxN:tgxaxNMM:rgsJbbbb9Bmbaoc:G:qefawcx2fgAakas:vUdwaAaxas:vUdlaAaPas:vUdbaocafawc8K2fgAaq8Pdb83dbaAav8Pdb83dxaAam8Pdb83dKaAcwfaqcwfydbBdbaAcCfavcwfydbBdbaAcafamcwfydbBdbawcefhwkaecxfheaDcifgDad6mbkab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbawTmeao9cb83iKao9cb83izaoczfaocafawci2z1jjjbaoIdKhCaoIdChXaoIdzhQao9cb83iwao9cb83ibaoaoc:G:qefawz1jjjbJbbjZhkaoIdwgPJbbbbJbbjZaPaPNaoIdbgPaPNaoIdlgsasNMM:rgx:vaxJbbbb9BEgzNhxasazNhsaPazNhzaoc:G:qefheawhvinaecwfIdbaxNaeIdbazNasaeclfIdbNMMgPakaPak9DEhkaecxfheavcufgvmbkabaCUdwabaXUdlabaQUdbabaoId3UdxdndnakJ;n;m;m899FmbJbbbbhPaoc:G:qefheaocafhvinaCavcwfIdb:taecwfIdbgHNaQavIdb:taeIdbgONaXavclfIdb:taeclfIdbgLNMMaxaHNazaONasaLNMM:vgHaPaHaP9EEhPavc8KfhvaecxfheawcufgwmbkabazUd3abc8KfaxUdbabcafasUdbabcKfaCaxaPN:tUdbabcCfaXasaPN:tUdbabaQazaPN:tUdzabJbbjZakakN:t:rgkUdydndnaxJbbj:;axJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;axJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohexekcjjjj94hekabc8Ufae86bbdndnasJbbj:;asJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;asJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkabcRfav86bbdndnazJbbj:;azJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;azJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohqxekcjjjj94hqkabaq86b8SdndnaecKtcK91:YJbb;:9c:vax:t:lavcKtcK91:YJbb;:9c:vas:t:laqcKtcK91:YJbb;:9c:vaz:t:lakMMMJbb;:9cNJbbjZMgk:lJbbb9p9DTmbak:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbkaoc:G;aef8Kjjjjbk:mvdouq99cbhi8Jjjjjbca9RglczfcwfcbBdbal9cb83izalcwfcbBdbal9cb83ibdnadTmbcbhvinaeaifhocbhrinalczfarfgwavawydbgwaoarfIdbgDaearawcx2ffIdb9DEBdbalarfgwavawydbgwaDaearawcx2ffIdb9EEBdbarclfgrcx9hmbkaicxfhiavcefgvad9hmbkkJbbbbhDcbhrcbhicbhvinaealarfydbcx2fgwIdwaealczfarfydbcx2fgoIdw:tgqaqNawIdbaoIdb:tgqaqNawIdlaoIdl:tgqaqNMMgqaDaqaD9EgwEhDavaiawEhiarclfhravcefgvci9hmbkaealczfaicdtgvfydbcx2fgrIdwaealavfydbcx2fglIdwMJbbbZNhqarIdlalIdlMJbbbZNhkarIdbalIdbMJbbbZNhxaD:rJbbbZNhDdnadTmbindnaecwfIdbgmaq:tgPaPNaeIdbgsax:tgPaPNaeclfIdbgzak:tgPaPNMMgPaDaDN9ETmbaqaDaP:rgH:vJbbbZNJbbbZMgPNamJbbjZaP:tgONMhqakaPNazaONMhkaxaPNasaONMhxaDaHMJbbbZNhDkaecxfheadcufgdmbkkabaDUdxabaqUdwabakUdlabaxUdbkjeeiu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwdnaiTmbawceawce0EhDarhiinaiaeadRbbcdtfydbBdbadcefhdaiclfhiaDcufgDmbkkabarawaladaoz:hjjjbarcj8Wf8Kjjjjbk:Ylequ8Jjjjjbcjx9Rgl8Kjjjjbcbhvalcjqfcbaiz:njjjb8AdndnadTmbcjehoaehrincuhwarhDcuhqavhkdninawakaoalcjqfaDcefRbbfRbb9RcFeGci6aoalcjqfaDRbbfRbb9RcFeGci6faoalcjqfaDcdfRbbfRbb9RcFeGci6fgxaq9mgmEhwdnammbaxce0mdkaxaqaxaq9kEhqaDcifhDadakcefgk9hmbkkaeawci2fgDcdfRbbhqaDcefRbbhxaDRbbhkaeavci2fgDcifaDawav9Rci2z:qjjjb8Aakalcjqffaocefgo86bbaxalcjqffao86bbaDcdfaq86bbaDcefax86bbaDak86bbaqalcjqffao86bbarcifhravcefgvad9hmbkalcFeaiz:njjjbhoadci2gDceaDce0EhqcbhxindnaoaeRbbgkfgwRbbgDcFe9hmbawax86bbaocjdfaxcdtfabakcdtfydbBdbaxhDaxcefhxkaeaD86bbaecefheaqcufgqmbkaxcdthDxekcbhDkabalcjdfaDz:mjjjb8Aalcjxf8Kjjjjbk9teiucbcbyd11jjbgeabcifc98GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd11jjbgeabcrfc94GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd11jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd11jjbfgdBd11jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk:;Deludndndnadch9pmbabaeSmdaeabadfgi9Rcbadcet9R0mekabaead;8qbbxekaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocd4cefciGgiTmbaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglcd4cefcrGgdTmbavadcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaiaeydzBdzaiaeydCBdCaiaeydKBdKaiaeyd3Bd3aecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaiaeRbe86beaiaeRbd86bdaiaeRbi86biaiaeRbl86blaiaeRbv86bvaiaeRbo86boaiaeRbr86braicwfhiaecwfhealc94fglmbkkabkkAebcjwkxebbbdbbbzNbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(f){n=f.instance,n.exports.__wasm_call_ctors()});function o(f){for(var x=new Uint8Array(f.length),_=0;_<f.length;++_){var C=f.charCodeAt(_);x[_]=C>96?C-97:C>64?C-39:C+4}for(var V=0,_=0;_<f.length;++_)x[V++]=x[_]<60?t[x[_]]:(x[_]-60)*64+x[++_];return x.buffer.slice(0,V)}function r(f){if(!f)throw new Error("Assertion failed")}function s(f){return new Uint8Array(f.buffer,f.byteOffset,f.byteLength)}var a=48,c=16;function d(f,x){var _=f.meshlets[x*4+0],C=f.meshlets[x*4+1],V=f.meshlets[x*4+2],L=f.meshlets[x*4+3];return{vertices:f.vertices.subarray(_,_+V),triangles:f.triangles.subarray(C,C+L*3)}}function u(f,x,_,C,V,L,Z){var G=n.exports.sbrk,I=n.exports.meshopt_buildMeshletsBound(f.length,V,L),v=G(I*c),P=G(I*V*4),w=G(I*L*3),F=G(f.byteLength),b=G(x.byteLength),R=new Uint8Array(n.exports.memory.buffer);R.set(s(f),F),R.set(s(x),b);var E=n.exports.meshopt_buildMeshlets(v,P,w,F,f.length,b,_,C,V,L,Z);R=new Uint8Array(n.exports.memory.buffer);for(var X=R.subarray(v,v+E*c),A=new Uint32Array(X.buffer,X.byteOffset,X.byteLength/4).slice(),N=0;N<E;++N){var O=A[N*4+0],U=A[N*4+1],_=A[N*4+2],Y=A[N*4+3];n.exports.meshopt_optimizeMeshlet(P+O*4,w+U,Y,_)}var k=A[(E-1)*4+0],H=A[(E-1)*4+1],J=A[(E-1)*4+2],te=A[(E-1)*4+3],z=k+J,q=H+(te*3+3&-4),ee={meshlets:A,vertices:new Uint32Array(R.buffer,P,z).slice(),triangles:new Uint8Array(R.buffer,w,q*3).slice(),meshletCount:E};return G(v-G(0)),ee}function m(f){var x=new Float32Array(n.exports.memory.buffer,f,a/4);return{centerX:x[0],centerY:x[1],centerZ:x[2],radius:x[3],coneApexX:x[4],coneApexY:x[5],coneApexZ:x[6],coneAxisX:x[7],coneAxisY:x[8],coneAxisZ:x[9],coneCutoff:x[10]}}function p(f,x,_,C){var V=n.exports.sbrk,L=[],Z=V(x.byteLength),G=V(f.vertices.byteLength),I=V(f.triangles.byteLength),v=V(a),P=new Uint8Array(n.exports.memory.buffer);P.set(s(x),Z),P.set(s(f.vertices),G),P.set(s(f.triangles),I);for(var w=0;w<f.meshletCount;++w){var F=f.meshlets[w*4+0],b=f.meshlets[w*4+0+1],R=f.meshlets[w*4+0+3];n.exports.meshopt_computeMeshletBounds(v,G+F*4,I+b,R,Z,_,C),L.push(m(v))}return V(Z-V(0)),L}function g(f,x,_,C){var V=n.exports.sbrk,L=V(a),Z=V(f.byteLength),G=V(x.byteLength),I=new Uint8Array(n.exports.memory.buffer);I.set(s(f),Z),I.set(s(x),G),n.exports.meshopt_computeClusterBounds(L,Z,f.length,G,_,C);var v=m(L);return V(L-V(0)),v}return{ready:i,supported:!0,buildMeshlets:function(f,x,_,C,V,L){r(f.length%3==0),r(x instanceof Float32Array),r(x.length%_==0),r(_>=3),r(C<=255||C>0),r(V<=512),r(V%4==0),L=L||0;var Z=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f);return u(Z,x,x.length/_,_*4,C,V,L)},computeClusterBounds:function(f,x,_){r(f.length%3==0),r(f.length/3<=512),r(x instanceof Float32Array),r(x.length%_==0),r(_>=3);var C=f.BYTES_PER_ELEMENT==4?f:new Uint32Array(f);return g(C,x,x.length/_,_*4)},computeMeshletBounds:function(f,x,_){return r(f.meshletCount!=0),r(x instanceof Float32Array),r(x.length%_==0),r(_>=3),p(f,x,x.length/_,_*4)},extractMeshlet:function(f,x){return r(x>=0&&x<f.meshletCount),d(f,x)}}}();function Qx(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.bufferViewId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.bufferViews[i],c=a.buffer,d=a.byteOffset,u=a.byteLength,m=!1,p,g,f,x;if(oi(a,"EXT_meshopt_compression")){let C=a.extensions.EXT_meshopt_compression;c=C.buffer,d=y(C.byteOffset,0),u=C.byteLength,m=!0,p=C.byteStride,g=C.count,f=C.mode,x=y(C.filter,"NONE")}let _=n.buffers[c];this._hasMeshopt=m,this._meshoptByteStride=p,this._meshoptCount=g,this._meshoptMode=f,this._meshoptFilter=x,this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._buffer=_,this._bufferId=c,this._byteOffset=d,this._byteLength=u,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(Qx.prototype=Object.create(Hi.prototype),Qx.prototype.constructor=Qx);Object.defineProperties(Qx.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function aAe(e){try{let t=cAe(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let o=e._meshoptCount,r=e._meshoptByteStride,s=new Uint8Array(o*r);Poe.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=yt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load buffer view",t)}}Qx.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,this._promise=aAe(this),this._promise)};function cAe(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let o=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:o})}return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId})}Qx.prototype.unload=function(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var pC=Qx;var ecn=T(S(),1);var zan=T(S(),1);function wr(){}wr._maxDecodingConcurrency=Math.max(zt.hardwareConcurrency-1,1);wr._decoderTaskProcessor=void 0;wr._taskProcessorReady=!1;wr._error=void 0;wr._getDecoderTaskProcessor=function(){if(!l(wr._decoderTaskProcessor)){let e=new bi("decodeDraco",wr._maxDecodingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(t){t?wr._taskProcessorReady=!0:wr._error=new de("Draco decoder could not be initialized.")}).catch(t=>{wr._error=t}),wr._decoderTaskProcessor=e}return wr._decoderTaskProcessor};wr.decodePointCloud=function(e){let t=wr._getDecoderTaskProcessor();if(l(wr._error))throw wr._error;if(wr._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};wr.decodeBufferView=function(e){let t=wr._getDecoderTaskProcessor();if(l(wr._error))throw wr._error;if(wr._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var Op=wr;function $0(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.draco,o=e.gltfResource,r=e.baseResource,s=e.cacheKey;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._draco=i,this._cacheKey=s,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=yt.UNLOADED,this._promise=void 0,this._dracoError=void 0}l(Object.create)&&($0.prototype=Object.create(Hi.prototype),$0.prototype.constructor=$0);Object.defineProperties($0.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function lAe(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=yt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;voe(e,n)}}$0.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,this._promise=lAe(this),this._promise)};function voe(e,t){throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load Draco",t)}async function dAe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=yt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}$0.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.PROCESSING||(l(this._dracoError)&&voe(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let t=this._draco,i=this._gltf.bufferViews,o=t.bufferView,r=i[o],s=t.attributes,a={array:new Uint8Array(this._bufferViewTypedArray),bufferView:r,compressedAttributes:s,dequantizeInShader:!0},c=Op.decodeBufferView(a);if(!l(c))return!1;this._decodePromise=dAe(this,c)};$0.prototype.unload=function(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0};var bC=$0;var fcn=T(S(),1);var rcn=T(S(),1);function uAe(e){let t=e.uint8Array,n=e.format,i=e.request,o=y(e.flipY,!1),r=y(e.skipColorSpaceConversion,!1),s=new Blob([t],{type:n}),a;return Ee.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(Ee.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new Ee({url:a,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(c){return l(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return l(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var jx=uAe;function Yp(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.imageId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey,a=n.images[i],c=a.bufferView,d=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=c,this._uri=d,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(Yp.prototype=Object.create(Hi.prototype),Yp.prototype.constructor=Yp);Object.defineProperties(Yp.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});Yp.prototype.load=function(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=mAe(this),this._promise):(this._promise=hAe(this),this._promise)};function woe(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function mAe(e){e._state=yt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,o=await pAe(i);if(e.isDestroyed())return;let r=woe(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=yt.READY,e}catch(n){return e.isDestroyed()?void 0:Foe(e,n,"Failed to load embedded image")}}async function hAe(e){e._state=yt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await gAe(i);if(e.isDestroyed())return;let r=woe(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=yt.READY,e}catch(o){return e.isDestroyed()?void 0:Foe(e,o,`Failed to load image: ${n}`)}}function Foe(e,t,n){return e.unload(),e._state=yt.FAILED,Promise.reject(e.getError(n,t))}function fAe(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new de("Image format is not recognized")}async function pAe(e){let t=fAe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return _l(n)}return Yp._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var bAe=/(^data:image\/ktx2)|(\.ktx2$)/i;function gAe(e){let t=e.getUrlComponent(!1,!0);return bAe.test(t)?_l(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}Yp.prototype.unload=function(){l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0};Yp._loadImageFromTypedArray=jx;var gC=Yp;var Gcn=T(S(),1);var bcn=T(S(),1),yAe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},Wa=Object.freeze(yAe);function eg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.accessorId,o=e.gltfResource,r=e.baseResource,s=e.draco,a=e.cacheKey,c=y(e.asynchronous,!0),d=y(e.loadBuffer,!1),u=y(e.loadTypedArray,!1),m=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._accessorId=i,this._indexDatatype=m,this._draco=s,this._cacheKey=a,this._asynchronous=c,this._loadBuffer=d,this._loadTypedArray=u,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(eg.prototype=Object.create(Hi.prototype),eg.prototype.constructor=eg);Object.defineProperties(eg.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});var xAe=new ZH;eg.prototype.load=async function(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=_Ae(this),this._promise):(this._promise=TAe(this),this._promise)};async function _Ae(e){e._state=yt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=yt.LOADED,e)}catch(n){if(e.isDestroyed())return;RH(e,n)}}async function TAe(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=yt.LOADING;let r=e._resourceCache;try{let s=r.getBufferViewLoader({gltf:t,bufferViewId:o,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=SAe(e,a),e._state=yt.PROCESSING,e}catch(s){if(e.isDestroyed())return;RH(e,s)}}function SAe(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Ae.getSizeInBytes(s),c=t.buffer,d=t.byteOffset+o.byteOffset;if(d%a!==0){let m=r*a,p=new Uint8Array(c,d,m);c=new Uint8Array(p).buffer,d=0,ls("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let u;return s===Ae.UNSIGNED_BYTE?u=new Uint8Array(c,d,r):s===Ae.UNSIGNED_SHORT?u=new Uint16Array(c,d,r):s===Ae.UNSIGNED_INT&&(u=new Uint32Array(c,d,r)),u}function RH(e,t){throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load index buffer",t)}function ZH(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}ZH.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};ZH.prototype.execute=function(){this.buffer=Aoe(this.typedArray,this.indexDatatype,this.context)};function Aoe(e,t,n){let i=xt.createIndexBuffer({typedArray:e,context:n,usage:Me.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}eg.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.LOADED&&this._state!==yt.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(e)&&(t=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=t,n=Q.fromTypedArray(t),this._indexDatatype=n)}catch(o){RH(this,o)}if(!l(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=xAe;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,Wa.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=Aoe(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=yt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};eg.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var yC=eg;var Nun=T(S(),1);var $cn=T(S(),1);var Xcn=T(S(),1);function CAe(e,t,n){if(n=y(n,!1),n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var Ss=CAe;var Mcn=T(S(),1);var vcn=T(S(),1);function VAe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var sr=VAe;function Qt(){}Qt.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}}};Qt.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=t(o,i);if(l(r))return r}}};Qt.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?Qt.objectLegacy(i,n):Qt.object(i,n)};Qt.accessor=function(e,t){return Qt.topLevel(e,"accessors",t)};Qt.accessorWithSemantic=function(e,t,n){let i={};return Qt.mesh(e,function(o){return Qt.meshPrimitive(o,function(r){let s=Qt.meshPrimitiveAttribute(r,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let d=n(a);if(l(d))return d}});return l(s)?s:Qt.meshPrimitiveTarget(r,function(a){return Qt.meshPrimitiveTargetAttribute(a,function(c,d){if(d.indexOf(t)===0&&!l(i[c])){i[c]=!0;let u=n(c);if(l(u))return u}})})})})};Qt.accessorContainingVertexAttributeData=function(e,t){let n={};return Qt.mesh(e,function(i){return Qt.meshPrimitive(i,function(o){let r=Qt.meshPrimitiveAttribute(o,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(r)?r:Qt.meshPrimitiveTarget(o,function(s){return Qt.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};Qt.accessorContainingIndexData=function(e,t){let n={};return Qt.mesh(e,function(i){return Qt.meshPrimitive(i,function(o){let r=o.indices;if(l(r)&&!l(n[r])){n[r]=!0;let s=t(r);if(l(s))return s}})})};Qt.animation=function(e,t){return Qt.topLevel(e,"animations",t)};Qt.animationChannel=function(e,t){let n=e.channels;return Qt.object(n,t)};Qt.animationSampler=function(e,t){let n=e.samplers;return Qt.object(n,t)};Qt.buffer=function(e,t){return Qt.topLevel(e,"buffers",t)};Qt.bufferView=function(e,t){return Qt.topLevel(e,"bufferViews",t)};Qt.camera=function(e,t){return Qt.topLevel(e,"cameras",t)};Qt.image=function(e,t){return Qt.topLevel(e,"images",t)};Qt.material=function(e,t){return Qt.topLevel(e,"materials",t)};Qt.materialValue=function(e,t){let n=e.values;l(e.extensions)&&l(e.extensions.KHR_techniques_webgl)&&(n=e.extensions.KHR_techniques_webgl.values);for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Qt.mesh=function(e,t){return Qt.topLevel(e,"meshes",t)};Qt.meshPrimitive=function(e,t){let n=e.primitives;if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r,o);if(l(s))return s}}};Qt.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Qt.meshPrimitiveTarget=function(e,t){let n=e.targets;if(l(n)){let i=n.length;for(let o=0;o<i;++o){let r=t(n[o],o);if(l(r))return r}}};Qt.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}};Qt.node=function(e,t){return Qt.topLevel(e,"nodes",t)};Qt.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let o=t.length;for(let r=0;r<o;r++){let s=t[r],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let d=a.children;if(l(d)&&(c=Qt.nodeInTree(e,d,n),l(c)))return c}}}};Qt.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return Qt.nodeInTree(e,i,n)};Qt.program=function(e,t){return sr(e,"KHR_techniques_webgl")?Qt.object(e.extensions.KHR_techniques_webgl.programs,t):Qt.topLevel(e,"programs",t)};Qt.sampler=function(e,t){return Qt.topLevel(e,"samplers",t)};Qt.scene=function(e,t){return Qt.topLevel(e,"scenes",t)};Qt.shader=function(e,t){return sr(e,"KHR_techniques_webgl")?Qt.object(e.extensions.KHR_techniques_webgl.shaders,t):Qt.topLevel(e,"shaders",t)};Qt.skin=function(e,t){return Qt.topLevel(e,"skins",t)};Qt.skinJoint=function(e,t){let n=e.joints;if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r);if(l(s))return s}}};Qt.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Qt.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Qt.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};Qt.technique=function(e,t){return sr(e,"KHR_techniques_webgl")?Qt.object(e.extensions.KHR_techniques_webgl.techniques,t):Qt.topLevel(e,"techniques",t)};Qt.texture=function(e,t){return Qt.topLevel(e,"textures",t)};var Pe=Qt;var Ycn=T(S(),1);var kcn=T(S(),1);function LAe(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}var gd=LAe;function RAe(e,t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n];if(l(i.byteStride)&&i.byteStride>0)return i.byteStride}return Q.getSizeInBytes(t.componentType)*gd(t.type)}var Xl=RAe;function ZAe(e){Pe.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=y(n.byteOffset,0))}),Pe.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=y(n.byteOffset,0))}),Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){if(i.mode=y(i.mode,ie.TRIANGLES),!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=Ss(e.materials,o)}})}),Pe.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=y(i.normalized,!1),l(o)){let r=e.bufferViews[o];r.byteStride=Xl(e,i),r.target=ie.ARRAY_BUFFER}}),Pe.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=ie.ELEMENT_ARRAY_BUFFER}}),Pe.material(e,function(n){let i=y(n.extensions,y.EMPTY_OBJECT),o=i.KHR_materials_common;if(l(o)){let c=o.technique,d=l(o.values)?o.values:{};o.values=d,d.ambient=l(d.ambient)?d.ambient:[0,0,0,1],d.emission=l(d.emission)?d.emission:[0,0,0,1],d.transparency=y(d.transparency,1),c!=="CONSTANT"&&(d.diffuse=l(d.diffuse)?d.diffuse:[0,0,0,1],c!=="LAMBERT"&&(d.specular=l(d.specular)?d.specular:[0,0,0,1],d.shininess=y(d.shininess,0))),o.transparent=y(o.transparent,!1),o.doubleSided=y(o.doubleSided,!1);return}n.emissiveFactor=y(n.emissiveFactor,[0,0,0]),n.alphaMode=y(n.alphaMode,"OPAQUE"),n.doubleSided=y(n.doubleSided,!1),n.alphaMode==="MASK"&&(n.alphaCutoff=y(n.alphaCutoff,.5));let r=i.KHR_techniques_webgl;l(r)&&Pe.materialValue(n,function(c){l(c.index)&&qx(c)}),qx(n.emissiveTexture),qx(n.normalTexture),qx(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=y(s.baseColorFactor,[1,1,1,1]),s.metallicFactor=y(s.metallicFactor,1),s.roughnessFactor=y(s.roughnessFactor,1),qx(s.baseColorTexture),qx(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=y(a.diffuseFactor,[1,1,1,1]),a.specularFactor=y(a.specularFactor,[1,1,1]),a.glossinessFactor=y(a.glossinessFactor,1),qx(a.specularGlossinessTexture))}),Pe.animation(e,function(n){Pe.animationSampler(n,function(i){i.interpolation=y(i.interpolation,"LINEAR")})});let t=GAe(e);return Pe.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=y(n.translation,[0,0,0]),n.rotation=y(n.rotation,[0,0,0,1]),n.scale=y(n.scale,[1,1,1])):n.matrix=y(n.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),Pe.sampler(e,function(n){n.wrapS=y(n.wrapS,ie.REPEAT),n.wrapT=y(n.wrapT,ie.REPEAT)}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function GAe(e){let t={};return Pe.animation(e,function(n){Pe.animationChannel(n,function(i){let o=i.target,r=o.node,s=o.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[r]=!0)})}),t}function qx(e){l(e)&&(e.texCoord=y(e.texCoord,0))}var GI=ZAe;var iln=T(S(),1);function EAe(e){return Pe.shader(e,function(t){p5(t)}),Pe.buffer(e,function(t){p5(t)}),Pe.image(e,function(t){p5(t)}),p5(e),e}function p5(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var tg=EAe;var xln=T(S(),1);var dln=T(S(),1);var sln=T(S(),1);function IAe(e,t){let n=e.extensionsRequired;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var EI=IAe;function XAe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),EI(e,t),n.length===0&&delete e.extensionsUsed}}var $x=XAe;var WAe=4;function PAe(e){if(vm(e)!=="glTF")throw new de("File is not valid binary glTF");let n=Moe(e,0,5),i=n[1];if(i!==1&&i!==2)throw new de("Binary glTF version is not 1 or 2");return i===1?vAe(e,n):wAe(e,n)}function Moe(e,t,n){let i=new DataView(e.buffer),o=new Array(n);for(let r=0;r<n;++r)o[r]=i.getUint32(e.byteOffset+t+r*WAe,!0);return o}function vAe(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new de("Binary glTF scene format is not JSON");let r=20,s=r+i,a=Zl(e,r,i),c=JSON.parse(a);tg(c);let d=e.subarray(s,n),u=c.buffers;if(l(u)&&Object.keys(u).length>0){let m=y(u.binary_glTF,u.KHR_binary_glTF);l(m)&&(m.extras._pipeline.source=d,delete m.uri)}return $x(c,"KHR_binary_glTF"),c}function wAe(e,t){let n=t[2],i=12,o,r;for(;i<n;){let s=Moe(e,i,2),a=s[0],c=s[1];i+=8;let d=e.subarray(i,i+a);if(i+=a,c===1313821514){let u=Zl(d);o=JSON.parse(u),tg(o)}else c===5130562&&(r=d)}if(l(o)&&l(r)){let s=o.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=r}}return o}var II=PAe;var Cln=T(S(),1);function FAe(e){return Pe.shader(e,function(t){b5(t)}),Pe.buffer(e,function(t){b5(t)}),Pe.image(e,function(t){b5(t)}),b5(e),e}function b5(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var XI=FAe;var oun=T(S(),1);var Zln=T(S(),1);function AAe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),Ss(n,t,!0)}var Su=AAe;var Aln=T(S(),1);var Iln=T(S(),1);function MAe(e){switch(e){case Q.BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt8(n+s*o)};case Q.UNSIGNED_BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint8(n+s*o)};case Q.SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt16(n+s*o,!0)};case Q.UNSIGNED_SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint16(n+s*o,!0)};case Q.INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt32(n+s*o,!0)};case Q.UNSIGNED_INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint32(n+s*o,!0)};case Q.FLOAT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat32(n+s*o,!0)};case Q.DOUBLE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat64(n+s*o,!0)}}}var Hp=MAe;function NAe(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=gd(t.type);if(!l(t.bufferView))return{min:new Array(r).fill(0),max:new Array(r).fill(0)};let s=new Array(r).fill(Number.POSITIVE_INFINITY),a=new Array(r).fill(Number.NEGATIVE_INFINITY),c=n[o],d=c.buffer,m=i[d].extras._pipeline.source,p=t.count,g=Xl(e,t),f=t.byteOffset+c.byteOffset+m.byteOffset,x=t.componentType,_=Q.getSizeInBytes(x),C=new DataView(m.buffer),V=new Array(r),L=Hp(x);for(let Z=0;Z<p;Z++){L(C,f,r,_,V);for(let G=0;G<r;G++){let I=V[G];s[G]=Math.min(s[G],I),a[G]=Math.max(a[G],I)}f+=g}return{min:s,max:a}}var e_=NAe;var Oln=T(S(),1);var kAe=[ie.FUNC_ADD,ie.FUNC_ADD],UAe=[ie.ONE,ie.ZERO,ie.ONE,ie.ZERO];function Noe(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var DAe=[ie.ZERO,ie.ONE,ie.SRC_COLOR,ie.ONE_MINUS_SRC_COLOR,ie.SRC_ALPHA,ie.ONE_MINUS_SRC_ALPHA,ie.DST_ALPHA,ie.ONE_MINUS_DST_ALPHA,ie.DST_COLOR,ie.ONE_MINUS_DST_COLOR];function BAe(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(DAe.indexOf(e[n])===-1)return t;return e}function OAe(e){let t={},n={},i=e.techniques;return l(i)&&(Pe.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(Noe(s,ie.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:y(c.blendEquationSeparate,kAe),blendFactors:BAe(c.blendFuncSeparate,UAe)})}Noe(s,ie.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Su(e,"KHR_blend")),Pe.material(e,function(o){if(l(o.technique)){let r=n[o.technique];Pe.objectLegacy(r,function(a,c){o[c]=a});let s=t[o.technique];l(s)&&(l(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var WI=OAe;var ndn=T(S(),1);var Jln=T(S(),1);function YAe(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),Ss(n,t,!0),Su(e,t)}var PI=YAe;function HAe(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Pe.technique(e,function(a,c){let d={name:a.name,program:void 0,attributes:{},uniforms:{}},u;if(Pe.techniqueAttribute(a,function(m,p){u=a.parameters[m],d.attributes[p]={semantic:u.semantic}}),Pe.techniqueUniform(a,function(m,p){u=a.parameters[m],d.uniforms[p]={count:u.count,node:u.node,type:u.type,semantic:u.semantic,value:u.value},l(n[c])||(n[c]={}),n[c][m]=p}),l(o[a.program]))d.program=o[a.program];else{let m=e.programs[a.program],p={name:m.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[m.fragmentShader];p.fragmentShader=Ss(r.shaders,g,!0);let f=e.shaders[m.vertexShader];p.vertexShader=Ss(r.shaders,f,!0),d.program=Ss(r.programs,p),o[a.program]=d.program}i[c]=Ss(r.techniques,d)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,Su(e,"KHR_techniques_webgl"),PI(e,"KHR_techniques_webgl"))}return Pe.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};Pe.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let d=n[r.technique][c];l(d)&&(s.values[d]=a)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var vI=HAe;var fdn=T(S(),1);var adn=T(S(),1);function zAe(e,t){go.typeOf.object("material",e),go.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let r=n.baseColorTexture,s=t(r.index,r);if(l(s))return s}if(l(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,s=t(r.index,r);if(l(s))return s}}let{extensions:i}=e;if(l(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(l(r)){if(l(r.diffuseTexture)){let c=r.diffuseTexture,d=t(c.index,c);if(l(d))return d}if(l(r.specularGlossinessTexture)){let c=r.specularGlossinessTexture,d=t(c.index,c);if(l(d))return d}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:c,specularColorTexture:d}=s;if(l(c)){let u=t(c.index,c);if(l(u))return u}if(l(d)){let u=t(d.index,d);if(l(u))return u}}let a=i.KHR_materials_common;if(l(a)&&l(a.values)){let{diffuse:c,ambient:d,emission:u,specular:m}=a.values;if(l(c)&&l(c.index)){let p=t(c.index,c);if(l(p))return p}if(l(d)&&l(d.index)){let p=t(d.index,d);if(l(p))return p}if(l(u)&&l(u.index)){let p=t(u.index,u);if(l(p))return p}if(l(m)&&l(m.index)){let p=t(m.index,m);if(l(p))return p}}}let o=Pe.materialValue(e,function(r){if(l(r.index)){let s=t(r.index,r);if(l(s))return s}});if(l(o))return o;if(l(e.emissiveTexture)){let r=e.emissiveTexture,s=t(r.index,r);if(l(s))return s}if(l(e.normalTexture)){let r=e.normalTexture,s=t(r.index,r);if(l(s))return s}if(l(e.occlusionTexture)){let r=e.occlusionTexture,s=t(r.index,r);if(l(s))return s}}var xC=zAe;var koe=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function KAe(e,t){return t=y(t,koe),koe.forEach(function(n){t.indexOf(n)>-1&&QAe(e,n)}),e}var JAe={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function QAe(e,t){let n=JAe[t],i=e[n];if(l(i)){let o=0,r=sf[t](e),s=i.length;for(let a=0;a<s;++a)r[a]||(rf[t](e,a-o),o++)}}function rf(){}rf.accessor=function(e,t){e.accessors.splice(t,1),Pe.mesh(e,function(i){Pe.meshPrimitive(i,function(o){Pe.meshPrimitiveAttribute(o,function(a,c){a>t&&o.attributes[c]--}),Pe.meshPrimitiveTarget(o,function(a){Pe.meshPrimitiveTargetAttribute(a,function(c,d){c>t&&a[d]--})});let r=o.indices;l(r)&&r>t&&o.indices--;let s=o.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),Pe.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Pe.animation(e,function(i){Pe.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};rf.buffer=function(e,t){e.buffers.splice(t,1),Pe.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--,l(i.extensions)&&l(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};rf.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Pe.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Pe.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Pe.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),sr(e,"KHR_draco_mesh_compression")&&Pe.mesh(e,function(i){Pe.meshPrimitive(i,function(o){l(o.extensions)&&l(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),sr(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let d=a[c];l(d.bufferView)&&d.bufferView>t&&d.bufferView--,l(d.arrayOffsetBufferView)&&d.arrayOffsetBufferView>t&&d.arrayOffsetBufferView--,l(d.stringOffsetBufferView)&&d.stringOffsetBufferView>t&&d.stringOffsetBufferView--}}}}if(sr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let d in c)if(c.hasOwnProperty(d)){let u=c[d];l(u.values)&&u.values>t&&u.values--,l(u.arrayOffsets)&&u.arrayOffsets>t&&u.arrayOffsets--,l(u.stringOffsets)&&u.stringOffsets>t&&u.stringOffsets--}}}}};rf.image=function(e,t){e.images.splice(t,1),Pe.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let o=i.extensions;l(o)&&l(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(o)&&l(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};rf.mesh=function(e,t){e.meshes.splice(t,1),Pe.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};rf.node=function(e,t){e.nodes.splice(t,1),Pe.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(o){return o>t?o-1:o})}),Pe.animation(e,function(i){Pe.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),Pe.technique(e,function(i){Pe.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),Pe.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o}))}),Pe.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};rf.material=function(e,t){e.materials.splice(t,1),Pe.mesh(e,function(i){Pe.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};rf.sampler=function(e,t){e.samplers.splice(t,1),Pe.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};rf.texture=function(e,t){if(e.textures.splice(t,1),Pe.material(e,function(i){xC(i,function(o,r){r.index>t&&--r.index})}),sr(e,"EXT_feature_metadata")){Pe.mesh(e,function(r){Pe.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let d=a.EXT_feature_metadata.featureIdTextures;if(l(d)){let u=d.length;for(let m=0;m<u;++m){let g=d[m].featureIds.texture;g.index>t&&--g.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c].texture;u.index>t&&--u.index}}}}if(sr(e,"EXT_mesh_features")&&Pe.mesh(e,function(i){Pe.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let d=0;d<c;++d){let u=a[d];l(u.texture)&&u.texture.index>t&&--u.texture.index}}}})}),sr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let c=o[s].properties;for(let d in c)if(c.hasOwnProperty(d)){let u=c[d];u.index>t&&--u.index}}}}};function sf(){}sf.accessor=function(e){let t={};return Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){Pe.meshPrimitiveAttribute(i,function(r){t[r]=!0}),Pe.meshPrimitiveTarget(i,function(r){Pe.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),Pe.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Pe.animation(e,function(n){Pe.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),sr(e,"EXT_mesh_gpu_instancing")&&Pe.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let o=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[o]=!0})}),sr(e,"CESIUM_primitive_outline")&&Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};sf.buffer=function(e){let t={};return Pe.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0),l(n.extensions)&&l(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};sf.bufferView=function(e){let t={};if(Pe.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Pe.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Pe.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),sr(e,"KHR_draco_mesh_compression")&&Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),sr(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(sr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let d=a[c];l(d.values)&&(t[d.values]=!0),l(d.arrayOffsets)&&(t[d.arrayOffsets]=!0),l(d.stringOffsets)&&(t[d.stringOffsets]=!0)}}}}return t};sf.image=function(e){let t={};return Pe.texture(e,function(n){l(n.source)&&(t[n.source]=!0),l(n.extensions)&&l(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:l(n.extensions)&&l(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};sf.mesh=function(e){let t={};return Pe.node(e,function(n){if(l(n.mesh&&l(e.meshes))){let i=e.meshes[n.mesh];l(i)&&l(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function Uoe(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(o){return!Uoe(e,o,n)}).length===0}sf.node=function(e){let t={};return Pe.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),Pe.skinJoint(n,function(i){t[i]=!0})}),Pe.animation(e,function(n){Pe.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),Pe.technique(e,function(n){Pe.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),Pe.node(e,function(n,i){Uoe(e,i,t)||(t[i]=!0)}),t};sf.material=function(e){let t={};return Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};sf.texture=function(e){let t={};if(Pe.material(e,function(n){xC(n,function(i){t[i]=!0})}),sr(e,"EXT_feature_metadata")){Pe.mesh(e,function(o){Pe.meshPrimitive(o,function(r){let s=r.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let d=c.length;for(let u=0;u<d;++u){let p=c[u].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let d=s[a].texture;t[d.index]=!0}}}}if(sr(e,"EXT_mesh_features")&&Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.EXT_mesh_features)){let s=o.EXT_mesh_features.featureIds;if(l(s)){let a=s.length;for(let c=0;c<a;++c){let d=s[c];l(d.texture)&&(t[d.texture.index]=!0)}}}})}),sr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let c in a)if(a.hasOwnProperty(c)){let d=a[c];t[d.index]=!0}}}}return t};sf.sampler=function(e){let t={};return Pe.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var wI=KAe;var Xdn=T(S(),1);var gdn=T(S(),1);function jAe(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:Ss(e.buffers,n),byteOffset:0,byteLength:t.length};return Ss(e.bufferViews,o)}var FI=jAe;var Vdn=T(S(),1);function qAe(e,t){let n=Xl(e,t),i=Q.getSizeInBytes(t.componentType),o=gd(t.type),r=t.count,s=new Array(o*r);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,d=t.byteOffset+a.byteOffset+c.byteOffset,u=new DataView(c.buffer),m=new Array(o),p=Hp(t.componentType);for(let g=0;g<r;++g){p(u,d,o,i,m);for(let f=0;f<o;++f)s[g*o+f]=m[f];d+=n}return s}var AI=qAe;function $Ae(e){let t;return Pe.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ie.BYTE?g5(e,i,Q.UNSIGNED_BYTE):t!==ie.UNSIGNED_BYTE&&t!==ie.UNSIGNED_SHORT&&g5(e,i,Q.UNSIGNED_SHORT)}),Pe.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ie.BYTE?g5(e,i,Q.UNSIGNED_BYTE):t===ie.SHORT&&g5(e,i,Q.UNSIGNED_SHORT)}),e}function g5(e,t,n){let i=Q.createTypedArray(n,AI(e,t)),o=new Uint8Array(i.buffer);t.bufferView=FI(e,o),t.componentType=n,t.byteOffset=0}var MI=$Ae;var Fdn=T(S(),1);function eMe(e,t){return $x(e,t),t==="CESIUM_RTC"&&tMe(e),GH(e,t)}function tMe(e){Pe.technique(e,function(t){Pe.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function GH(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)GH(e[i],t)}else if(e!==null&&typeof e=="object"&&e.constructor===Object){let n=e.extensions,i;l(n)&&(i=n[t],l(i)&&(delete n[t],Object.keys(n).length===0&&delete e.extensions));for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&GH(e[o],t);return i}}var t_=eMe;var y5={.8:aMe,"1.0":GMe,"2.0":void 0};function nMe(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.targetVersion,i=e.version;e.asset=y(e.asset,{version:"1.0"}),e.asset.version=y(e.asset.version,"1.0"),i=y(i,e.asset.version).toString(),Object.prototype.hasOwnProperty.call(y5,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(y5,i)||(i="1.0"));let o=y5[i];for(;l(o)&&i!==n;)o(e,t),i=e.asset.version,o=y5[i];return t.keepLegacyExtensions||(XMe(e,t),WMe(e)),e}function Ooe(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.instanceTechnique;l(o)&&(i.technique=o.technique,i.values=o.values,delete i.instanceTechnique)}}function iMe(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let o=t[n].primitives;if(l(o)){let r=o.length;for(let s=0;s<r;++s){let a=o[s],c=y(a.primitive,ie.TRIANGLES);a.mode=y(a.mode,c),delete a.primitive}}}}function oMe(e){let t=e.nodes,n=new h,i=new we;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(l(r.rotation)){let a=r.rotation;h.fromArray(a,0,n),we.fromAxisAngle(n,a[3],i),r.rotation=[i.x,i.y,i.z,i.w]}let s=r.instanceSkin;l(s)&&(r.skeletons=s.skeletons,r.skin=s.skin,r.meshes=s.meshes,delete r.instanceSkin)}}function rMe(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},s=new h,a=new we;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let d=t[c],u=d.channels,m=d.parameters,p=d.samplers;if(l(u)){let g=u.length;for(let f=0;f<g;++f){let x=u[f];if(x.target.path==="rotation"){let _=m[p[x.sampler].output];if(l(r[_]))continue;r[_]=!0;let C=n[_],V=i[C.bufferView],Z=o[V.buffer].extras._pipeline.source,G=Z.byteOffset+V.byteOffset+C.byteOffset,I=C.componentType,v=C.count,P=gd(C.type),w=C.count*P,F=Q.createArrayBufferView(I,Z.buffer,G,w);for(let b=0;b<v;b++){let R=b*P;h.unpack(F,R,s);let E=F[R+3];we.fromAxisAngle(s,E,a),we.pack(a,F,R)}}}}}}function sMe(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.passes;if(l(o)){let r=y(i.pass,"defaultPass");if(Object.prototype.hasOwnProperty.call(o,r)){let s=o[r],a=s.instanceProgram;i.attributes=y(i.attributes,a.attributes),i.program=y(i.program,a.program),i.uniforms=y(i.uniforms,a.uniforms),i.states=y(i.states,s.states)}delete i.passes,delete i.pass}}}function aMe(e){l(e.asset)||(e.asset={});let t=e.asset;if(t.version="1.0",typeof t.profile=="string"){let n=t.profile.split(" ");t.profile={api:n[0],version:n[1]}}else t.profile={};if(l(e.version)&&delete e.version,Ooe(e),iMe(e),oMe(e),rMe(e),sMe(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=y(e.extensions,{});e.extensions=n;let i=y(n.KHR_materials_common,{});n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,Su(e,"KHR_materials_common")}}function cMe(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.parameters;if(l(o)){let r=i.samplers;for(let s in r)if(Object.prototype.hasOwnProperty.call(r,s)){let a=r[s];a.input=o[a.input],a.output=o[a.output]}delete i.parameters}}}function Doe(e,t){let n=[];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let o=e[i];t[i]=n.length,n.push(o),l(o.name)||(o.name=i)}return n}function lMe(e){let t,n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},i,o={},r=e.nodes;for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i=r[s].jointName,l(i)&&(o[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&l(n[s])){let a={},c=e[s];e[s]=Doe(c,a),n[s]=a}for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(o[i]=n.nodes[o[i]]);l(e.scene)&&(e.scene=n.scenes[e.scene]),Pe.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Pe.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Pe.shader(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Pe.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Pe.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),Pe.techniqueParameter(s,function(a){l(a.node)&&(a.node=n.nodes[a.node]);let c=a.value;typeof c=="string"&&(a.value={index:n.textures[c]})})}),Pe.mesh(e,function(s){Pe.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),Pe.meshPrimitiveAttribute(a,function(c,d){a.attributes[d]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),Pe.node(e,function(s){let a=s.children;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(l(s.meshes)){let c=s.meshes,d=c.length;if(d>0)for(s.mesh=n.meshes[c[0]],t=1;t<d;++t){let u={mesh:n.meshes[c[t]]},m=Ss(e.nodes,u);l(a)||(a=[],s.children=a),a.push(m)}delete s.meshes}if(l(s.camera)&&(s.camera=n.cameras[s.camera]),l(s.skin)&&(s.skin=n.skins[s.skin]),l(s.skeletons)){let c=s.skeletons;if(c.length>0&&l(s.skin)){let u=e.skins[s.skin];u.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),Pe.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],d=a.length;for(t=0;t<d;++t)c[t]=o[a[t]];s.joints=c,delete s.jointNames}}),Pe.scene(e,function(s){let a=s.nodes;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}}),Pe.animation(e,function(s){let a={};s.samplers=Doe(s.samplers,a),Pe.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),Pe.animationChannel(s,function(c){c.sampler=a[c.sampler];let d=c.target;l(d)&&(d.node=n.nodes[d.id],delete d.id)})}),Pe.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),Pe.materialValue(s,function(c,d){typeof c=="string"&&(s.values[d]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&Pe.materialValue(c,function(d,u){typeof d=="string"&&(c.values[u]={index:n.textures[d]})})}}),Pe.image(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],s.mimeType=c.mimeType,delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Pe.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function dMe(e){Pe.animation(e,function(t){Pe.animationSampler(t,function(n){delete n.name})})}function uMe(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];Array.isArray(n)&&n.length===0&&delete e[t]}Pe.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function mMe(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var hMe={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function fMe(e){let t=e.extensionsUsed;if(e.extensionsRequired=y(e.extensionsRequired,[]),l(t)){let n=t.length;for(let i=0;i<n;++i){let o=t[i];l(hMe[o])&&e.extensionsRequired.push(o)}}}function pMe(e){Pe.buffer(e,function(t){delete t.type})}function bMe(e){Pe.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function gMe(e){Pe.mesh(e,function(t){Pe.meshPrimitive(t,function(n){Pe.meshPrimitiveAttribute(n,function(i,o){o==="TEXCOORD"?n.attributes.TEXCOORD_0=i:o==="COLOR"&&(n.attributes.COLOR_0=i)}),delete n.attributes.TEXCOORD,delete n.attributes.COLOR})}),Pe.technique(e,function(t){Pe.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var yMe={POSITION:!0,NORMAL:!0,TANGENT:!0},xMe={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function _Me(e){let t={};Pe.mesh(e,function(n){Pe.meshPrimitive(n,function(i){Pe.meshPrimitiveAttribute(i,function(o,r){if(r.charAt(0)!=="_"){let s=r.search(/_[0-9]+/g),a=r,c="_0";s>=0&&(a=r.substring(0,s),c=r.substring(s));let d,u=xMe[a];l(u)?(d=u+c,t[r]=d):l(yMe[a])||(d=`_${r}`,t[r]=d)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];l(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),Pe.technique(e,function(n){Pe.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function TMe(e){Pe.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;l(o)&&o===0&&(n.yfov=1)}})}function IH(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:Xl(e,t)}function SMe(e){Pe.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Pe.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=IH(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(y(i.byteLength,0),r)}})}function CMe(e){let t,n,i,o=e.bufferViews,r={};Pe.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};Pe.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=y(s[a.bufferView],[]),s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=o[a];let c=s[a];c.sort(function(p,g){return p.byteOffset-g.byteOffset});let d=0,u=0,m=c.length;for(t=0;t<m;++t){let p=c[t],g=IH(e,p),f=p.byteOffset,x=p.count*g;delete p.byteStride;let _=t<m-1,C=_?IH(e,c[t+1]):void 0;if(g!==C){let V=Ye(i,!0);r[a]&&(V.byteStride=g),V.byteOffset+=d,V.byteLength=f+x-d;let L=Ss(o,V);for(n=u;n<=t;++n)p=c[n],p.bufferView=L,p.byteOffset=p.byteOffset-d;d=_?c[t+1].byteOffset:void 0,u=t+1}}}wI(e,["accessor","bufferView","buffer"])}function VMe(e){Pe.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=e_(e,n);n.min=i.min,n.max=i.max}})}function Yoe(e){return(!l(e.children)||e.children.length===0)&&(!l(e.meshes)||e.meshes.length===0)&&!l(e.camera)&&!l(e.skin)&&!l(e.skeletons)&&!l(e.jointName)&&(!l(e.translation)||h.fromArray(e.translation).equals(h.ZERO))&&(!l(e.scale)||h.fromArray(e.scale).equals(new h(1,1,1)))&&(!l(e.rotation)||se.fromArray(e.rotation).equals(new se(0,0,0,1)))&&(!l(e.matrix)||M.fromColumnMajorArray(e.matrix).equals(M.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function Hoe(e,t){Pe.scene(e,function(n){let i=n.nodes;if(l(i)){let o=i.length;for(let r=o;r>=0;--r)if(i[r]===t){i.splice(r,1);return}}}),Pe.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),Yoe(n)&&Hoe(e,i))}}),delete e.nodes[t]}function LMe(e){return Pe.node(e,function(t,n){Yoe(t)&&Hoe(e,n)}),e}function RMe(e){Pe.animation(e,function(t){Pe.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=e_(e,i);i.min=o.min,i.max=o.max}})})}function ZMe(e){Pe.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=e_(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function GMe(e){e.asset=y(e.asset,{}),e.asset.version="2.0",Ooe(e),cMe(e),LMe(e),lMe(e),dMe(e),mMe(e),fMe(e),SMe(e),CMe(e),VMe(e),RMe(e),ZMe(e),pMe(e),bMe(e),gMe(e),_Me(e),MI(e),TMe(e),WI(e),vI(e),uMe(e)}var EMe=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],IMe=["u_diffuse","u_diffuse_mat"];function XH(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function WH(e){return l(e.index)}function PH(e){return Array.isArray(e)&&e.length===4}function zoe(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function XMe(e,t){t=y(t,y.EMPTY_OBJECT);let n=y(t.baseColorTextureNames,EMe),i=y(t.baseColorFactorNames,IMe);Pe.material(e,function(o){Pe.materialValue(o,function(r,s){n.indexOf(s)!==-1&&WH(r)?(XH(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&PH(r)&&(XH(o),o.pbrMetallicRoughness.baseColorFactor=zoe(r))})}),t_(e,"KHR_techniques_webgl"),t_(e,"KHR_blend")}function EH(e,t){l(t)&&(PH(t)?e.pbrMetallicRoughness.baseColorFactor=zoe(t):WH(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function Boe(e,t){l(t)&&(PH(t)?e.emissiveFactor=t.slice(0,3):WH(t)&&(e.emissiveTexture=t))}function WMe(e){Pe.material(e,function(t){let n=y(t.extensions,y.EMPTY_OBJECT).KHR_materials_common;if(!l(n))return;let i=y(n.values,{}),o=i.ambient,r=i.diffuse,s=i.emission,a=i.transparency,c=n.doubleSided,d=n.transparent;XH(t),n.technique==="CONSTANT"?(Su(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},EH(t,s),EH(t,o)):(EH(t,r),Boe(t,o),Boe(t,s)),l(c)&&(t.doubleSided=c),l(a)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),l(d)&&(t.alphaMode=d?"BLEND":"OPAQUE")}),t_(e,"KHR_materials_common")}var NI=nMe;var _un=T(S(),1);var aun=T(S(),1);var ri={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function PMe(e){switch(e){case ri.POSITION:return"positionMC";case ri.NORMAL:return"normalMC";case ri.TANGENT:return"tangentMC";case ri.TEXCOORD:return"texCoord";case ri.COLOR:return"color";case ri.JOINTS:return"joints";case ri.WEIGHTS:return"weights";case ri.FEATURE_ID:return"featureId"}}ri.hasSetIndex=function(e){switch(e){case ri.POSITION:case ri.NORMAL:case ri.TANGENT:return!1;case ri.TEXCOORD:case ri.COLOR:case ri.JOINTS:case ri.WEIGHTS:case ri.FEATURE_ID:return!0}};ri.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return ri.POSITION;case"NORMAL":return ri.NORMAL;case"TANGENT":return ri.TANGENT;case"TEXCOORD":return ri.TEXCOORD;case"COLOR":return ri.COLOR;case"JOINTS":return ri.JOINTS;case"WEIGHTS":return ri.WEIGHTS;case"_FEATURE_ID":return ri.FEATURE_ID}};ri.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return ri.POSITION;case"RGBA":case"RGB":case"RGB565":return ri.COLOR;case"NORMAL":case"NORMAL_OCT16P":return ri.NORMAL;case"BATCH_ID":return ri.FEATURE_ID}};ri.getGlslType=function(e){switch(e){case ri.POSITION:case ri.NORMAL:case ri.TANGENT:return"vec3";case ri.TEXCOORD:return"vec2";case ri.COLOR:return"vec4";case ri.JOINTS:return"ivec4";case ri.WEIGHTS:return"vec4";case ri.FEATURE_ID:return"int"}};ri.getVariableName=function(e,t){let n=PMe(e);return l(t)&&(n+=`_${t}`),n};var Vt=Object.freeze(ri);function sc(){}sc.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=`
  5534. ${n.message}`);let o=new de(i);return l(n)&&(o.stack=`Original stack:
  5535. ${n.stack}
  5536. Handler stack:
  5537. ${o.stack}`),o};sc.getNodeTransform=function(e){return l(e.matrix)?e.matrix:M.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:h.ZERO,l(e.rotation)?e.rotation:we.IDENTITY,l(e.scale)?e.scale:h.ONE)};sc.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=l(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};sc.getAttributeByName=function(e,t){let n=e.attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.name===t)return r}};sc.getFeatureIdsByLabel=function(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.positionalLabel===t||i.label===t)return i}};sc.hasQuantizedAttributes=function(e){if(!l(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(l(n.quantization))return!0}return!1};sc.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,o=!1;l(t)?(i=Vt.getVariableName(t,n),o=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let r=/^color_\d+$/.test(i),s=e.type,a=sn.getGlslType(s);r&&(a="vec4");let c=l(e.quantization),d;return c&&(d=r?"vec4":sn.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:o,glslType:a,quantizedGlslType:d}};var vMe=new h,wMe=new h;sc.getPositionMinMax=function(e,t,n){let i=sc.getAttributeBySemantic(e,"POSITION"),o=i.max,r=i.min;return l(n)&&l(t)&&(r=h.add(r,t,wMe),o=h.add(o,n,vMe)),{min:r,max:o}};sc.getAxisCorrectionMatrix=function(e,t,n){return n=M.clone(M.IDENTITY,n),e===Xo.Y?n=M.clone(Xo.Y_UP_TO_Z_UP,n):e===Xo.X&&(n=M.clone(Xo.X_UP_TO_Z_UP,n)),t===Xo.Z&&(n=M.multiplyTransformation(n,Xo.Z_UP_TO_X_UP,n)),n};var FMe=new $;sc.getCullFace=function(e,t){if(!Fe.isTriangles(t))return yi.BACK;let n=M.getMatrix3(e,FMe);return $.determinant(n)<0?yi.FRONT:yi.BACK};sc.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};sc.supportedExtensions={AGI_articulations:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_meshopt_compression:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_techniques_webgl:!0,KHR_materials_common:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_materials_specular:!0,KHR_materials_anisotropy:!0,KHR_materials_clearcoat:!0,KHR_materials_unlit:!0,KHR_mesh_quantization:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0};sc.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!sc.supportedExtensions[i])throw new de(`Unsupported glTF Extension: ${i}`)}};var qt=sc;function ng(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltfResource,i=e.baseResource,o=e.typedArray,r=e.gltfJson,s=e.cacheKey;this._resourceCache=t,this._gltfResource=n,this._baseResource=i,this._typedArray=o,this._gltfJson=r,this._cacheKey=s,this._gltf=void 0,this._bufferLoaders=[],this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(ng.prototype=Object.create(Hi.prototype),ng.prototype.constructor=ng);Object.defineProperties(ng.prototype,{cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}});ng.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,l(this._gltfJson)?(this._promise=Koe(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=Joe(this,this._typedArray),this._promise):(this._promise=AMe(this),this._promise))};async function AMe(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;vH(e,n)}return Joe(e,t)}function vH(e,t){e.unload(),e._state=yt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function MMe(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!sr(t,"KHR_techniques_webgl")&&!sr(t,"KHR_materials_common"))return Promise.resolve();let n=[];Pe.buffer(t,function(i){if(!l(i.extras._pipeline.source)&&l(i.uri)){let o=e._baseResource.getDerivedResource({url:i.uri}),s=e._resourceCache.getExternalBufferLoader({resource:o});e._bufferLoaders.push(s),n.push(s.load().then(function(){s.isDestroyed()||(i.extras._pipeline.source=s.typedArray)}))}}),await Promise.all(n),NI(t)}function NMe(e){let t=[];return Pe.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&hp(i)&&(delete n.uri,t.push(Ee.fetchArrayBuffer(i).then(function(o){n.extras._pipeline.source=new Uint8Array(o)})))}),Promise.all(t)}function kMe(e,t){let n=[];return Pe.buffer(t,function(i,o){let r=i.extras._pipeline.source;if(l(r)&&!l(i.uri)){let a=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:o,typedArray:r});e._bufferLoaders.push(a),n.push(a.load())}}),Promise.all(n)}async function Koe(e,t){try{tg(t),await NMe(t),await MMe(e,t),GI(t),await kMe(e,t),XI(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new de(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&qt.checkSupportedExtensions(i),e._gltf=t,e._state=yt.READY,e}catch(n){if(e.isDestroyed())return;vH(e,n)}}async function Joe(e,t){let n;try{vm(t)==="glTF"?n=II(t):n=Wo(t)}catch(i){if(e.isDestroyed())return;vH(e,i)}return Koe(e,n)}ng.prototype.unload=function(){let e=this._bufferLoaders,t=e.length;for(let n=0;n<t;++n)e[n]=!e[n].isDestroyed()&&this._resourceCache.unload(e[n]);this._bufferLoaders.length=0,this._gltf=void 0};ng.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var _C=ng;var Smn=T(S(),1);var rmn=T(S(),1);var Kun=T(S(),1);var Uun=T(S(),1),UMe={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},af=Object.freeze(UMe);var Vo={};function DMe(){this.octEncoded=!1,this.octEncodedZXY=!1,this.normalizationRange=void 0,this.quantizedVolumeOffset=void 0,this.quantizedVolumeDimensions=void 0,this.quantizedVolumeStepSize=void 0,this.componentDatatype=void 0,this.type=void 0}function BMe(){this.name=void 0,this.semantic=void 0,this.setIndex=void 0,this.componentDatatype=void 0,this.type=void 0,this.normalized=!1,this.count=void 0,this.min=void 0,this.max=void 0,this.constant=void 0,this.quantization=void 0,this.typedArray=void 0,this.buffer=void 0,this.byteOffset=0,this.byteStride=void 0}function OMe(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function YMe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}function HMe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.offset=0,this.repeat=void 0,this.label=void 0,this.positionalLabel=void 0}function zMe(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}function KMe(){this.attributes=[]}function JMe(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0}function QMe(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function jMe(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function qMe(){this.name=void 0,this.index=void 0,this.children=[],this.primitives=[],this.instances=void 0,this.skin=void 0,this.matrix=void 0,this.translation=void 0,this.rotation=void 0,this.scale=void 0,this.morphWeights=[],this.articulationName=void 0}function $Me(){this.nodes=[]}var e9e={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function t9e(){this.input=[],this.interpolation=void 0,this.output=[]}function n9e(){this.node=void 0,this.path=void 0}function i9e(){this.sampler=void 0,this.target=void 0}function o9e(){this.name=void 0,this.samplers=[],this.channels=[]}function r9e(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function s9e(){this.name=void 0,this.stages=[]}function Qoe(){this.credits=[]}function a9e(){this.asset=new Qoe,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=M.clone(M.IDENTITY),this.extensions={}}function c9e(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=$.clone($.IDENTITY),this.scale=1,this.channels=void 0}function ig(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=se.clone(ig.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=ig.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=ig.DEFAULT_ROUGHNESS_FACTOR}ig.DEFAULT_BASE_COLOR_FACTOR=se.ONE;ig.DEFAULT_METALLIC_FACTOR=1;ig.DEFAULT_ROUGHNESS_FACTOR=1;function n_(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=se.clone(n_.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone(n_.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=n_.DEFAULT_GLOSSINESS_FACTOR}n_.DEFAULT_DIFFUSE_FACTOR=se.ONE;n_.DEFAULT_SPECULAR_FACTOR=h.ONE;n_.DEFAULT_GLOSSINESS_FACTOR=1;function kI(){this.specularFactor=kI.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=h.clone(kI.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}kI.DEFAULT_SPECULAR_FACTOR=1;kI.DEFAULT_SPECULAR_COLOR_FACTOR=h.ONE;function UI(){this.anisotropyStrength=UI.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=UI.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}UI.DEFAULT_ANISOTROPY_STRENGTH=0;UI.DEFAULT_ANISOTROPY_ROTATION=0;function DI(){this.clearcoatFactor=DI.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=DI.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}DI.DEFAULT_CLEARCOAT_FACTOR=0;DI.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR=0;function wH(){this.metallicRoughness=new ig,this.specularGlossiness=void 0,this.specular=void 0,this.anisotropy=void 0,this.clearcoat=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=h.clone(wH.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=af.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}wH.DEFAULT_EMISSIVE_FACTOR=h.ZERO;Vo.Quantization=DMe;Vo.Attribute=BMe;Vo.Indices=OMe;Vo.FeatureIdAttribute=YMe;Vo.FeatureIdTexture=zMe;Vo.FeatureIdImplicitRange=HMe;Vo.MorphTarget=KMe;Vo.Primitive=JMe;Vo.Instances=QMe;Vo.Skin=jMe;Vo.Node=qMe;Vo.Scene=$Me;Vo.AnimatedPropertyType=Object.freeze(e9e);Vo.AnimationSampler=t9e;Vo.AnimationTarget=n9e;Vo.AnimationChannel=i9e;Vo.Animation=o9e;Vo.ArticulationStage=r9e;Vo.Articulation=s9e;Vo.Asset=Qoe;Vo.Components=a9e;Vo.TextureReader=c9e;Vo.MetallicRoughness=ig;Vo.SpecularGlossiness=n_;Vo.Specular=kI;Vo.Anisotropy=UI;Vo.Clearcoat=DI;Vo.Material=wH;var Tn=Vo;var x5={};x5.getImageIdFromTexture=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureId:n,supportedImageFormats:i}=e,o=t.textures[n],r=o.extensions;if(l(r)){if(i.webp&&l(r.EXT_texture_webp))return r.EXT_texture_webp.source;if(i.basis&&l(r.KHR_texture_basisu))return r.KHR_texture_basisu.source}return o.source};x5.createSampler=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e,o=Cn.REPEAT,r=Cn.REPEAT,s=$t.LINEAR,a=hi.LINEAR,c=n.index,u=t.textures[c].sampler;if(l(u)){let m=t.samplers[u];o=y(m.wrapS,o),r=y(m.wrapT,r),s=y(m.minFilter,s),a=y(m.magFilter,a)}return i&&s!==$t.LINEAR&&s!==$t.NEAREST&&(s===$t.NEAREST_MIPMAP_NEAREST||s===$t.NEAREST_MIPMAP_LINEAR?s=$t.NEAREST:s=$t.LINEAR),new en({wrapS:o,wrapT:r,minificationFilter:s,magnificationFilter:a})};var l9e=new D(1,1);x5.createModelTextureReader=function(e){e=y(e,y.EMPTY_OBJECT);let{textureInfo:t,channels:n,texture:i}=e,o=y(t.texCoord,0),r,s=t.extensions?.KHR_texture_transform;if(l(s)){o=y(s.texCoord,o);let c=l(s.offset)?D.unpack(s.offset):D.ZERO,d=y(s.rotation,0),u=l(s.scale)?D.unpack(s.scale):l9e;d=-d,r=new $(Math.cos(d)*u.x,-Math.sin(d)*u.y,c.x,Math.sin(d)*u.x,Math.cos(d)*u.y,c.y,0,0,1)}let a=new Tn.TextureReader;return a.index=t.index,a.texture=i,a.texCoord=o,a.scale=t.scale,a.transform=r,a.channels=n,a};var Wl=x5;var cmn=T(S(),1);function d9e(e){let t=document.createElement("canvas");return t.width=W.nextPowerOfTwo(e.width),t.height=W.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var og=d9e;function rg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.textureInfo,o=e.gltfResource,r=e.baseResource,s=e.supportedImageFormats,a=e.cacheKey,c=y(e.asynchronous,!0),d=i.index,u=Wl.getImageIdFromTexture({gltf:n,textureId:d,supportedImageFormats:s});this._resourceCache=t,this._gltf=n,this._textureInfo=i,this._imageId=u,this._gltfResource=o,this._baseResource=r,this._cacheKey=a,this._asynchronous=c,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(rg.prototype=Object.create(Hi.prototype),rg.prototype.constructor=rg);Object.defineProperties(rg.prototype,{cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});var u9e=new FH;async function m9e(e){let t=e._resourceCache;try{let n=t.getImageLoader({gltf:e._gltf,imageId:e._imageId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._imageLoader=n,await n.load(),e.isDestroyed()?void 0:(e._image=n.image,e._mipLevels=n.mipLevels,e._state=yt.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load texture",n)}}rg.prototype.load=async function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,this._promise=m9e(this),this._promise)};function FH(){this.gltf=void 0,this.textureInfo=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}FH.prototype.set=function(e,t,n,i,o){this.gltf=e,this.textureInfo=t,this.image=n,this.mipLevels=i,this.context=o};FH.prototype.execute=function(){this.texture=joe(this.gltf,this.textureInfo,this.image,this.mipLevels,this.context)};function joe(e,t,n,i,o){let r=n.internalFormat,s=!1;ot.isCompressedFormat(r)&&!l(i)&&(s=!0);let a=Wl.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:s}),c=a.minificationFilter,d=a.wrapS,u=a.wrapT,m=c===$t.NEAREST_MIPMAP_NEAREST||c===$t.NEAREST_MIPMAP_LINEAR||c===$t.LINEAR_MIPMAP_NEAREST||c===$t.LINEAR_MIPMAP_LINEAR,p=!l(r)&&m,g=p||d===Cn.REPEAT||d===Cn.MIRRORED_REPEAT||u===Cn.REPEAT||u===Cn.MIRRORED_REPEAT,f=!W.isPowerOfTwo(n.width)||!W.isPowerOfTwo(n.height),x=g&&f,_;return l(r)?(!o.webgl2&&ot.isCompressedFormat(r)&&f&&g&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),_=Pt.create({context:o,source:{arrayBufferView:n.bufferView,mipLevels:i},width:n.width,height:n.height,pixelFormat:n.internalFormat,sampler:a})):(x&&(n=og(n)),_=Pt.create({context:o,source:n,sampler:a,flipY:!1,skipColorSpaceConversion:!0})),p&&_.generateMipmap(),_}rg.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.LOADED&&this._state!==yt.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=yt.PROCESSING;let t;if(this._asynchronous){let n=u9e;if(n.set(this._gltf,this._textureInfo,this._image,this._mipLevels,e.context),!e.jobScheduler.execute(n,Wa.TEXTURE))return;t=n.texture}else t=joe(this._gltf,this._textureInfo,this._image,this._mipLevels,e.context);return this.unload(),this._texture=t,this._state=yt.READY,this._resourceCache.statistics.addTextureLoader(this),!0};rg.prototype.unload=function(){l(this._texture)&&this._texture.destroy(),l(this._imageLoader)&&!this._imageLoader.isDestroyed()&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0};var TC=rg;var Pmn=T(S(),1);function sg(e){e=y(e,y.EMPTY_OBJECT);let t=e.resourceCache,n=e.gltf,i=e.gltfResource,o=e.baseResource,r=e.bufferViewId,s=e.draco,a=e.attributeSemantic,c=e.accessorId,d=e.cacheKey,u=y(e.asynchronous,!0),m=y(e.loadBuffer,!1),p=y(e.loadTypedArray,!1);this._resourceCache=t,this._gltfResource=i,this._baseResource=o,this._gltf=n,this._bufferViewId=r,this._draco=s,this._attributeSemantic=a,this._accessorId=c,this._cacheKey=d,this._asynchronous=u,this._loadBuffer=m,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(sg.prototype=Object.create(Hi.prototype),sg.prototype.constructor=sg);Object.defineProperties(sg.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},quantization:{get:function(){return this._quantization}}});function h9e(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}sg.prototype.load=async function(){return l(this._promise)?this._promise:h9e(this._draco,this._attributeSemantic)?(this._promise=p9e(this),this._promise):(this._promise=g9e(this),this._promise)};function f9e(e,t,n,i){let r=(1<<e.quantizationBits)-1,s=1/r,a=new Tn.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=sn.VEC2,a.normalizationRange=r;else{let c=sn.getMathType(i);if(c===Number){let d=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=d,a.normalizationRange=r,a.quantizedVolumeStepSize=d*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(r));let d=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(d);let u=d.map(function(m){return m*s});a.quantizedVolumeStepSize=c.unpack(u)}}return a}async function p9e(e){e._state=yt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=yt.LOADED,e)}catch{if(e.isDestroyed())return;AH(e)}}function b9e(e){e._state=yt.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,o=n[i],r=e._accessorId,a=e._gltf.accessors[r].type,c=o.array,d=o.data.quantization;l(d)&&(e._quantization=f9e(d,o.data.componentDatatype,o.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function g9e(e){e._state=yt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._typedArray=n.typedArray,e._state=yt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;AH(e,n)}}function AH(e,t){throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load vertex buffer",t)}function MH(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}MH.prototype.set=function(e,t){this.typedArray=e,this.context=t};MH.prototype.execute=function(){this.buffer=qoe(this.typedArray,this.context)};function qoe(e,t){let n=xt.createVertexBuffer({typedArray:e,context:t,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var y9e=new MH;sg.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.LOADED&&this._state!==yt.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(e))return!1}catch(i){AH(this,i)}b9e(this)}let t,n=this._typedArray;if(this._loadBuffer&&this._asynchronous){let i=y9e;if(i.set(n,e.context),!e.jobScheduler.execute(i,Wa.BUFFER))return!1;t=i.buffer}else this._loadBuffer&&(t=qoe(n,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?n:void 0,this._state=yt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};sg.prototype.unload=function(){l(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),l(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var SC=sg;var lhn=T(S(),1);var nhn=T(S(),1);var Nmn=T(S(),1);function BI(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=y(e.properties,{}),i={};for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r.semantic)&&(i[r.semantic]=r)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}BI.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.class,i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=j0.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new BI({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(BI.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});BI.BATCH_TABLE_CLASS_NAME="_batchTable";var Am=BI;var Jmn=T(S(),1);var Bmn=T(S(),1);function _5(e){e=y(e,y.EMPTY_OBJECT);let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}_5.fromJson=function(e){return new _5({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(_5.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var OI=_5;function T5(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.values,i={},o={},r=n.length;for(let a=0;a<r;++a){let c=n[a];i[c.value]=c.name,o[c.name]=c.value}let s=y(e.valueType,Ht.UINT16);this._values=n,this._namesByValue=i,this._valuesByName=o,this._valueType=s,this._id=t,this._name=e.name,this._description=e.description,this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}T5.fromJson=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.enum,i=n.values.map(function(o){return OI.fromJson(o)});return new T5({id:t,values:i,valueType:Ht[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(T5.prototype,{values:{get:function(){return this._values}},namesByValue:{get:function(){return this._namesByValue}},valuesByName:{get:function(){return this._valuesByName}},valueType:{get:function(){return this._valueType}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var YI=T5;function S5(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.classes,{}),n=y(e.enums,{});this._classes=t,this._enums=n,this._id=e.id,this._name=e.name,this._description=e.description,this._version=e.version,this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}S5.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=YI.fromJson({id:i,enum:e.enums[i]}));let n={};if(l(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=Am.fromJson({id:i,class:e.classes[i],enums:t}));return new S5({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(S5.prototype,{classes:{get:function(){return this._classes}},enums:{get:function(){return this._enums}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},version:{get:function(){return this._version}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var yd=S5;function i_(e){e=y(e,y.EMPTY_OBJECT);let t=e.schema,n=e.resource,i=e.cacheKey;this._schema=l(t)?yd.fromJson(t):void 0,this._resource=n,this._cacheKey=i,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(i_.prototype=Object.create(Hi.prototype),i_.prototype.constructor=i_);Object.defineProperties(i_.prototype,{cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}});i_.prototype.load=async function(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=x9e(this),this._promise)};async function x9e(e){let t=e._resource;e._state=yt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=yd.fromJson(n),e._state=yt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=yt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}i_.prototype.unload=function(){this._schema=void 0};var CC=i_;var bhn=T(S(),1);var Mm={};function VC(e){return kh(e.url)}function C5(e){let{byteOffset:t,byteLength:n}=e;if(oi(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=y(i.byteOffset,0),n=i.byteLength}return`${t}-${t+n}`}function _9e(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:o,count:r}=e;return`${n}-${i}-${o}-${r}`}function $oe(e,t){return`${VC(e)}-buffer-id-${t}`}function HI(e,t,n,i){if(l(e.uri)){let o=i.getDerivedResource({url:e.uri});return VC(o)}return $oe(n,t)}function NH(e,t,n,i){let o=t.bufferView,r=e.bufferViews[o],s=r.buffer,a=e.buffers[s],c=HI(a,s,n,i),d=C5(r);return`${c}-range-${d}`}function ere(e,t,n,i){let o=e.images[t],r=o.bufferView,s=o.uri;if(l(s)){let p=i.getDerivedResource({url:s});return VC(p)}let a=e.bufferViews[r],c=a.buffer,d=e.buffers[c],u=HI(d,c,n,i),m=C5(a);return`${u}-range-${m}`}function T9e(e,t){let n=Wl.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}Mm.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${VC(n)}`};Mm.getExternalBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{resource:t}=e;return`external-buffer:${VC(t)}`};Mm.getEmbeddedBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${$oe(t,n)}`};Mm.getGltfCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltfResource:t}=e;return`gltf:${VC(t)}`};Mm.getBufferViewCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=t.bufferViews[n],s=r.buffer,a=t.buffers[s];oi(r,"EXT_meshopt_compression")&&(s=r.extensions.EXT_meshopt_compression.buffer);let c=HI(a,s,i,o),d=C5(r);return`buffer-view:${c}-range-${d}`};Mm.getDracoCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e;return`draco:${NH(t,n,i,o)}`};Mm.getVertexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,dequantize:c=!1,loadBuffer:d=!1,loadTypedArray:u=!1}=e,m="";if(c&&(m+="-dequantize"),d&&(m+="-buffer",m+=`-context-${o.context.id}`),u&&(m+="-typed-array"),l(s))return`vertex-buffer:${NH(t,s,n,i)}-draco-${a}${m}`;let p=t.bufferViews[r],g=p.buffer,f=t.buffers[g],x=HI(f,g,n,i),_=C5(p);return`vertex-buffer:${x}-range-${_}${m}`};Mm.getIndexBufferCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:a=!1,loadTypedArray:c=!1}=e,d="";if(a&&(d+="-buffer",d+=`-context-${r.context.id}`),c&&(d+="-typed-array"),l(s))return`index-buffer:${NH(t,s,i,o)}-draco${d}`;let u=t.accessors[n],m=u.bufferView,p=t.bufferViews[m],g=p.buffer,f=t.buffers[g],x=HI(f,g,i,o),_=_9e(u,p);return`index-buffer:${x}-accessor-${_}${d}`};Mm.getImageCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e;return`image:${ere(t,n,i,o)}`};Mm.getTextureCacheKey=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}=e,a=n.index,c=Wl.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:r}),d=ere(t,c,i,o),u=T9e(t,n);return`texture:${d}-sampler-${u}-context-${s.context.id}`};var Pl=Mm;var xhn=T(S(),1);function zI(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}zI.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};zI.prototype.addGeometryLoader=function(e){let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=e.buffer,i=e.typedArray,o=0;l(n)&&(o+=n.sizeInBytes),l(i)&&(o+=i.byteLength),this.geometryByteLength+=o,this._geometrySizes[t]=o};zI.prototype.addTextureLoader=function(e){let t=e.cacheKey;if(this._textureSizes.hasOwnProperty(t))return;this._textureSizes[t]=0;let n=e.texture.sizeInBytes;this.texturesByteLength+=e.texture.sizeInBytes,this._textureSizes[t]=n};zI.prototype.removeLoader=function(e){let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],l(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],l(i)&&(this.texturesByteLength-=i)};var KI=zI;function An(){}An.cacheEntries={};An.statistics=new KI;function S9e(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}An.get=function(e){let t=An.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};An.add=function(e){let t=e.cacheKey;return An.cacheEntries[t]=new S9e(e),e};An.unload=function(e){let t=e.cacheKey,n=An.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(An.statistics.removeLoader(e),e.destroy(),delete An.cacheEntries[t])};An.getSchemaLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{schema:t,resource:n}=e,i=Pl.getSchemaCacheKey({schema:t,resource:n}),o=An.get(i);return l(o)?o:(o=new CC({schema:t,resource:n,cacheKey:i}),An.add(o))};An.getEmbeddedBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{parentResource:t,bufferId:n,typedArray:i}=e,o=Pl.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),r=An.get(o);return l(r)?r:(r=new Jx({typedArray:i,cacheKey:o}),An.add(r))};An.getExternalBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{resource:t}=e,n=Pl.getExternalBufferCacheKey({resource:t}),i=An.get(n);return l(i)?i:(i=new Jx({resource:t,cacheKey:n}),An.add(i))};An.getGltfJsonLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:o}=e,r=Pl.getGltfCacheKey({gltfResource:t}),s=An.get(r);return l(s)?s:(s=new _C({resourceCache:An,gltfResource:t,baseResource:n,typedArray:i,gltfJson:o,cacheKey:r}),An.add(s))};An.getBufferViewLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=Pl.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}),s=An.get(r);return l(s)?s:(s=new pC({resourceCache:An,gltf:t,bufferViewId:n,gltfResource:i,baseResource:o,cacheKey:r}),An.add(s))};An.getDracoLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e,r=Pl.getDracoCacheKey({gltf:t,draco:n,gltfResource:i,baseResource:o}),s=An.get(r);return l(s)?s:(s=new bC({resourceCache:An,gltf:t,draco:n,gltfResource:i,baseResource:o,cacheKey:r}),An.add(s))};An.getVertexBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,accessorId:c,asynchronous:d=!0,dequantize:u=!1,loadBuffer:m=!1,loadTypedArray:p=!1}=e,g=Pl.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,dequantize:u,loadBuffer:m,loadTypedArray:p}),f=An.get(g);return l(f)?f:(f=new SC({resourceCache:An,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,draco:s,attributeSemantic:a,accessorId:c,cacheKey:g,asynchronous:d,dequantize:u,loadBuffer:m,loadTypedArray:p}),An.add(f))};An.getIndexBufferLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,asynchronous:a=!0,loadBuffer:c=!1,loadTypedArray:d=!1}=e,u=Pl.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:c,loadTypedArray:d}),m=An.get(u);return l(m)?m:(m=new yC({resourceCache:An,gltf:t,accessorId:n,gltfResource:i,baseResource:o,draco:s,cacheKey:u,asynchronous:a,loadBuffer:c,loadTypedArray:d}),An.add(m))};An.getImageLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e,r=Pl.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:o}),s=An.get(r);return l(s)?s:(s=new gC({resourceCache:An,gltf:t,imageId:n,gltfResource:i,baseResource:o,cacheKey:r}),An.add(s))};An.getTextureLoader=function(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a=!0}=e,c=Pl.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}),d=An.get(c);return l(d)?d:(d=new TC({resourceCache:An,gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,cacheKey:c,asynchronous:a}),An.add(d))};An.clearForSpecs=function(){let e=[SC,yC,bC,TC,gC,pC,Jx,CC,_C],t,n=An.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(r,s){let a=e.indexOf(r.resourceLoader.constructor),c=e.indexOf(s.resourceLoader.constructor);return a-c});let o=i.length;for(let r=0;r<o;++r){let s=i[r];t=s.resourceLoader.cacheKey,l(n[t])&&(s.resourceLoader.destroy(),delete n[t])}An.statistics.clear()};var Ci=An;function ca(e,t,n){this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=n,this._subtreeLevels=t.subtreeLevels,this._subdivisionScheme=t.subdivisionScheme,this._branchingFactor=t.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._ready=!1}Object.defineProperties(ca.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}},tileMetadataTable:{get:function(){return this._tileMetadataTable}},tilePropertyTableJson:{get:function(){return this._tilePropertyTableJson}},contentMetadataTables:{get:function(){return this._contentMetadataTables}},contentPropertyTableJsons:{get:function(){return this._contentPropertyTableJsons}},implicitCoordinates:{get:function(){return this._implicitCoordinates}}});ca.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};ca.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};ca.prototype.contentIsAvailableAtIndex=function(e,t){return t=y(t,0),this._contentAvailabilityBitstreams[t].getBit(e)};ca.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};ca.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};ca.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};ca.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};ca.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===jr.OCTREE&&(t=3),e>>t};ca.fromSubtreeJson=async function(e,t,n,i,o){let r=new ca(e,i,o),s;l(t)?s={json:t,binary:void 0}:s=C9e(n);let a=s.json;r._subtreeJson=a;let c;if(oi(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let V=a.tileMetadata;c=a.propertyTables[V]}let d=[];if(l(a.contentMetadata)){let V=a.contentMetadata.length;for(let L=0;L<V;L++){let Z=a.contentMetadata[L];d.push(a.propertyTables[Z])}}let u,m=i.metadataSchema,p=a.subtreeMetadata;if(l(p)){let V=p.class,L=m.classes[V];u=new LI({subtreeMetadata:p,class:L})}r._metadata=u,r._tilePropertyTableJson=c,r._contentPropertyTableJsons=d;let g={constant:0};a.contentAvailabilityHeaders=[],oi(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(y(a.contentAvailability,g));let f=V9e(a.buffers),x=L9e(a.bufferViews,f);R9e(a,x),l(c)&&tre(c,x);for(let V=0;V<d.length;V++){let L=d[V];tre(L,x)}let _=await Z9e(r,f,s.binary),C=E9e(x,_);return I9e(r,a,i,C),l(c)&&(X9e(r,i,C),P9e(r)),W9e(r,i,C),v9e(r),r._ready=!0,r};function C9e(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=Wo(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}function V9e(e){e=l(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=l(n.uri),n.isActive=!1}return e}function L9e(e,t){e=l(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],o=t[i.buffer];i.bufferHeader=o,i.isActive=!1}return e}function R9e(e,t){let n,i=e.tileAvailability;l(i.bitstream)?n=t[i.bitstream]:l(i.bufferView)&&(n=t[i.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let o=e.contentAvailabilityHeaders;for(let s=0;s<o.length;s++)n=void 0,l(o[s].bitstream)?n=t[o[s].bitstream]:l(o[s].bufferView)&&(n=t[o[s].bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let r=e.childSubtreeAvailability;l(r.bitstream)?n=t[r.bitstream]:l(r.bufferView)&&(n=t[r.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function tre(e,t){let n=e.properties,i;for(let o in n)if(n.hasOwnProperty(o)){let r=n[o],s=y(r.values,r.bufferView);i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=y(r.stringOffsets,r.stringOffsetBufferView);l(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let c=y(r.arrayOffsets,r.arrayOffsetBufferView);l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function Z9e(e,t,n){let i=[];for(let o=0;o<t.length;o++){let r=t[o];if(!r.isActive)i.push(Promise.resolve(void 0));else if(r.isExternal){let s=G9e(e,r);i.push(s)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(o){let r={};for(let s=0;s<o.length;s++){let a=o[s];l(a)&&(r[s]=a)}return r})}async function G9e(e,t){let i=e._resource.getDerivedResource({url:t.uri}),o=Ci.getExternalBufferLoader({resource:i});e._bufferLoader=o;try{await o.load()}catch(r){if(o.isDestroyed())return;throw r}return o.typedArray}function E9e(e,t){let n={};for(let i=0;i<e.length;i++){let o=e[i];if(!o.isActive)continue;let r=o.byteOffset,s=r+o.byteLength,c=t[o.buffer].subarray(r,s);n[i]=c}return n}function I9e(e,t,n,i){let o=n.branchingFactor,r=n.subtreeLevels,s=(Math.pow(o,r)-1)/(o-1),a=Math.pow(o,r),c=oi(t,"3DTILES_metadata"),d=l(e._tilePropertyTableJson),u=c||d;e._tileAvailability=kH(t.tileAvailability,i,s,u);let m=e._contentPropertyTableJsons.length>0;u=u||m;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let g=kH(t.contentAvailabilityHeaders[p],i,s,u);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=kH(t.childSubtreeAvailability,i,a)}function kH(e,t,n,i){if(l(e.constant))return new hC({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let o;return l(e.bitstream)?o=t[e.bitstream]:l(e.bufferView)&&(o=t[e.bufferView]),new hC({bitstream:o,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function X9e(e,t,n){let i=e._tilePropertyTableJson,o=e._tileAvailability.availableCount,r=t.metadataSchema,s=i.class,a=r.classes[s];e._tileMetadataTable=new Il({class:a,count:o,properties:i.properties,bufferViews:n})}function W9e(e,t,n){let i=e._contentPropertyTableJsons,o=e._contentAvailabilityBitstreams,r=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],u=o[a].availableCount,m=c.class,p=r.classes[m],g=new Il({class:p,count:u,properties:c.properties,bufferViews:n});s.push(g)}}function nre(e){let t=0,n=e.lengthBits,i=e.availableCount,o;i<256?o=new Uint8Array(n):i<65536?o=new Uint16Array(n):o=new Uint32Array(n);for(let r=0;r<e.lengthBits;r++)e.getBit(r)&&(o[r]=t,t++);return o}function P9e(e){let t=nre(e._tileAvailability);e._tileJumpBuffer=t}function v9e(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let o=n[i],r=nre(o);t.push(r)}}ca.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new de("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};ca.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new de("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function w9e(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function F9e(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let o=i[n];if(!l(o))return;let r=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(r.getBit(s))return e._contentJumpBuffers[n][s]}ca.prototype.getTileMetadataView=function(e){let t=w9e(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new fC({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};ca.prototype.getContentMetadataView=function(e,t){let n=F9e(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],o=this._contentPropertyTableJsons[t];return new fC({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:o})};ca.prototype.isDestroyed=function(){return!1};ca.prototype.destroy=function(){return l(this._bufferLoader)&&Ci.unload(this._bufferLoader),me(this)};var o_=ca;var Qhn=T(S(),1),A9e={ID:"ID",NAME:"NAME",DESCRIPTION:"DESCRIPTION",TILESET_TILE_COUNT:"TILESET_TILE_COUNT",TILE_BOUNDING_BOX:"TILE_BOUNDING_BOX",TILE_BOUNDING_REGION:"TILE_BOUNDING_REGION",TILE_BOUNDING_SPHERE:"TILE_BOUNDING_SPHERE",TILE_MINIMUM_HEIGHT:"TILE_MINIMUM_HEIGHT",TILE_MAXIMUM_HEIGHT:"TILE_MAXIMUM_HEIGHT",TILE_HORIZON_OCCLUSION_POINT:"TILE_HORIZON_OCCLUSION_POINT",TILE_GEOMETRIC_ERROR:"TILE_GEOMETRIC_ERROR",CONTENT_BOUNDING_BOX:"CONTENT_BOUNDING_BOX",CONTENT_BOUNDING_REGION:"CONTENT_BOUNDING_REGION",CONTENT_BOUNDING_SPHERE:"CONTENT_BOUNDING_SPHERE",CONTENT_MINIMUM_HEIGHT:"CONTENT_MINIMUM_HEIGHT",CONTENT_MAXIMUM_HEIGHT:"CONTENT_MAXIMUM_HEIGHT",CONTENT_HORIZON_OCCLUSION_POINT:"CONTENT_HORIZON_OCCLUSION_POINT"},r_=Object.freeze(A9e);var $hn=T(S(),1);var Nm={};Nm.parseAllBoundingVolumeSemantics=function(e){return{tile:{boundingVolume:Nm.parseBoundingVolumeSemantic("TILE",e),minimumHeight:Nm._parseMinimumHeight("TILE",e),maximumHeight:Nm._parseMaximumHeight("TILE",e)},content:{boundingVolume:Nm.parseBoundingVolumeSemantic("CONTENT",e),minimumHeight:Nm._parseMinimumHeight("CONTENT",e),maximumHeight:Nm._parseMaximumHeight("CONTENT",e)}}};Nm.parseBoundingVolumeSemantic=function(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(l(i))return{box:i};let o=`${e}_BOUNDING_REGION`,r=t.getPropertyBySemantic(o);if(l(r))return{region:r};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(l(a))return{sphere:a}};Nm._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};Nm._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var s_=Nm;function Oc(e,t,n){let i=t.implicitTileset,o=t.implicitCoordinates;this._implicitTileset=i,this._implicitCoordinates=o,this._implicitSubtree=void 0,this._tileset=e,this._tile=t,this._resource=n,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let r=o.getTemplateValues(),s=i.subtreeUriTemplate.getDerivedResource({templateValues:r});this._url=s.getUrlComponent(!0),this._ready=!1}Object.defineProperties(Oc.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._url}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Oc.fromSubtreeJson=async function(e,t,n,i,o,r){r=y(r,0);let s;l(o)&&(s=new Uint8Array(o,r));let a=t.implicitTileset,c=t.implicitCoordinates,d=await o_.fromSubtreeJson(n,i,s,a,c),u=new Oc(e,t,n);return u._implicitSubtree=d,M9e(u,d),u._ready=!0,u};function M9e(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,o=k9e(e,t,n,i),r=e._tileset.statistics;n.children.push(o.rootTile),r.numberOfTilesTotal++;let s=N9e(e,t,o.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],d=c.tile,u=J9e(e,d,c.childIndex);d.children.push(u),r.numberOfTilesTotal++}}function N9e(e,t,n){let i=[],o=e._implicitTileset.branchingFactor;for(let r=0;r<n.length;r++){let s=n[r];if(l(s))for(let a=0;a<o;a++){let c=r*o+a;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:s,childIndex:a})}}return i}function k9e(e,t,n,i){let s=ire(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],d=[],u=e._implicitTileset;for(let m=1;m<u.subtreeLevels;m++){let p=t.getLevelOffset(m),g=u.branchingFactor*c.length;for(let f=0;f<g;f++){let x=p+f;if(!t.tileIsAvailableAtIndex(x)){d.push(void 0);continue}let _=t.getParentMortonIndex(f),C=c[_],V=f%u.branchingFactor,L=ire(e,t,C,V,x);C.children.push(L),a.numberOfTilesTotal++,d.push(L)}c=d,d=[]}return{rootTile:s,bottomRow:c}}function ore(e,t,n){let i=r_.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function ire(e,t,n,i,o,r){let s=e._implicitTileset,a;y(r,!1)?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,d,u;if(l(t.tilePropertyTableJson)){c=t.getTileMetadataView(a);let I=s_.parseAllBoundingVolumeSemantics(c);d=I.tile,u=I.content}let p=t.contentPropertyTableJsons.length,g=!1;for(let I=0;I<p;I++)if(t.contentIsAvailableAtCoordinates(a,I)){g=!0;break}let f=B9e(s,a,i,r,n,d),x=[];for(let I=0;I<s.contentCount;I++){if(!t.contentIsAvailableAtIndex(o,I))continue;let w={uri:s.contentUriTemplates[I].getDerivedResource({templateValues:a.getTemplateValues()}).url},F=O9e(f,u);l(F)&&(w.boundingVolume=F),x.push(Tt(w,s.contentHeaders[I]))}let _=ore(c,s,a),C={boundingVolume:f,geometricError:_,refine:s.refine,contents:x},V=!0,L=Ye(s.tileHeader,V);delete L.boundingVolume,delete L.transform,delete L.metadata;let Z=Tt(C,L,V),G=lre(e,s.baseResource,Z,n);return G.implicitCoordinates=a,G.implicitSubtree=t,G.metadata=c,G.hasImplicitContentMetadata=g,G}function V5(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(oi(e,"3DTILES_bounding_volume_S2")||l(e.region))}function DH(e,t){l(t)&&(oi(e,"3DTILES_bounding_volume_S2")?D9e(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&U9e(e.region,t.minimumHeight,t.maximumHeight))}function U9e(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function D9e(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function B9e(e,t,n,i,o,r){let s;return!l(r)||!l(r.boundingVolume)||!V5(r.boundingVolume,r)&&V5(e.boundingVolume,r)?s=rre(e,t,n,y(i,!1),o):s=r.boundingVolume,DH(s,r),s}function O9e(e,t){let n;return l(t)&&(n=t.boundingVolume),V5(n,t)?DH(n,t):V5(e,t)&&(n=Ye(e,!0),DH(n,t)),n}function rre(e,t,n,i,o){let r=e.boundingVolume;return oi(r,"3DTILES_bounding_volume_S2")?sre(i,o,n,t.level,t.x,t.y,t.z):l(r.region)?{region:cre(r.region,t.level,t.x,t.y,t.z)}:{box:are(r.box,t.level,t.x,t.y,t.z)}}function sre(e,t,n,i,o,r,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:kp.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),d=c%2===0?uC.encode2D(i,o,r):uC.encode2D(i,r,o),u=kp.fromFacePositionLevel(c,BigInt(d),i),m,p;if(l(s)){let g=(a.maximumHeight+a.minimumHeight)/2;m=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else m=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:kp.getTokenFromId(u._cellId),minimumHeight:m,maximumHeight:p}}}}var Y9e=new h,H9e=new h,UH=new h,z9e=new $;function are(e,t,n,i,o){if(t===0)return e;let r=h.unpack(e,0,H9e),s=$.unpack(e,3,z9e),a=Math.pow(2,-t),c=-1+(2*n+1)*a,d=-1+(2*i+1)*a,u=0,m=h.fromElements(a,a,1,Y9e);l(o)&&(u=-1+(2*o+1)*a,m.z=a);let p=h.fromElements(c,d,u,UH);p=$.multiplyByVector(s,p,UH),p=h.add(p,r,UH);let g=$.clone(s);g=$.multiplyByScale(g,m,g);let f=new Array(12);return h.pack(p,f),$.pack(g,f,3),f}var K9e=new ae;function cre(e,t,n,i,o){if(t===0)return e.slice();let r=ae.unpack(e,0,K9e),s=e[4],a=e[5],c=Math.pow(2,-t),d=c*r.width,u=W.negativePiToPi(r.west+n*d),m=W.negativePiToPi(u+d),p=c*r.height,g=W.negativePiToPi(r.south+i*p),f=W.negativePiToPi(g+p),x=s,_=a;if(l(o)){let C=c*(a-s);x+=o*C,_=x+C}return[u,g,m,f,x,_]}function J9e(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=rre(i,o,n,!1,t),s=ore(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},d=lre(e,i.baseResource,c,t);return d.implicitTileset=i,d.implicitCoordinates=o,d}function lre(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}Oc.prototype.hasProperty=function(e,t){return!1};Oc.prototype.getFeature=function(e){};Oc.prototype.applyDebugSettings=function(e,t){};Oc.prototype.applyStyle=function(e){};Oc.prototype.update=function(e,t){};Oc.prototype.pick=function(e,t,n){};Oc.prototype.isDestroyed=function(){return!1};Oc.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),me(this)};Oc._deriveBoundingBox=are;Oc._deriveBoundingRegion=cre;Oc._deriveBoundingVolumeS2=sre;var LC=Oc;var Vvn=T(S(),1);var yfn=T(S(),1),Q9e={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},vl=Object.freeze(Q9e);var fvn=T(S(),1);var Dfn=T(S(),1);var Sfn=T(S(),1);function RC(e,t){this._distance=t,this._normal=new dre(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(RC.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!h.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),h.clone(e,this._normal._cartesian3)}}});RC.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new RC(e.normal,e.distance),t};RC.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new RC(e.normal,e.distance)};function dre(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(dre.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var a_=RC;function ac(e){e=y(e,y.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=y(e.enabled,!0),this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this.edgeColor=B.clone(y(e.edgeColor,B.WHITE)),this.edgeWidth=y(e.edgeWidth,0),this.planeAdded=new be,this.planeRemoved=new be,this._owner=void 0;let t=y(e.unionClippingRegions,!1);this._unionClippingRegions=t,this._testIntersection=t?pre:bre,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(l(n)){let i=n.length;for(let o=0;o<i;++o)this.add(n[o])}}function pre(e){return e===Jt.OUTSIDE}function bre(e){return e===Jt.INSIDE}Object.defineProperties(ac.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?pre:bre)}},enabled:{get:function(){return this._enabled},set:function(e){this._enabled!==e&&(this._enabled=e)}},texture:{get:function(){return this._clippingPlanesTexture}},owner:{get:function(){return this._owner}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});function ure(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}ac.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){ure(n,i)},e.index=t,ure(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};ac.prototype.get=function(e){return this._planes[e]};function gre(e,t){let n=e.length;for(let i=0;i<n;++i)if(ln.equals(e[i],t))return i;return-1}ac.prototype.contains=function(e){return gre(this._planes,e)!==-1};ac.prototype.remove=function(e){let t=this._planes,n=gre(t,e);if(n===-1)return!1;e instanceof a_&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let o=n;o<i;++o){let r=t[o+1];t[o]=r,r instanceof a_&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};ac.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof a_&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var j9e=new se,q9e=new se;function mre(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=wn.octEncodeToCartesian4(a.normal,q9e);i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=c.w;let d=se.packFloat(a.distance,j9e);i[r+4]=d.x,i[r+5]=d.y,i[r+6]=d.z,i[r+7]=d.w,r+=8}}function hre(e,t,n){let i=e._float32View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],c=a.normal;i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=a.distance,r+=4}}function yre(e,t){let n=Bt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var $9e=new D;ac.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=ac.useFloatTexture(n),o=i?this.length:this.length*2;if(l(t)){let s=t.width*t.height;(s<o||o<.25*s)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(t)){let s=yre(o,$9e);s.y*=2,i?(t=new Pt({context:n,width:s.x,height:s.y,pixelFormat:ot.RGBA,pixelDatatype:qe.FLOAT,sampler:en.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new Pt({context:n,width:s.x,height:s.y,pixelFormat:ot.RGBA,pixelDatatype:qe.UNSIGNED_BYTE,sampler:en.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(s.x*s.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let r=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&r===-1)){if(this._multipleDirtyPlanes)i?(hre(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(mre(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let s=0,a=0;i?(a=Math.floor(r/t.width),s=Math.floor(r-a*t.width),hre(this,r,r+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:s,yOffset:a})):(a=Math.floor(r*2/t.width),s=Math.floor(r*2-a*t.width),mre(this,r,r+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:s,yOffset:a}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var eNe=new M,fre=new ln(h.UNIT_X,0);ac.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;l(t)&&(o=M.multiply(t,o,eNe));let r=Jt.INSIDE;!this.unionClippingRegions&&i>0&&(r=Jt.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];ln.transform(a,o,fre);let c=e.intersectPlane(fre);if(c===Jt.INTERSECTING)r=c;else if(this._testIntersection(c))return c}return r};ac.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};ac.useFloatTexture=function(e){return e.floatingPointTexture};ac.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=ac.useFloatTexture(t)?e.length:e.length*2,r=yre(o,n);return r.y*=2,r};ac.prototype.isDestroyed=function(){return!1};ac.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),me(this)};var hs=ac;var e0n=T(S(),1);var Ibn=T(S(),1);var _bn=T(S(),1);var wpn=T(S(),1);var spn=T(S(),1);var Ofn=T(S(),1);function YH(e,t,n=2){let i=t&&t.length,o=i?t[0]*n:e.length,r=_re(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;let a,c,d;if(i&&(r=rNe(e,t,r,n)),e.length>80*n){a=1/0,c=1/0;let u=-1/0,m=-1/0;for(let p=n;p<o;p+=n){let g=e[p],f=e[p+1];g<a&&(a=g),f<c&&(c=f),g>u&&(u=g),f>m&&(m=f)}d=Math.max(u-a,m-c),d=d!==0?32767/d:0}return JI(r,s,n,a,c,d,0),s}function _re(e,t,n,i,o){let r;if(o===bNe(e,t,n,i)>0)for(let s=t;s<n;s+=i)r=xre(s/i|0,e[s],e[s+1],r);else for(let s=n-i;s>=t;s-=i)r=xre(s/i|0,e[s],e[s+1],r);return r&&Z5(r,r.next)&&(jI(r),r=r.next),r}function c_(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(Z5(n,n.next)||Fr(n.prev,n,n.next)===0)){if(jI(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function JI(e,t,n,i,o,r,s){if(!e)return;!s&&r&&dNe(e,i,o,r);let a=e;for(;e.prev!==e.next;){let c=e.prev,d=e.next;if(r?nNe(e,i,o,r):tNe(e)){t.push(c.i,e.i,d.i),jI(e),e=d.next,a=d.next;continue}if(e=d,e===a){s?s===1?(e=iNe(c_(e),t),JI(e,t,n,i,o,r,2)):s===2&&oNe(e,t,n,i,o,r):JI(c_(e),t,n,i,o,r,1);break}}}function tNe(e){let t=e.prev,n=e,i=e.next;if(Fr(t,n,i)>=0)return!1;let o=t.x,r=n.x,s=i.x,a=t.y,c=n.y,d=i.y,u=o<r?o<s?o:s:r<s?r:s,m=a<c?a<d?a:d:c<d?c:d,p=o>r?o>s?o:s:r>s?r:s,g=a>c?a>d?a:d:c>d?c:d,f=i.next;for(;f!==t;){if(f.x>=u&&f.x<=p&&f.y>=m&&f.y<=g&&ZC(o,a,r,c,s,d,f.x,f.y)&&Fr(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function nNe(e,t,n,i){let o=e.prev,r=e,s=e.next;if(Fr(o,r,s)>=0)return!1;let a=o.x,c=r.x,d=s.x,u=o.y,m=r.y,p=s.y,g=a<c?a<d?a:d:c<d?c:d,f=u<m?u<p?u:p:m<p?m:p,x=a>c?a>d?a:d:c>d?c:d,_=u>m?u>p?u:p:m>p?m:p,C=BH(g,f,t,n,i),V=BH(x,_,t,n,i),L=e.prevZ,Z=e.nextZ;for(;L&&L.z>=C&&Z&&Z.z<=V;){if(L.x>=g&&L.x<=x&&L.y>=f&&L.y<=_&&L!==o&&L!==s&&ZC(a,u,c,m,d,p,L.x,L.y)&&Fr(L.prev,L,L.next)>=0||(L=L.prevZ,Z.x>=g&&Z.x<=x&&Z.y>=f&&Z.y<=_&&Z!==o&&Z!==s&&ZC(a,u,c,m,d,p,Z.x,Z.y)&&Fr(Z.prev,Z,Z.next)>=0))return!1;Z=Z.nextZ}for(;L&&L.z>=C;){if(L.x>=g&&L.x<=x&&L.y>=f&&L.y<=_&&L!==o&&L!==s&&ZC(a,u,c,m,d,p,L.x,L.y)&&Fr(L.prev,L,L.next)>=0)return!1;L=L.prevZ}for(;Z&&Z.z<=V;){if(Z.x>=g&&Z.x<=x&&Z.y>=f&&Z.y<=_&&Z!==o&&Z!==s&&ZC(a,u,c,m,d,p,Z.x,Z.y)&&Fr(Z.prev,Z,Z.next)>=0)return!1;Z=Z.nextZ}return!0}function iNe(e,t){let n=e;do{let i=n.prev,o=n.next.next;!Z5(i,o)&&Tre(i,n,n.next,o)&&QI(i,o)&&QI(o,i)&&(t.push(i.i,n.i,o.i),jI(n),jI(n.next),n=e=o),n=n.next}while(n!==e);return c_(n)}function oNe(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&hNe(s,a)){let c=Sre(s,a);s=c_(s,s.next),c=c_(c,c.next),JI(s,t,n,i,o,r,0),JI(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function rNe(e,t,n,i){let o=[];for(let r=0,s=t.length;r<s;r++){let a=t[r]*i,c=r<s-1?t[r+1]*i:e.length,d=_re(e,a,c,i,!1);d===d.next&&(d.steiner=!0),o.push(mNe(d))}o.sort(sNe);for(let r=0;r<o.length;r++)n=aNe(o[r],n);return n}function sNe(e,t){return e.x-t.x}function aNe(e,t){let n=cNe(e,t);if(!n)return t;let i=Sre(n,e);return c_(i,i.next),c_(n,n.next)}function cNe(e,t){let n=t,i=e.x,o=e.y,r=-1/0,s;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let m=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(m<=i&&m>r&&(r=m,s=n.x<n.next.x?n:n.next,m===i))return s}n=n.next}while(n!==t);if(!s)return null;let a=s,c=s.x,d=s.y,u=1/0;n=s;do{if(i>=n.x&&n.x>=c&&i!==n.x&&ZC(o<d?i:r,o,c,d,o<d?r:i,o,n.x,n.y)){let m=Math.abs(o-n.y)/(i-n.x);QI(n,e)&&(m<u||m===u&&(n.x>s.x||n.x===s.x&&lNe(s,n)))&&(s=n,u=m)}n=n.next}while(n!==a);return s}function lNe(e,t){return Fr(e.prev,e,t.prev)<0&&Fr(t.next,e,e.next)<0}function dNe(e,t,n,i){let o=e;do o.z===0&&(o.z=BH(o.x,o.y,t,n,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,uNe(o)}function uNe(e){let t,n=1;do{let i=e,o;e=null;let r=null;for(t=0;i;){t++;let s=i,a=0;for(let d=0;d<n&&(a++,s=s.nextZ,!!s);d++);let c=n;for(;a>0||c>0&&s;)a!==0&&(c===0||!s||i.z<=s.z)?(o=i,i=i.nextZ,a--):(o=s,s=s.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=s}r.nextZ=null,n*=2}while(t>1);return e}function BH(e,t,n,i,o){return e=(e-n)*o|0,t=(t-i)*o|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function mNe(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function ZC(e,t,n,i,o,r,s,a){return(o-s)*(t-a)>=(e-s)*(r-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(r-a)>=(o-s)*(i-a)}function hNe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!fNe(e,t)&&(QI(e,t)&&QI(t,e)&&pNe(e,t)&&(Fr(e.prev,e,t.prev)||Fr(e,t.prev,t))||Z5(e,t)&&Fr(e.prev,e,e.next)>0&&Fr(t.prev,t,t.next)>0)}function Fr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function Z5(e,t){return e.x===t.x&&e.y===t.y}function Tre(e,t,n,i){let o=R5(Fr(e,t,n)),r=R5(Fr(e,t,i)),s=R5(Fr(n,i,e)),a=R5(Fr(n,i,t));return!!(o!==r&&s!==a||o===0&&L5(e,n,t)||r===0&&L5(e,i,t)||s===0&&L5(n,e,i)||a===0&&L5(n,t,i))}function L5(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function R5(e){return e>0?1:e<0?-1:0}function fNe(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Tre(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function QI(e,t){return Fr(e.prev,e,e.next)<0?Fr(e,t,e.next)>=0&&Fr(e,e.prev,t)>=0:Fr(e,t,e.prev)<0||Fr(e,e.next,t)<0}function pNe(e,t){let n=e,i=!1,o=(e.x+t.x)/2,r=(e.y+t.y)/2;do n.y>r!=n.next.y>r&&n.next.y!==n.y&&o<(n.next.x-n.x)*(r-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function Sre(e,t){let n=OH(e.i,e.x,e.y),i=OH(t.i,t.x,t.y),o=e.next,r=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function xre(e,t,n,i){let o=OH(e,t,n);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function jI(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function OH(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function bNe(e,t,n,i){let o=0;for(let r=t,s=n-i;r<n;r+=i)o+=(e[s]-e[r])*(e[r+1]+e[s+1]),s=r;return o}var gNe=new h,yNe=new h,ag={};ag.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];n+=r.x*s.y-s.x*r.y}return n*.5};ag.computeWindingOrder2D=function(e){return ag.computeArea2D(e)>0?ds.COUNTER_CLOCKWISE:ds.CLOCKWISE};ag.triangulate=function(e,t){let n=D.packArray(e);return YH(n,t,2)};var Rre=new h,Zre=new h,Gre=new h,Cre=new h,Vre=new h,Lre=new h,zp=new h,Ere=new D,Ire=new D,Xre=new D,GC=new D;ag.computeSubdivision=function(e,t,n,i,o){o=y(o,W.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,d=new Array(c*3),u=new Array(c*2),m=0,p=0;for(a=0;a<c;a++){let L=t[a];if(d[m++]=L.x,d[m++]=L.y,d[m++]=L.z,r){let Z=i[a];u[p++]=Z.x,u[p++]=Z.y}}let g=[],f={},x=e.maximumRadius,_=W.chordLength(o,x),C=_*_;for(;s.length>0;){let L=s.pop(),Z=s.pop(),G=s.pop(),I=h.fromArray(d,G*3,Rre),v=h.fromArray(d,Z*3,Zre),P=h.fromArray(d,L*3,Gre),w,F,b;r&&(w=D.fromArray(u,G*2,Ere),F=D.fromArray(u,Z*2,Ire),b=D.fromArray(u,L*2,Xre));let R=h.multiplyByScalar(h.normalize(I,Cre),x,Cre),E=h.multiplyByScalar(h.normalize(v,Vre),x,Vre),X=h.multiplyByScalar(h.normalize(P,Lre),x,Lre),A=h.magnitudeSquared(h.subtract(R,E,zp)),N=h.magnitudeSquared(h.subtract(E,X,zp)),O=h.magnitudeSquared(h.subtract(X,R,zp)),U=Math.max(A,N,O),Y,k,H;U>C?A===U?(Y=`${Math.min(G,Z)} ${Math.max(G,Z)}`,a=f[Y],l(a)||(k=h.add(I,v,zp),h.multiplyByScalar(k,.5,k),d.push(k.x,k.y,k.z),a=d.length/3-1,f[Y]=a,r&&(H=D.add(w,F,GC),D.multiplyByScalar(H,.5,H),u.push(H.x,H.y))),s.push(G,a,L),s.push(a,Z,L)):N===U?(Y=`${Math.min(Z,L)} ${Math.max(Z,L)}`,a=f[Y],l(a)||(k=h.add(v,P,zp),h.multiplyByScalar(k,.5,k),d.push(k.x,k.y,k.z),a=d.length/3-1,f[Y]=a,r&&(H=D.add(F,b,GC),D.multiplyByScalar(H,.5,H),u.push(H.x,H.y))),s.push(Z,a,G),s.push(a,L,G)):O===U&&(Y=`${Math.min(L,G)} ${Math.max(L,G)}`,a=f[Y],l(a)||(k=h.add(P,I,zp),h.multiplyByScalar(k,.5,k),d.push(k.x,k.y,k.z),a=d.length/3-1,f[Y]=a,r&&(H=D.add(b,w,GC),D.multiplyByScalar(H,.5,H),u.push(H.x,H.y))),s.push(L,a,Z),s.push(a,G,Z)):(g.push(G),g.push(Z),g.push(L))}let V={attributes:{position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:d})},indices:g,primitiveType:Fe.TRIANGLES};return r&&(V.attributes.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:u})),new ht(V)};var xNe=new he,_Ne=new he,TNe=new he,HH=new he;ag.computeRhumbLineSubdivision=function(e,t,n,i,o){o=y(o,W.RADIANS_PER_DEGREE);let r=l(i),s=n.slice(0),a,c=t.length,d=new Array(c*3),u=new Array(c*2),m=0,p=0;for(a=0;a<c;a++){let G=t[a];if(d[m++]=G.x,d[m++]=G.y,d[m++]=G.z,r){let I=i[a];u[p++]=I.x,u[p++]=I.y}}let g=[],f={},x=e.maximumRadius,_=W.chordLength(o,x),C=new Ea(void 0,void 0,e),V=new Ea(void 0,void 0,e),L=new Ea(void 0,void 0,e);for(;s.length>0;){let G=s.pop(),I=s.pop(),v=s.pop(),P=h.fromArray(d,v*3,Rre),w=h.fromArray(d,I*3,Zre),F=h.fromArray(d,G*3,Gre),b,R,E;r&&(b=D.fromArray(u,v*2,Ere),R=D.fromArray(u,I*2,Ire),E=D.fromArray(u,G*2,Xre));let X=e.cartesianToCartographic(P,xNe),A=e.cartesianToCartographic(w,_Ne),N=e.cartesianToCartographic(F,TNe);C.setEndPoints(X,A);let O=C.surfaceDistance;V.setEndPoints(A,N);let U=V.surfaceDistance;L.setEndPoints(N,X);let Y=L.surfaceDistance,k=Math.max(O,U,Y),H,J,te,z,q;k>_?O===k?(H=`${Math.min(v,I)} ${Math.max(v,I)}`,a=f[H],l(a)||(J=C.interpolateUsingFraction(.5,HH),te=(X.height+A.height)*.5,z=h.fromRadians(J.longitude,J.latitude,te,e,zp),d.push(z.x,z.y,z.z),a=d.length/3-1,f[H]=a,r&&(q=D.add(b,R,GC),D.multiplyByScalar(q,.5,q),u.push(q.x,q.y))),s.push(v,a,G),s.push(a,I,G)):U===k?(H=`${Math.min(I,G)} ${Math.max(I,G)}`,a=f[H],l(a)||(J=V.interpolateUsingFraction(.5,HH),te=(A.height+N.height)*.5,z=h.fromRadians(J.longitude,J.latitude,te,e,zp),d.push(z.x,z.y,z.z),a=d.length/3-1,f[H]=a,r&&(q=D.add(R,E,GC),D.multiplyByScalar(q,.5,q),u.push(q.x,q.y))),s.push(I,a,v),s.push(a,G,v)):Y===k&&(H=`${Math.min(G,v)} ${Math.max(G,v)}`,a=f[H],l(a)||(J=L.interpolateUsingFraction(.5,HH),te=(N.height+X.height)*.5,z=h.fromRadians(J.longitude,J.latitude,te,e,zp),d.push(z.x,z.y,z.z),a=d.length/3-1,f[H]=a,r&&(q=D.add(E,b,GC),D.multiplyByScalar(q,.5,q),u.push(q.x,q.y))),s.push(G,a,I),s.push(a,v,I)):(g.push(v),g.push(I),g.push(G))}let Z={attributes:{position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:d})},indices:g,primitiveType:Fe.TRIANGLES};return r&&(Z.attributes.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:u})),new ht(Z)};ag.scaleToGeodeticHeight=function(e,t,n,i){n=y(n,ne.default);let o=gNe,r=yNe;if(t=y(t,0),i=y(i,!0),l(e)){let s=e.length;for(let a=0;a<s;a+=3)h.fromArray(e,a,r),i&&(r=n.scaleToGeodeticSurface(r,r)),t!==0&&(o=n.geodeticSurfaceNormal(r,o),h.multiplyByScalar(o,t,o),h.add(r,o,r)),e[a]=r.x,e[a+1]=r.y,e[a+2]=r.z}return e};var si=ag;var cpn=T(S(),1);function cg(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(cg.prototype,{length:{get:function(){return this._length}}});cg.prototype.enqueue=function(e){this._array.push(e),this._length++};cg.prototype.dequeue=function(){if(this._length===0)return;let e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};cg.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};cg.prototype.contains=function(e){return this._array.indexOf(e)!==-1};cg.prototype.clear=function(){this._array.length=this._offset=this._length=0};cg.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var lg=cg;var qo={};qo.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let o=i.pop();if(!l(o))continue;n+=2;let r=o.positions,s=o.holes;if(l(r)&&r.length>0&&(n+=r.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c<a;++c)i.push(s[c])}}return n};qo.packPolygonHierarchy=function(e,t,n,i){let o=[e];for(;o.length>0;){let r=o.pop();if(!l(r))continue;let s=r.positions,a=r.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let d=0;d<c;++d,n+=i.packedLength)i.pack(s[d],t,n)}if(l(a)){let c=a.length;for(let d=0;d<c;++d)o.push(a[d])}}return n};qo.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],o=e[t++],r=new Array(i),s=o>0?new Array(o):void 0;for(let a=0;a<i;++a,t+=n.packedLength)r[a]=n.unpack(e,t);for(let a=0;a<o;++a)s[a]=qo.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:r,holes:s,startingIndex:t}};var l_=new D;function vre(e,t,n,i){return D.subtract(t,e,l_),D.multiplyByScalar(l_,n/i,l_),D.add(e,l_,l_),[l_.x,l_.y]}var dg=new h;function SNe(e,t,n,i){return h.subtract(t,e,dg),h.multiplyByScalar(dg,n/i,dg),h.add(e,dg,dg),[dg.x,dg.y,dg.z]}qo.subdivideLineCount=function(e,t,n){let o=h.distance(e,t)/n,r=Math.max(0,Math.ceil(W.log2(o)));return Math.pow(2,r)};var E5=new he,I5=new he,CNe=new he,VNe=new h,G5=new Ea;qo.subdivideRhumbLineCount=function(e,t,n,i){let o=e.cartesianToCartographic(t,E5),r=e.cartesianToCartographic(n,I5),a=new Ea(o,r,e).surfaceDistance/i,c=Math.max(0,Math.ceil(W.log2(a)));return Math.pow(2,c)};qo.subdivideTexcoordLine=function(e,t,n,i,o,r){let s=qo.subdivideLineCount(n,i,o),a=D.distance(e,t),c=a/s,d=r;d.length=s*2;let u=0;for(let m=0;m<s;m++){let p=vre(e,t,m*c,a);d[u++]=p[0],d[u++]=p[1]}return d};qo.subdivideLine=function(e,t,n,i){let o=qo.subdivideLineCount(e,t,n),r=h.distance(e,t),s=r/o;l(i)||(i=[]);let a=i;a.length=o*3;let c=0;for(let d=0;d<o;d++){let u=SNe(e,t,d*s,r);a[c++]=u[0],a[c++]=u[1],a[c++]=u[2]}return a};qo.subdivideTexcoordRhumbLine=function(e,t,n,i,o,r,s){let a=n.cartesianToCartographic(i,E5),c=n.cartesianToCartographic(o,I5);G5.setEndPoints(a,c);let d=G5.surfaceDistance/r,u=Math.max(0,Math.ceil(W.log2(d))),m=Math.pow(2,u),p=D.distance(e,t),g=p/m,f=s;f.length=m*2;let x=0;for(let _=0;_<m;_++){let C=vre(e,t,_*g,p);f[x++]=C[0],f[x++]=C[1]}return f};qo.subdivideRhumbLine=function(e,t,n,i,o){let r=e.cartesianToCartographic(t,E5),s=e.cartesianToCartographic(n,I5),a=new Ea(r,s,e),c=a.surfaceDistance/i,d=Math.max(0,Math.ceil(W.log2(c))),u=Math.pow(2,d),m=a.surfaceDistance/u;l(o)||(o=[]);let p=o;p.length=u*3;let g=0;for(let f=0;f<u;f++){let x=a.interpolateUsingSurfaceDistance(f*m,CNe),_=e.cartographicToCartesian(x,VNe);p[g++]=_.x,p[g++]=_.y,p[g++]=_.z}return p};var LNe=new h,RNe=new h,ZNe=new h,GNe=new h;qo.scaleToGeodeticHeightExtruded=function(e,t,n,i,o){i=y(i,ne.default);let r=LNe,s=RNe,a=ZNe,c=GNe;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let d=e.attributes.position.values,u=d.length/2;for(let m=0;m<u;m+=3)h.fromArray(d,m,a),i.geodeticSurfaceNormal(a,r),c=i.scaleToGeodeticSurface(a,c),s=h.multiplyByScalar(r,n,s),s=h.add(c,s,s),d[m+u]=s.x,d[m+1+u]=s.y,d[m+2+u]=s.z,o&&(c=h.clone(a,c)),s=h.multiplyByScalar(r,t,s),s=h.add(c,s,s),d[m]=s.x,d[m+1]=s.y,d[m+2]=s.z}return e};qo.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],o=new lg;o.enqueue(e);let r,s,a;for(;o.length!==0;){let c=o.dequeue(),d=c.positions;if(t)for(a=d.length,r=0;r<a;r++)n.scaleToGeodeticSurface(d[r],d[r]);if(d=xo(d,h.equalsEpsilon,!0),d.length<3)continue;let u=c.holes?c.holes.length:0;for(r=0;r<u;r++){let m=c.holes[r],p=m.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=xo(p,h.equalsEpsilon,!0),p.length<3)continue;i.push(p);let g=0;for(l(m.holes)&&(g=m.holes.length),s=0;s<g;s++)o.enqueue(m.holes[s])}i.push(d)}return i};var ENe=new he;function INe(e,t,n){let i=n.cartesianToCartographic(e,E5),o=n.cartesianToCartographic(t,I5);if(Math.sign(i.latitude)===Math.sign(o.latitude))return;G5.setEndPoints(i,o);let r=G5.findIntersectionWithLatitude(0,ENe);if(!l(r))return;let s=Math.min(i.longitude,o.longitude),a=Math.max(i.longitude,o.longitude);if(Math.abs(a-s)>W.PI){let c=s;s=a,a=c}if(!(r.longitude<s||r.longitude>a))return n.cartographicToCartesian(r)}function XNe(e,t,n,i){if(i===nn.RHUMB)return INe(e,t,n);let o=qn.lineSegmentPlane(e,t,ln.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var WNe=new he;function PNe(e,t,n){let i=[],o,r,s,a,c,d=0;for(;d<e.length;){o=e[d],r=e[(d+1)%e.length],s=W.sign(o.z),a=W.sign(r.z);let u=m=>t.cartesianToCartographic(m,WNe).longitude;if(s===0)i.push({position:d,type:s,visited:!1,next:a,theta:u(o)});else if(a!==0){if(c=XNe(o,r,t,n),++d,!l(c))continue;e.splice(d,0,c),i.push({position:d,type:s,visited:!1,next:a,theta:u(c)})}++d}return i}function wre(e,t,n,i,o,r,s){let a=[],c=r,d=m=>p=>p.position===m,u=[];do{let m=n[c];a.push(m);let p=i.findIndex(d(c)),g=i[p];if(!l(g)){++c;continue}let{visited:f,type:x,next:_}=g;if(g.visited=!0,x===0){if(_===0){let Z=i[p-(s?1:-1)];if(Z?.position===c+1)Z.visited=!0;else{++c;continue}}if(!f&&s&&_>0||r===c&&!s&&_<0){++c;continue}}if(!(s?x>=0:x<=0)){++c;continue}f||u.push(c);let V=p+(s?1:-1),L=i[V];if(!l(L)){++c;continue}c=L.position}while(c<n.length&&c>=0&&c!==r&&a.length<n.length);e.splice(t,o,a);for(let m of u)t=wre(e,++t,n,i,0,m,!s);return t}qo.splitPolygonsOnEquator=function(e,t,n,i){l(i)||(i=[]),i.splice(0,0,...e),i.length=e.length;let o=0;for(;o<i.length;){let r=i[o],s=r.slice();if(r.length<3){i[o]=s,++o;continue}let a=PNe(s,t,n);if(s.length===r.length||a.length<=1){i[o]=s,++o;continue}a.sort((d,u)=>d.theta-u.theta);let c=s[0].z>=0;o=wre(i,o,s,a,1,0,c)}return i};qo.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],c=new lg;c.enqueue(e);let d=l(r);for(;c.length!==0;){let u=c.dequeue(),m=u.positions,p=u.holes,g,f;if(i)for(f=m.length,g=0;g<f;g++)o.scaleToGeodeticSurface(m[g],m[g]);if(t||(m=xo(m,h.equalsEpsilon,!0)),m.length<3)continue;let x=n(m);if(!l(x))continue;let _=[],C=si.computeWindingOrder2D(x);if(C===ds.CLOCKWISE&&(x.reverse(),m=m.slice().reverse()),d){d=!1;let I=[m];if(I=r(I,I),I.length>1){for(let v of I)c.enqueue(new Ia(v,p));continue}}let V=m.slice(),L=l(p)?p.length:0,Z=[],G;for(g=0;g<L;g++){let I=p[g],v=I.positions;if(i)for(f=v.length,G=0;G<f;++G)o.scaleToGeodeticSurface(v[G],v[G]);if(t||(v=xo(v,h.equalsEpsilon,!0)),v.length<3)continue;let P=n(v);if(!l(P))continue;C=si.computeWindingOrder2D(P),C===ds.CLOCKWISE&&(P.reverse(),v=v.slice().reverse()),Z.push(v),_.push(V.length),V=V.concat(v),x=x.concat(P);let w=0;for(l(I.holes)&&(w=I.holes.length),G=0;G<w;G++)c.enqueue(I.holes[G])}s.push({outerRing:m,holes:Z}),a.push({positions:V,positions2D:x,holes:_})}return{hierarchy:s,polygons:a}};var vNe=new D,wNe=new h,FNe=new we,ANe=new $;qo.computeBoundingRectangle=function(e,t,n,i,o){let r=we.fromAxisAngle(e,i,FNe),s=$.fromQuaternion(r,ANe),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,d=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,m=n.length;for(let p=0;p<m;++p){let g=h.clone(n[p],wNe);$.multiplyByVector(s,g,g);let f=t(g,vNe);l(f)&&(a=Math.min(a,f.x),c=Math.max(c,f.x),d=Math.min(d,f.y),u=Math.max(u,f.y))}return o.x=a,o.y=d,o.width=c-a,o.height=u-d,o};qo.createGeometryFromPositions=function(e,t,n,i,o,r,s){let a=si.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,d=l(n),u=d?n.positions:void 0;if(o){let m=c.length,p=new Array(m*3),g=0;for(let _=0;_<m;_++){let C=c[_];p[g++]=C.x,p[g++]=C.y,p[g++]=C.z}let f={attributes:{position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Fe.TRIANGLES};d&&(f.attributes.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:D.packArray(u)}));let x=new ht(f);return r.normal?Fn.computeNormal(x):x}if(s===nn.GEODESIC)return si.computeSubdivision(e,c,a,u,i);if(s===nn.RHUMB)return si.computeRhumbLineSubdivision(e,c,a,u,i)};var Wre=[],Pre=[],MNe=new h,NNe=new h;qo.computeWallGeometry=function(e,t,n,i,o,r){let s,a,c,d,u,m,p,g,f,x=e.length,_=0,C=0,V=l(t),L=V?t.positions:void 0;if(o)for(a=x*3*2,s=new Array(a*2),V&&(f=x*2*2,g=new Array(f*2)),c=0;c<x;c++)d=e[c],u=e[(c+1)%x],s[_]=s[_+a]=d.x,++_,s[_]=s[_+a]=d.y,++_,s[_]=s[_+a]=d.z,++_,s[_]=s[_+a]=u.x,++_,s[_]=s[_+a]=u.y,++_,s[_]=s[_+a]=u.z,++_,V&&(m=L[c],p=L[(c+1)%x],g[C]=g[C+f]=m.x,++C,g[C]=g[C+f]=m.y,++C,g[C]=g[C+f]=p.x,++C,g[C]=g[C+f]=p.y,++C);else{let P=W.chordLength(i,n.maximumRadius),w=0;if(r===nn.GEODESIC)for(c=0;c<x;c++)w+=qo.subdivideLineCount(e[c],e[(c+1)%x],P);else if(r===nn.RHUMB)for(c=0;c<x;c++)w+=qo.subdivideRhumbLineCount(n,e[c],e[(c+1)%x],P);for(a=(w+x)*3,s=new Array(a*2),V&&(f=(w+x)*2,g=new Array(f*2)),c=0;c<x;c++){d=e[c],u=e[(c+1)%x];let F,b;V&&(m=L[c],p=L[(c+1)%x]),r===nn.GEODESIC?(F=qo.subdivideLine(d,u,P,Pre),V&&(b=qo.subdivideTexcoordLine(m,p,d,u,P,Wre))):r===nn.RHUMB&&(F=qo.subdivideRhumbLine(n,d,u,P,Pre),V&&(b=qo.subdivideTexcoordRhumbLine(m,p,n,d,u,P,Wre)));let R=F.length;for(let E=0;E<R;++E,++_)s[_]=F[E],s[_+a]=F[E];if(s[_]=u.x,s[_+a]=u.x,++_,s[_]=u.y,s[_+a]=u.y,++_,s[_]=u.z,s[_+a]=u.z,++_,V){let E=b.length;for(let X=0;X<E;++X,++C)g[C]=b[X],g[C+f]=b[X];g[C]=p.x,g[C+f]=p.x,++C,g[C]=p.y,g[C+f]=p.y,++C}}}x=s.length;let Z=Ae.createTypedArray(x/3,x-e.length*6),G=0;for(x/=6,c=0;c<x;c++){let P=c,w=P+1,F=P+x,b=F+1;d=h.fromArray(s,P*3,MNe),u=h.fromArray(s,w*3,NNe),!h.equalsEpsilon(d,u,W.EPSILON10,W.EPSILON10)&&(Z[G++]=P,Z[G++]=F,Z[G++]=w,Z[G++]=w,Z[G++]=F,Z[G++]=b)}let I={attributes:new mn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})}),indices:Z,primitiveType:Fe.TRIANGLES};return V&&(I.attributes.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:g})),new ht(I)};var Dn=qo;var Hpn=T(S(),1);function Ar(e,t){this.position=e,l(this.position)||(this.position=new D),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=Ar.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(Ar.prototype,{ellipsoid:{get:function(){return this.tangentPlane.ellipsoid}},x:{get:function(){return this.position.x}},y:{get:function(){return this.position.y}},conformalLatitude:{get:function(){let e=D.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(W.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=W.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=W.TWO_PI),e}}});var EC=new he,kNe=new h;Ar.prototype.getLatitude=function(e){l(e)||(e=ne.default),EC.latitude=this.conformalLatitude,EC.longitude=this.longitude,EC.height=0;let t=this.ellipsoid.cartographicToCartesian(EC,kNe);return e.cartesianToCartographic(t,EC),EC.latitude};var UNe=new pn,DNe=new h,BNe=new h;Ar.fromCartesian=function(e,t){let n=W.signNotZero(e.z),i=Ar.NORTH_POLE_TANGENT_PLANE,o=Ar.SOUTH_POLE;n<0&&(i=Ar.SOUTH_POLE_TANGENT_PLANE,o=Ar.NORTH_POLE);let r=UNe;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=h.subtract(r.origin,o,DNe),h.normalize(r.direction,r.direction);let s=qn.rayPlane(r,i.plane,BNe),a=h.subtract(s,o,s),c=h.dot(i.xAxis,a),d=n*h.dot(i.yAxis,a);return l(t)?(t.position=new D(c,d),t.tangentPlane=i,t):new Ar(new D(c,d),i)};Ar.fromCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=Ar.fromCartesian(e[i],t[i]);return t};Ar.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new Ar(e.position,e.tangentPlane)};Ar.HALF_UNIT_SPHERE=Object.freeze(new ne(.5,.5,.5));Ar.NORTH_POLE=Object.freeze(new h(0,0,.5));Ar.SOUTH_POLE=Object.freeze(new h(0,0,-.5));Ar.NORTH_POLE_TANGENT_PLANE=Object.freeze(new Kr(Ar.NORTH_POLE,Ar.HALF_UNIT_SPHERE));Ar.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new Kr(Ar.SOUTH_POLE,Ar.HALF_UNIT_SPHERE));var cc=Ar;var ONe=new he,Fre=new he;function YNe(e,t,n,i){let r=i.cartesianToCartographic(e,ONe).height,s=i.cartesianToCartographic(t,Fre);s.height=r,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,Fre);a.height=r-100,i.cartographicToCartesian(a,n)}var Are=new Ke,HNe=new h,zNe=new h,KNe=new h,JNe=new h,QNe=new h,jNe=new h,X5=new h,cf=new h,IC=new h,qNe=new D,$Ne=new D,e5e=new h,Mre=new we,t5e=new $,n5e=new $;function zH(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,o=n.attributes.position.values,r=l(n.attributes.st)?n.attributes.st.values:void 0,s=o.length,a=e.wall,c=e.top||a,d=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let u=e.boundingRectangle,m=e.rotationAxis,p=e.projectTo2d,g=e.ellipsoid,f=e.stRotation,x=e.perPositionHeight,_=qNe;_.x=u.x,_.y=u.y;let C=t.st?new Float32Array(2*(s/3)):void 0,V;t.normal&&(x&&c&&!a?V=n.attributes.normal.values:V=new Float32Array(s));let L=t.tangent?new Float32Array(s):void 0,Z=t.bitangent?new Float32Array(s):void 0,G=i?new Float32Array(s):void 0,I=0,v=0,P=zNe,w=KNe,F=JNe,b=!0,R=t5e,E=n5e;if(f!==0){let N=we.fromAxisAngle(m,f,Mre);R=$.fromQuaternion(N,R),N=we.fromAxisAngle(m,-f,Mre),E=$.fromQuaternion(N,E)}else R=$.clone($.IDENTITY,R),E=$.clone($.IDENTITY,E);let X=0,A=0;c&&d&&(X=s/2,A=s/3,s/=2);for(let N=0;N<s;N+=3){let O=h.fromArray(o,N,e5e);if(t.st&&!l(r)){let U=$.multiplyByVector(R,O,HNe);U=g.scaleToGeodeticSurface(U,U);let Y=p([U],$Ne)[0];D.subtract(Y,_,Y);let k=W.clamp(Y.x/u.width,0,1),H=W.clamp(Y.y/u.height,0,1);d&&(C[I+A]=k,C[I+1+A]=H),c&&(C[I]=k,C[I+1]=H),I+=2}if(t.normal||t.tangent||t.bitangent||i){let U=v+1,Y=v+2;if(a){if(N+3<s){let k=h.fromArray(o,N+3,QNe);if(b){let H=h.fromArray(o,N+s,jNe);x&&YNe(O,k,H,g),h.subtract(k,O,k),h.subtract(H,O,H),P=h.normalize(h.cross(H,k,P),P),b=!1}h.equalsEpsilon(k,O,W.EPSILON10)&&(b=!0)}(t.tangent||t.bitangent)&&(F=g.geodeticSurfaceNormal(O,F),t.tangent&&(w=h.normalize(h.cross(F,P,w),w)))}else P=g.geodeticSurfaceNormal(O,P),(t.tangent||t.bitangent)&&(x&&(X5=h.fromArray(V,v,X5),cf=h.cross(h.UNIT_Z,X5,cf),cf=h.normalize($.multiplyByVector(E,cf,cf),cf),t.bitangent&&(IC=h.normalize(h.cross(X5,cf,IC),IC))),w=h.cross(h.UNIT_Z,P,w),w=h.normalize($.multiplyByVector(E,w,w),w),t.bitangent&&(F=h.normalize(h.cross(P,w,F),F)));t.normal&&(e.wall?(V[v+X]=P.x,V[U+X]=P.y,V[Y+X]=P.z):d&&(V[v+X]=-P.x,V[U+X]=-P.y,V[Y+X]=-P.z),(c&&!x||a)&&(V[v]=P.x,V[U]=P.y,V[Y]=P.z)),i&&(a&&(P=g.geodeticSurfaceNormal(O,P)),G[v+X]=-P.x,G[U+X]=-P.y,G[Y+X]=-P.z),t.tangent&&(e.wall?(L[v+X]=w.x,L[U+X]=w.y,L[Y+X]=w.z):d&&(L[v+X]=-w.x,L[U+X]=-w.y,L[Y+X]=-w.z),c&&(x?(L[v]=cf.x,L[U]=cf.y,L[Y]=cf.z):(L[v]=w.x,L[U]=w.y,L[Y]=w.z))),t.bitangent&&(d&&(Z[v+X]=F.x,Z[U+X]=F.y,Z[Y+X]=F.z),c&&(x?(Z[v]=IC.x,Z[U]=IC.y,Z[Y]=IC.z):(Z[v]=F.x,Z[U]=F.y,Z[Y]=F.z))),v+=3}}t.st&&!l(r)&&(n.attributes.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:C})),t.normal&&(n.attributes.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:V})),t.tangent&&(n.attributes.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:L})),t.bitangent&&(n.attributes.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:Z})),i&&(n.attributes.extrudeDirection=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:G}))}if(e.extrude&&l(e.offsetAttribute)){let u=o.length/3,m=new Uint8Array(u);if(e.offsetAttribute===cn.TOP)c&&d||a?m=m.fill(1,0,u/2):c&&(m=m.fill(1));else{let p=e.offsetAttribute===cn.NONE?0:1;m=m.fill(p)}n.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}return n}var Nre=[];function i5e(e,t,n,i,o,r,s,a,c,d){let u={walls:[]},m;if(s||a){let V=Dn.createGeometryFromPositions(e,t,n,i,r,c,d),L=V.attributes.position.values,Z=V.indices,G,I;if(s&&a){let v=L.concat(L);G=v.length/3,I=Ae.createTypedArray(G,Z.length*2),I.set(Z);let P=Z.length,w=G/2;for(m=0;m<P;m+=3){let F=I[m]+w,b=I[m+1]+w,R=I[m+2]+w;I[m+P]=R,I[m+1+P]=b,I[m+2+P]=F}if(V.attributes.position.values=v,r&&c.normal){let F=V.attributes.normal.values;V.attributes.normal.values=new Float32Array(v.length),V.attributes.normal.values.set(F)}if(c.st&&l(n)){let F=V.attributes.st.values;V.attributes.st.values=new Float32Array(G*2),V.attributes.st.values=F.concat(F)}V.indices=I}else if(a){for(G=L.length/3,I=Ae.createTypedArray(G,Z.length),m=0;m<Z.length;m+=3)I[m]=Z[m+2],I[m+1]=Z[m+1],I[m+2]=Z[m];V.indices=I}u.topAndBottom=new Gt({geometry:V})}let p=o.outerRing,g=Kr.fromPoints(p,e),f=g.projectPointsOntoPlane(p,Nre),x=si.computeWindingOrder2D(f);x===ds.CLOCKWISE&&(p=p.slice().reverse());let _=Dn.computeWallGeometry(p,n,e,i,r,d);u.walls.push(new Gt({geometry:_}));let C=o.holes;for(m=0;m<C.length;m++){let V=C[m];f=g.projectPointsOntoPlane(V,Nre),x=si.computeWindingOrder2D(f),x===ds.COUNTER_CLOCKWISE&&(V=V.slice().reverse()),_=Dn.computeWallGeometry(V,n,e,i,r,d),u.walls.push(new Gt({geometry:_}))}return u}function Vu(e){let t=e.polygonHierarchy,n=y(e.vertexFormat,We.DEFAULT),i=y(e.ellipsoid,ne.default),o=y(e.granularity,W.RADIANS_PER_DEGREE),r=y(e.stRotation,0),s=e.textureCoordinates,a=y(e.perPositionHeight,!1),c=a&&l(e.extrudedHeight),d=y(e.height,0),u=y(e.extrudedHeight,d);if(!c){let m=Math.max(d,u);u=Math.min(d,u),d=m}this._vertexFormat=We.clone(n),this._ellipsoid=ne.clone(i),this._granularity=o,this._stRotation=r,this._height=d,this._extrudedHeight=u,this._closeTop=y(e.closeTop,!0),this._closeBottom=y(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=y(e.arcType,nn.GEODESIC),this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=Dn.computeHierarchyPackedLength(t,h)+ne.packedLength+We.packedLength+(s?Dn.computeHierarchyPackedLength(s,D):1)+12}Vu.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates};return new Vu(t)};Vu.pack=function(e,t,n){return n=y(n,0),n=Dn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n++]=y(e._offsetAttribute,-1),t[n++]=e._arcType,l(e._textureCoordinates)?n=Dn.packPolygonHierarchy(e._textureCoordinates,t,n,D):t[n++]=-1,t[n++]=e.packedLength,t};var o5e=ne.clone(ne.UNIT_SPHERE),r5e=new We,s5e={polygonHierarchy:{}};Vu.unpack=function(e,t,n){t=y(t,0);let i=Dn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=ne.unpack(e,t,o5e);t+=ne.packedLength;let r=We.unpack(e,t,r5e);t+=We.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++]===1,m=e[t++]===1,p=e[t++]===1,g=e[t++]===1,f=e[t++]===1,x=e[t++],_=e[t++],C=e[t]===-1?void 0:Dn.unpackPolygonHierarchy(e,t,D);l(C)?(t=C.startingIndex,delete C.startingIndex):t++;let V=e[t++];return l(n)||(n=new Vu(s5e)),n._polygonHierarchy=i,n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=We.clone(r,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=d,n._perPositionHeightExtrude=u,n._perPositionHeight=m,n._closeTop=p,n._closeBottom=g,n._shadowVolume=f,n._offsetAttribute=x===-1?void 0:x,n._arcType=_,n._textureCoordinates=C,n.packedLength=V,n};var a5e=new D,c5e=new D,l5e=new cc;function kre(e,t,n,i,o,r){let s=e.longitude,a=s>=0?s:s+W.TWO_PI;o.westOverIdl=Math.min(o.westOverIdl,a),o.eastOverIdl=Math.max(o.eastOverIdl,a),r.west=Math.min(r.west,s),r.east=Math.max(r.east,s);let c=e.getLatitude(n),d=c;if(r.south=Math.min(r.south,c),r.north=Math.max(r.north,c),i!==nn.RHUMB){let p=D.subtract(t.position,e.position,a5e),g=D.dot(t.position,p)/D.dot(p,p);if(g>0&&g<1){let f=D.add(t.position,D.multiplyByScalar(p,-g,p),c5e),x=cc.clone(t,l5e);x.position=f;let _=x.getLatitude(n);r.south=Math.min(r.south,_),r.north=Math.max(r.north,_),Math.abs(c)>Math.abs(_)&&(d=_)}}let u=t.x*e.y-e.x*t.y,m=Math.sign(u);m!==0&&(m*=D.angleBetween(t.position,e.position)),d>=0&&(o.northAngle+=m),d<=0&&(o.southAngle+=m)}var Ure=new cc,d5e=new cc,Cu={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};Vu.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new ae),e.length<3)return i;i.west=Number.POSITIVE_INFINITY,i.east=Number.NEGATIVE_INFINITY,i.south=Number.POSITIVE_INFINITY,i.north=Number.NEGATIVE_INFINITY,Cu.northAngle=0,Cu.southAngle=0,Cu.westOverIdl=Number.POSITIVE_INFINITY,Cu.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=cc.fromCartesian(e[0],d5e);for(let s=1;s<o;s++){let a=cc.fromCartesian(e[s],Ure);kre(a,r,t,n,Cu,i),r=cc.clone(a,r)}return kre(cc.fromCartesian(e[0],Ure),r,t,n,Cu,i),i.east-i.west>Cu.eastOverIdl-Cu.westOverIdl&&(i.west=Cu.westOverIdl,i.east=Cu.eastOverIdl,i.east>W.PI&&(i.east=i.east-W.TWO_PI),i.west>W.PI&&(i.west=i.west-W.TWO_PI)),W.equalsEpsilon(Math.abs(Cu.northAngle),W.TWO_PI,W.EPSILON10)&&(i.north=W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),W.equalsEpsilon(Math.abs(Cu.southAngle),W.TWO_PI,W.EPSILON10)&&(i.south=-W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),i};var u5e=new cc;function m5e(e,t,n){return e.height>=W.PI||e.width>=W.PI?cc.fromCartesian(t[0],u5e).tangentPlane:Kr.fromPoints(t,n)}var Dre=new he;function h5e(e,t,n){return(i,o)=>{if(e.height>=W.PI||e.width>=W.PI){if(e.south<0&&e.north>0){l(o)||(o=[]);for(let s=0;s<i.length;++s){let a=n.cartesianToCartographic(i[s],Dre);o[s]=new D(a.longitude/W.PI,a.latitude/W.PI_OVER_TWO)}return o.length=i.length,o}return cc.fromCartesianArray(i,o)}return Kr.fromPoints(t,n).projectPointsOntoPlane(i,o)}}function f5e(e,t,n){if(e.height>=W.PI||e.width>=W.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,Dre);return l(r)||(r=new D),r.x=s.longitude/W.PI,r.y=s.latitude/W.PI_OVER_TWO,r}return cc.fromCartesian(o,r)};let i=Kr.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function p5e(e,t,n,i){return(o,r)=>!i&&(e.height>=W.PI_OVER_TWO||e.width>=2*W.PI_OVER_THREE)?Dn.splitPolygonsOnEquator(o,t,n,r):o}function b5e(e,t,n,i){if(t.height>=W.PI||t.width>=W.PI)return Ke.fromRectangle(t,void 0,Are);let o=e,r=Kr.fromPoints(o,n);return Dn.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,Are)}Vu.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,o=e._stRotation,r=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,d=e._arcType,u=e._textureCoordinates,m=l(u),p=r.positions;if(p.length<3)return;let g=e.rectangle,f=Dn.polygonsFromHierarchy(r,m,h5e(g,p,n),!s,n,p5e(g,n,d,s)),x=f.hierarchy,_=f.polygons,C=function(X){return X},V=m?Dn.polygonsFromHierarchy(u,!0,C,!1,n).polygons:void 0;if(x.length===0)return;let L=x[0].outerRing,Z=b5e(L,g,n,o),G=[],I=e._height,v=e._extrudedHeight,P=e._perPositionHeightExtrude||!W.equalsEpsilon(I,v,0,W.EPSILON2),w={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:m5e(g,L,n).plane.normal,projectTo2d:f5e(g,L,n),boundingRectangle:Z,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:d},F;if(P)for(w.extrude=!0,w.top=a,w.bottom=c,w.shadowVolume=e._shadowVolume,w.offsetAttribute=e._offsetAttribute,F=0;F<_.length;F++){let X=i5e(n,_[F],m?V[F]:void 0,i,x[F],s,a,c,t,d),A;a&&c?(A=X.topAndBottom,w.geometry=Dn.scaleToGeodeticHeightExtruded(A.geometry,I,v,n,s)):a?(A=X.topAndBottom,A.geometry.attributes.position.values=si.scaleToGeodeticHeight(A.geometry.attributes.position.values,I,n,!s),w.geometry=A.geometry):c&&(A=X.topAndBottom,A.geometry.attributes.position.values=si.scaleToGeodeticHeight(A.geometry.attributes.position.values,v,n,!0),w.geometry=A.geometry),(a||c)&&(w.wall=!1,A.geometry=zH(w),G.push(A));let N=X.walls;w.wall=!0;for(let O=0;O<N.length;O++){let U=N[O];w.geometry=Dn.scaleToGeodeticHeightExtruded(U.geometry,I,v,n,s),U.geometry=zH(w),G.push(U)}}else for(F=0;F<_.length;F++){let X=new Gt({geometry:Dn.createGeometryFromPositions(n,_[F],m?V[F]:void 0,i,s,t,d)});if(X.geometry.attributes.position.values=si.scaleToGeodeticHeight(X.geometry.attributes.position.values,I,n,!s),w.geometry=X.geometry,X.geometry=zH(w),l(e._offsetAttribute)){let A=X.geometry.attributes.position.values.length,N=e._offsetAttribute===cn.NONE?0:1,O=new Uint8Array(A/3).fill(N);X.geometry.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:O})}G.push(X)}let b=Fn.combineInstances(G)[0];b.attributes.position.values=new Float64Array(b.attributes.position.values),b.indices=Ae.createTypedArray(b.attributes.position.values.length/3,b.indices);let R=b.attributes,E=ce.fromVertices(R.position.values);return t.position||delete R.position,new ht({attributes:R,indices:b.indices,primitiveType:b.primitiveType,boundingSphere:E,offsetAttribute:e._offsetAttribute})};Vu.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Vu({polygonHierarchy:e._polygonHierarchy,ellipsoid:o,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:r,height:s,vertexFormat:We.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function g5e(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let n=e._ellipsoid,i=e._polygonHierarchy.positions,o=e.rectangle;return ht._textureCoordinateRotationPoints(i,t,n,o)}Object.defineProperties(Vu.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=Vu.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=g5e(this)),this._textureCoordinateRotationPoints}}});var Kp=Vu;function d_(e){this._ellipsoid=y(e.ellipsoid,ne.default),this._positions=[...e.positions]}Object.defineProperties(d_.prototype,{length:{get:function(){return this._positions.length}},positions:{get:function(){return this._positions}},ellipsoid:{get:function(){return this._ellipsoid}}});d_.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions.length=0,t._positions.push(...e.positions),t):new d_({positions:e.positions,ellipsoid:e.ellipsoid})};d_.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions};d_.prototype.computeRectangle=function(e){return Kp.computeRectangleFromPositions(this.positions,this.ellipsoid,void 0,e)};var y5e=new ae,Bre=new h;d_.prototype.computeSphericalExtents=function(e){l(e)||(e=new ae);let t=this.computeRectangle(y5e),n=he.toCartesian(ae.southwest(t),this.ellipsoid,Bre),i=Math.sqrt(n.x*n.x+n.y*n.y),o=W.fastApproximateAtan2(i,n.z),r=W.fastApproximateAtan2(n.x,n.y);return e.south=o,e.west=r,n=he.toCartesian(ae.northeast(t),this.ellipsoid,Bre),i=Math.sqrt(n.x*n.x+n.y*n.y),o=W.fastApproximateAtan2(i,n.z),r=W.fastApproximateAtan2(n.x,n.y),e.north=o,e.east=r,e};var XC=d_;var Wbn=T(S(),1),qI=`in vec2 v_textureCoordinates;
  5538. uniform int u_polygonsLength;
  5539. uniform int u_extentsLength;
  5540. uniform highp sampler2D u_polygonTexture;
  5541. uniform highp sampler2D u_extentsTexture;
  5542. int getPolygonIndex(float dimension, vec2 coord) {
  5543. vec2 uv = coord.xy * dimension;
  5544. return int(floor(uv.y) * dimension + floor(uv.x));
  5545. }
  5546. vec2 getLookupUv(ivec2 dimensions, int i) {
  5547. int pixY = i / dimensions.x;
  5548. int pixX = i - (pixY * dimensions.x);
  5549. float pixelWidth = 1.0 / float(dimensions.x);
  5550. float pixelHeight = 1.0 / float(dimensions.y);
  5551. float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
  5552. float v = (float(pixY) + 0.5) * pixelHeight;
  5553. return vec2(u, v);
  5554. }
  5555. vec4 getExtents(int i) {
  5556. return texture(u_extentsTexture, getLookupUv(textureSize(u_extentsTexture, 0), i));
  5557. }
  5558. ivec2 getPositionsLengthAndExtentsIndex(int i) {
  5559. vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i);
  5560. vec4 value = texture(u_polygonTexture, uv);
  5561. return ivec2(int(value.x), int(value.y));
  5562. }
  5563. vec2 getPolygonPosition(int i) {
  5564. vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i);
  5565. return texture(u_polygonTexture, uv).xy;
  5566. }
  5567. vec2 getCoordinates(vec2 textureCoordinates, vec4 extents) {
  5568. float latitude = mix(extents.x, extents.x + 1.0 / extents.z, textureCoordinates.y);
  5569. float longitude = mix(extents.y, extents.y + 1.0 / extents.w, textureCoordinates.x);
  5570. return vec2(latitude, longitude);
  5571. }
  5572. void main() {
  5573. int lastPolygonIndex = 0;
  5574. out_FragColor = vec4(1.0);
  5575. // Get the relevant region of the texture
  5576. float dimension = float(u_extentsLength);
  5577. if (u_extentsLength > 2) {
  5578. dimension = ceil(log2(float(u_extentsLength)));
  5579. }
  5580. int regionIndex = getPolygonIndex(dimension, v_textureCoordinates);
  5581. for (int polygonIndex = 0; polygonIndex < u_polygonsLength; polygonIndex++) {
  5582. ivec2 positionsLengthAndExtents = getPositionsLengthAndExtentsIndex(lastPolygonIndex);
  5583. int positionsLength = positionsLengthAndExtents.x;
  5584. int polygonExtentsIndex = positionsLengthAndExtents.y;
  5585. lastPolygonIndex += 1;
  5586. // Only compute signed distance for the relevant part of the atlas
  5587. if (polygonExtentsIndex == regionIndex) {
  5588. float clipAmount = czm_infinity;
  5589. vec4 extents = getExtents(polygonExtentsIndex);
  5590. vec2 textureOffset = vec2(mod(float(polygonExtentsIndex), dimension), floor(float(polygonExtentsIndex) / dimension)) / dimension;
  5591. vec2 p = getCoordinates((v_textureCoordinates - textureOffset) * dimension, extents);
  5592. float s = 1.0;
  5593. // Check each edge for absolute distance
  5594. for (int i = 0, j = positionsLength - 1; i < positionsLength; j = i, i++) {
  5595. vec2 a = getPolygonPosition(lastPolygonIndex + i);
  5596. vec2 b = getPolygonPosition(lastPolygonIndex + j);
  5597. vec2 ab = b - a;
  5598. vec2 pa = p - a;
  5599. float t = dot(pa, ab) / dot(ab, ab);
  5600. t = clamp(t, 0.0, 1.0);
  5601. vec2 pq = pa - t * ab;
  5602. float d = length(pq);
  5603. // Inside / outside computation to determine sign
  5604. bvec3 cond = bvec3(p.y >= a.y,
  5605. p.y < b.y,
  5606. ab.x * pa.y > ab.y * pa.x);
  5607. if (all(cond) || all(not(cond))) s = -s;
  5608. if (abs(d) < abs(clipAmount)) {
  5609. clipAmount = d;
  5610. }
  5611. }
  5612. // Normalize the range to [0,1]
  5613. vec4 result = (s * vec4(clipAmount * length(extents.zw))) / 2.0 + 0.5;
  5614. // In the case where we've iterated through multiple polygons, take the minimum
  5615. out_FragColor = min(out_FragColor, result);
  5616. }
  5617. lastPolygonIndex += positionsLength;
  5618. }
  5619. }`;function qr(e){e=y(e,y.EMPTY_OBJECT),this._polygons=[],this._totalPositions=0,this.enabled=y(e.enabled,!0),this.inverse=y(e.inverse,!1),this.polygonAdded=new be,this.polygonRemoved=new be,this._owner=void 0,this._float32View=void 0,this._extentsFloat32View=void 0,this._extentsCount=0,this._polygonsTexture=void 0,this._extentsTexture=void 0,this._signedDistanceTexture=void 0,this._signedDistanceComputeCommand=void 0;let t=e.polygons;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this._polygons.push(t[i])}}Object.defineProperties(qr.prototype,{length:{get:function(){return this._polygons.length}},totalPositions:{get:function(){return this._totalPositions}},extentsTexture:{get:function(){return this._extentsTexture}},extentsCount:{get:function(){return this._extentsCount}},pixelsNeededForExtents:{get:function(){return this.length}},pixelsNeededForPolygonPositions:{get:function(){return this.totalPositions+this.length}},clippingTexture:{get:function(){return this._signedDistanceTexture}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return this.inverse?-this.extentsCount:this.extentsCount}}});qr.prototype.add=function(e){let t=this._polygons.length;return this._polygons.push(e),this.polygonAdded.raiseEvent(e,t),e};qr.prototype.get=function(e){return this._polygons[e]};qr.prototype.contains=function(e){return this._polygons.some(t=>XC.equals(t,e))};qr.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(i=>XC.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};var x5e=new ae;function _5e(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let a=e[r].computeSphericalExtents(),c=Math.max(a.height*2.5,.001),d=Math.max(a.width*2.5,.001),u=ae.clone(a);u.south-=c,u.west-=d,u.north+=c,u.east+=d,u.south=Math.max(u.south,-Math.PI),u.west=Math.max(u.west,-Math.PI),u.north=Math.min(u.north,Math.PI),u.east=Math.min(u.east,Math.PI);let m=[r];for(let p=0;p<t.length;++p){let g=t[p];if(l(g)&&l(ae.simpleIntersection(g,u))&&!ae.equals(g,u)){let f=n[p];m.push(...f),f.reduce((x,_)=>ae.union(e[_].computeSphericalExtents(x5e),x,x),a),t[p]=void 0,n[p]=void 0,c=Math.max(a.height*2.5,.001),d=Math.max(a.width*2.5,.001),u=ae.clone(a,u),u.south-=c,u.west-=d,u.north+=c,u.east+=d,u.south=Math.max(u.south,-Math.PI),u.west=Math.max(u.west,-Math.PI),u.north=Math.min(u.north,Math.PI),u.east=Math.min(u.east,Math.PI),p=-1}}t.push(u),n.push(m)}let o=new Map;return n.filter(l).forEach((r,s)=>r.forEach(a=>o.set(a,s))),{extentsList:t.filter(l),extentsIndexByPolygon:o}}qr.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n<t;++n){let i=e[n];this.polygonRemoved.raiseEvent(i,n)}this._polygons=[]};function T5e(e){let t=e._float32View,n=e._extentsFloat32View,i=e._polygons,{extentsList:o,extentsIndexByPolygon:r}=_5e(i),s=0;for(let[c,d]of i.entries()){let u=d.length;t[s++]=u,t[s++]=r.get(c);for(let m=0;m<u;++m){let p=d.positions[m],g=Math.hypot(p.x,p.y),f=W.fastApproximateAtan2(g,p.z),x=W.fastApproximateAtan2(p.x,p.y);t[s++]=f,t[s++]=x}}let a=0;for(let c of o){let d=1/(c.east-c.west),u=1/(c.north-c.south);n[a++]=c.south,n[a++]=c.west,n[a++]=u,n[a++]=d}e._extentsCount=o.length}var KH=new D;qr.prototype.update=function(e){let t=e.context;if(!qr.isSupported(e))throw new de("ClippingPolygonCollections are only supported for WebGL 2.");let n=this._polygons.reduce((s,a)=>s+a.length,0);if(n===this.totalPositions||(this._totalPositions=n,this.length===0))return;l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0,this._signedDistanceComputeCommand=void 0);let i=this._polygonsTexture,o=this._extentsTexture,r=this._signedDistanceTexture;if(l(i)){let s=i.width*i.height;(s<this.pixelsNeededForPolygonPositions||this.pixelsNeededForPolygonPositions<.25*s)&&(i.destroy(),i=void 0,this._polygonsTexture=void 0)}if(!l(i)){let s=qr.getTextureResolution(i,this.pixelsNeededForPolygonPositions,KH);i=new Pt({context:t,width:s.x,height:s.y,pixelFormat:ot.RG,pixelDatatype:qe.FLOAT,sampler:en.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*2),this._polygonsTexture=i}if(l(o)){let s=o.width*o.height;(s<this.pixelsNeededForExtents||this.pixelsNeededForExtents<.25*s)&&(o.destroy(),o=void 0,this._extentsTexture=void 0)}if(!l(o)){let s=qr.getTextureResolution(o,this.pixelsNeededForExtents,KH);o=new Pt({context:t,width:s.x,height:s.y,pixelFormat:ot.RGBA,pixelDatatype:qe.FLOAT,sampler:en.NEAREST,flipY:!1}),this._extentsFloat32View=new Float32Array(s.x*s.y*4),this._extentsTexture=o}if(T5e(this),o.copyFrom({source:{width:o.width,height:o.height,arrayBufferView:this._extentsFloat32View}}),i.copyFrom({source:{width:i.width,height:i.height,arrayBufferView:this._float32View}}),!l(r)){let s=qr.getClippingDistanceTextureResolution(this,KH);r=new Pt({context:t,width:s.x,height:s.y,pixelFormat:t.webgl2?ot.RED:ot.LUMINANCE,pixelDatatype:qe.FLOAT,sampler:new en({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:$t.LINEAR,magnificationFilter:hi.LINEAR}),flipY:!1}),this._signedDistanceTexture=r}this._signedDistanceComputeCommand=S5e(this)};qr.prototype.queueCommands=function(e){l(this._signedDistanceComputeCommand)&&e.commandList.push(this._signedDistanceComputeCommand)};function S5e(e){let t=e._polygonsTexture,n=e._extentsTexture;return new Xc({fragmentShaderSource:qI,outputTexture:e._signedDistanceTexture,uniformMap:{u_polygonsLength:function(){return e.length},u_extentsLength:function(){return e.extentsCount},u_extentsTexture:function(){return n},u_polygonTexture:function(){return t}},persists:!1,owner:e,postExecute:()=>{e._signedDistanceComputeCommand=void 0}})}var Ore=new ae,C5e=new ae;qr.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=Jt.OUTSIDE;this.inverse&&(o=Jt.INSIDE);for(let r=0;r<i;++r){let a=n[r].computeRectangle(),c=e.rectangle;if(!l(c)&&l(e.boundingVolume?.computeCorners)){let u=e.boundingVolume.computeCorners();c=ae.fromCartesianArray(u,t,Ore)}l(c)||(c=ae.fromBoundingSphere(e.boundingSphere,t,Ore));let d=ae.simpleIntersection(c,a,C5e);l(d)&&(o=Jt.INTERSECTING)}return o};qr.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};qr.isSupported=function(e){return e?.context.webgl2};qr.getTextureResolution=function(e,t,n){if(l(e))return n.x=e.width,n.y=e.height,n;let i=Bt.maximumTextureSize;return n.x=Math.min(t,i),n.y=Math.ceil(t/n.x),n.y*=2,n};qr.getClippingDistanceTextureResolution=function(e,t){let n=e.signedDistanceTexture;return l(n)?(t.x=n.width,t.y=n.height,t):(t.x=Math.min(Bt.maximumTextureSize,4096),t.y=Math.min(Bt.maximumTextureSize,4096),t)};qr.getClippingExtentsTextureResolution=function(e,t){let n=e.extentsTexture;return l(n)?(t.x=n.width,t.y=n.height,t):qr.getTextureResolution(n,e.pixelsNeededForExtents,t)};qr.prototype.isDestroyed=function(){return!1};qr.prototype.destroy=function(){return l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0),this._polygonsTexture=this._polygonsTexture&&this._polygonsTexture.destroy(),this._extentsTexture=this._extentsTexture&&this._extentsTexture.destroy(),this._signedDistanceTexture=this._signedDistanceTexture&&this._signedDistanceTexture.destroy(),me(this)};var km=qr;var z0n=T(S(),1);var a0n=T(S(),1);var n0n=T(S(),1),$I={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};$I.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?$I.SUNLIGHT:$I.SCENE_LIGHT:$I.NONE};var Jp=Object.freeze($I);function Yre(){this.lightIntensity=10,this.rayleighCoefficient=new h(55e-7,13e-6,284e-7),this.mieCoefficient=new h(21e-6,21e-6,21e-6),this.rayleighScaleHeight=1e4,this.mieScaleHeight=3200,this.mieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.dynamicLighting=Jp.NONE}Yre.requiresColorCorrect=function(e){return!(W.equalsEpsilon(e.hueShift,0,W.EPSILON7)&&W.equalsEpsilon(e.saturationShift,0,W.EPSILON7)&&W.equalsEpsilon(e.brightnessShift,0,W.EPSILON7))};var u_=Yre;var l0n=T(S(),1),Um=`uniform vec3 u_radiiAndDynamicAtmosphereColor;
  5620. uniform float u_atmosphereLightIntensity;
  5621. uniform float u_atmosphereRayleighScaleHeight;
  5622. uniform float u_atmosphereMieScaleHeight;
  5623. uniform float u_atmosphereMieAnisotropy;
  5624. uniform vec3 u_atmosphereRayleighCoefficient;
  5625. uniform vec3 u_atmosphereMieCoefficient;
  5626. const float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters.
  5627. const int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled.
  5628. const int LIGHT_STEPS_MAX = 4; // Maximum number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.
  5629. /**
  5630. * This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as
  5631. * the transmittance value for the ray.
  5632. *
  5633. * @param {czm_ray} primaryRay The ray from the camera to the position.
  5634. * @param {float} primaryRayLength The length of the primary ray.
  5635. * @param {vec3} lightDirection The direction of the light to calculate the scattering from.
  5636. * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.
  5637. * @param {vec3} mieColor The variable the Mie scattering will be written to.
  5638. * @param {float} opacity The variable the transmittance will be written to.
  5639. * @glslFunction
  5640. */
  5641. void computeScattering(
  5642. czm_ray primaryRay,
  5643. float primaryRayLength,
  5644. vec3 lightDirection,
  5645. float atmosphereInnerRadius,
  5646. out vec3 rayleighColor,
  5647. out vec3 mieColor,
  5648. out float opacity
  5649. ) {
  5650. // Initialize the default scattering amounts to 0.
  5651. rayleighColor = vec3(0.0);
  5652. mieColor = vec3(0.0);
  5653. opacity = 0.0;
  5654. float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
  5655. vec3 origin = vec3(0.0);
  5656. // Calculate intersection from the camera to the outer ring of the atmosphere.
  5657. czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);
  5658. // Return empty colors if no intersection with the atmosphere geometry.
  5659. if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {
  5660. return;
  5661. }
  5662. // To deal with smaller values of PRIMARY_STEPS (e.g. 4)
  5663. // we implement a split strategy: sky or horizon.
  5664. // For performance reasons, instead of a if/else branch
  5665. // a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0
  5666. float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength);
  5667. // Value close to 0.0: close to the horizon
  5668. // Value close to 1.0: above in the sky
  5669. float w_stop_gt_lprl = 0.5 * (1.0 + czm_approximateTanh(x));
  5670. // The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere.
  5671. float start_0 = primaryRayAtmosphereIntersect.start;
  5672. primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);
  5673. // The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller.
  5674. primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));
  5675. // For the number of ray steps, distinguish inside or outside atmosphere (outer space)
  5676. // (1) from outer space we have to use more ray steps to get a realistic rendering
  5677. // (2) within atmosphere we need fewer steps for faster rendering
  5678. float x_o_a = start_0 - ATMOSPHERE_THICKNESS; // ATMOSPHERE_THICKNESS used as an ad-hoc constant, no precise meaning here, only the order of magnitude matters
  5679. float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + czm_approximateTanh(x_o_a));
  5680. int PRIMARY_STEPS = PRIMARY_STEPS_MAX - int(w_inside_atmosphere * 12.0); // Number of times the ray from the camera to the world position (primary ray) is sampled.
  5681. int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.
  5682. // Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere.
  5683. float rayPositionLength = primaryRayAtmosphereIntersect.start;
  5684. // (1) Outside the atmosphere: constant rayStepLength
  5685. // (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps
  5686. float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength;
  5687. float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0));
  5688. float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS));
  5689. vec3 rayleighAccumulation = vec3(0.0);
  5690. vec3 mieAccumulation = vec3(0.0);
  5691. vec2 opticalDepth = vec2(0.0);
  5692. vec2 heightScale = vec2(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight);
  5693. // Sample positions on the primary ray.
  5694. for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) {
  5695. // The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot
  5696. // loop with non-constant condition, so it has to break early instead
  5697. if (i >= PRIMARY_STEPS) {
  5698. break;
  5699. }
  5700. // Calculate sample position along viewpoint ray.
  5701. vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);
  5702. // Calculate height of sample position above ellipsoid.
  5703. float sampleHeight = length(samplePosition) - atmosphereInnerRadius;
  5704. // Calculate and accumulate density of particles at the sample position.
  5705. vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;
  5706. opticalDepth += sampleDensity;
  5707. // Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere.
  5708. czm_ray lightRay = czm_ray(samplePosition, lightDirection);
  5709. czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius);
  5710. float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS);
  5711. float lightPositionLength = 0.0;
  5712. vec2 lightOpticalDepth = vec2(0.0);
  5713. // Sample positions along the light ray, to accumulate incidence of light on the latest sample segment.
  5714. for (int j = 0; j < LIGHT_STEPS_MAX; ++j) {
  5715. // The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot
  5716. // loop with non-constant condition, so it has to break early instead
  5717. if (j >= LIGHT_STEPS) {
  5718. break;
  5719. }
  5720. // Calculate sample position along light ray.
  5721. vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);
  5722. // Calculate height of the light sample position above ellipsoid.
  5723. float lightHeight = length(lightPosition) - atmosphereInnerRadius;
  5724. // Calculate density of photons at the light sample position.
  5725. lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;
  5726. // Increment distance on light ray.
  5727. lightPositionLength += lightStepLength;
  5728. }
  5729. // Compute attenuation via the primary ray and the light ray.
  5730. vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));
  5731. // Accumulate the scattering.
  5732. rayleighAccumulation += sampleDensity.x * attenuation;
  5733. mieAccumulation += sampleDensity.y * attenuation;
  5734. // Increment distance on primary ray.
  5735. rayPositionLength += (rayStepLength += rayStepLengthIncrease);
  5736. }
  5737. // Compute the scattering amount.
  5738. rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation;
  5739. mieColor = u_atmosphereMieCoefficient * mieAccumulation;
  5740. // Compute the transmittance i.e. how much light is passing through the atmosphere.
  5741. opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x))));
  5742. }
  5743. vec4 computeAtmosphereColor(
  5744. vec3 positionWC,
  5745. vec3 lightDirection,
  5746. vec3 rayleighColor,
  5747. vec3 mieColor,
  5748. float opacity
  5749. ) {
  5750. // Setup the primary ray: from the camera position to the vertex position.
  5751. vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
  5752. vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
  5753. float cosAngle = dot(cameraToPositionWCDirection, lightDirection);
  5754. float cosAngleSq = cosAngle * cosAngle;
  5755. float G = u_atmosphereMieAnisotropy;
  5756. float GSq = G * G;
  5757. // The Rayleigh phase function.
  5758. float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
  5759. // The Mie phase function.
  5760. float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));
  5761. // The final color is generated by combining the effects of the Rayleigh and Mie scattering.
  5762. vec3 rayleigh = rayleighPhase * rayleighColor;
  5763. vec3 mie = miePhase * mieColor;
  5764. vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity;
  5765. return vec4(color, opacity);
  5766. }
  5767. `;var u0n=T(S(),1),eX=`uniform samplerCube u_radianceMap;
  5768. in vec2 v_textureCoordinates;
  5769. const float twoSqrtPi = 2.0 * sqrt(czm_pi);
  5770. // Coutesy of https://www.ppsloan.org/publications/StupidSH36.pdf
  5771. float computeShBasis(int index, vec3 s) {
  5772. if (index == 0) { // l = 0, m = 0
  5773. return 1.0 / twoSqrtPi;
  5774. }
  5775. if (index == 1) { // l = 1, m = -1
  5776. return -sqrt(3.0) * s.y / twoSqrtPi;
  5777. }
  5778. if (index == 2) { // l = 1, m = 0
  5779. return sqrt(3.0) * s.z / twoSqrtPi;
  5780. }
  5781. if (index == 3) { // l = 1, m = 1
  5782. return -sqrt(3.0) * s.x / twoSqrtPi;
  5783. }
  5784. if (index == 4) { // l = 2, m = -2
  5785. return sqrt(15.0) * s.y * s.x / twoSqrtPi;
  5786. }
  5787. if (index == 5) { // l = 2, m = -1
  5788. return -sqrt(15.0) * s.y * s.z / twoSqrtPi;
  5789. }
  5790. if (index == 6) { // l = 2, m = 0
  5791. return sqrt(5.0) * (3.0 * s.z * s.z - 1.0) / 2.0 / twoSqrtPi;
  5792. }
  5793. if (index == 7) { // l = 2, m = 1
  5794. return -sqrt(15.0) * s.x * s.z / twoSqrtPi;
  5795. }
  5796. if (index == 8) { // l = 2, m = 2
  5797. return sqrt(15.0) * (s.x * s.x - s.y * s.y) / 2.0 / twoSqrtPi;
  5798. }
  5799. return 0.0;
  5800. }
  5801. float vdcRadicalInverse(int i)
  5802. {
  5803. float r;
  5804. float base = 2.0;
  5805. float value = 0.0;
  5806. float invBase = 1.0 / base;
  5807. float invBi = invBase;
  5808. for (int x = 0; x < 100; x++)
  5809. {
  5810. if (i <= 0)
  5811. {
  5812. break;
  5813. }
  5814. r = mod(float(i), base);
  5815. value += r * invBi;
  5816. invBi *= invBase;
  5817. i = int(float(i) * invBase);
  5818. }
  5819. return value;
  5820. }
  5821. vec2 hammersley2D(int i, int N)
  5822. {
  5823. return vec2(float(i) / float(N), vdcRadicalInverse(i));
  5824. }
  5825. // Sample count is relatively low for the sake of performance, but should still be enough to capture directionality needed for third-order harmonics
  5826. const int samples = 256;
  5827. const float solidAngle = 1.0 / float(samples);
  5828. void main() {
  5829. // Get the current coefficient based on the uv
  5830. vec2 uv = v_textureCoordinates.xy * 3.0;
  5831. int coefficientIndex = int(floor(uv.y) * 3.0 + floor(uv.x));
  5832. for (int i = 0; i < samples; ++i) {
  5833. vec2 xi = hammersley2D(i, samples);
  5834. float phi = czm_twoPi * xi.x;
  5835. float cosTheta = 1.0 - 2.0 * sqrt(1.0 - xi.y * xi.y);
  5836. float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
  5837. vec3 direction = normalize(vec3(sinTheta * cos(phi), cosTheta, sinTheta * sin(phi)));
  5838. // Generate the spherical harmonics basis from the direction
  5839. float Ylm = computeShBasis(coefficientIndex, direction);
  5840. vec3 lookupDirection = -direction.xyz;
  5841. lookupDirection.z = -lookupDirection.z;
  5842. vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0);
  5843. // Use the relevant function for this coefficient
  5844. out_FragColor += Ylm * color * solidAngle * sinTheta;
  5845. }
  5846. }
  5847. `;var h0n=T(S(),1),tX=`precision highp float;
  5848. in vec2 v_textureCoordinates;
  5849. uniform vec3 u_faceDirection; // Current cubemap face
  5850. uniform vec3 u_positionWC;
  5851. uniform mat4 u_enuToFixedFrame;
  5852. uniform vec4 u_brightnessSaturationGammaIntensity;
  5853. uniform vec4 u_groundColor; // alpha component represent albedo
  5854. vec4 getCubeMapDirection(vec2 uv, vec3 faceDir) {
  5855. vec2 scaledUV = uv * 2.0 - 1.0;
  5856. if (faceDir.x != 0.0) {
  5857. return vec4(faceDir.x, scaledUV.x * faceDir.x, -scaledUV.y, 0.0);
  5858. } else if (faceDir.y != 0.0) {
  5859. return vec4(scaledUV.x, -scaledUV.y * faceDir.y, faceDir.y, 0.0);
  5860. } else {
  5861. return vec4(scaledUV.x * faceDir.z, -faceDir.z, -scaledUV.y, 0.0);
  5862. }
  5863. }
  5864. void main() {
  5865. float height = length(u_positionWC);
  5866. float atmosphereInnerRadius = u_radiiAndDynamicAtmosphereColor.y;
  5867. float ellipsoidHeight = max(height - atmosphereInnerRadius, 0.0);
  5868. // Scale the position to ensure the sky color is present, even when underground.
  5869. vec3 positionWC = u_positionWC / height * (ellipsoidHeight + atmosphereInnerRadius);
  5870. float atmosphereOuterRadius = u_radiiAndDynamicAtmosphereColor.x;
  5871. float atmosphereHeight = atmosphereOuterRadius - atmosphereInnerRadius;
  5872. vec3 direction = (u_enuToFixedFrame * getCubeMapDirection(v_textureCoordinates, u_faceDirection)).xyz;
  5873. vec3 normalizedDirection = normalize(direction);
  5874. czm_ray ray = czm_ray(positionWC, normalizedDirection);
  5875. czm_raySegment intersection = czm_raySphereIntersectionInterval(ray, vec3(0.0), atmosphereInnerRadius);
  5876. if (!czm_isEmpty(intersection)) {
  5877. intersection = czm_rayEllipsoidIntersectionInterval(ray, vec3(0.0), czm_ellipsoidInverseRadii);
  5878. }
  5879. bool onEllipsoid = intersection.start >= 0.0;
  5880. float rayLength = czm_branchFreeTernary(onEllipsoid, intersection.start, atmosphereOuterRadius);
  5881. // Compute sky color for each position on a sphere at radius centered around the provided position's origin
  5882. vec3 skyPositionWC = positionWC + normalizedDirection * rayLength;
  5883. float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
  5884. vec3 lightDirectionWC = normalize(czm_getDynamicAtmosphereLightDirection(skyPositionWC, lightEnum));
  5885. vec3 mieColor;
  5886. vec3 rayleighColor;
  5887. float opacity;
  5888. czm_computeScattering(
  5889. ray,
  5890. rayLength,
  5891. lightDirectionWC,
  5892. atmosphereInnerRadius,
  5893. rayleighColor,
  5894. mieColor,
  5895. opacity
  5896. );
  5897. vec4 atmopshereColor = czm_computeAtmosphereColor(ray, lightDirectionWC, rayleighColor, mieColor, opacity);
  5898. #ifdef ATMOSPHERE_COLOR_CORRECT
  5899. const bool ignoreBlackPixels = true;
  5900. atmopshereColor.rgb = czm_applyHSBShift(atmopshereColor.rgb, czm_atmosphereHsbShift, ignoreBlackPixels);
  5901. #endif
  5902. vec3 lookupDirection = -normalizedDirection;
  5903. // Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z.
  5904. lookupDirection.x = -lookupDirection.x;
  5905. lookupDirection = -normalize(czm_temeToPseudoFixed * lookupDirection);
  5906. lookupDirection.x = -lookupDirection.x;
  5907. // Values outside the atmopshere are rendered as black, when they should be treated as transparent
  5908. float skyAlpha = clamp((1.0 - ellipsoidHeight / atmosphereHeight) * atmopshereColor.a, 0.0, 1.0);
  5909. skyAlpha = czm_branchFreeTernary(length(atmopshereColor.rgb) <= czm_epsilon7, 0.0, skyAlpha); // Treat black as transparent
  5910. // Blend starmap with atmopshere scattering
  5911. float intensity = u_brightnessSaturationGammaIntensity.w;
  5912. vec4 sceneSkyBoxColor = czm_textureCube(czm_environmentMap, lookupDirection);
  5913. vec3 skyBackgroundColor = mix(czm_backgroundColor.rgb, sceneSkyBoxColor.rgb, sceneSkyBoxColor.a);
  5914. vec4 combinedSkyColor = vec4(mix(skyBackgroundColor, atmopshereColor.rgb * intensity, skyAlpha), 1.0);
  5915. // Compute ground color based on amount of reflected light, then blend it with ground atmosphere based on height
  5916. vec3 up = normalize(positionWC);
  5917. float occlusion = max(dot(lightDirectionWC, up), 0.05);
  5918. vec4 groundColor = vec4(u_groundColor.rgb * u_groundColor.a * (vec3(intensity * occlusion) + atmopshereColor.rgb), 1.0);
  5919. vec4 blendedGroundColor = mix(groundColor, atmopshereColor, clamp(ellipsoidHeight / atmosphereHeight, 0.0, 1.0));
  5920. vec4 color = czm_branchFreeTernary(onEllipsoid, blendedGroundColor, combinedSkyColor);
  5921. float brightness = u_brightnessSaturationGammaIntensity.x;
  5922. float saturation = u_brightnessSaturationGammaIntensity.y;
  5923. float gamma = u_brightnessSaturationGammaIntensity.z;
  5924. #ifdef ENVIRONMENT_COLOR_CORRECT
  5925. color.rgb = mix(vec3(0.0), color.rgb, brightness);
  5926. color.rgb = czm_saturation(color.rgb, saturation);
  5927. #endif
  5928. color.rgb = pow(color.rgb, vec3(gamma)); // Normally this would be in the ifdef above, but there is a precision issue with the atmopshere scattering transmittance (alpha). Having this line is a workaround for that issue, even when gamma is 1.0.
  5929. color.rgb = czm_gammaCorrect(color.rgb);
  5930. out_FragColor = color;
  5931. }
  5932. `;var p0n=T(S(),1),nX=`precision highp float;
  5933. in vec3 v_textureCoordinates;
  5934. uniform float u_roughness;
  5935. uniform samplerCube u_radianceTexture;
  5936. uniform vec3 u_faceDirection;
  5937. float vdcRadicalInverse(int i)
  5938. {
  5939. float r;
  5940. float base = 2.0;
  5941. float value = 0.0;
  5942. float invBase = 1.0 / base;
  5943. float invBi = invBase;
  5944. for (int x = 0; x < 100; x++)
  5945. {
  5946. if (i <= 0)
  5947. {
  5948. break;
  5949. }
  5950. r = mod(float(i), base);
  5951. value += r * invBi;
  5952. invBi *= invBase;
  5953. i = int(float(i) * invBase);
  5954. }
  5955. return value;
  5956. }
  5957. vec2 hammersley2D(int i, int N)
  5958. {
  5959. return vec2(float(i) / float(N), vdcRadicalInverse(i));
  5960. }
  5961. vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N)
  5962. {
  5963. float alphaRoughnessSquared = alphaRoughness * alphaRoughness;
  5964. float phi = czm_twoPi * xi.x;
  5965. float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y));
  5966. float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
  5967. vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);
  5968. vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
  5969. vec3 tangentX = normalize(cross(upVector, N));
  5970. vec3 tangentY = cross(N, tangentX);
  5971. return tangentX * H.x + tangentY * H.y + N * H.z;
  5972. }
  5973. // Sample count is relatively low for the sake of performance, but should still be enough to prevent artifacting in lower roughnesses
  5974. const int samples = 128;
  5975. void main() {
  5976. vec3 normal = u_faceDirection;
  5977. vec3 V = normalize(v_textureCoordinates);
  5978. float roughness = u_roughness;
  5979. vec4 color = vec4(0.0);
  5980. float weight = 0.0;
  5981. for (int i = 0; i < samples; ++i) {
  5982. vec2 xi = hammersley2D(i, samples);
  5983. vec3 H = importanceSampleGGX(xi, roughness, V);
  5984. vec3 L = 2.0 * dot(V, H) * H - V; // reflected vector
  5985. float NdotL = max(dot(V, L), 0.0);
  5986. if (NdotL > 0.0) {
  5987. color += vec4(texture(u_radianceTexture, L).rgb, 1.0) * NdotL;
  5988. weight += NdotL;
  5989. }
  5990. }
  5991. out_FragColor = color / weight;
  5992. }
  5993. `;var g0n=T(S(),1),iX=`in vec3 position;
  5994. out vec3 v_textureCoordinates;
  5995. uniform vec3 u_faceDirection;
  5996. vec3 getCubeMapDirection(vec2 uv, vec3 faceDir) {
  5997. vec2 scaledUV = uv;
  5998. if (faceDir.x != 0.0) {
  5999. return vec3(faceDir.x, scaledUV.y, scaledUV.x * faceDir.x);
  6000. } else if (faceDir.y != 0.0) {
  6001. return vec3(scaledUV.x, -faceDir.y, -scaledUV.y * faceDir.y);
  6002. } else {
  6003. return vec3(scaledUV.x * faceDir.z, scaledUV.y, -faceDir.z);
  6004. }
  6005. }
  6006. void main()
  6007. {
  6008. v_textureCoordinates = getCubeMapDirection(position.xy, u_faceDirection);
  6009. v_textureCoordinates.y = -v_textureCoordinates.y;
  6010. v_textureCoordinates.z = -v_textureCoordinates.z;
  6011. gl_Position = vec4(position, 1.0);
  6012. }
  6013. `;function Qp(e){this._position=void 0,this._radianceMapDirty=!1,this._radianceCommandsDirty=!1,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1,this._irradianceTextureDirty=!1,this._sphericalHarmonicCoefficientsDirty=!1,this._shouldRegenerateShaders=!1,e=y(e,y.EMPTY_OBJECT);let t=y(e.mipmapLevels,10);this._mipmapLevels=t,this._radianceMapComputeCommands=new Array(6),this._convolutionComputeCommands=new Array((t-1)*6),this._irradianceComputeCommand=void 0,this._radianceMapFS=void 0,this._irradianceMapFS=void 0,this._convolveSP=void 0,this._va=void 0,this._radianceMapTextures=new Array(6),this._specularMapTextures=new Array((t-1)*6),this._radianceCubeMap=void 0,this._irradianceMapTexture=void 0,this._sphericalHarmonicCoefficients=new Array(9),this._lastTime=new j;let n=Math.pow(2,t-1);this._textureDimensions=new D(n,n),this._radiiAndDynamicAtmosphereColor=new h,this._sceneEnvironmentMap=void 0,this._backgroundColor=void 0,this._owner=void 0,this.enabled=y(e.enabled,!0),this.shouldUpdate=!0,this.maximumSecondsDifference=y(e.maximumSecondsDifference,60*60),this.maximumPositionEpsilon=y(e.maximumPositionEpsilon,1e3),this.atmosphereScatteringIntensity=y(e.atmosphereScatteringIntensity,2),this.gamma=y(e.gamma,1),this.brightness=y(e.brightness,1),this.saturation=y(e.saturation,1),this.groundColor=y(e.groundColor,Qp.AVERAGE_EARTH_GROUND_COLOR),this.groundAlbedo=y(e.groundAlbedo,.31)}Object.defineProperties(Qp.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){h.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=h.clone(e,this._position),this.reset())}},radianceCubeMap:{get:function(){return this._radianceCubeMap}},maximumMipmapLevel:{get:function(){return this._mipmapLevels}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}}});Qp.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Qp.prototype.reset=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)this._convolutionComputeCommands[t]=void 0;l(this._irradianceComputeCommand)&&(this._irradianceComputeCommand=void 0),this._radianceMapDirty=!0,this._radianceCommandsDirty=!0};var V5e=new h,L5e=new h;function R5e(e,t){let n=e._position,i=t.atmosphere,o=t.mapProjection.ellipsoid,r=o.scaleToGeodeticSurface(n,L5e),s=1.025,a=V5e,c=l(r)?h.magnitude(r):o.maximumRadius;return a.x=c*s,a.y=c,a.z=i.dynamicLighting,!h.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,a)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(h.clone(a,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var Hre=new h,Z5e=new M,G5e=new se,E5e=new B;function I5e(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new yr({context:n,width:i.x,height:i.y,pixelDatatype:qe.UNSIGNED_BYTE,pixelFormat:ot.RGBA})),e._radianceCommandsDirty){let o=e._radianceMapFS;l(o)||(o=new De({sources:[Um,tX]}),e._radianceMapFS=o),u_.requiresColorCorrect(t.atmosphere)&&o.defines.push("ATMOSPHERE_COLOR_CORRECT");let r=e._position,s=e._radiiAndDynamicAtmosphereColor,a=t.mapProjection.ellipsoid,c=Ft.eastNorthUpToFixedFrame(r,a,Z5e),d=G5e;d.x=e.brightness,d.y=e.saturation,d.z=e.gamma,d.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&o.defines.push("ENVIRONMENT_COLOR_CORRECT");let u=0;for(let m of yr.faceNames()){let p=e._radianceMapTextures[u];l(p)&&p.destroy(),p=new Pt({context:n,width:i.x,height:i.y,pixelDatatype:qe.UNSIGNED_BYTE,pixelFormat:ot.RGBA}),e._radianceMapTextures[u]=p;let g=u,f=new Xc({fragmentShaderSource:o,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>c,u_faceDirection:()=>yr.getDirection(m,Hre),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>d,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,E5e)},persists:!0,owner:e,postExecute:()=>{let x=e._radianceMapComputeCommands;if(!l(x[g]))return;x[g]=void 0;let _=new Wr({context:n,colorTextures:[e._radianceMapTextures[g]],destroyAttachments:!1});_._bind(),e._radianceCubeMap[m].copyFromFramebuffer(),_._unBind(),_.destroy(),x.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)}});t.commandList.push(f),e._radianceMapComputeCommands[u]=f,u++}e._radianceCommandsDirty=!1}}function X5e(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,o=e._textureDimensions,r=o.x/2,s=o.y/2,a=t.context,c=0,d=(m,p,g,f)=>()=>{let x=e._convolutionComputeCommands;l(x[m])&&(x[m]=void 0,n.copyFace(t,p,g,f),c++,c===e._specularMapTextures.length&&(e._irradianceCommandDirty=!0,n.sampler=new en({minificationFilter:$t.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0))},u=0;for(let m=1;m<i;++m){for(let p of yr.faceNames()){let g=e._specularMapTextures[u]=new Pt({context:a,width:r,height:s,pixelDatatype:qe.UNSIGNED_BYTE,pixelFormat:ot.RGBA}),f=e._va;l(f)||(f=yr.createVertexArray(a,p),e._va=f);let x=e._convolveSP;l(x)||(x=tn.fromCache({context:a,vertexShaderSource:iX,fragmentShaderSource:nX,attributeLocations:{positions:0}}),e._convolveSP=x);let _=new Xc({shaderProgram:x,vertexArray:f,outputTexture:g,persists:!0,owner:e,uniformMap:{u_roughness:()=>m/(i-1),u_radianceTexture:()=>n,u_faceDirection:()=>yr.getDirection(p,Hre)},postExecute:d(u,g,p,m)});e._convolutionComputeCommands[u]=_,t.commandList.push(_),++u}r/=2,s/=2}}var zre=new D(3,3);function W5e(e,t){let n=t.context,i=zre,o=e._irradianceMapTexture;l(o)||(o=new Pt({context:n,width:i.x,height:i.y,pixelDatatype:qe.FLOAT,pixelFormat:ot.RGBA}),e._irradianceMapTexture=o);let r=e._irradianceMapFS;l(r)||(r=new De({sources:[eX]}),e._irradianceMapFS=r);let s=new Xc({fragmentShaderSource:r,outputTexture:o,uniformMap:{u_radianceMap:()=>e._radianceCubeMap},postExecute:()=>{l(e._irradianceComputeCommand)&&(e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0)}});e._irradianceComputeCommand=s,t.commandList.push(s),e._irradianceTextureDirty=!0}function P5e(e,t){let n=t.context,i=new Wr({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=zre,r=n.readPixels({x:0,y:0,width:o.x,height:o.y,framebuffer:i});for(let s=0;s<9;++s)e._sphericalHarmonicCoefficients[s]=h.unpack(r,s*4),h.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._shouldRegenerateShaders=!0}Qp.prototype.update=function(e){let t=e.mode;if(!this.enabled||!this.shouldUpdate||!l(this._position)||t===oe.MORPHING){this._shouldRegenerateShaders=!1;return}let n=e.atmosphere.dynamicLighting;if((R5e(this,e)||n===Jp.SUNLIGHT&&!j.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference))&&(this.reset(),this._lastTime=j.clone(e.time,this._lastTime)),this._radianceMapDirty&&(I5e(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(X5e(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(W5e(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){P5e(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};Qp.prototype.isDestroyed=function(){return!1};Qp.prototype.destroy=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)this._convolutionComputeCommands[t]=void 0;this._irradianceMapComputeCommand=void 0,e=this._radianceMapTextures.length;for(let t=0;t<e;++t)this._radianceMapTextures[t]=this._radianceMapTextures[t]&&this._radianceMapTextures[t].destroy();e=this._specularMapTextures.length;for(let t=0;t<e;++t)this._specularMapTextures[t]=this._specularMapTextures[t]&&this._specularMapTextures[t].destroy();return this._radianceCubeMap=this._radianceCubeMap&&this._radianceCubeMap.destroy(),this._irradianceMapTexture=this._irradianceMapTexture&&this._irradianceMapTexture.destroy(),me(this)};Qp.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(B.fromCssColorString("#717145"));var jp=Qp;var Q0n=T(S(),1);var oX={HIGHLIGHT:0,REPLACE:1,MIX:2};oX.getColorBlend=function(e,t){if(e===oX.HIGHLIGHT)return 0;if(e===oX.REPLACE)return 1;if(e===oX.MIX)return W.clamp(t,W.EPSILON4,1)};var lc=Object.freeze(oX);var o_n=T(S(),1);var q0n=T(S(),1),v5e={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},dc=Object.freeze(v5e);var egn=T(S(),1),w5e={STEP:0,LINEAR:1,CUBICSPLINE:2},Dm=Object.freeze(w5e);var lyn=T(S(),1);var Ygn=T(S(),1);var dgn=T(S(),1);var rgn=T(S(),1);var Kre={};function rX(e){this._count=e.count,this._properties=Ye(e.properties,!0)}rX.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,Kre)};rX.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,Kre,e)};rX.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Ye(n[e],!0)};rX.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Ye(n,!0)};var qp=rX;function uc(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy}Object.defineProperties(uc.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(l(this._metadataTable))return this._metadataTable.class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return l(this._metadataTable)&&(e+=this._metadataTable.byteLength),l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}}});uc.prototype.hasProperty=function(e,t){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(t)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};uc.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};uc.prototype.propertyExists=function(e){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(e)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};uc.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var JH=[];uc.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,l(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(JH)),l(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,JH)),l(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(JH)),t};uc.prototype.getProperty=function(e,t){let n;if(l(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),l(n))||l(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),l(n))||l(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),l(n)))return n};uc.prototype.setProperty=function(e,t,n){l(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(l(this._jsonMetadataTable)||(this._jsonMetadataTable=new qp({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};uc.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};uc.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};uc.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};uc.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};uc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};uc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};uc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};var Yc=uc;var Cgn=T(S(),1);var ygn=T(S(),1);function sX(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty,i=e.textures,o=l(t.channels)?t.channels:[0],r=t,s=Wl.createModelTextureReader({textureInfo:r,channels:M5e(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,d=n.hasValueTransform||l(a)||l(c);a=y(a,n.offset),c=y(c,n.scale),a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=d,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(sX.prototype,{textureReader:{get:function(){return this._textureReader}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});sX.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?e.isVariableLengthArray?(St(`Property texture property ${e.id} is a variable-length array, which is not supported`),!1):e.arrayLength>4?(St(`Property texture property ${e.id} is an array of length ${e.arrayLength}, but may have at most a length of 4`),!1):t!==Rt.SCALAR?(St(`Property texture property ${e.id} is an array of type ${t}, but only SCALAR is supported`),!1):n!==Ht.UINT8?(St(`Property texture property ${e.id} is an array with component type ${n}, but only UINT8 is supported`),!1):!0:Rt.isVectorType(t)||t===Rt.SCALAR?n!==Ht.UINT8?(St(`Property texture property ${e.id} has component type ${n}, but only UINT8 is supported`),!1):!0:(St(`Property texture property ${e.id} has an unsupported type`),!1)};var F5e=[void 0,"float","vec2","vec3","vec4"],A5e=[void 0,"int","ivec2","ivec3","ivec4"];sX.prototype.getGlslType=function(){let e=this._classProperty,t=Rt.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?F5e[t]:A5e[t]};sX.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function M5e(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var aX=sX;function QH(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyTexture,n=e.class,i=e.textures,o=t.extensions,r=t.extras,s={};if(l(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new aX({property:t.properties[a],classProperty:n.properties[a],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=s,this._extras=r,this._extensions=o}Object.defineProperties(QH.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});QH.prototype.getProperty=function(e){return this._properties[e]};var $p=QH;var Wgn=T(S(),1);var Zgn=T(S(),1);function Jre(e){e=y(e,y.EMPTY_OBJECT);let t=e.property,n=e.classProperty;this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,o=t.scale,r=n.hasValueTransform||l(i)||l(o);i=y(i,n.offset),o=y(o,n.scale),i=n.unpackVectorAndMatrixTypes(i),o=n.unpackVectorAndMatrixTypes(o),this._offset=i,this._scale=o,this._hasValueTransform=r,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Jre.prototype,{attribute:{get:function(){return this._attribute}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var cX=Jre;function jH(e){e=y(e,y.EMPTY_OBJECT);let t=e.propertyAttribute,n=e.class,i={};if(l(t.properties))for(let o in t.properties)t.properties.hasOwnProperty(o)&&(i[o]=new cX({property:t.properties[o],classProperty:n.properties[o]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(jH.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});jH.prototype.getProperty=function(e){return this._properties[e]};var m_=jH;var Fgn=T(S(),1);function lX(e){e=y(e,y.EMPTY_OBJECT),this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=l(t)?t.length:0,this._propertyTables=t,this._propertyTextures=e.propertyTextures,this._propertyAttributes=e.propertyAttributes,this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(lX.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!l(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n<t;n++)e+=this._propertyTables[n].byteLength;return e}}});lX.prototype.getPropertyTable=function(e){return this._propertyTables[e]};lX.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};lX.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};var Us=lX;function N5e(e){e=y(e,y.EMPTY_OBJECT);let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],c=n.classes[a.class],d=new Il({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new Yc({id:s,name:a.name,count:a.count,metadataTable:d,extras:a.extras,extensions:a.extensions}))}let o=[];if(l(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];o.push(new $p({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let r=[];if(l(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];r.push(new m_({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new Us({schema:n,propertyTables:i,propertyTextures:o,propertyAttributes:r,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var dX=N5e;var eyn=T(S(),1);function k5e(e){e=y(e,y.EMPTY_OBJECT);let t=e.extension,n=e.schema,i,o=[],r;if(l(t.featureTables))for(r=Object.keys(t.featureTables).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTables[a],d=n.classes[c.class],u=new Il({count:c.count,properties:c.properties,class:d,bufferViews:e.bufferViews});o.push(new Yc({id:a,count:c.count,metadataTable:u,extras:c.extras,extensions:c.extensions}))}let s=[];if(l(t.featureTextures))for(r=Object.keys(t.featureTextures).sort(),i=0;i<r.length;i++){let a=r[i],c=t.featureTextures[a];s.push(new $p({id:a,propertyTexture:U5e(c),class:n.classes[c.class],textures:e.textures}))}return new Us({schema:n,propertyTables:o,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function U5e(e){let t={class:e.class,properties:{}},n=e.properties;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i],r={channels:D5e(o.channels),extras:o.extras,extensions:o.extensions};t.properties[i]=Tt(o.texture,r,!0)}return t}function D5e(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]="rgba".indexOf(e[i]);return n}var uX=k5e;function ug(e){e=y(e,y.EMPTY_OBJECT);let{gltf:t,extension:n,extensionLegacy:i,gltfResource:o,baseResource:r,supportedImageFormats:s,frameState:a,cacheKey:c,asynchronous:d=!0}=e;this._gltfResource=o,this._baseResource=r,this._gltf=t,this._extension=n,this._extensionLegacy=i,this._supportedImageFormats=s,this._frameState=a,this._cacheKey=c,this._asynchronous=d,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(ug.prototype=Object.create(Hi.prototype),ug.prototype.constructor=ug);Object.defineProperties(ug.prototype,{cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}});async function B5e(e){try{let t=K5e(e),n=$5e(e),i=eke(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=yt.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=yt.FAILED,e.getError("Failed to load structural metadata",t)}}ug.prototype.load=function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,this._promise=B5e(this),this._promise)};function O5e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.values,r=i.arrayOffsets,s=i.stringOffsets;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(s)&&(t[s]=!0)}}function Y5e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.bufferView,r=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(s)&&(t[s]=!0)}}function H5e(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let o=t[i];O5e(o.properties,n)}return n}function z5e(e){let t=e.featureTables,n={};if(l(t)){for(let i in t)if(t.hasOwnProperty(i)){let r=t[i].properties;l(r)&&Y5e(r,n)}}return n}async function K5e(e){let t;l(e._extension)?t=H5e(e._extension):t=z5e(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let o=Ci.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(o),e._bufferViewIds.push(i),n.push(o.load())}return Promise.all(n)}function J5e(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i].properties;l(r)&&Q5e(r,t)}return t}function Q5e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function j5e(e){let t={},n=e.featureTextures;if(l(n)){for(let i in n)if(n.hasOwnProperty(i)){let r=n[i].properties;l(r)&&q5e(r,t)}}return t}function q5e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let o=e[n].texture;t[o.index]=o}}function $5e(e){let t;l(e._extension)?t=J5e(e._extension):t=j5e(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,o=e._baseResource,r=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let d in t)if(t.hasOwnProperty(d)){let u=Ci.getTextureLoader({gltf:n,textureInfo:t[d],gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a});e._textureLoaders.push(u),e._textureIds.push(d),c.push(u.load())}return Promise.all(c)}async function eke(e){let t=y(e._extension,e._extensionLegacy),n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Ci.getSchemaLoader({resource:i})}else n=Ci.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}ug.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let a=0;a<n;++a){let d=t[a].process(e);i=i&&d}if(!i)return!1;let o=this._schemaLoader.schema,r={};for(let a=0;a<this._bufferViewIds.length;++a){let c=this._bufferViewIds[a],d=this._bufferViewLoaders[a];if(!d.isDestroyed()){let u=new Uint8Array(d.typedArray);r[c]=u}}let s={};for(let a=0;a<this._textureIds.length;++a){let c=this._textureIds[a],d=t[a];d.isDestroyed()||(s[c]=d.texture)}return l(this._extension)?this._structuralMetadata=dX({extension:this._extension,schema:o,bufferViews:r,textures:s}):this._structuralMetadata=uX({extension:this._extensionLegacy,schema:o,bufferViews:r,textures:s}),Qre(this),this._state=yt.READY,!0};function Qre(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Ci.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function tke(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Ci.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}ug.prototype.unload=function(){Qre(this),tke(this),l(this._schemaLoader)&&Ci.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};var mX=ug;var uyn=T(S(),1);var WC={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};WC.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return WC.TRANSLATION;case"ROTATION":return WC.ROTATION;case"SCALE":return WC.SCALE;case"_FEATURE_ID":return WC.FEATURE_ID}};var $r=Object.freeze(WC);var Wyn=T(S(),1);var Syn=T(S(),1);var nke=65534,ike=255;function W5(e){e=y(e,y.EMPTY_OBJECT);let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new $re(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],oke(this)}Object.defineProperties(W5.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function oke(e){let t=e._triangleIndices,n=e._edges,i=[],o=e._extraVertices,r=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],d=t[a+1],u=t[a+2],m=!1,p=m||n.hasEdge(c,d),g=m||n.hasEdge(d,u),f=m||n.hasEdge(u,c),x=jre(i,c,d,u,p,g,f);for(;l(x);){let _=s[x];if(!l(_)){_=r+o.length;let C=x;for(;C>=r;)C=o[C-r];o.push(C),s[x]=_}_>nke&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):_>ike&&t instanceof Uint8Array&&(t=new Uint16Array(t)),x===c?(c=_,t[a]=_):x===d?(d=_,t[a+1]=_):(u=_,t[a+2]=_),x=jre(i,c,d,u,p,g,f)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function jre(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,d=0,u=qH(e,t,a,c,d);if(u===0)return t;let m=0,p=o?1:0,g=r?1:0,f=qH(e,n,m,p,g);if(f===0)return n;let x=s?1:0,_=0,C=r?1:0,V=qH(e,i,x,_,C);if(V===0)return i;let L=u&f&V,Z,G,I;if(L&1)Z=0,G=1,I=2;else if(L&2)Z=0,I=1,G=2;else if(L&4)G=0,Z=1,I=2;else if(L&8)G=0,I=1,Z=2;else if(L&16)I=0,Z=1,G=2;else if(L&32)I=0,G=1,Z=2;else{let F=$H(u),b=$H(f),R=$H(V);return F<b&&F<R?t:b<R?n:i}let v=t*3;e[v+Z]=a,e[v+G]=c,e[v+I]=d;let P=n*3;e[P+Z]=m,e[P+G]=p,e[P+I]=g;let w=i*3;e[w+Z]=x,e[w+G]=_,e[w+I]=C}function qH(e,t,n,i,o){let r=t*3,s=e[r],a=e[r+1],c=e[r+2];return l(s)?(s===n&&a===i&&c===o)<<0|(s===n&&a===o&&c===i)<<1|(s===i&&a===n&&c===o)<<2|(s===i&&a===o&&c===n)<<3|(s===o&&a===n&&c===i)<<4|(s===o&&a===i&&c===n)<<5:63}function $H(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}W5.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,s=new r(e.length+o*i);s.set(e);for(let a=0;a<o;a++){let c=t[a]*i,d=n+a*i;for(let u=0;u<i;u++)s[d+u]=s[c+u]}return s};W5.createTexture=function(e){let t=e.cache.modelOutliningCache;if(l(t)||(t=e.cache.modelOutliningCache={}),l(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,Bt.maximumTextureSize),i=n,o=qre(i),r=[];for(;i>1;)i>>=1,r.push(qre(i));let s=new Pt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:ot.LUMINANCE,sampler:new en({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:$t.LINEAR_MIPMAP_LINEAR,magnificationFilter:hi.LINEAR})});return t.outlineTexture=s,s};function qre(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function $re(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],o=e[n+1],r=Math.min(i,o),s=Math.max(i,o),a=r*this._originalVertexCount+s;this._edges.add(a)}}$re.prototype.hasEdge=function(e,t){let n=Math.min(e,t),i=Math.max(e,t),o=n*this._originalVertexCount+i;return this._edges.has(o)};var h_=W5;function ese(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function rke(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function P5(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0}P5.prototype.postProcess=function(e){this.needsOutlines&&(ske(this),cke(this,e))};function ske(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,o=new h_({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=o.updatedTriangleIndices,n.indexDatatype=Ae.fromTypedArray(n.typedArray);let r=ake(o.outlineCoordinates),s=new ese(r);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let d=0;d<c;d++){let u=a[d].attribute;u.typedArray=o.updateAttribute(u.typedArray)}}function ake(e){let t=new Tn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=Q.FLOAT,t.type=sn.VEC3,t.normalized=!1,t.count=e.length/3,t}function cke(e,t){lke(e.attributePlans,t),l(e.indicesPlan)&&dke(e.indicesPlan,t)}function lke(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=o.attribute,s=r.typedArray;if(o.loadBuffer){let a=xt.createVertexBuffer({typedArray:s,context:t,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.buffer=a}o.loadTypedArray||(r.typedArray=void 0)}}function dke(e,t){let n=e.indices;if(e.loadBuffer){let i=xt.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Me.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}P5.AttributeLoadPlan=ese;P5.IndicesLoadPlan=rke;var f_=P5;var wyn=T(S(),1);function uke(e){e=y(e,y.EMPTY_OBJECT),this.webp=y(e.webp,!1),this.basis=y(e.basis,!1)}var hX=uke;var oxn=T(S(),1);var Ayn=T(S(),1);function tse(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(tse.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var fX=tse;var Nyn=T(S(),1);function nse(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(nse.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var pX=nse;var Uyn=T(S(),1);function ise(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(ise.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var bX=ise;var Yyn=T(S(),1);var Byn=T(S(),1),mke={Direct:"Direct",Indirect:"Indirect"},mg=Object.freeze(mke);function ose(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(ose.prototype,{storageType:{get:function(){return this._storageType}},anchorPointsIndirect:{get:function(){return this._anchorPointsIndirect}},anchorPointsDirect:{get:function(){return this._anchorPointsDirect}},intraTileCorrelationGroups:{get:function(){return this._intraTileCorrelationGroups}},covarianceDirect:{get:function(){return this._covarianceDirect}}});var PC=ose;var zyn=T(S(),1);function rse(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(rse.prototype,{A:{get:function(){return this._A}},alpha:{get:function(){return this._alpha}},beta:{get:function(){return this._beta}},T:{get:function(){return this._T}}});var gX=rse;function vC(){}function sse(e){return new $(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function hke(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h);return new fX({position:t,adjustmentParams:n})}function fke(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h),i=sse(e.covarianceMatrix);return new pX({position:t,adjustmentParams:n,covarianceMatrix:i})}function pke(e){let t=e.groupFlags,n=h.fromArray(e.rotationThetas,0,new h),i=[];for(let r of e.params){let s=new gX({A:r.A,alpha:r.alpha,beta:r.beta,T:r.T});i.push(s)}return new bX({groupFlags:t,rotationThetas:n,params:i})}vC.load=function(e){let t=e.storageType;if(t===mg.Direct)return vC.loadDirect(e);if(t===mg.Indirect)return vC.loadIndirect(e);throw new de(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};vC.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let r of n){let s=hke(r);t.push(s)}let i=sse(e.covarianceDirectUpperTriangle);return new PC({storageType:mg.Direct,anchorPointsDirect:t,covarianceDirect:i})};vC.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=fke(s);t.push(a)}let i=e.intraTileCorrelationGroups,o=[];for(let s of i){let a=pke(s);o.push(a)}return new PC({storageType:mg.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:o})};var yX=vC;var Cxn=T(S(),1);var sxn=T(S(),1);function ase(e){this._traits=e.traits,this._noData=e.noData,this._offset=e.offset,this._scale=e.scale,this._index=e.index,this._texCoord=e.texCoord}Object.defineProperties(ase.prototype,{traits:{get:function(){return this._traits}},noData:{get:function(){return this._noData}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},index:{get:function(){return this._index}},texCoord:{get:function(){return this._texCoord}}});var xX=ase;var cxn=T(S(),1);function cse(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(cse.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var _X=cse;var dxn=T(S(),1);function lse(e){this._ppeTextures=e}Object.defineProperties(lse.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var TX=lse;function Cr(e){e=y(e,y.EMPTY_OBJECT);let t=e.gltf,n=e.extension,i=e.gltfResource,o=e.baseResource,r=e.supportedImageFormats,s=e.frameState,a=e.cacheKey,c=y(e.asynchronous,!0);this._gltfResource=i,this._baseResource=o,this._gltf=t,this._extension=n,this._supportedImageFormats=r,this._frameState=s,this._cacheKey=a,this._asynchronous=c,this._textureLoaders=[],this._textureIds=[],this._meshPrimitiveGpmLocal=void 0,this._structuralMetadata=void 0,this._state=yt.UNLOADED,this._promise=void 0}l(Object.create)&&(Cr.prototype=Object.create(Hi.prototype),Cr.prototype.constructor=Cr);Object.defineProperties(Cr.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});Cr.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=yt.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=yt.FAILED,this.getError("Failed to load GPM data",e)}};Cr.prototype.load=function(){return l(this._promise)?this._promise:(this._state=yt.LOADING,this._promise=this._loadResources(this),this._promise)};function bke(e){let t={},n=e.ppeTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i];t[o.index]=o}return t}Cr.prototype._loadTextures=function(){let e;l(this._extension)&&(e=bke(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,o=this._supportedImageFormats,r=this._frameState,s=this._asynchronous,a=[];for(let c in e)if(e.hasOwnProperty(c)){let d=Ci.getTextureLoader({gltf:t,textureInfo:e[c],gltfResource:n,baseResource:i,supportedImageFormats:o,frameState:r,asynchronous:s});this._textureLoaders.push(d),this._textureIds.push(c),a.push(d.load())}return Promise.all(a)};Cr.ppeTexturesMetadataSchemaCache=new Map;Cr._createPpeTextureClassJson=function(e,t){let n=e.traits,i=n.source;return{name:`PPE texture class ${t}`,properties:{[i]:{name:"PPE",type:"SCALAR",componentType:"UINT8",normalized:!0,min:n.min,max:n.max}}}};Cr._obtainPpeTexturesMetadataSchema=function(e){let n=Cr._collectPpeTexturePropertyIdentifiers(e).toString(),i=Cr.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let r={id:`PPE_TEXTURE_SCHEMA_${Cr.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let c=s[a],d=`ppeTexture_${a}`,u=Cr._createPpeTextureClassJson(c,a);r.classes[d]=u}return i=yd.fromJson(r),Cr.ppeTexturesMetadataSchemaCache.set(n,i),i};Cr._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let o=n[i],r=Cr._createPpeTextureClassJson(o,i),s=JSON.stringify(r);t.push(s)}return t};Cr._convertToStructuralMetadata=function(e,t){let n=[],i=Cr._obtainPpeTexturesMetadataSchema(e),o=e.ppeTextures;for(let s=0;s<o.length;s++){let a=o[s],c=`ppeTexture_${s}`,u=a.traits.source,m=i.classes[c],p=(a.scale??1)*255,g={class:c,properties:{[u]:{index:a.index,texCoord:a.texCoord,offset:a.offset,scale:p}}};n.push(new $p({id:s,name:a.name,propertyTexture:g,class:m,textures:t}))}return new Us({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};Cr.prototype.process=function(e){if(this._state===yt.READY)return!0;if(this._state!==yt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let d=0;d<n;++d){let m=t[d].process(e);i=i&&m}if(!i)return!1;let o={};for(let d=0;d<this._textureIds.length;++d){let u=this._textureIds[d],m=t[d];m.isDestroyed()||(o[u]=m.texture)}let r=[],s=this._extension;if(l(s.ppeTextures)){let d=s.ppeTextures;for(let u of d){let m=u.traits,p=new _X({min:m.min,max:m.max,source:m.source}),g=new xX({traits:p,noData:u.noData,offset:u.offset,scale:u.scale,index:u.index,texCoord:u.texCoord});r.push(g)}}let a=new TX(r);this._meshPrimitiveGpmLocal=a;let c=Cr._convertToStructuralMetadata(a,o);return this._structuralMetadata=c,this._state=yt.READY,!0};Cr.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Ci.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};Cr.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var SX=Cr;var{Attribute:gke,Indices:yke,FeatureIdAttribute:dse,FeatureIdTexture:use,FeatureIdImplicitRange:mse,MorphTarget:xke,Primitive:_ke,Instances:Tke,Skin:Ske,Node:Cke,AnimatedPropertyType:Vke,AnimationSampler:Lke,AnimationTarget:Rke,AnimationChannel:Zke,Animation:Gke,ArticulationStage:Eke,Articulation:Ike,Asset:Xke,Scene:Wke,Components:Pke,MetallicRoughness:vke,SpecularGlossiness:wke,Specular:Fke,Anisotropy:ez,Clearcoat:tz,Material:Ake}=Tn,Po={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function Bm(e){e=y(e,y.EMPTY_OBJECT);let{gltfResource:t,typedArray:n,releaseGltfJson:i=!1,asynchronous:o=!0,incrementallyLoadTextures:r=!0,upAxis:s=Xo.Y,forwardAxis:a=Xo.Z,loadAttributesAsTypedArray:c=!1,loadAttributesFor2D:d=!1,enablePick:u=!1,loadIndicesForWireframe:m=!1,loadPrimitiveOutline:p=!0,loadForClassification:g=!1,renameBatchIdSemantic:f=!1}=e,{baseResource:x=t.clone()}=e;this._gltfJson=e.gltfJson,this._gltfResource=t,this._baseResource=x,this._typedArray=n,this._releaseGltfJson=i,this._asynchronous=o,this._incrementallyLoadTextures=r,this._upAxis=s,this._forwardAxis=a,this._loadAttributesAsTypedArray=c,this._loadAttributesFor2D=d,this._enablePick=u,this._loadIndicesForWireframe=m,this._loadPrimitiveOutline=p,this._loadForClassification=g,this._renameBatchIdSemantic=f,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=Po.NOT_LOADED,this._textureState=Po.NOT_LOADED,this._promise=void 0,this._processError=void 0,this._textureErrors=[],this._primitiveLoadPlans=[],this._loaderPromises=[],this._textureLoaders=[],this._texturesPromises=[],this._textureCallbacks=[],this._bufferViewLoaders=[],this._geometryLoaders=[],this._geometryCallbacks=[],this._structuralMetadataLoader=void 0,this._meshPrimitiveGpmLoader=void 0,this._loadResourcesPromise=void 0,this._resourcesLoaded=!1,this._texturesLoaded=!1,this._supportedImageFormats=void 0,this._postProcessBuffers=[],this._components=void 0}l(Object.create)&&(Bm.prototype=Object.create(Hi.prototype),Bm.prototype.constructor=Bm);Object.defineProperties(Bm.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},gltfJson:{get:function(){return l(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},texturesLoaded:{get:function(){return this._texturesLoaded}}});async function Mke(e){e._state=Po.LOADING,e._textureState=Po.LOADING;try{let t=Ci.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=Po.LOADED,e._textureState=Po.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=Po.FAILED,e._textureState=Po.FAILED,v5(e,t)}}async function Nke(e,t){zt.supportsWebP.initialized||await zt.supportsWebP.initialize(),e._supportedImageFormats=new hX({webp:zt.supportsWebP(),basis:t.context.supportsBasis});let n=DUe(e,t);return e._state=Po.PROCESSING,e._textureState=Po.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Ci.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}Bm.prototype.load=async function(){return l(this._promise)?this._promise:(this._promise=Mke(this),this._promise)};function v5(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function kke(e,t){let n=!0,i=e._geometryLoaders;for(let s=0;s<i.length;++s){let a=i[s].process(t);a&&l(e._geometryCallbacks[s])&&(e._geometryCallbacks[s](),e._geometryCallbacks[s]=void 0),n=n&&a}let o=e._structuralMetadataLoader;if(l(o)){let s=o.process(t);s&&(e._components.structuralMetadata=o.structuralMetadata),n=n&&s}let r=e._meshPrimitiveGpmLoader;if(l(r)){let s=r.process(t);s&&(l(e._components.structuralMetadata)&&St("structural-metadata-gpm","The model defines both the 'EXT_structural_metadata' extension and the 'NGA_gpm_local' extension. The data from the 'EXT_structural_metadata' extension will be replaced with the data from the 'NGA_gpm_local' extension, and will no longer be available for styling and picking."),e._components.structuralMetadata=r.structuralMetadata),n=n&&s}n&&(e._state=Po.POST_PROCESSING)}function Uke(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let o=n[i];o.postProcess(t),o.needsOutlines&&Dke(e,o)}}function Dke(e,t){let n=e._postProcessBuffers,i=t.primitive,o=i.outlineCoordinates;l(o)&&n.push(o.buffer);let r=i.attributes;for(let a=0;a<r.length;a++){let c=r[a];l(c.buffer)&&n.push(c.buffer)}let s=i.indices;l(s)&&l(s.buffer)&&n.push(s.buffer)}Bm.prototype._process=function(e){return this._state===Po.READY?!0:(this._state===Po.PROCESSING&&kke(this,e),this._resourcesLoaded&&this._state===Po.POST_PROCESSING&&(Uke(this,e.context),this._state=Po.PROCESSED),this._resourcesLoaded&&this._state===Po.PROCESSED?(Tse(this),this._typedArray=void 0,this._state=Po.READY,!0):!1)};Bm.prototype._processTextures=function(e){if(this._textureState===Po.READY)return!0;if(this._textureState!==Po.PROCESSING)return!1;let t=!0,n=this._textureLoaders;for(let i=0;i<n.length;++i){let o=n[i].process(e);o&&l(this._textureCallbacks[i])&&(this._textureCallbacks[i](),this._textureCallbacks[i]=void 0),t=t&&o}return t?(this._textureState=Po.READY,this._texturesLoaded=!0,!0):!1};Bm.prototype.process=function(e){if(this._state===Po.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=Nke(this,e).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=Po.FAILED;let o=this._processError;this._processError=void 0,v5(this,o)}let t=this._textureErrors.pop();if(l(t)){let o=this.getError("Failed to load glTF texture",t);throw o.name="TextureError",o}if(this._state===Po.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(o){this._state=Po.FAILED,v5(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=Po.FAILED,v5(this,o)}return this._incrementallyLoadTextures?n:n&&i};function Bke(e,t,n,i,o,r,s){let a=e.gltfJson,d=a.accessors[t].bufferView;return Ci.getVertexBufferLoader({gltf:a,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,bufferViewId:d,draco:i,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:r})}function Oke(e,t,n,i,o,r){return Ci.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:r,draco:n,asynchronous:e._asynchronous,loadBuffer:i,loadTypedArray:o})}function Yke(e,t){let n=Ci.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function hse(e,t,n){let i=t.byteOffset,o=Xl(e,t),r=t.count,s=gd(t.type),a=t.componentType,c=Q.getSizeInBytes(a),d=c*s,u=r*s;if(o===d)return n=new Uint8Array(n),Q.createArrayBufferView(a,n.buffer,n.byteOffset+i,u);let m=Q.createTypedArray(a,u),p=new DataView(n.buffer),g=new Array(s),f=Hp(t.componentType);i=n.byteOffset+i;for(let x=0;x<r;++x){f(p,i,s,c,g);for(let _=0;_<s;++_)m[x*s+_]=g[_];i+=o}return m}function Hke(e,t){let n=e.type;if(n===sn.SCALAR)return t.fill(0);let i=sn.getMathType(n);return t.fill(i.clone(i.ZERO))}function zke(e,t,n,i){let o=e.type,r=e.count;if(o===sn.SCALAR)for(let s=0;s<r;s++)n[s]=t[s];else if(o===sn.VEC4&&i)for(let s=0;s<r;s++)n[s]=we.unpack(t,s*4);else{let s=sn.getMathType(o),a=sn.getNumberOfComponents(o);for(let c=0;c<r;c++)n[c]=s.unpack(t,c*a)}return n}async function Kke(e,t,n,i,o){let{gltfJson:r}=e;if(await t.load(),e.isDestroyed())return;let s=hse(r,n,t.typedArray);i=y(i,!1),zke(n,s,o,i)}function w5(e,t,n){let i=new Array(t.count),o=t.bufferView;if(l(o)){let r=Yke(e,o),s=Kke(e,r,t,n,i);return e._loaderPromises.push(s),i}return Hke(t,i)}function xd(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function Jke(e){return e===Number?0:new e}function Qke(e){switch(e){case Q.BYTE:return 127;case Q.UNSIGNED_BYTE:return 255;case Q.SHORT:return 32767;case Q.UNSIGNED_SHORT:return 65535;default:return 1}}var jke={VEC2:new D(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new se(-1,-1,-1,-1)};function qke(e,t){let n=Qke(e.componentDatatype),i=jke[e.type],o=e.min;l(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o));let r=e.max;l(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r)),e.min=o,e.max=r}function $ke(e,t,n){let i=e.decodeMatrix,o=xd(n,e.decodedMin),r=xd(n,e.decodedMax);l(o)&&l(r)&&(t.min=o,t.max=r);let s=new Tn.Quantization;s.componentDatatype=t.componentDatatype,s.type=t.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new D(i[6],i[7]),s.quantizedVolumeStepSize=new D(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new h(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new h(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new se(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new se(i[0],i[6],i[12],i[18])),t.quantization=s}function eUe(e,t,n,i,o){let r=e.accessors[t],s=sn.getMathType(r.type),a=y(r.normalized,!1),c=new gke;c.name=n,c.semantic=i,c.setIndex=o,c.constant=Jke(s),c.componentDatatype=r.componentType,c.normalized=a,c.count=r.count,c.type=r.type,c.min=xd(s,r.min),c.max=xd(s,r.max),c.byteOffset=r.byteOffset,c.byteStride=Xl(e,r),oi(r,"WEB3D_quantized_attributes")&&$ke(r.extensions.WEB3D_quantized_attributes,c,s);let d=c.semantic===Vt.POSITION||c.semantic===Vt.NORMAL||c.semantic===Vt.TANGENT||c.semantic===Vt.TEXCOORD;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&d&&qke(c,s),c}function fse(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var tUe={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function nz(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=tUe;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function nUe(e){let t=e===Vt.POSITION,n=e===Vt.FEATURE_ID,i=e===Vt.TEXCOORD;return t||n||i}function iUe(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let o=l(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=Q.createArrayBufferView(o,t.typedArray.buffer)}}function oUe(e,t,n,i,o,r){if(o&&(n.buffer=i.buffer),r){let s=i.typedArray;n.typedArray=hse(e,t,s),o||(n.byteOffset=0,n.byteStride=void 0)}}function pse(e,t,n,i,o,r,s){let a=e.gltfJson,c=a.accessors[t],d=c.bufferView,u=n.gltfSemantic,m=n.renamedSemantic,p=n.modelSemantic,g=l(p)?fse(m):void 0,x=eUe(a,t,u,p,g);if(!l(i)&&!l(d))return x;let _=Bke(e,t,u,i,o,r,s),C=e._geometryLoaders.length;e._geometryLoaders.push(_);let V=_.load();return e._loaderPromises.push(V),e._geometryCallbacks[C]=()=>{l(i)&&l(i.attributes)&&l(i.attributes[u])?iUe(x,_,o,r):oUe(a,c,x,_,o,r)},x}function bse(e,t,n,i,o,r,s){let a=n.modelSemantic,c=a===Vt.POSITION,d=a===Vt.FEATURE_ID,u=c&&!o&&e._loadAttributesFor2D&&!s.scene3DOnly,m=c&&e._enablePick&&!s.context.webgl2,p=e._loadForClassification&&d,g=e._loadAttributesAsTypedArray,f=!g,x=g||u||m||p,V=pse(e,t,n,i,r?!1:f,r?!0:x,s),L=new f_.AttributeLoadPlan(V);return L.loadBuffer=f,L.loadTypedArray=x,L}function rUe(e,t,n,i,o){let r=e.gltfJson.accessors,s=l(n.ROTATION),a=l(n.TRANSLATION)&&l(r[n.TRANSLATION].min)&&l(r[n.TRANSLATION].max),c=nz(e,$r,i),d=c.modelSemantic,u=d===$r.TRANSLATION||d===$r.ROTATION||d===$r.SCALE,m=d===$r.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&u||!o.context.instancedArrays,g=e._enablePick&&!o.context.webgl2,f=!p,x=e._loadAttributesFor2D&&!o.scene3DOnly;return pse(e,t,c,void 0,f,p||m&&(!a||x||g),o)}function sUe(e,t,n,i,o,r){let s=e.gltfJson.accessors[t],a=s.bufferView;if(!l(n)&&!l(a))return;let c=new yke;c.count=s.count;let d=e._loadAttributesAsTypedArray,u=(e._loadIndicesForWireframe||e._enablePick)&&!r.context.webgl2,m=e._loadForClassification&&i,g=!d,f=d||u||m,C=Oke(e,t,n,o?!1:g,o?!0:f,r),V=e._geometryLoaders.length;e._geometryLoaders.push(C);let L=C.load();e._loaderPromises.push(L),e._geometryCallbacks[V]=()=>{c.indexDatatype=C.indexDatatype,c.buffer=C.buffer,c.typedArray=C.typedArray};let Z=new f_.IndicesLoadPlan(c);return Z.loadBuffer=g,Z.loadTypedArray=f,Z}function Hc(e,t,n,i){let o=e.gltfJson,r=Wl.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(r))return;let s=Ci.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),a=Wl.createModelTextureReader({textureInfo:t}),c=e._textureLoaders.length;e._textureLoaders.push(s);let d=s.load().catch(u=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw u;e._textureState=Po.FAILED,e._textureErrors.push(u)}});return e._texturesPromises.push(d),e._textureCallbacks[c]=()=>{a.texture=s.texture,l(i)&&(a.texture.sampler=i)},a}function aUe(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,c=new wke;return l(i)&&(c.diffuseTexture=Hc(e,i,n)),l(o)&&(c.specularGlossinessTexture=Hc(e,o,n)),c.diffuseFactor=xd(se,r),c.specularFactor=xd(h,s),c.glossinessFactor=a,c}function cUe(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,c=new vke;return l(i)&&(c.baseColorTexture=Hc(e,i,n)),l(o)&&(c.metallicRoughnessTexture=Hc(e,o,n)),c.baseColorFactor=xd(se,r),c.metallicFactor=s,c.roughnessFactor=a,c}function lUe(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new Fke;return l(o)&&(a.specularTexture=Hc(e,o,n)),l(s)&&(a.specularColorTexture=Hc(e,s,n)),a.specularFactor=i,a.specularColorFactor=xd(h,r),a}function dUe(e,t,n){let{anisotropyStrength:i=ez.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=ez.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new ez;return l(r)&&(s.anisotropyTexture=Hc(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function uUe(e,t,n){let{clearcoatFactor:i=tz.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=tz.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new tz;return l(o)&&(c.clearcoatTexture=Hc(e,o,n)),l(s)&&(c.clearcoatRoughnessTexture=Hc(e,s,n)),l(a)&&(c.clearcoatNormalTexture=Hc(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=r,c}function mUe(e,t,n){let i=new Ake,o=y(t.extensions,y.EMPTY_OBJECT),r=o.KHR_materials_pbrSpecularGlossiness,s=o.KHR_materials_specular,a=o.KHR_materials_anisotropy,c=o.KHR_materials_clearcoat,d=t.pbrMetallicRoughness;return i.unlit=l(o.KHR_materials_unlit),l(r)?i.specularGlossiness=aUe(e,r,n):(l(d)&&(i.metallicRoughness=cUe(e,d,n)),l(s)&&!i.unlit&&(i.specular=lUe(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=dUe(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=uUe(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=Hc(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=Hc(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=Hc(e,t.occlusionTexture,n)),i.emissiveFactor=xd(h,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,i}function gse(e,t){let n=new dse;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function yse(e,t,n,i){let o=new dse,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=fse(r.attribute),o.positionalLabel=i,o}function xse(e,t){let n=new mse;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function _se(e,t,n,i){let o=new mse,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=y(r.constant,0);let s=y(r.divisor,0);return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function hUe(e,t,n,i){let o=new use;o.featureCount=t.featureCount,o.nullFeatureId=t.nullFeatureId,o.propertyTableId=t.propertyTable,o.label=t.label,o.positionalLabel=i;let r=t.texture;o.textureReader=Hc(e,r,n,en.NEAREST);let a=(l(r.channels)?r.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=a,o}function fUe(e,t,n,i,o,r){let s=new use,a=t.featureIds,c=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=Hc(e,c,i,en.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function pUe(e,t,n,i,o){let r=new xke,s=void 0,a=!1;for(let c in t){if(!t.hasOwnProperty(c))continue;let d=t[c],u=nz(e,Vt,c),m=bse(e,d,u,s,a,n,o);r.attributes.push(m.attribute),i.attributePlans.push(m)}return r}function bUe(e,t,n,i){let o=new _ke,r=new f_(o);e._primitiveLoadPlans.push(r);let s=t.material;l(s)&&(o.material=mUe(e,e.gltfJson.materials[s],i));let a=y(t.extensions,y.EMPTY_OBJECT),c=!1,d=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(c=!0,r.needsOutlines=!0,r.outlineIndices=gUe(e,d,r));let u=e._loadForClassification,m=a.KHR_draco_mesh_compression,p=!1,g=t.attributes;if(l(g))for(let G in g){if(!g.hasOwnProperty(G))continue;let I=g[G],v=nz(e,Vt,G),P=v.modelSemantic;if(u&&!nUe(P))continue;P===Vt.FEATURE_ID&&(p=!0);let w=bse(e,I,v,m,n,c,i);r.attributePlans.push(w),o.attributes.push(w.attribute)}let f=t.targets;if(l(f)&&!u)for(let G=0;G<f.length;++G)o.morphTargets.push(pUe(e,f[G],c,r,i));let x=t.indices;if(l(x)){let G=sUe(e,x,m,p,c,i);l(G)&&(r.indicesPlan=G,o.indices=G.indices)}let _=a.EXT_structural_metadata,C=a.EXT_mesh_features,V=a.EXT_feature_metadata,L=l(V);l(C)?yUe(e,o,C,i):L&&xUe(e,o,V,i),l(_)?_Ue(o,_):L&&TUe(e,o,V);let Z=t.mode;if(u&&Z!==Fe.TRIANGLES)throw new de("Only triangle meshes can be used for classification.");return o.primitiveType=Z,o}function gUe(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return w5(e,i,!1)}function yUe(e,t,n,i){let o;l(n)&&l(n.featureIds)?o=n.featureIds:o=[];for(let r=0;r<o.length;r++){let s=o[r],a=`featureId_${r}`,c;l(s.texture)?c=hUe(e,s,i,a):l(s.attribute)?c=gse(s,a):c=xse(s,a),t.featureIds.push(c)}}function xUe(e,t,n,i){let{featureTables:o}=e.gltfJson.extensions.EXT_feature_metadata,r=0,s=n.featureIdAttributes;if(l(s))for(let c=0;c<s.length;++c){let d=s[c],u=d.featureTable,m=e._sortedPropertyTableIds.indexOf(u),p=o[u].count,g=`featureId_${r}`;r++;let f;l(d.featureIds.attribute)?f=yse(d,m,p,g):f=_se(d,m,p,g),t.featureIds.push(f)}let a=n.featureIdTextures;if(l(a))for(let c=0;c<a.length;++c){let d=a[c],u=d.featureTable,m=e._sortedPropertyTableIds.indexOf(u),p=o[u].count,g=`featureId_${r}`;r++;let f=fUe(e,d,m,i,p,g);t.featureIds.push(f)}}function _Ue(e,t){l(t)&&(l(t.propertyTextures)&&(e.propertyTextureIds=t.propertyTextures),l(t.propertyAttributes)&&(e.propertyAttributeIds=t.propertyAttributes))}function TUe(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function SUe(e,t,n){let i=t.EXT_mesh_gpu_instancing,o=new Tke,r=i.attributes;if(l(r))for(let d in r){if(!r.hasOwnProperty(d))continue;let u=r[d];o.attributes.push(rUe(e,u,r,d,n))}let s=y(i.extensions,y.EMPTY_OBJECT),a=t.EXT_instance_features,c=s.EXT_feature_metadata;return l(a)?CUe(o,a):l(c)&&VUe(e.gltfJson,o,c,e._sortedPropertyTableIds),o}function CUe(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let o=n[i],r=`instanceFeatureId_${i}`,s;l(o.attribute)?s=gse(o,r):s=xse(o,r),e.featureIds.push(s)}}function VUe(e,t,n,i){let o=e.extensions.EXT_feature_metadata.featureTables,r=n.featureIdAttributes;if(l(r))for(let s=0;s<r.length;++s){let a=r[s],c=a.featureTable,d=i.indexOf(c),u=o[c].count,m=`instanceFeatureId_${s}`,p;l(a.featureIds.attribute)?p=yse(a,d,u,m):p=_se(a,d,u,m),t.featureIds.push(p)}}function LUe(e,t,n){let i=new Cke;i.name=t.name,i.matrix=xd(M,t.matrix),i.translation=xd(h,t.translation),i.rotation=xd(we,t.rotation),i.scale=xd(h,t.scale);let o=y(t.extensions,y.EMPTY_OBJECT),r=o.EXT_mesh_gpu_instancing,s=o.AGI_articulations;if(l(r)){if(e._loadForClassification)throw new de("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=SUe(e,o,n)}l(s)&&(i.articulationName=s.articulationName);let a=t.mesh;if(l(a)){let c=e.gltfJson.meshes[a],d=c.primitives;for(let p=0;p<d.length;++p)i.primitives.push(bUe(e,d[p],l(i.instances),n));let u=y(t.weights,c.weights),m=i.primitives[0].morphTargets;i.morphWeights=l(u)?u.slice():new Array(m.length).fill(0)}return i}function RUe(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(o,r){let s=LUe(e,o,t);return s.index=r,s});for(let o=0;o<i.length;++o){let r=n[o].children;if(l(r))for(let s=0;s<r.length;++s)i[o].children.push(i[r[s]])}return i}function ZUe(e,t,n){let i=new Ske,o=t.joints;i.joints=o.map(s=>n[s]);let r=t.inverseBindMatrices;if(l(r)){let s=e.gltfJson.accessors[r];i.inverseBindMatrices=w5(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(M.IDENTITY);return i}function GUe(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(r,s){let a=ZUe(e,r,t);return a.index=s,a}),o=e.gltfJson.nodes;for(let r=0;r<t.length;++r){let s=o[r].skin;l(s)&&(t[r].skin=i[s])}return i}async function EUe(e,t,n,i){let o=new mX({gltf:e.gltfJson,extension:t,extensionLegacy:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._structuralMetadataLoader=o,o.load()}async function IUe(e,t,n,i){let o=new SX({gltf:t,extension:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._meshPrimitiveGpmLoader=o,o.load()}function XUe(e,t){let n=new Lke,i=e.gltfJson.accessors,o=i[t.input];n.input=w5(e,o);let r=t.interpolation;n.interpolation=y(Dm[r],Dm.LINEAR);let s=i[t.output];return n.output=w5(e,s,!0),n}function WUe(e,t){let n=new Rke,i=e.node;if(!l(i))return;n.node=t[i];let o=e.path.toUpperCase();return n.path=Vke[o],n}function PUe(e,t,n){let i=new Zke,o=e.sampler;return i.sampler=t[o],i.target=WUe(e.target,n),i}function vUe(e,t,n){let i=new Gke;i.name=t.name;let o=t.samplers.map(function(s,a){let c=XUe(e,s);return c.index=a,c}),r=t.channels.map(function(s){return PUe(s,o,n)});return i.samplers=o,i.channels=r,i}function wUe(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(o,r){let s=vUe(e,o,t);return s.index=r,s})}function FUe(e){let t=new Eke;t.name=e.name;let n=e.type.toUpperCase();return t.type=dc[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function AUe(e){let t=new Ike;return t.name=e.name,t.stages=e.stages.map(FUe),t}function MUe(e){let n=y(e.extensions,y.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(AUe):[]}function NUe(e){let t;return l(e.scenes)&&l(e.scene)&&(t=e.scenes[e.scene].nodes),t=y(t,e.nodes),t=l(t)?t:[],t}function kUe(e,t){let n=new Wke,i=NUe(e);return n.nodes=i.map(function(o){return t[o]}),n}var UUe=new h;function DUe(e,t){let n=e.gltfJson,i=y(n.extensions,y.EMPTY_OBJECT),o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(l(r)){let V=r.featureTables,L=r.featureTextures,Z=l(V)?V:[],G=l(L)?L:[];e._sortedPropertyTableIds=Object.keys(Z).sort(),e._sortedFeatureTextureIds=Object.keys(G).sort()}let a=RUe(e,t),c=GUe(e,a),d=wUe(e,a),u=MUe(n),m=kUe(n,a),p=new Pke,g=new Xke,f=n.asset.copyright;if(l(f)){let V=f.split(";").map(function(L){return new Et(L.trim())});g.credits=V}if(p.asset=g,p.scene=m,p.nodes=a,p.skins=c,p.animations=d,p.articulations=u,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,l(s)){let V=h.fromArray(s.center,0,UUe);p.transform=M.fromTranslation(V,p.transform)}if(e._components=p,l(o)||l(r)){let V=EUe(e,o,r,t);e._loaderPromises.push(V)}let x=i.NGA_gpm_local;if(l(x)){let V=yX.load(x);e._components.extensions.NGA_gpm_local=V}let _=n.meshes;if(l(_))for(let V of _){let L=V.primitives;if(l(L))for(let Z of L){let G=Z.extensions;if(l(G)){let I=G.NGA_gpm_local;if(l(I)){let v=IUe(e,n,I,t);e._loaderPromises.push(v)}}}}let C=[];return C.push.apply(C,e._loaderPromises),e._incrementallyLoadTextures||C.push.apply(C,e._texturesPromises),Promise.all(C)}function BUe(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ci.unload(t[n]);e._textureLoaders.length=0}function Tse(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ci.unload(t[n]);e._bufferViewLoaders.length=0}function OUe(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Ci.unload(t[n]);e._geometryLoaders.length=0}function YUe(e){let t=e._postProcessBuffers;for(let n=0;n<t.length;n++){let i=t[n];i.isDestroyed()||i.destroy()}t.length=0}function HUe(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function zUe(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}Bm.prototype.isUnloaded=function(){return this._state===Po.UNLOADED};Bm.prototype.unload=function(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Ci.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,BUe(this),Tse(this),OUe(this),YUe(this),HUe(this),zUe(this),this._components=void 0,this._typedArray=void 0,this._state=Po.UNLOADED};var eb=Bm;var R_n=T(S(),1);var S_n=T(S(),1);var s_n=T(S(),1),CX=`uniform sampler2D u_pointCloud_colorGBuffer;
  6014. uniform sampler2D u_pointCloud_depthGBuffer;
  6015. uniform vec2 u_distanceAndEdlStrength;
  6016. in vec2 v_textureCoordinates;
  6017. vec2 neighborContribution(float log2Depth, vec2 offset)
  6018. {
  6019. float dist = u_distanceAndEdlStrength.x;
  6020. vec2 texCoordOrig = v_textureCoordinates + offset * dist;
  6021. vec2 texCoord0 = v_textureCoordinates + offset * floor(dist);
  6022. vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist);
  6023. float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0));
  6024. float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1));
  6025. // ignore depth values that are the clear depth
  6026. if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) {
  6027. return vec2(0.0);
  6028. }
  6029. // interpolate the two adjacent depth values
  6030. float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist));
  6031. vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix);
  6032. return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0);
  6033. }
  6034. void main()
  6035. {
  6036. float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates));
  6037. vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth);
  6038. eyeCoordinate /= eyeCoordinate.w;
  6039. float log2Depth = log2(-eyeCoordinate.z);
  6040. if (depthOrLogDepth == 0.0) // 0.0 is the clear value for the gbuffer
  6041. {
  6042. discard;
  6043. }
  6044. vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates);
  6045. // sample from neighbors left, right, down, up
  6046. vec2 texelSize = 1.0 / czm_viewport.zw;
  6047. vec2 responseAndCount = vec2(0.0);
  6048. responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0));
  6049. responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0));
  6050. responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y));
  6051. responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y));
  6052. float response = responseAndCount.x / responseAndCount.y;
  6053. float strength = u_distanceAndEdlStrength.y;
  6054. float shade = exp(-response * 300.0 * strength);
  6055. color.rgb *= shade;
  6056. out_FragColor = vec4(color);
  6057. // Input and output depth are the same.
  6058. gl_FragDepth = depthOrLogDepth;
  6059. }
  6060. `;function wC(){this._framebuffer=new fi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(wC.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});function KUe(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var iz=new D;function JUe(e,t){let n=new De({defines:["LOG_DEPTH_WRITE"],sources:[CX]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return iz.x=e._radius,iz.y=e._strength,iz}},o=Ue.fromCache({blending:un.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Ot.setCesium3DTileBit(),stencilMask:Ot.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:Ge.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ei({framebuffer:e.framebuffer,color:new B(0,0,0,0),depth:1,renderState:Ue.fromCache(),pass:Ge.CESIUM_3D_TILE,owner:e})}function QUe(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),JUe(e,t)}function Sse(e){return e.drawBuffers&&e.fragmentDepth}wC.isSupported=Sse;function jUe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!l(n)){let i=t._attributeLocations,o=t.fragmentShaderSource.clone();o.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0;
  6061. layout (location = 1) out vec4 out_FragData_1;`),o.sources=o.sources.map(function(r){return r=De.replaceMain(r,"czm_point_cloud_post_process_main"),r=r.replaceAll(/out_FragColor/g,"out_FragData_0"),r}),o.sources.push(`void main()
  6062. {
  6063. czm_point_cloud_post_process_main();
  6064. #ifdef LOG_DEPTH
  6065. czm_writeLogDepth();
  6066. out_FragData_1 = czm_packDepth(gl_FragDepth);
  6067. #else
  6068. out_FragData_1 = czm_packDepth(gl_FragCoord.z);
  6069. #endif
  6070. }`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:i})}return n}wC.prototype.update=function(e,t,n,i){if(!Sse(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,QUe(this,e.context);let o,r=e.commandList,s=r.length;for(o=t;o<s;++o){let d=r[o];if(d.primitiveType!==Fe.POINTS||d.pass===Ge.TRANSLUCENT)continue;let u,m,p=d.derivedCommands.pointCloudProcessor;l(p)&&(u=p.command,m=p.originalShaderProgram),(!l(u)||d.dirty||m!==d.shaderProgram||u.framebuffer!==this.framebuffer)&&(u=tt.shallowClone(d,u),u.framebuffer=this.framebuffer,u.shaderProgram=jUe(e.context,d.shaderProgram),u.castShadows=!1,u.receiveShadows=!1,l(p)||(p={command:u,originalShaderProgram:d.shaderProgram},d.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=d.shaderProgram),r[o]=u}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,r.push(c),r.push(a)};wC.prototype.isDestroyed=function(){return!1};wC.prototype.destroy=function(){return KUe(this),me(this)};var tb=wC;function Cse(e){let t=y(e,{});this.attenuation=y(t.attenuation,!1),this.geometricErrorScale=y(t.geometricErrorScale,1),this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=y(t.eyeDomeLighting,!0),this.eyeDomeLightingStrength=y(t.eyeDomeLightingStrength,1),this.eyeDomeLightingRadius=y(t.eyeDomeLightingRadius,1),this.backFaceCulling=y(t.backFaceCulling,!1),this.normalShading=y(t.normalShading,!0)}Cse.isSupported=function(e){return tb.isSupported(e.context)};var lf=Cse;var k_n=T(S(),1);var Pa={},qUe=new se(0,0,0,1),mc=new se,$Ue=new Ke,oz=new D,rz=new D;Pa.worldToWindowCoordinates=function(e,t,n){return Pa.worldWithEyeOffsetToWindowCoordinates(e,t,h.ZERO,n)};var Vse=new se,Lse=new h;function VX(e,t,n,i){let o=n.viewMatrix,r=M.multiplyByVector(o,se.fromElements(e.x,e.y,e.z,1,Vse),Vse),s=h.multiplyComponents(t,h.normalize(r,Lse),Lse);return r.x+=t.x+s.x,r.y+=t.y+s.y,r.z+=s.z,M.multiplyByVector(n.frustum.projectionMatrix,r,i)}var eDe=new he(Math.PI,W.PI_OVER_TWO),tDe=new h,nDe=new h;Pa.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let o=e.frameState,r=Pa.computeActualEllipsoidPosition(o,t,qUe);if(!l(r))return;let s=e.canvas,a=$Ue;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,d=!1;if(o.mode===oe.SCENE2D){let u=e.mapProjection,m=eDe,p=u.project(m,tDe),g=h.clone(c.position,nDe),f=c.frustum.clone(),x=M.computeViewportTransformation(a,0,1,new M),_=c.frustum.projectionMatrix,C=c.positionWC.y,V=h.fromElements(W.sign(C)*p.x-C,0,-c.positionWC.x),L=Ft.pointToGLWindowCoordinates(_,x,V);if(C===0||L.x<=0||L.x>=s.clientWidth)d=!0;else{if(L.x>s.clientWidth*.5){a.width=L.x,c.frustum.right=p.x-C,mc=VX(r,n,c,mc),Pa.clipToGLWindowCoordinates(a,mc,oz),a.x+=L.x,c.position.x=-c.position.x;let Z=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-Z,mc=VX(r,n,c,mc),Pa.clipToGLWindowCoordinates(a,mc,rz)}else{a.x+=L.x,a.width-=L.x,c.frustum.left=-p.x-C,mc=VX(r,n,c,mc),Pa.clipToGLWindowCoordinates(a,mc,oz),a.x=a.x-a.width,c.position.x=-c.position.x;let Z=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-Z,mc=VX(r,n,c,mc),Pa.clipToGLWindowCoordinates(a,mc,rz)}h.clone(g,c.position),c.frustum=f.clone(),i=D.clone(oz,i),(i.x<0||i.x>s.clientWidth)&&(i.x=rz.x)}}if(o.mode!==oe.SCENE2D||d){if(mc=VX(r,n,c,mc),mc.z<0&&!(c.frustum instanceof an)&&!(c.frustum instanceof Pr))return;i=Pa.clipToGLWindowCoordinates(a,mc,i)}return i.y=s.clientHeight-i.y,i};Pa.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Pa.worldToWindowCoordinates(e,t,n),!!l(n))return Pa.transformWindowToDrawingBuffer(e,n,n)};var nb=new h,iDe=new he;Pa.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===oe.SCENE3D)return h.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,iDe);if(!l(r))return;if(o.project(r,nb),i===oe.COLUMBUS_VIEW)return h.fromElements(nb.z,nb.x,nb.y,n);if(i===oe.SCENE2D)return h.fromElements(0,nb.x,nb.y,n);let s=e.morphTime;return h.fromElements(W.lerp(nb.z,t.x,s),W.lerp(nb.x,t.y,s),W.lerp(nb.y,t.z,s),n)};var Rse=new h,Zse=new h,Gse=new M;Pa.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,Rse),M.computeViewportTransformation(e,0,1,Gse),M.multiplyByPoint(Gse,Rse,Zse),D.fromCartesian3(Zse,n)};Pa.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return D.fromElements(t.x*o,t.y*r,n)};var oDe=new se,Ese=new se;Pa.drawingBufferToWorldCoordinates=function(e,t,n,i){let r=e.context.uniformState,s=r.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let g=n*r.log2FarDepthFromNearPlusOne,f=Math.pow(2,g)-1;n=c*(1-a/(f+a))/(c-a)}let d=e.view.passState.viewport,u=se.clone(se.UNIT_W,oDe);u.x=(t.x-d.x)/d.width*2-1,u.y=(t.y-d.y)/d.height*2-1,u.z=n*2-1,u.w=1;let m,p=e.camera.frustum;if(l(p.fovy)){m=M.multiplyByVector(r.inverseViewProjection,u,Ese);let g=1/m.w;h.multiplyByScalar(m,g,m)}else{let g=p.offCenterFrustum;l(g)&&(p=g),m=Ese,m.x=(u.x*(p.right-p.left)+p.left+p.right)*.5,m.y=(u.y*(p.top-p.bottom)+p.bottom+p.top)*.5,m.z=(u.z*(a-c)-a-c)*.5,m.w=1,m=M.multiplyByVector(r.inverseView,m,m)}return h.fromCartesian4(m,i)};var Mi=Pa;var wTn=T(S(),1);var H_n=T(S(),1);var FC={};FC._deprecationWarning=ls;var ib=Uint32Array.BYTES_PER_ELEMENT;FC.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),o=new DataView(e);t+=ib;let r=o.getUint32(t,!0);if(r!==1)throw new de(`Only Batched 3D Model version 1 is supported. Version ${r} is not.`);t+=ib;let s=o.getUint32(t,!0);t+=ib;let a=o.getUint32(t,!0);t+=ib;let c=o.getUint32(t,!0);t+=ib;let d=o.getUint32(t,!0);t+=ib;let u=o.getUint32(t,!0);t+=ib;let m;d>=570425344?(t-=ib*2,m=a,d=c,u=0,a=0,c=0,FC._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):u>=570425344&&(t-=ib,m=d,d=a,u=c,a=0,c=0,FC._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:y(m,0)}:(p=Wo(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let f,x;d>0&&(f=Wo(i,t,d),t+=d,u>0&&(x=new Uint8Array(e,t,u),x=new Uint8Array(x),t+=u));let _=n+s-t;if(_===0)throw new de("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,_):(FC._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+_))),{batchLength:m,featureTableJson:p,featureTableBinary:g,batchTableJson:f,batchTableBinary:x,gltf:C}};var LX=FC;var j_n=T(S(),1);function RX(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function Ise(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=Q.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function rDe(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=Q.createTypedArray(n,i),o[t]=r),r}RX.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=y(t,Q.UNSIGNED_INT),n=y(n,1),Ise(this,e,t,n,1,i.byteOffset)):i};RX.prototype.hasProperty=function(e){return l(this.json[e])};RX.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=Q.fromName(i.componentType)),Ise(this,e,t,n,this.featuresLength,i.byteOffset)):rDe(this,e,t,i)};RX.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!l(r))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a<n;++a)o[a]=s[n*i+a];return o};var Om=RX;var bTn=T(S(),1);function ZX(e){let t=e.count,n=e.batchTable,i=e.binaryBody,o=y(e.parseAsPropertyAttributes,!1),r=e.customAttributeOutput,s=sDe(n),a;l(s.jsonProperties)&&(a=new qp({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new Bx({extension:s.hierarchy,binaryBody:i}));let d=Am.BATCH_TABLE_CLASS_NAME,u=s.binaryProperties,m,p,g;if(o){let _=cDe(t,d,u,i,r);g=_.transcodedSchema,p=[new m_({propertyAttribute:_.propertyAttributeJson,class:_.transcodedClass})]}else{let _=aDe(t,d,u,i);g=_.transcodedSchema;let C=_.featureTableJson;m=new Il({count:C.count,properties:C.properties,class:_.transcodedClass,bufferViews:_.bufferViewsTypedArrays}),p=[]}let f=[];if(l(m)||l(a)||l(c)){let _=new Yc({id:0,name:"Batch Table",count:t,metadataTable:m,jsonMetadataTable:a,batchTableHierarchy:c});f.push(_)}let x={schema:g,propertyTables:f,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new Us(x)}function sDe(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,o;l(t)?(ZX._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),o=t):l(i)&&(o=i["3DTILES_batch_table_hierarchy"]);let r,s={};for(let a in e){if(!e.hasOwnProperty(a)||a==="HIERARCHY"||a==="extensions"||a==="extras")continue;let c=e[a];Array.isArray(c)?(r=l(r)?r:{},r[a]=c):s[a]=c}return{binaryProperties:s,jsonProperties:r,hierarchy:o,extras:n,extensions:i}}function aDe(e,t,n,i){let o={},r={},s={},a=0;for(let m in n){if(!n.hasOwnProperty(m))continue;if(!l(i))throw new de(`Property ${m} requires a batch table binary.`);let p=n[m],g=pd(p);r[m]={bufferView:a},o[m]=Xse(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:o};let d=yd.fromJson(c);return{featureTableJson:{class:t,count:e,properties:r},bufferViewsTypedArrays:s,transcodedSchema:d,transcodedClass:d.classes[t]}}function cDe(e,t,n,i,o){let r={},s={},a=0;for(let m in n){if(!n.hasOwnProperty(m))continue;let p=n[m];if(!l(i)&&!l(p.typedArray))throw new de(`Property ${m} requires a batch table binary.`);let g=qt.sanitizeGlslIdentifier(m);(g===""||r.hasOwnProperty(g))&&(g=`property_${a}`,a++);let f=Xse(p);f.name=m,r[g]=f;let x=g.toUpperCase();x.startsWith("_")||(x=`_${x}`);let _=p.typedArray;l(_)||(_=pd(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let C=new Tn.Attribute;C.name=x,C.count=e,C.type=p.type;let V=Q.fromTypedArray(_);(V===Q.INT||V===Q.UNSIGNED_INT||V===Q.DOUBLE)&&(ZX._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${x}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),_=new Float32Array(_)),C.componentDatatype=Q.fromTypedArray(_),C.typedArray=_,o.push(C),s[g]={attribute:x}}let c={classes:{}};c.classes[t]={properties:r};let d=yd.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:d,transcodedClass:d.classes[t]}}function Xse(e){let t=lDe(e.componentType);return{type:e.type,componentType:t}}function lDe(e){switch(e){case"BYTE":return"INT8";case"UNSIGNED_BYTE":return"UINT8";case"SHORT":return"INT16";case"UNSIGNED_SHORT":return"UINT16";case"INT":return"INT32";case"UNSIGNED_INT":return"UINT32";case"FLOAT":return"FLOAT32";case"DOUBLE":return"FLOAT64"}}ZX._deprecationWarning=ls;ZX._oneTimeWarning=St;var ob=ZX;var p_={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},dDe=Tn.FeatureIdAttribute;function hg(e){e=y(e,y.EMPTY_OBJECT);let t=e.b3dmResource,n=e.baseResource,i=e.arrayBuffer,o=y(e.byteOffset,0),r=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,Xo.Y),d=y(e.forwardAxis,Xo.X),u=y(e.loadAttributesAsTypedArray,!1),m=y(e.loadAttributesFor2D,!1),p=y(e.enablePick,!1),g=y(e.loadIndicesForWireframe,!1),f=y(e.loadPrimitiveOutline,!0),x=y(e.loadForClassification,!1);n=l(n)?n:t.clone(),this._b3dmResource=t,this._baseResource=n,this._arrayBuffer=i,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=d,this._loadAttributesAsTypedArray=u,this._loadAttributesFor2D=m,this._enablePick=p,this._loadIndicesForWireframe=g,this._loadPrimitiveOutline=f,this._loadForClassification=x,this._state=p_.UNLOADED,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=M.IDENTITY}l(Object.create)&&(hg.prototype=Object.create(Hi.prototype),hg.prototype.constructor=hg);Object.defineProperties(hg.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});hg.prototype.load=function(){if(l(this._promise))return this._promise;let e=LX.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,n=e.featureTableJson,i=e.featureTableBinary,o=e.batchTableJson,r=e.batchTableBinary,s=new Om(n,i);t=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let a=s.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(a)&&(this._transform=M.fromTranslation(h.fromArray(a))),this._batchTable={json:o,binary:r};let c=new eb({typedArray:e.gltf,upAxis:this._upAxis,forwardAxis:this._forwardAxis,gltfResource:this._b3dmResource,baseResource:this._baseResource,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadAttributesFor2D:this._loadAttributesFor2D,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline,loadForClassification:this._loadForClassification,renameBatchIdSemantic:!0});this._gltfLoader=c,this._state=p_.LOADING;let d=this;return this._promise=c.load().then(function(){if(!d.isDestroyed())return d._state=p_.PROCESSING,d}).catch(function(u){if(!d.isDestroyed())return uDe(d,u)}),this._promise};function uDe(e,t){return e.unload(),e._state=p_.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}hg.prototype.process=function(e){if(this._state===p_.READY)return!0;if(this._state!==p_.PROCESSING||!this._gltfLoader.process(e))return!1;let n=this._gltfLoader.components;return n.transform=M.multiplyTransformation(this._transform,n.transform,n.transform),mDe(this,n),this._components=n,this._arrayBuffer=void 0,this._state=p_.READY,!0};function mDe(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let o;if(l(n.json))o=ob({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new Yc({name:Am.BATCH_TABLE_CLASS_NAME,count:i});o=new Us({schema:{},propertyTables:[a]})}let r=t.scene.nodes,s=r.length;for(let a=0;a<s;a++)Wse(r[a]);t.structuralMetadata=o}function Wse(e){let t=e.children.length;for(let i=0;i<t;i++)Wse(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let o=e.primitives[i],r=qt.getAttributeBySemantic(o,Vt.FEATURE_ID);if(l(r)){r.setIndex=0;let s=new dDe;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",o.featureIds.push(s)}}}hg.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0};var GX=hg;var iSn=T(S(),1);function fg(e){e=y(e,y.EMPTY_OBJECT),this._geoJson=e.geoJson,this._components=void 0}l(Object.create)&&(fg.prototype=Object.create(Hi.prototype),fg.prototype.constructor=fg);Object.defineProperties(fg.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}}});fg.prototype.load=function(){return Promise.resolve(this)};fg.prototype.process=function(e){return l(this._components)||(this._components=LDe(this._geoJson,e),this._geoJson=void 0),!0};function hDe(){this.lines=void 0,this.points=void 0,this.properties=void 0}function fDe(){this.features=[]}function sz(e){let t=e[0],n=e[1],i=y(e[2],0);return new h(t,n,i)}function az(e){let t=e.length,n=new Array(t);for(let o=0;o<t;o++)n[o]=sz(e[o]);return[n]}function pDe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=az(e[i])[0];return n}function Pse(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=az(e[i])[0];return n}function bDe(e){let t=e.length,n=[];for(let i=0;i<t;i++)Array.prototype.push.apply(n,Pse(e[i]));return n}function gDe(e){return[sz(e)]}function yDe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=sz(e[i]);return n}var xDe={LineString:az,MultiLineString:pDe,MultiPolygon:bDe,Polygon:Pse,MultiPoint:yDe,Point:gDe},_De={LineString:Fe.LINES,MultiLineString:Fe.LINES,MultiPolygon:Fe.LINES,Polygon:Fe.LINES,MultiPoint:Fe.POINTS,Point:Fe.POINTS};function vse(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=xDe[n],o=_De[n],r=e.geometry.coordinates;if(!l(i)||!l(r))return;let s=new hDe;o===Fe.LINES?s.lines=i(r):o===Fe.POINTS&&(s.points=i(r)),s.properties=e.properties,t.features.push(s)}function TDe(e,t){let n=e.features,i=n.length;for(let o=0;o<i;o++)vse(n[o],t)}var SDe={FeatureCollection:TDe,Feature:vse},F5=new h;function CDe(e,t,n){let i=0,o=0,r=e.length;for(let w=0;w<r;w++){let F=e[w];if(l(F.lines)){let b=F.lines.length;for(let R=0;R<b;R++){let E=F.lines[R];i+=E.length,o+=(E.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=Ae.createTypedArray(i,o),d=Ae.fromTypedArray(c),u=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),m=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,g=0;for(let w=0;w<r;w++){let F=e[w];if(!l(F.lines))continue;let b=F.lines.length;for(let R=0;R<b;R++){let E=F.lines[R],X=E.length;for(let A=0;A<X;A++){let N=E[A],O=h.fromDegrees(N.x,N.y,N.z,ne.WGS84,F5),U=M.multiplyByPoint(t,O,F5);h.minimumByComponent(u,U,u),h.maximumByComponent(m,U,m),h.pack(U,s,p*3),a[p]=w,A<X-1&&(c[g*2]=p,c[g*2+1]=p+1,g++),p++}}}let f=xt.createVertexBuffer({typedArray:s,context:n.context,usage:Me.STATIC_DRAW});f.vertexArrayDestroyable=!1;let x=xt.createVertexBuffer({typedArray:a,context:n.context,usage:Me.STATIC_DRAW});x.vertexArrayDestroyable=!1;let _=xt.createIndexBuffer({typedArray:c,context:n.context,usage:Me.STATIC_DRAW,indexDatatype:d});_.vertexArrayDestroyable=!1;let C=new Tn.Attribute;C.semantic=Vt.POSITION,C.componentDatatype=Q.FLOAT,C.type=sn.VEC3,C.count=i,C.min=u,C.max=m,C.buffer=f;let V=new Tn.Attribute;V.semantic=Vt.FEATURE_ID,V.setIndex=0,V.componentDatatype=Q.FLOAT,V.type=sn.SCALAR,V.count=i,V.buffer=x;let L=[C,V],Z=new Tn.Material;Z.unlit=!0;let G=new Tn.Indices;G.indexDatatype=d,G.count=c.length,G.buffer=_;let I=new Tn.FeatureIdAttribute;I.featureCount=r,I.propertyTableId=0,I.setIndex=0,I.positionalLabel="featureId_0";let v=[I],P=new Tn.Primitive;return P.attributes=L,P.indices=G,P.featureIds=v,P.primitiveType=Fe.LINES,P.material=Z,P}function VDe(e,t,n){let i=0,o=e.length;for(let L=0;L<o;L++){let Z=e[L];l(Z.points)&&(i+=Z.points.length)}let r=new Float32Array(i*3),s=new Float32Array(i),a=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),d=0;for(let L=0;L<o;L++){let Z=e[L];if(!l(Z.points))continue;let G=Z.points.length;for(let I=0;I<G;I++){let v=Z.points[I],P=h.fromDegrees(v.x,v.y,v.z,ne.WGS84,F5),w=M.multiplyByPoint(t,P,F5);h.minimumByComponent(a,w,a),h.maximumByComponent(c,w,c),h.pack(w,r,d*3),s[d]=L,d++}}let u=xt.createVertexBuffer({typedArray:r,context:n.context,usage:Me.STATIC_DRAW});u.vertexArrayDestroyable=!1;let m=xt.createVertexBuffer({typedArray:s,context:n.context,usage:Me.STATIC_DRAW});m.vertexArrayDestroyable=!1;let p=new Tn.Attribute;p.semantic=Vt.POSITION,p.componentDatatype=Q.FLOAT,p.type=sn.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=u;let g=new Tn.Attribute;g.semantic=Vt.FEATURE_ID,g.setIndex=0,g.componentDatatype=Q.FLOAT,g.type=sn.SCALAR,g.count=i,g.buffer=m;let f=[p,g],x=new Tn.Material;x.unlit=!0;let _=new Tn.FeatureIdAttribute;_.featureCount=o,_.propertyTableId=0,_.setIndex=0,_.positionalLabel="featureId_0";let C=[_],V=new Tn.Primitive;return V.attributes=f,V.featureIds=C,V.primitiveType=Fe.POINTS,V.material=x,V}function LDe(e,t){let n=new fDe,i=SDe[e.type];l(i)&&i(e,n);let o=n.features,r=o.length;if(r===0)throw new de("GeoJSON must have at least one feature");let s={};for(let w=0;w<r;w++){let F=o[w],b=y(F.properties,y.EMPTY_OBJECT);for(let R in b)b.hasOwnProperty(R)&&(l(s[R])||(s[R]=new Array(r)))}for(let w=0;w<r;w++){let F=o[w];for(let b in s)if(s.hasOwnProperty(b)){let R=y(F.properties[b],"");s[b][w]=R}}let a=new qp({count:r,properties:s}),d=[new Yc({id:0,count:r,jsonMetadataTable:a})],u=yd.fromJson({}),m=new Us({schema:u,propertyTables:d}),p=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),g=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),f=!1,x=!1;for(let w=0;w<r;w++){let F=o[w];if(l(F.lines)){f=!0;let b=F.lines.length;for(let R=0;R<b;R++){let E=F.lines[R],X=E.length;for(let A=0;A<X;A++)h.minimumByComponent(p,E[A],p),h.maximumByComponent(g,E[A],g)}}if(l(F.points)){x=!0;let b=F.points.length;for(let R=0;R<b;R++){let E=F.points[R];h.minimumByComponent(p,E,p),h.maximumByComponent(g,E,g)}}}let _=h.midpoint(p,g,new h),C=h.fromDegrees(_.x,_.y,_.z,ne.WGS84,new h),V=Ft.eastNorthUpToFixedFrame(C,ne.WGS84,new M),L=M.inverseTransformation(V,new M),Z=[];f&&Z.push(CDe(o,L,t)),x&&Z.push(VDe(o,L,t));let G=new Tn.Node;G.index=0,G.primitives=Z;let I=[G],v=new Tn.Scene;v.nodes=I;let P=new Tn.Components;return P.scene=v,P.nodes=I,P.transform=V,P.structuralMetadata=m,P}fg.prototype.unload=function(){this._components=void 0};var EX=fg;var NSn=T(S(),1);var lSn=T(S(),1);var A5={};A5._deprecationWarning=ls;var pg=Uint32Array.BYTES_PER_ELEMENT;A5.parse=function(e,t){let n=y(t,0);t=n;let i=new Uint8Array(e),o=new DataView(e);t+=pg;let r=o.getUint32(t,!0);if(r!==1)throw new de(`Only Instanced 3D Model version 1 is supported. Version ${r} is not.`);t+=pg;let s=o.getUint32(t,!0);t+=pg;let a=o.getUint32(t,!0);if(a===0)throw new de("featureTableJsonByteLength is zero, the feature table must be defined.");t+=pg;let c=o.getUint32(t,!0);t+=pg;let d=o.getUint32(t,!0);t+=pg;let u=o.getUint32(t,!0);t+=pg;let m=o.getUint32(t,!0);if(m!==1&&m!==0)throw new de(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${m} is not.`);t+=pg;let p=Wo(i,t,a);t+=a;let g=new Uint8Array(e,t,c);t+=c;let f,x;d>0&&(f=Wo(i,t,d),t+=d,u>0&&(x=new Uint8Array(e,t,u),x=new Uint8Array(x),t+=u));let _=n+s-t;if(_===0)throw new de("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,_):(A5._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+_))),{gltfFormat:m,featureTableJson:p,featureTableBinary:g,batchTableJson:f,batchTableBinary:x,gltf:C}};var IX=A5;var rb={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},M5=Tn.Attribute,RDe=Tn.FeatureIdAttribute,Fse=Tn.Instances;function sb(e){e=y(e,y.EMPTY_OBJECT);let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,o=y(e.byteOffset,0),r=y(e.releaseGltfJson,!1),s=y(e.asynchronous,!0),a=y(e.incrementallyLoadTextures,!0),c=y(e.upAxis,Xo.Y),d=y(e.forwardAxis,Xo.X),u=y(e.loadAttributesAsTypedArray,!1),m=y(e.loadIndicesForWireframe,!1),p=y(e.loadPrimitiveOutline,!0),g=y(e.enablePick,!1);i=l(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=c,this._forwardAxis=d,this._loadAttributesAsTypedArray=u,this._loadIndicesForWireframe=m,this._loadPrimitiveOutline=p,this._enablePick=g,this._state=rb.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=M.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}l(Object.create)&&(sb.prototype=Object.create(Hi.prototype),sb.prototype.constructor=sb);Object.defineProperties(sb.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});sb.prototype.load=function(){if(l(this._promise))return this._promise;let e=IX.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new Om(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!l(a))throw new de("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let c=s.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(c)&&(this._transform=M.fromTranslation(h.fromArray(c))),this._batchTable={json:i,binary:o};let d={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(r===0){let m=Zl(e.gltf);m=m.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:m});d.gltfResource=p,d.baseResource=p}else d.gltfResource=this._i3dmResource,d.typedArray=e.gltf;let u=new eb(d);return this._gltfLoader=u,this._state=rb.LOADING,this._promise=u.load().then(()=>{if(!this.isDestroyed())return this._state=rb.PROCESSING,this}).catch(m=>{if(!this.isDestroyed())throw ZDe(this,m)}),this._promise};function ZDe(e,t){return e.unload(),e._state=rb.FAILED,e.getError("Failed to load i3dm",t)}sb.prototype.process=function(e){if(this._state===rb.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===rb.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=M.multiplyTransformation(this._transform,i.transform,i.transform),IDe(this,i,e),GDe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=rb.READY,!0};function GDe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=ob({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new Yc({name:Am.BATCH_TABLE_CLASS_NAME,count:i});o=new Us({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var N5=new h,cz=new Array(4),EDe=new M;function IDe(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",Q.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),c=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,d=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),u=WDe(o,r),m;c&&(m=new Float32Array(4*r));let p;d&&(p=new Float32Array(3*r));let g=new Float32Array(r),f=h.unpackArray(u),x=new h,_=new h,C=new h,V=new h,L=new $,Z=new we,G=new Array(4),I=new h,v=new Array(3),P=new M;if(!l(s)||h.equals(h.unpack(s),h.ZERO)){let U=ce.fromPoints(f);for(i=0;i<f.length;i++)h.subtract(f[i],U.center,N5),u[3*i+0]=N5.x,u[3*i+1]=N5.y,u[3*i+2]=N5.z;let Y=M.fromTranslation(U.center,EDe);t.transform=M.multiplyTransformation(Y,t.transform,t.transform)}for(i=0;i<r;i++){x=h.clone(f[i]),l(s)&&h.add(x,h.unpack(s),x),c&&(PDe(o,a,i,Z,x,C,_,V,L,P),we.pack(Z,G,0),m[4*i+0]=G[0],m[4*i+1]=G[1],m[4*i+2]=G[2],m[4*i+3]=G[3]),d&&(vDe(o,i,I),h.pack(I,v,0),p[3*i+0]=v[0],p[3*i+1]=v[1],p[3*i+2]=v[2]);let U=o.getProperty("BATCH_ID",Q.UNSIGNED_SHORT,1,i);l(U)||(U=i),g[i]=U}let w=new Fse;w.transformInWorldSpace=!0;let F=e._buffers,b=new M5;if(b.name="Instance Translation",b.semantic=$r.TRANSLATION,b.componentDatatype=Q.FLOAT,b.type=sn.VEC3,b.count=r,b.typedArray=u,!c){let U=xt.createVertexBuffer({context:n.context,typedArray:u,usage:Me.STATIC_DRAW});U.vertexArrayDestroyable=!1,F.push(U),b.buffer=U}if(w.attributes.push(b),c){let U=new M5;U.name="Instance Rotation",U.semantic=$r.ROTATION,U.componentDatatype=Q.FLOAT,U.type=sn.VEC4,U.count=r,U.typedArray=m,w.attributes.push(U)}if(d){let U=new M5;if(U.name="Instance Scale",U.semantic=$r.SCALE,U.componentDatatype=Q.FLOAT,U.type=sn.VEC3,U.count=r,c)U.typedArray=p;else{let Y=xt.createVertexBuffer({context:n.context,typedArray:p,usage:Me.STATIC_DRAW});Y.vertexArrayDestroyable=!1,F.push(Y),U.buffer=Y}w.attributes.push(U)}let R=new M5;R.name="Instance Feature ID",R.setIndex=0,R.semantic=$r.FEATURE_ID,R.componentDatatype=Q.FLOAT,R.type=sn.SCALAR,R.count=r;let E=xt.createVertexBuffer({context:n.context,typedArray:g,usage:Me.STATIC_DRAW});E.vertexArrayDestroyable=!1,F.push(E),R.buffer=E,w.attributes.push(R);let X=new RDe;X.propertyTableId=0,X.setIndex=0,X.positionalLabel="instanceFeatureId_0",w.featureIds.push(X);let A=t.nodes,N=A.length,O=!1;for(i=0;i<N;i++){let U=A[i];U.primitives.length>0&&(U.instances=O?XDe(w):w,O=!0)}}function XDe(e){let t=new Fse;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=Ye(n[o],!1);t.attributes.push(r)}return t.featureIds=e.featureIds,t}function WDe(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",Q.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",Q.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Q.FLOAT,3);if(!l(i))throw new de("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let o=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Q.FLOAT,3);if(!l(o))throw new de("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=new Float32Array(n.length);for(let s=0;s<n.length/3;s++)for(let a=0;a<3;a++){let c=3*s+a;r[c]=n[c]/65535*o[a]+i[a]}return r}else throw new de("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var wse=new Array(4);function PDe(e,t,n,i,o,r,s,a,c,d){let u=e.getProperty("NORMAL_UP",Q.FLOAT,3,n,cz),m=e.getProperty("NORMAL_RIGHT",Q.FLOAT,3,n,wse),p=!1;if(l(u)){if(!l(m))throw new de("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");h.unpack(u,0,r),h.unpack(m,0,s),p=!0}else{let g=e.getProperty("NORMAL_UP_OCT32P",Q.UNSIGNED_SHORT,2,n,cz),f=e.getProperty("NORMAL_RIGHT_OCT32P",Q.UNSIGNED_SHORT,2,n,wse);if(l(g)){if(!l(f))throw new de("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");wn.octDecodeInRange(g[0],g[1],65535,r),wn.octDecodeInRange(f[0],f[1],65535,s),p=!0}else t?(Ft.eastNorthUpToFixedFrame(o,ne.WGS84,d),M.getMatrix3(d,c)):$.clone($.IDENTITY,c)}p&&(h.cross(s,r,a),h.normalize(a,a),$.setColumn(c,0,s,c),$.setColumn(c,1,r,c),$.setColumn(c,2,a,c)),we.fromRotationMatrix(c,i)}function vDe(e,t,n){n=h.fromElements(1,1,1,n);let i=e.getProperty("SCALE",Q.FLOAT,1,t);l(i)&&h.multiplyByScalar(n,i,n);let o=e.getProperty("SCALE_NON_UNIFORM",Q.FLOAT,3,t,cz);l(o)&&(n.x*=o[0],n.y*=o[1],n.z*=o[2])}function wDe(e){let t=e._buffers,n=t.length;for(let i=0;i<n;i++){let o=t[i];o.isDestroyed()||o.destroy()}t.length=0}sb.prototype.isUnloaded=function(){return this._state===rb.UNLOADED};sb.prototype.unload=function(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),wDe(this),this._components=void 0,this._arrayBuffer=void 0,this._state=rb.UNLOADED};var XX=sb;var r1n=T(S(),1);var JCn=T(S(),1);var USn=T(S(),1),FDe={STOPPED:0,ANIMATING:1},Ym=Object.freeze(FDe);var kCn=T(S(),1);var jSn=T(S(),1);var KSn=T(S(),1);function AC(){this.times=void 0,this.points=void 0,pe.throwInstantiationError()}AC.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof h)return h;if(e instanceof we)return we};AC.prototype.evaluate=pe.throwInstantiationError;AC.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=y(t,0),e>=n[t]){if(t+1<i&&e<n[t+1])return t;if(t+2<i&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let o;if(e>n[t])for(o=t;o<i-1&&!(e>=n[o]&&e<n[o+1]);++o);else for(o=t-1;o>=0&&!(e>=n[o]&&e<n[o+1]);--o);return o===i-1&&(o=i-2),o};AC.prototype.wrapTime=function(e){let t=this.times,n=t[t.length-1],i=t[0],o=n-i,r;return e<i&&(r=Math.floor((i-e)/o)+1,e+=r*o),e>n&&(r=Math.floor((e-n)/o)+1,e-=r*o),e};AC.prototype.clampTime=function(e){let t=this.times;return W.clamp(e,t[0],t[t.length-1])};var to=AC;function MC(e){this._value=e,this._valueType=to.getPointType(e)}Object.defineProperties(MC.prototype,{value:{get:function(){return this._value}}});MC.prototype.findTimeInterval=function(e){};MC.prototype.wrapTime=function(e){return 0};MC.prototype.clampTime=function(e){return 0};MC.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var WX=MC;var bCn=T(S(),1);var iCn=T(S(),1);function NC(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=to.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(NC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});NC.prototype.findTimeInterval=to.prototype.findTimeInterval;NC.prototype.wrapTime=to.prototype.wrapTime;NC.prototype.clampTime=to.prototype.clampTime;NC.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);return this._pointType===Number?(1-r)*n[o]+r*n[o+1]:(l(t)||(t=new h),h.lerp(n[o],n[o+1],r,t))};var bg=NC;var sCn=T(S(),1);var Ase={};Ase.solve=function(e,t,n,i){let o=new Array(n.length),r=new Array(i.length),s=new Array(i.length),a;for(a=0;a<r.length;a++)r[a]=new h,s[a]=new h;o[0]=n[0]/t[0],r[0]=h.multiplyByScalar(i[0],1/t[0],r[0]);let c;for(a=1;a<o.length;++a)c=1/(t[a]-o[a-1]*e[a-1]),o[a]=n[a]*c,r[a]=h.subtract(i[a],h.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=h.multiplyByScalar(r[a],c,r[a]);for(c=1/(t[a]-o[a-1]*e[a-1]),r[a]=h.subtract(i[a],h.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=h.multiplyByScalar(r[a],c,r[a]),s[s.length-1]=r[r.length-1],a=s.length-2;a>=0;--a)s[a]=h.subtract(r[a],h.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var kC=Ase;var Mse=[],Nse=[],kse=[],Use=[];function ADe(e,t,n){let i=Mse,o=kse,r=Nse,s=Use;i.length=o.length=e.length-1,r.length=s.length=e.length;let a;i[0]=r[0]=1,o[0]=0;let c=s[0];for(l(c)||(c=s[0]=new h),h.clone(t,c),a=1;a<i.length-1;++a)i[a]=o[a]=1,r[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c);return i[a]=0,o[a]=1,r[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c),r[a+1]=1,c=s[a+1],l(c)||(c=s[a+1]=new h),h.clone(n,c),kC.solve(i,r,o,s)}function MDe(e){let t=Mse,n=kse,i=Nse,o=Use;t.length=n.length=e.length-1,i.length=o.length=e.length;let r;t[0]=n[0]=1,i[0]=2;let s=o[0];for(l(s)||(s=o[0]=new h),h.subtract(e[1],e[0],s),h.multiplyByScalar(s,3,s),r=1;r<t.length;++r)t[r]=n[r]=1,i[r]=4,s=o[r],l(s)||(s=o[r]=new h),h.subtract(e[r+1],e[r-1],s),h.multiplyByScalar(s,3,s);return i[r]=2,s=o[r],l(s)||(s=o[r]=new h),h.subtract(e[r],e[r-1],s),h.multiplyByScalar(s,3,s),kC.solve(t,i,n,o)}function wl(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.inTangents,o=e.outTangents;this._times=n,this._points=t,this._pointType=to.getPointType(t[0]),this._inTangents=i,this._outTangents=o,this._lastTimeIndex=0}Object.defineProperties(wl.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}});wl.createC1=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.tangents,o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new wl({times:t,points:n,inTangents:r,outTangents:o})};wl.createNaturalCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points;if(n.length<3)return new bg({points:n,times:t});let i=MDe(n),o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new wl({times:t,points:n,inTangents:r,outTangents:o})};wl.createClampedCubic=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.times,n=e.points,i=e.firstTangent,o=e.lastTangent,r=to.getPointType(n[0]);if(n.length<3)return new bg({points:n,times:t});let s=ADe(n,i,o),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new wl({times:t,points:n,inTangents:c,outTangents:a})};wl.hermiteCoefficientMatrix=new M(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);wl.prototype.findTimeInterval=to.prototype.findTimeInterval;var NDe=new se,UC=new h;wl.prototype.wrapTime=to.prototype.wrapTime;wl.prototype.clampTime=to.prototype.clampTime;wl.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this.inTangents,r=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,d=NDe;d.z=c,d.y=c*c,d.x=d.y*c,d.w=1;let u=M.multiplyByVector(wl.hermiteCoefficientMatrix,d,d);u.z*=a,u.w*=a;let m=this._pointType;return m===Number?n[s]*u.x+n[s+1]*u.y+r[s]*u.z+o[s]*u.w:(l(t)||(t=new m),t=m.multiplyByScalar(n[s],u.x,t),m.multiplyByScalar(n[s+1],u.y,UC),m.add(t,UC,t),m.multiplyByScalar(r[s],u.z,UC),m.add(t,UC,t),m.multiplyByScalar(o[s],u.w,UC),m.add(t,UC,t))};var gg=wl;var TCn=T(S(),1);function DC(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=to.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(DC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});DC.prototype.findTimeInterval=to.prototype.findTimeInterval;DC.prototype.wrapTime=to.prototype.wrapTime;DC.prototype.clampTime=to.prototype.clampTime;DC.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,o=this._pointType;return o===Number?n[i]:(l(t)||(t=new o),o.clone(n[i],t))};var PX=DC;var ZCn=T(S(),1);function kDe(e){let t=e.points,n=e.times;return function(i,o){l(o)||(o=new we);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=t[r],c=t[r+1];return we.fastSlerp(a,c,s,o)}}function BC(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=kDe(this),this._lastTimeIndex=0}Object.defineProperties(BC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});BC.prototype.findTimeInterval=to.prototype.findTimeInterval;BC.prototype.wrapTime=to.prototype.wrapTime;BC.prototype.clampTime=to.prototype.clampTime;BC.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var vX=BC;var OC=Tn.AnimatedPropertyType;function lz(e){e=y(e,y.EMPTY_OBJECT);let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,YDe(this)}Object.defineProperties(lz.prototype,{channel:{get:function(){return this._channel}},runtimeAnimation:{get:function(){return this._runtimeAnimation}},runtimeNode:{get:function(){return this._runtimeNode}},splines:{get:function(){return this._splines}}});function UDe(e,t){let n=[],i=[],o=[],r=t.length;for(let s=0;s<r;s+=3)i.push(t[s]),n.push(t[s+1]),o.push(t[s+2]);return i.splice(0,1),o.length=o.length-1,new gg({times:e,points:n,inTangents:i,outTangents:o})}function Dse(e,t,n,i){if(e.length===1&&t.length===1)return new WX(t[0]);switch(n){case Dm.STEP:return new PX({times:e,points:t});case Dm.CUBICSPLINE:return UDe(e,t);case Dm.LINEAR:return i===OC.ROTATION?new vX({times:e,points:t}):new bg({times:e,points:t})}}function DDe(e,t,n,i,o){let r=[];if(i===OC.WEIGHTS){let a=t.length/o,c,d;for(c=0;c<o;c++){let u=new Array(a),m=c;if(n===Dm.CUBICSPLINE)for(d=0;d<a;d+=3)u[d]=t[m],u[d+1]=t[m+o],u[d+2]=t[m+2*o],m+=o*3;else for(d=0;d<a;d++)u[d]=t[m],m+=o;r.push(Dse(e,u,n,i))}}else r.push(Dse(e,t,n,i));return r}var BDe=new h,ODe=new we;function YDe(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,a=t.target.path,c=e._runtimeNode,d=l(c.morphWeights)?c.morphWeights.length:1,u=DDe(i,o,r,a,d);e._splines=u,e._path=a}lz.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===OC.WEIGHTS){let r=o.morphWeights,s=r.length;for(let a=0;a<s;a++){let c=t[a],d=i.clampAnimations?c.clampTime(e):c.wrapTime(e);r[a]=c.evaluate(d)}}else{if(o.userAnimated)return;{let r=t[0],s=i.clampAnimations?r.clampTime(e):r.wrapTime(e);n===OC.TRANSLATION||n===OC.SCALE?o[n]=r.evaluate(s,BDe):n===OC.ROTATION&&(o[n]=r.evaluate(s,ODe))}}};var wX=lz;function dz(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=j.clone(n.startTime),this._delay=y(n.delay,0),this._stopTime=j.clone(n.stopTime),this.removeOnStop=y(n.removeOnStop,!1),this._multiplier=y(n.multiplier,1),this._reverse=y(n.reverse,!1),this._loop=y(n.loop,vl.NONE),this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new be,this.update=new be,this.stop=new be,this._state=Ym.STOPPED,this._computedStartTime=void 0,this._duration=void 0;let i=this;this._raiseStartEvent=function(){i.start.raiseEvent(e,i)},this._updateEventTime=0,this._raiseUpdateEvent=function(){i.update.raiseEvent(e,i,i._updateEventTime)},this._raiseStopEvent=function(){i.stop.raiseEvent(e,i)},this._model=e,this._localStartTime=void 0,this._localStopTime=void 0,HDe(this)}Object.defineProperties(dz.prototype,{animation:{get:function(){return this._animation}},name:{get:function(){return this._name}},runtimeChannels:{get:function(){return this._runtimeChannels}},model:{get:function(){return this._model}},localStartTime:{get:function(){return this._localStartTime}},localStopTime:{get:function(){return this._localStopTime}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}},animationTime:{get:function(){return this._animationTime}}});function HDe(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,s=r.length,a=[];for(let c=0;c<s;c++){let d=r[c],u=d.target;if(!l(u))continue;let m=u.node.index,p=i._runtimeNodes[m],g=new wX({channel:d,runtimeAnimation:e,runtimeNode:p}),f=d.sampler.input;t=Math.min(t,f[0]),n=Math.max(n,f[f.length-1]),a.push(g)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}dz.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var FX=dz;function ab(e){this.animationAdded=new be,this.animationRemoved=new be,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(ab.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function uz(e,t,n){let i=e._model,o=new FX(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}ab.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return uz(this,n[i],e);let o=n.length;for(let r=0;r<o;++r)if(n[r].name===e.name){i=r;break}return uz(this,n[i],e)};ab.prototype.addAll=function(e){e=y(e,y.EMPTY_OBJECT);let n=this._model.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let s=uz(this,n[r],e);i.push(s)}return i};ab.prototype.remove=function(e){if(!l(e))return!1;let t=this._runtimeAnimations,n=t.indexOf(e);return n!==-1?(t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0):!1};ab.prototype.removeAll=function(){let e=this._model,t=this._runtimeAnimations,n=t.length;this._runtimeAnimations.length=0;for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])};ab.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};ab.prototype.get=function(e){return this._runtimeAnimations[e]};var k5=[];function zDe(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}ab.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&j.equals(e.time,this._previousTime))return!1;this._previousTime=j.clone(e.time,this._previousTime);let i=!1,o=e.time,r=this._model;for(let s=0;s<n;++s){let a=t[s];l(a._computedStartTime)||(a._computedStartTime=j.addSeconds(y(a.startTime,o),a.delay,new j)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,d=a._duration,u=a.stopTime,m=j.lessThanOrEquals(c,o),p=l(u)&&j.greaterThan(o,u),g=0;if(d!==0){let _=j.secondsDifference(p?u:o,c);g=l(a._animationTime)?a._animationTime(d,_):_/d}let f=a.loop===vl.REPEAT||a.loop===vl.MIRRORED_REPEAT,x=(m||f&&!l(a.startTime))&&(g<=1||f)&&!p;if(g===a._prevAnimationDelta){let _=a._state===Ym.STOPPED;if(x!==_)continue}if(a._prevAnimationDelta=g,x||a._state===Ym.ANIMATING){if(x&&a._state===Ym.STOPPED&&(a._state=Ym.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===vl.REPEAT)g=g-Math.floor(g);else if(a.loop===vl.MIRRORED_REPEAT){let C=Math.floor(g),V=g-C;g=C%2===1?1-V:V}a.reverse&&(g=1-g);let _=g*d*a.multiplier;_=W.clamp(_,a.localStartTime,a.localStopTime),a.animate(_),a.update.numberOfListeners>0&&(a._updateEventTime=_,e.afterRender.push(a._raiseUpdateEvent)),i=!0,x||(a._state=Ym.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&k5.push(a))}}n=k5.length;for(let s=0;s<n;++s){let a=k5[s];t.splice(t.indexOf(a),1),e.afterRender.push(zDe(this,r,a))}return k5.length=0,i};var AX=ab;var V1n=T(S(),1);var l1n=T(S(),1);function b_(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(b_.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return l(this._color)||(this._color=new B),this._featureTable.getColor(this._featureId,this._color)},set:function(e){this._featureTable.setColor(this._featureId,e)}},primitive:{get:function(){return this._model}},featureTable:{get:function(){return this._featureTable}},featureId:{get:function(){return this._featureId}}});b_.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};b_.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};b_.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};b_.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};b_.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var MX=b_;var u1n=T(S(),1),NX={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};NX.getStyleCommandsNeeded=function(e,t){return t===0?NX.ALL_OPAQUE:t===e?NX.ALL_TRANSLUCENT:NX.OPAQUE_AND_TRANSLUCENT};var Hm=Object.freeze(NX);var h1n=T(S(),1);var yg={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};yg.is3DTiles=function(e){switch(e){case yg.TILE_GLTF:case yg.TILE_B3DM:case yg.TILE_I3DM:case yg.TILE_PNTS:case yg.TILE_GEOJSON:return!0;case yg.GLTF:return!1}};var ar=Object.freeze(yg);function Mr(e){let t=e.model,n=e.propertyTable;this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=Hm.ALL_OPAQUE,KDe(this)}Object.defineProperties(Mr.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return l(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function KDe(e){let t=e._model,n=ar.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let o,r=new Array(i);if(n){let s=t.content;for(o=0;o<i;o++)r[o]=new Ns(s,o)}else for(o=0;o<i;o++)r[o]=new MX({model:t,featureId:o,featureTable:e});e._features=r,e._featuresLength=i,e._batchTexture=new Bc({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}Mr.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=Hm.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};Mr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Mr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Mr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Mr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Mr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Mr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Mr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};Mr.prototype.getFeature=function(e){return this._features[e]};Mr.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};Mr.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};Mr.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};Mr.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};Mr.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};Mr.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};Mr.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};Mr.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};Mr.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var JDe=new B;Mr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(Bc.DEFAULT_COLOR_VALUE),this.setAllShow(Bc.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=l(e.color)?y(e.color.evaluateColor(n,JDe),Bc.DEFAULT_COLOR_VALUE):Bc.DEFAULT_COLOR_VALUE,o=l(e.show)?y(e.show.evaluate(n),Bc.DEFAULT_SHOW_VALUE):Bc.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,o)}};Mr.prototype.isDestroyed=function(){return!1};Mr.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),me(this)};var kX=Mr;var x2n=T(S(),1);var I1n=T(S(),1);var Bse={name:"TilesetPipelineStage"};Bse.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,ge.FRAGMENT);let r={u_polygonOffset:function(){return D.ZERO}};e.uniformMap=Tt(r,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Ot.setCesium3DTileBit(),i.stencilMask=Ot.CESIUM_3D_TILE_MASK};var UX=Bse;var U1n=T(S(),1);var W1n=T(S(),1),DX=`// robust iterative solution without trig functions
  6071. // https://github.com/0xfaded/ellipse_demo/issues/1
  6072. // https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse
  6073. //
  6074. // This version uses only a single iteration for best performance. For fog
  6075. // rendering, the difference is negligible.
  6076. vec2 nearestPointOnEllipseFast(vec2 pos, vec2 radii) {
  6077. vec2 p = abs(pos);
  6078. vec2 inverseRadii = 1.0 / radii;
  6079. vec2 evoluteScale = (radii.x * radii.x - radii.y * radii.y) * vec2(1.0, -1.0) * inverseRadii;
  6080. // We describe the ellipse parametrically: v = radii * vec2(cos(t), sin(t))
  6081. // but store the cos and sin of t in a vec2 for efficiency.
  6082. // Initial guess: t = cos(pi/4)
  6083. vec2 tTrigs = vec2(0.70710678118);
  6084. vec2 v = radii * tTrigs;
  6085. // Find the evolute of the ellipse (center of curvature) at v.
  6086. vec2 evolute = evoluteScale * tTrigs * tTrigs * tTrigs;
  6087. // Find the (approximate) intersection of p - evolute with the ellipsoid.
  6088. vec2 q = normalize(p - evolute) * length(v - evolute);
  6089. // Update the estimate of t.
  6090. tTrigs = (q + evolute) * inverseRadii;
  6091. tTrigs = normalize(clamp(tTrigs, 0.0, 1.0));
  6092. v = radii * tTrigs;
  6093. return v * sign(pos);
  6094. }
  6095. vec3 computeEllipsoidPositionWC(vec3 positionMC) {
  6096. // Get the world-space position and project onto a meridian plane of
  6097. // the ellipsoid
  6098. vec3 positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;
  6099. vec2 positionEllipse = vec2(length(positionWC.xy), positionWC.z);
  6100. vec2 nearestPoint = nearestPointOnEllipseFast(positionEllipse, czm_ellipsoidRadii.xz);
  6101. // Reconstruct a 3D point in world space
  6102. return vec3(nearestPoint.x * normalize(positionWC.xy), nearestPoint.y);
  6103. }
  6104. void applyFog(inout vec4 color, vec4 groundAtmosphereColor, vec3 lightDirection, float distanceToCamera) {
  6105. vec3 fogColor = groundAtmosphereColor.rgb;
  6106. // If there is dynamic lighting, apply that to the fog.
  6107. const float NONE = 0.0;
  6108. if (czm_atmosphereDynamicLighting != NONE) {
  6109. float darken = clamp(dot(normalize(czm_viewerPositionWC), lightDirection), czm_fogMinimumBrightness, 1.0);
  6110. fogColor *= darken;
  6111. }
  6112. // Tonemap if HDR rendering is disabled
  6113. #ifndef HDR
  6114. fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb);
  6115. fogColor.rgb = czm_inverseGamma(fogColor.rgb);
  6116. #endif
  6117. vec3 withFog = czm_fog(distanceToCamera, color.rgb, fogColor, czm_fogVisualDensityScalar);
  6118. color = vec4(withFog, color.a);
  6119. }
  6120. void atmosphereStage(inout vec4 color, in ProcessedAttributes attributes) {
  6121. vec3 rayleighColor;
  6122. vec3 mieColor;
  6123. float opacity;
  6124. vec3 positionWC;
  6125. vec3 lightDirection;
  6126. // When the camera is in space, compute the position per-fragment for
  6127. // more accurate ground atmosphere. All other cases will use
  6128. //
  6129. // The if condition will be added in https://github.com/CesiumGS/cesium/issues/11717
  6130. if (false) {
  6131. positionWC = computeEllipsoidPositionWC(attributes.positionMC);
  6132. lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting);
  6133. // The fog color is derived from the ground atmosphere color
  6134. czm_computeGroundAtmosphereScattering(
  6135. positionWC,
  6136. lightDirection,
  6137. rayleighColor,
  6138. mieColor,
  6139. opacity
  6140. );
  6141. } else {
  6142. positionWC = attributes.positionWC;
  6143. lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting);
  6144. rayleighColor = v_atmosphereRayleighColor;
  6145. mieColor = v_atmosphereMieColor;
  6146. opacity = v_atmosphereOpacity;
  6147. }
  6148. //color correct rayleigh and mie colors
  6149. const bool ignoreBlackPixels = true;
  6150. rayleighColor = czm_applyHSBShift(rayleighColor, czm_atmosphereHsbShift, ignoreBlackPixels);
  6151. mieColor = czm_applyHSBShift(mieColor, czm_atmosphereHsbShift, ignoreBlackPixels);
  6152. vec4 groundAtmosphereColor = czm_computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity);
  6153. if (u_isInFog) {
  6154. float distanceToCamera = length(attributes.positionEC);
  6155. applyFog(color, groundAtmosphereColor, lightDirection, distanceToCamera);
  6156. } else {
  6157. // Ground atmosphere
  6158. }
  6159. }
  6160. `;var v1n=T(S(),1),BX=`void atmosphereStage(ProcessedAttributes attributes) {
  6161. vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_positionWC, czm_atmosphereDynamicLighting);
  6162. czm_computeGroundAtmosphereScattering(
  6163. // This assumes the geometry stage came before this.
  6164. v_positionWC,
  6165. lightDirection,
  6166. v_atmosphereRayleighColor,
  6167. v_atmosphereMieColor,
  6168. v_atmosphereOpacity
  6169. );
  6170. }
  6171. `;var Ose={name:"AtmospherePipelineStage"};Ose.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,ge.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,ge.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([BX]),i.addFragmentLines([DX]),i.addUniform("bool","u_isInFog",ge.FRAGMENT),e.uniformMap.u_isInFog=function(){let o=h.distance(n.camera.positionWC,t.boundingSphere.center);return W.fog(o,n.fog.density)>W.EPSILON3}};var OX=Ose;var j1n=T(S(),1);var B1n=T(S(),1),YX=`#ifdef DIFFUSE_IBL
  6172. vec3 sampleDiffuseEnvironment(vec3 cubeDir)
  6173. {
  6174. #ifdef CUSTOM_SPHERICAL_HARMONICS
  6175. return czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients);
  6176. #else
  6177. return czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients);
  6178. #endif
  6179. }
  6180. #endif
  6181. #ifdef SPECULAR_IBL
  6182. vec3 sampleSpecularEnvironment(vec3 cubeDir, float roughness)
  6183. {
  6184. #ifdef CUSTOM_SPECULAR_IBL
  6185. float lod = roughness * model_specularEnvironmentMapsMaximumLOD;
  6186. return czm_textureCube(model_specularEnvironmentMaps, cubeDir, lod).rgb;
  6187. #else
  6188. float lod = roughness * czm_specularEnvironmentMapsMaximumLOD;
  6189. return czm_textureCube(czm_specularEnvironmentMaps, cubeDir, lod).rgb;
  6190. #endif
  6191. }
  6192. vec3 computeSpecularIBL(vec3 cubeDir, float NdotV, vec3 f0, float roughness)
  6193. {
  6194. // see https://bruop.github.io/ibl/ at Single Scattering Results
  6195. // Roughness dependent fresnel, from Fdez-Aguera
  6196. vec3 f90 = max(vec3(1.0 - roughness), f0);
  6197. vec3 F = fresnelSchlick2(f0, f90, NdotV);
  6198. vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;
  6199. vec3 specularSample = sampleSpecularEnvironment(cubeDir, roughness);
  6200. return specularSample * (F * brdfLut.x + brdfLut.y);
  6201. }
  6202. #endif
  6203. #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)
  6204. /**
  6205. * Compute the light contributions from environment maps and spherical harmonic coefficients.
  6206. * See Fdez-Aguera, https://www.jcgt.org/published/0008/01/03/paper.pdf, for explanation
  6207. * of the single- and multi-scattering terms.
  6208. *
  6209. * @param {vec3} viewDirectionEC Unit vector pointing from the fragment to the eye position.
  6210. * @param {vec3} normalEC The surface normal in eye coordinates.
  6211. * @param {czm_modelMaterial} The material properties.
  6212. * @return {vec3} The computed HDR color.
  6213. */
  6214. vec3 textureIBL(vec3 viewDirectionEC, vec3 normalEC, czm_modelMaterial material) {
  6215. vec3 f0 = material.specular;
  6216. float roughness = material.roughness;
  6217. float specularWeight = 1.0;
  6218. #ifdef USE_SPECULAR
  6219. specularWeight = material.specularWeight;
  6220. #endif
  6221. float NdotV = clamp(dot(normalEC, viewDirectionEC), 0.0, 1.0);
  6222. // see https://bruop.github.io/ibl/ at Single Scattering Results
  6223. // Roughness dependent fresnel, from Fdez-Aguera
  6224. vec3 f90 = max(vec3(1.0 - roughness), f0);
  6225. vec3 singleScatterFresnel = fresnelSchlick2(f0, f90, NdotV);
  6226. vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;
  6227. vec3 FssEss = specularWeight * (singleScatterFresnel * brdfLut.x + brdfLut.y);
  6228. #ifdef DIFFUSE_IBL
  6229. vec3 normalMC = normalize(model_iblReferenceFrameMatrix * normalEC);
  6230. vec3 irradiance = sampleDiffuseEnvironment(normalMC);
  6231. vec3 averageFresnel = f0 + (1.0 - f0) / 21.0;
  6232. float Ems = specularWeight * (1.0 - brdfLut.x - brdfLut.y);
  6233. vec3 FmsEms = FssEss * averageFresnel * Ems / (1.0 - averageFresnel * Ems);
  6234. vec3 dielectricScattering = (1.0 - FssEss - FmsEms) * material.diffuse;
  6235. vec3 diffuseContribution = irradiance * (FmsEms + dielectricScattering) * model_iblFactor.x;
  6236. #else
  6237. vec3 diffuseContribution = vec3(0.0);
  6238. #endif
  6239. #ifdef USE_ANISOTROPY
  6240. // Bend normal to account for anisotropic distortion of specular reflection
  6241. vec3 anisotropyDirection = material.anisotropicB;
  6242. vec3 anisotropicTangent = cross(anisotropyDirection, viewDirectionEC);
  6243. vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection);
  6244. float bendFactor = 1.0 - material.anisotropyStrength * (1.0 - roughness);
  6245. float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor;
  6246. vec3 bentNormal = normalize(mix(anisotropicNormal, normalEC, bendFactorPow4));
  6247. vec3 reflectEC = reflect(-viewDirectionEC, bentNormal);
  6248. #else
  6249. vec3 reflectEC = reflect(-viewDirectionEC, normalEC);
  6250. #endif
  6251. #ifdef SPECULAR_IBL
  6252. vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflectEC);
  6253. vec3 radiance = sampleSpecularEnvironment(reflectMC, roughness);
  6254. vec3 specularContribution = radiance * FssEss * model_iblFactor.y;
  6255. #else
  6256. vec3 specularContribution = vec3(0.0);
  6257. #endif
  6258. return diffuseContribution + specularContribution;
  6259. }
  6260. #endif
  6261. `;var Yse={name:"ImageBasedLightingPipelineStage"},QDe=new D;Yse.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,s;l(i.specularEnvironmentMaps)||(s=o.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,ge.FRAGMENT),r.addUniform("vec2","model_iblFactor",ge.FRAGMENT),Wm.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",ge.FRAGMENT),l(s)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,ge.BOTH),l(a)&&l(a[0])?(r.addDefine("DIFFUSE_IBL",void 0,ge.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,ge.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",ge.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,ge.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(s)?(r.addDefine("SPECULAR_IBL",void 0,ge.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,ge.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",ge.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",ge.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,ge.FRAGMENT)),r.addFragmentLines(YX);let c={model_iblFactor:function(){return D.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,QDe)},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_sphericalHarmonicCoefficients:function(){return a},model_specularEnvironmentMaps:function(){return i.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};l(s)&&(c.model_specularEnvironmentMaps=function(){return s},c.model_specularEnvironmentMapsMaximumLOD=function(){return o.maximumMipmapLevel}),e.uniformMap=Tt(c,e.uniformMap)};var HX=Yse;var uVn=T(S(),1);var rVn=T(S(),1);var jDe=W.EPSILON16;function hz(e){e=y(e,y.EMPTY_OBJECT);let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(hz.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=W.clamp(e,this.minimumValue,this.maximumValue),W.equalsEpsilon(this._currentValue,e,jDe)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var qDe=new h,mz=new $;hz.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=qDe,o;switch(t){case dc.XROTATE:o=$.fromRotationX(W.toRadians(n),mz),e=M.multiplyByMatrix3(e,o,e);break;case dc.YROTATE:o=$.fromRotationY(W.toRadians(n),mz),e=M.multiplyByMatrix3(e,o,e);break;case dc.ZROTATE:o=$.fromRotationZ(W.toRadians(n),mz),e=M.multiplyByMatrix3(e,o,e);break;case dc.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case dc.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case dc.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=M.multiplyByTranslation(e,i,e);break;case dc.XSCALE:i.x=n,i.y=1,i.z=1,e=M.multiplyByScale(e,i,e);break;case dc.YSCALE:i.x=1,i.y=n,i.z=1,e=M.multiplyByScale(e,i,e);break;case dc.ZSCALE:i.x=1,i.y=1,i.z=n,e=M.multiplyByScale(e,i,e);break;case dc.UNIFORMSCALE:e=M.multiplyByUniformScale(e,n,e);break;default:break}return e};var zX=hz;function U5(e){e=y(e,y.EMPTY_OBJECT);let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,$De(this)}Object.defineProperties(U5.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function $De(e){let n=e.articulation.stages,i=n.length,o=e._runtimeStages,r=e._runtimeStagesByName;for(let s=0;s<i;s++){let a=n[s],c=new zX({stage:a,runtimeArticulation:e});o.push(c);let d=a.name;r[d]=c}}U5.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var eBe=new M,tBe=new M;U5.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=M.clone(M.IDENTITY,eBe),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let o=this._runtimeNodes,r=o.length;for(t=0;t<r;t++){let s=o[t],a=M.multiplyTransformation(s.originalTransform,e,tBe);s.transform=a}};var KX=U5;var _Vn=T(S(),1);var hVn=T(S(),1),JX=`void modelColorStage(inout czm_modelMaterial material)
  6262. {
  6263. material.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend);
  6264. float highlight = ceil(model_colorBlend);
  6265. material.diffuse *= mix(model_color.rgb, vec3(1.0), highlight);
  6266. material.alpha *= model_color.a;
  6267. }
  6268. `;var YC={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};YC.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,ge.FRAGMENT),i.addFragmentLines(JX);let o={},r=t.color;r.alpha===0&&!t.hasSilhouette(n)&&(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),r.alpha<1&&(e.alphaOptions.pass=Ge.TRANSLUCENT),i.addUniform("vec4",YC.COLOR_UNIFORM_NAME,ge.FRAGMENT),o[YC.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",YC.COLOR_BLEND_UNIFORM_NAME,ge.FRAGMENT),o[YC.COLOR_BLEND_UNIFORM_NAME]=function(){return lc.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=Tt(o,e.uniformMap)};var xg=YC;var IVn=T(S(),1);var SVn=T(S(),1),QX=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE
  6269. vec4 getClippingPlane(
  6270. highp sampler2D packedClippingPlanes,
  6271. int clippingPlaneNumber,
  6272. mat4 transform
  6273. ) {
  6274. int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH;
  6275. int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);
  6276. float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);
  6277. float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);
  6278. float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
  6279. float v = (float(pixY) + 0.5) * pixelHeight;
  6280. vec4 plane = texture(packedClippingPlanes, vec2(u, v));
  6281. return czm_transformPlane(plane, transform);
  6282. }
  6283. #else
  6284. // Handle uint8 clipping texture instead
  6285. vec4 getClippingPlane(
  6286. highp sampler2D packedClippingPlanes,
  6287. int clippingPlaneNumber,
  6288. mat4 transform
  6289. ) {
  6290. int clippingPlaneStartIndex = clippingPlaneNumber * 2; // clipping planes are two pixels each
  6291. int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH;
  6292. int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);
  6293. float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);
  6294. float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);
  6295. float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
  6296. float v = (float(pixY) + 0.5) * pixelHeight;
  6297. vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;
  6298. vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
  6299. vec4 plane;
  6300. plane.xyz = czm_octDecode(oct, 65535.0);
  6301. plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v)));
  6302. return czm_transformPlane(plane, transform);
  6303. }
  6304. #endif
  6305. float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) {
  6306. vec4 position = czm_windowToEyeCoordinates(fragCoord);
  6307. vec3 clipNormal = vec3(0.0);
  6308. vec3 clipPosition = vec3(0.0);
  6309. float pixelWidth = czm_metersPerPixel(position);
  6310. #ifdef UNION_CLIPPING_REGIONS
  6311. float clipAmount; // For union planes, we want to get the min distance. So we set the initial value to the first plane distance in the loop below.
  6312. #else
  6313. float clipAmount = 0.0;
  6314. bool clipped = true;
  6315. #endif
  6316. for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) {
  6317. vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
  6318. clipNormal = clippingPlane.xyz;
  6319. clipPosition = -clippingPlane.w * clipNormal;
  6320. float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
  6321. #ifdef UNION_CLIPPING_REGIONS
  6322. clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));
  6323. if (amount <= 0.0) {
  6324. discard;
  6325. }
  6326. #else
  6327. clipAmount = max(amount, clipAmount);
  6328. clipped = clipped && (amount <= 0.0);
  6329. #endif
  6330. }
  6331. #ifndef UNION_CLIPPING_REGIONS
  6332. if (clipped) {
  6333. discard;
  6334. }
  6335. #endif
  6336. return clipAmount;
  6337. }
  6338. void modelClippingPlanesStage(inout vec4 color)
  6339. {
  6340. float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix);
  6341. vec4 clippingPlanesEdgeColor = vec4(1.0);
  6342. clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb;
  6343. float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a;
  6344. if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) {
  6345. color = clippingPlanesEdgeColor;
  6346. }
  6347. }
  6348. `;var Hse={name:"ModelClippingPlanesPipelineStage"},nBe=new D;Hse.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,ge.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,ge.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,ge.FRAGMENT),hs.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,ge.FRAGMENT);let s=hs.getTextureResolution(i,o,nBe);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,ge.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,ge.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",ge.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",ge.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",ge.FRAGMENT),r.addFragmentLines(QX);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=B.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=Tt(a,e.uniformMap)};var jX=Hse;var kVn=T(S(),1);var WVn=T(S(),1),qX=`void modelClippingPolygonsStage(ProcessedAttributes attributes)
  6349. {
  6350. vec2 sphericalLatLong = czm_approximateSphericalCoordinates(v_positionWC);
  6351. sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);
  6352. vec2 minDistance = vec2(czm_infinity);
  6353. v_regionIndex = -1;
  6354. v_clippingPosition = vec2(czm_infinity);
  6355. for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) {
  6356. vec4 extents = czm_unpackClippingExtents(model_clippingExtents, regionIndex);
  6357. vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz;
  6358. vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0));
  6359. vec2 distance = abs(rectUv - clamped) * extents.wz;
  6360. if (minDistance.x > distance.x || minDistance.y > distance.y) {
  6361. minDistance = distance;
  6362. v_clippingPosition = rectUv;
  6363. }
  6364. float threshold = 0.01;
  6365. if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) {
  6366. v_regionIndex = regionIndex;
  6367. }
  6368. }
  6369. }
  6370. `;var vVn=T(S(),1),$X=`void modelClippingPolygonsStage()
  6371. {
  6372. vec2 clippingPosition = v_clippingPosition;
  6373. int regionIndex = v_regionIndex;
  6374. czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);
  6375. }
  6376. `;var zse={name:"ModelClippingPolygonsPipelineStage"};zse.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,ge.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,ge.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,ge.BOTH),o.addUniform("sampler2D","model_clippingDistance",ge.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",ge.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(qX),o.addFragmentLines($X);let r={model_clippingDistance:function(){return i.clippingTexture},model_clippingExtents:function(){return i.extentsTexture}};e.uniformMap=Tt(r,e.uniformMap)};var eW=zse;var BVn=T(S(),1);function Kse(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(Kse.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){l(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var tW=Kse;var FLn=T(S(),1);var gLn=T(S(),1);var YVn=T(S(),1),nW=`mat4 getInstancingTransform()
  6377. {
  6378. mat4 instancingTransform;
  6379. #ifdef HAS_INSTANCE_MATRICES
  6380. instancingTransform = mat4(
  6381. a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1
  6382. a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2
  6383. a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3
  6384. a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 // Column 4
  6385. );
  6386. #else
  6387. vec3 translation = vec3(0.0, 0.0, 0.0);
  6388. vec3 scale = vec3(1.0, 1.0, 1.0);
  6389. #ifdef HAS_INSTANCE_TRANSLATION
  6390. translation = a_instanceTranslation;
  6391. #endif
  6392. #ifdef HAS_INSTANCE_SCALE
  6393. scale = a_instanceScale;
  6394. #endif
  6395. instancingTransform = mat4(
  6396. scale.x, 0.0, 0.0, 0.0,
  6397. 0.0, scale.y, 0.0, 0.0,
  6398. 0.0, 0.0, scale.z, 0.0,
  6399. translation.x, translation.y, translation.z, 1.0
  6400. );
  6401. #endif
  6402. return instancingTransform;
  6403. }
  6404. #ifdef USE_2D_INSTANCING
  6405. mat4 getInstancingTransform2D()
  6406. {
  6407. mat4 instancingTransform2D;
  6408. #ifdef HAS_INSTANCE_MATRICES
  6409. instancingTransform2D = mat4(
  6410. a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1
  6411. a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2
  6412. a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3
  6413. a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 // Column 4
  6414. );
  6415. #else
  6416. vec3 translation2D = vec3(0.0, 0.0, 0.0);
  6417. vec3 scale = vec3(1.0, 1.0, 1.0);
  6418. #ifdef HAS_INSTANCE_TRANSLATION
  6419. translation2D = a_instanceTranslation2D;
  6420. #endif
  6421. #ifdef HAS_INSTANCE_SCALE
  6422. scale = a_instanceScale;
  6423. #endif
  6424. instancingTransform2D = mat4(
  6425. scale.x, 0.0, 0.0, 0.0,
  6426. 0.0, scale.y, 0.0, 0.0,
  6427. 0.0, 0.0, scale.z, 0.0,
  6428. translation2D.x, translation2D.y, translation2D.z, 1.0
  6429. );
  6430. #endif
  6431. return instancingTransform2D;
  6432. }
  6433. #endif
  6434. `;var zVn=T(S(),1),iW=`void instancingStage(inout ProcessedAttributes attributes)
  6435. {
  6436. vec3 positionMC = attributes.positionMC;
  6437. mat4 instancingTransform = getInstancingTransform();
  6438. attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz;
  6439. #ifdef HAS_NORMALS
  6440. vec3 normalMC = attributes.normalMC;
  6441. attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz;
  6442. #endif
  6443. #ifdef USE_2D_INSTANCING
  6444. mat4 instancingTransform2D = getInstancingTransform2D();
  6445. attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;
  6446. #endif
  6447. }
  6448. `;var JVn=T(S(),1),oW=`void legacyInstancingStage(
  6449. inout ProcessedAttributes attributes,
  6450. out mat4 instanceModelView,
  6451. out mat3 instanceModelViewInverseTranspose)
  6452. {
  6453. vec3 positionMC = attributes.positionMC;
  6454. mat4 instancingTransform = getInstancingTransform();
  6455. mat4 instanceModel = instancingTransform * u_instance_nodeTransform;
  6456. instanceModelView = u_instance_modifiedModelView;
  6457. instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel);
  6458. attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz;
  6459. #ifdef USE_2D_INSTANCING
  6460. mat4 instancingTransform2D = getInstancingTransform2D();
  6461. attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;
  6462. #endif
  6463. }
  6464. `;var D5=new M,iBe=new M,oBe=new M,Qse={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:tae,_transformsToTypedArray:pz};Qse.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(nW);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,d=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,u=s._enablePick&&!n.context.webgl2,m=[];xBe(e,n,i,m,d,u),SBe(e,n,i,m);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,ge.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",ge.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",ge.VERTEX),p.u_instance_modifiedModelView=function(){let g=M.multiplyTransformation(s.modelMatrix,a.components.transform,D5);return d?M.multiplyTransformation(n.context.uniformState.view3D,g,D5):(n.mode!==oe.SCENE3D&&(g=Ft.basisTo2D(n.mapProjection,g,D5)),M.multiplyTransformation(n.context.uniformState.view,g,D5))},p.u_instance_nodeTransform=function(){return M.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,iBe)},r.addVertexLines(oW)):r.addVertexLines(iW),d){r.addDefine("USE_2D_INSTANCING",void 0,ge.VERTEX),r.addUniform("mat4","u_modelView2D",ge.VERTEX);let g=n.context,f=M.fromTranslation(c.instancingReferencePoint2D,new M);p.u_modelView2D=function(){return M.multiplyTransformation(g.uniformState.view,f,oBe)}}e.uniformMap=Tt(p,e.uniformMap),e.instanceCount=o,e.attributes.push.apply(e.attributes,m)};var rW=new M,rBe=new h;function sBe(e,t,n,i,o){let r=M.multiplyTransformation(t,e,rW);return r=M.multiplyTransformation(r,n,rW),o=Ft.basisTo2D(i.mapProjection,r,o),o}function aBe(e,t,n,i,o){let r=M.fromTranslation(e,rW),s=M.multiplyTransformation(t,r,rW);s=M.multiplyTransformation(s,n,rW);let a=M.getTranslation(s,rBe);return o=Mi.computeActualEllipsoidPosition(i,a,o),o}function jse(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=M.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=M.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=M.clone(o.computedModelMatrix,t),t=M.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=M.clone(M.IDENTITY,n))}var qse=new M,$se=new M,cBe=new M,lBe=new h;function dBe(e,t,n,i){let o=qse,r=$se;jse(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let d=0;d<c;d++){let u=e[d],m=sBe(u,o,r,n,cBe),p=M.getTranslation(m,lBe),g=h.subtract(p,a,p);i[d]=M.setTranslation(m,g,i[d])}return i}function uBe(e,t,n,i){let o=qse,r=$se;jse(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let d=0;d<c;d++){let u=e[d],m=aBe(u,o,r,n,u);i[d]=h.subtract(m,a,i[d])}return i}var mBe=new h,hBe=new h;function eae(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,o=M.multiplyByPoint(i,n.instancingTranslationMin,mBe),r=Mi.computeActualEllipsoidPosition(t,o,o),s=M.multiplyByPoint(i,n.instancingTranslationMax,hBe),a=Mi.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=h.lerp(r,a,.5,new h)}function pz(e){let n=e.length,i=new Float32Array(n*12);for(let o=0;o<n;o++){let r=e[o],s=12*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8],i[s+3]=r[12],i[s+4]=r[1],i[s+5]=r[5],i[s+6]=r[9],i[s+7]=r[13],i[s+8]=r[2],i[s+9]=r[6],i[s+10]=r[10],i[s+11]=r[14]}return i}function fBe(e){let n=e.length,i=new Float32Array(n*3);for(let o=0;o<n;o++){let r=e[o],s=3*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8]}return i}var pBe=new h,bBe=new we,gBe=new h;function tae(e,t,n){let i=new Array(t),o=qt.getAttributeBySemantic(e,$r.TRANSLATION),r=qt.getAttributeBySemantic(e,$r.ROTATION),s=qt.getAttributeBySemantic(e,$r.SCALE),a=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),d=l(o),u=l(r),m=l(s),p=d?o.typedArray:new Float32Array(t*3),g=u?r.typedArray:new Float32Array(t*4);u&&r.normalized&&(g=wn.dequantize(g,r.componentDatatype,r.type,t));let f;m?f=s.typedArray:(f=new Float32Array(t*3),f.fill(1));for(let _=0;_<t;_++){let C=new h(p[_*3],p[_*3+1],p[_*3+2],pBe);h.maximumByComponent(a,C,a),h.minimumByComponent(c,C,c);let V=new we(g[_*4],g[_*4+1],g[_*4+2],u?g[_*4+3]:1,bBe),L=new h(f[_*3],f[_*3+1],f[_*3+2],gBe),Z=M.fromTranslationQuaternionRotationScale(C,V,L,new M);i[_]=Z}let x=n.runtimeNode;return x.instancingTranslationMin=c,x.instancingTranslationMax=a,d&&(o.typedArray=void 0),u&&(r.typedArray=void 0),m&&(s.typedArray=void 0),i}function yBe(e,t,n){let i=new Array(t),o=e.typedArray,r=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let d=new h(o[c*3],o[c*3+1],o[c*3+2]);i[c]=d,h.minimumByComponent(r,d,r),h.maximumByComponent(s,d,s)}let a=n.runtimeNode;return a.instancingTranslationMin=r,a.instancingTranslationMax=s,e.typedArray=void 0,i}function bz(e,t){let n=xt.createVertexBuffer({context:t.context,typedArray:e,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function xBe(e,t,n,i,o,r){let s=qt.getAttributeBySemantic(n,$r.ROTATION);l(s)?_Be(e,n,i,t,o,r):TBe(e,n,i,t,o)}function _Be(e,t,n,i,o,r){let s=e.shaderBuilder,a=t.attributes[0].count,c=e.model,d=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let u="Transform",m,p=d.instancingTransformsBuffer;if(!l(p)){m=tae(t,a,e);let _=pz(m);p=bz(_,i),c._modelResources.push(p),r&&(d.transformsTypedArray=_),d.instancingTransformsBuffer=p}if(Jse(e,p,n,u),!o)return;let g=Ye(i);g.mode=oe.COLUMBUS_VIEW,eae(e,g);let f=d.instancingTransformsBuffer2D;if(!l(f)){let _=dBe(m,e,g,m),C=pz(_);f=bz(C,i),c._modelResources.push(f),d.instancingTransformsBuffer2D=f}Jse(e,f,n,"Transform2D")}function TBe(e,t,n,i,o,r){let s=e.shaderBuilder,a=e.runtimeNode,c=qt.getAttributeBySemantic(t,$r.TRANSLATION),d=qt.getAttributeBySemantic(t,$r.SCALE);if(l(d)&&(s.addDefine("HAS_INSTANCE_SCALE"),fz(e,d.buffer,d.byteOffset,d.byteStride,n,"Scale")),!l(c))return;let u,m=c.typedArray;if(l(m)?u=yBe(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),fz(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!o&&!r)return;let g=Ye(i);g.mode=oe.COLUMBUS_VIEW,eae(e,g);let f=a.instancingTranslationBuffer2D;if(!l(f)){let V=uBe(u,e,g,u),L=fBe(V);r&&(a.transformsTypedArray=L),f=bz(L,i),e.model._modelResources.push(f),a.instancingTranslationBuffer2D=f}if(!o)return;fz(e,f,0,void 0,n,"Translation2D")}function Jse(e,t,n,i){let r=Q.getSizeInBytes(Q.FLOAT),s=r*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Q.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Q.FLOAT,normalize:!1,offsetInBytes:r*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Q.FLOAT,normalize:!1,offsetInBytes:r*8,strideInBytes:s,instanceDivisor:1}],c=e.shaderBuilder;c.addAttribute("vec4",`a_instancing${i}Row0`),c.addAttribute("vec4",`a_instancing${i}Row1`),c.addAttribute("vec4",`a_instancing${i}Row2`),n.push.apply(n,a)}function fz(e,t,n,i,o,r){o.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:Q.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${r}`)}function SBe(e,t,n,i){let o=n.attributes,r=e.shaderBuilder;for(let s=0;s<o.length;s++){let a=o[s];a.semantic===$r.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:sn.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var sW=Qse;var SLn=T(S(),1);var gz={};gz.name="ModelMatrixUpdateStage";gz.update=function(e,t,n){let i=n.mode!==oe.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let o=i?t._computedModelMatrix2D:t._computedModelMatrix;nae(e,t,o,e.transformToRoot),e._transformDirty=!1}};function CBe(e,t,n){e.modelMatrix=M.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=qt.getCullFace(e.modelMatrix,e.primitiveType)}function nae(e,t,n,i){let o;i=M.multiplyTransformation(i,e.transform,new M),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o<r;o++){let a=e.runtimePrimitives[o];CBe(a.drawCommand,n,i)}let s=e.children.length;for(o=0;o<s;o++){let a=t._runtimeNodes[e.children[o]];a._transformToRoot=M.clone(i,a._transformToRoot),nae(a,t,n,i),a._transformDirty=!1}}var aW=gz;var LLn=T(S(),1);var iae={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:oae,_countGeneratedBuffers:rae};iae.process=function(e,t,n){let i=e.model.statistics,o=t.instances,r=e.runtimeNode;oae(i,o),rae(i,r)};function oae(e,t){if(!l(t))return;let n=t.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];l(r.buffer)&&e.addBuffer(r.buffer,!1)}}function rae(e,t){l(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),l(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),l(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}var cW=iae;function HC(e){e=y(e,y.EMPTY_OBJECT);let t=e.node,n=e.transform,i=e.transformToRoot,o=e.sceneGraph,r=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=o,this._children=r,this._originalTransform=M.clone(n,this._originalTransform),this._transform=M.clone(n,this._transform),this._transformToRoot=M.clone(i,this._transformToRoot),this._computedTransform=new M,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTranslationMin=void 0,this.instancingTranslationMax=void 0,this.instancingTransformsBuffer=void 0,this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,this.instancingReferencePoint2D=void 0,VBe(this)}Object.defineProperties(HC.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=M.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return l(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters,n=t.translation;h.equals(n,e)||(t.translation=h.clone(e,t.translation),yz(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;we.equals(n,e)||(t.rotation=we.clone(e,t.rotation),yz(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;h.equals(n,e)||(t.scale=h.clone(e,t.scale),yz(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;for(let n=0;n<t;n++)this._morphWeights[n]=e[n]}},runtimeSkin:{get:function(){return this._runtimeSkin}},computedJointMatrices:{get:function(){return this._computedJointMatrices}}});function VBe(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=M.multiply(n,t,i);let o=e.node;l(o.matrix)||(e._transformParameters=new B0(o.translation,o.rotation,o.scale)),l(o.morphWeights)&&(e._morphWeights=o.morphWeights.slice());let r=o.articulationName;if(l(r)){let c=e.sceneGraph._runtimeArticulations[r];l(c)&&c.runtimeNodes.push(e)}}function yz(e,t){e._transformDirty=!0,e._transform=M.fromTranslationRotationScale(t,e._transform)}HC.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};HC.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,l(e.instances)&&t.push(sW),t.push(cW),n.push(aW)};HC.prototype.updateComputedTransform=function(){this._computedTransform=M.multiply(this._transformToRoot,this._transform,this._computedTransform)};HC.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!l(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let o=0;o<i;o++){l(t[o])||(t[o]=new M);let r=M.multiplyTransformation(this.transformToRoot,this.transform,t[o]),s=M.inverseTransformation(r,t[o]);t[o]=M.multiplyTransformation(s,n[o],t[o])}};var lW=HC;var qIn=T(S(),1);var BLn=T(S(),1);var sae={name:"AlphaPipelineStage"};sae.process=function(e,t,n){let i=e.alphaOptions,o=e.model;i.pass=y(i.pass,o.opaquePass);let r=e.renderStateOptions;i.pass===Ge.TRANSLUCENT&&(r.cull.enabled=!1,r.depthMask=!1,r.blending=un.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;l(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,ge.FRAGMENT),s.addUniform("float","u_alphaCutoff",ge.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var dW=sae;var zLn=T(S(),1);var aae={name:"BatchTexturePipelineStage"};aae.process=function(e,t,n){let i=e.shaderBuilder,o={},r=e.model,s=r.featureTables[r.featureTableId],a=s.featuresLength;i.addUniform("int","model_featuresLength"),o.model_featuresLength=function(){return a};let c=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),o.model_batchTexture=function(){return y(c.batchTexture,c.defaultTexture)},i.addUniform("vec4","model_textureStep"),o.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=Tt(o,e.uniformMap)};var uW=aae;var eRn=T(S(),1);var cae={name:"ClassificationPipelineStage"};cae.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,ge.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||LBe(t,o)};function LBe(e,t){let n=qt.getAttributeBySemantic(e,Vt.POSITION);if(!l(n))throw new de("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=l(o);r&&(i=o.typedArray,o.typedArray=void 0);let s=r?o.count:n.count,a=qt.getAttributeBySemantic(e,Vt.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let d=[],u=[0],m=r?i[0]:0,p=c[m],g=0;for(let x=1;x<s;x++){let _=r?i[x]:x,C=c[_];if(C!==p){let V=x-g,L=x;d.push(V),u.push(L),g=L,p=C}}let f=s-g;d.push(f),t.batchLengths=d,t.batchOffsets=u}var mW=cae;var hRn=T(S(),1);var nRn=T(S(),1),hW=`void filterByPassType(inout vec3 positionMC, vec4 featureColor)
  6465. {
  6466. bool styleTranslucent = (featureColor.a != 1.0);
  6467. // Only render translucent features in the translucent pass (if the style or the original command has translucency).
  6468. if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)
  6469. {
  6470. // If the model has a translucent silhouette, it needs to render during the silhouette color command,
  6471. // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.
  6472. #ifdef HAS_SILHOUETTE
  6473. positionMC *= float(model_silhouettePass);
  6474. #else
  6475. positionMC *= 0.0;
  6476. #endif
  6477. }
  6478. // If the current pass is not the translucent pass and the style is not translucent, don't render the feature.
  6479. else if (czm_pass != czm_passTranslucent && styleTranslucent)
  6480. {
  6481. positionMC *= 0.0;
  6482. }
  6483. }
  6484. void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature)
  6485. {
  6486. float show = ceil(feature.color.a);
  6487. positionMC *= show;
  6488. #if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION)
  6489. filterByPassType(positionMC, feature.color);
  6490. #endif
  6491. }
  6492. `;var oRn=T(S(),1),fW=`void filterByPassType(vec4 featureColor)
  6493. {
  6494. bool styleTranslucent = (featureColor.a != 1.0);
  6495. // Only render translucent features in the translucent pass (if the style or the original command has translucency).
  6496. if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)
  6497. {
  6498. // If the model has a translucent silhouette, it needs to render during the silhouette color command,
  6499. // (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.
  6500. #ifdef HAS_SILHOUETTE
  6501. if(!model_silhouettePass) {
  6502. discard;
  6503. }
  6504. #else
  6505. discard;
  6506. #endif
  6507. }
  6508. // If the current pass is not the translucent pass and the style is not translucent, don't render the feature.
  6509. else if (czm_pass != czm_passTranslucent && styleTranslucent)
  6510. {
  6511. discard;
  6512. }
  6513. }
  6514. void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature)
  6515. {
  6516. vec4 featureColor = feature.color;
  6517. if (featureColor.a == 0.0)
  6518. {
  6519. discard;
  6520. }
  6521. // If a feature ID vertex attribute is used, the pass type filter is applied in the vertex shader.
  6522. // So, we only apply in in the fragment shader if the feature ID texture is used.
  6523. #if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION)
  6524. filterByPassType(featureColor);
  6525. #endif
  6526. featureColor = czm_gammaCorrect(featureColor);
  6527. // Classification models compute the diffuse differently.
  6528. #ifdef HAS_CLASSIFICATION
  6529. material.diffuse = featureColor.rgb * featureColor.a;
  6530. #else
  6531. float highlight = ceil(model_colorBlend);
  6532. material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight);
  6533. #endif
  6534. material.alpha *= featureColor.a;
  6535. }
  6536. `;var lae={name:"CPUStylingPipelineStage"};lae.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines(hW),o.addFragmentLines(fW),o.addDefine("USE_CPU_STYLING",void 0,ge.BOTH),l(i.color)||(o.addUniform("float",xg.COLOR_BLEND_UNIFORM_NAME,ge.FRAGMENT),e.uniformMap[xg.COLOR_BLEND_UNIFORM_NAME]=function(){return lc.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",ge.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Ge.TRANSLUCENT}};var pW=lae;var pRn=T(S(),1),dae={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};dae.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var cb=Object.freeze(dae);var mZn=T(S(),1);var gRn=T(S(),1),bW=`void customShaderStage(
  6537. inout czm_modelVertexOutput vsOutput,
  6538. inout ProcessedAttributes attributes,
  6539. FeatureIds featureIds,
  6540. Metadata metadata,
  6541. MetadataClass metadataClass,
  6542. MetadataStatistics metadataStatistics
  6543. ) {
  6544. // VertexInput and initializeInputStruct() are dynamically generated in JS,
  6545. // see CustomShaderPipelineStage.js
  6546. VertexInput vsInput;
  6547. initializeInputStruct(vsInput, attributes);
  6548. vsInput.featureIds = featureIds;
  6549. vsInput.metadata = metadata;
  6550. vsInput.metadataClass = metadataClass;
  6551. vsInput.metadataStatistics = metadataStatistics;
  6552. vertexMain(vsInput, vsOutput);
  6553. attributes.positionMC = vsOutput.positionMC;
  6554. }
  6555. `;var xRn=T(S(),1),gW=`void customShaderStage(
  6556. inout czm_modelMaterial material,
  6557. ProcessedAttributes attributes,
  6558. FeatureIds featureIds,
  6559. Metadata metadata,
  6560. MetadataClass metadataClass,
  6561. MetadataStatistics metadataStatistics
  6562. ) {
  6563. // FragmentInput and initializeInputStruct() are dynamically generated in JS,
  6564. // see CustomShaderPipelineStage.js
  6565. FragmentInput fsInput;
  6566. initializeInputStruct(fsInput, attributes);
  6567. fsInput.featureIds = featureIds;
  6568. fsInput.metadata = metadata;
  6569. fsInput.metadataClass = metadataClass;
  6570. fsInput.metadataStatistics = metadataStatistics;
  6571. fragmentMain(fsInput, material);
  6572. }
  6573. `;var ARn=T(S(),1);var TRn=T(S(),1),yW=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) {
  6574. initializeFeatureIds(featureIds, attributes);
  6575. initializeFeatureIdAliases(featureIds);
  6576. }
  6577. `;var CRn=T(S(),1),xW=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes)
  6578. {
  6579. initializeFeatureIds(featureIds, attributes);
  6580. initializeFeatureIdAliases(featureIds);
  6581. setFeatureIdVaryings();
  6582. }
  6583. `;var Ni={name:"FeatureIdPipelineStage",STRUCT_ID_FEATURE_IDS_VS:"FeatureIdsVS",STRUCT_ID_FEATURE_IDS_FS:"FeatureIdsFS",STRUCT_NAME_FEATURE_IDS:"FeatureIds",FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS:"initializeFeatureIdsVS",FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS:"initializeFeatureIdsFS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS:"initializeFeatureIdAliasesVS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS:"initializeFeatureIdAliasesFS",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:"void initializeFeatureIdAliases(inout FeatureIds featureIds)",FUNCTION_ID_SET_FEATURE_ID_VARYINGS:"setFeatureIdVaryings",FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS:"void setFeatureIdVaryings()"};Ni.process=function(e,t,n){let i=e.shaderBuilder;RBe(i);let o=e.runtimeNode.node.instances;l(o)&&ZBe(e,o,n),GBe(e,t,n),i.addVertexLines(xW),i.addFragmentLines(yW)};function RBe(e){e.addStruct(Ni.STRUCT_ID_FEATURE_IDS_VS,Ni.STRUCT_NAME_FEATURE_IDS,ge.VERTEX),e.addStruct(Ni.STRUCT_ID_FEATURE_IDS_FS,Ni.STRUCT_NAME_FEATURE_IDS,ge.FRAGMENT),e.addFunction(Ni.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,Ni.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,ge.VERTEX),e.addFunction(Ni.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,Ni.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,ge.FRAGMENT),e.addFunction(Ni.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,Ni.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,ge.VERTEX),e.addFunction(Ni.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,Ni.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,ge.FRAGMENT),e.addFunction(Ni.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,Ni.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,ge.VERTEX)}function ZBe(e,t,n){let i=t.featureIds,o=t.attributes[0].count;for(let r=0;r<i.length;r++){let s=i[r],a=s.positionalLabel;s instanceof Tn.FeatureIdAttribute?EBe(e,s,a):uae(e,s,a,o,1,n);let c=s.label;l(c)&&mae(e,a,c,ge.BOTH)}}function GBe(e,t,n){let i=t.featureIds,r=qt.getAttributeBySemantic(t,Vt.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,d=ge.BOTH;a instanceof Tn.FeatureIdAttribute?IBe(e,a,c):a instanceof Tn.FeatureIdImplicitRange?uae(e,a,c,r,void 0,n):(XBe(e,a,c,s,n),d=ge.FRAGMENT);let u=a.label;l(u)&&mae(e,c,u,d)}}function EBe(e,t,n){let i=e.shaderBuilder;i.addStructField(Ni.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Ni.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=`a_${r}${o}`,a=`v_${r}${o}`,c=`featureIds.${n} = int(czm_round(${s}));`,d=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(Ni.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(Ni.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[d]),i.addVarying("float",a),i.addFunctionLines(Ni.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function IBe(e,t,n){let i=e.shaderBuilder;i.addStructField(Ni.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Ni.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=[`featureIds.${n} = int(czm_round(attributes.${r}${o}));`];i.addFunctionLines(Ni.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(Ni.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function uae(e,t,n,i,o,r){WBe(e,t,i,o,r);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let c=`v_implicit_${n}`;s.addVarying("float",c),s.addStructField(Ni.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(Ni.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(Ni.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(Ni.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(Ni.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function XBe(e,t,n,i,o){let r=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[r]=function(){return y(a.texture,o.context.defaultTexture)};let c=a.channels,d=e.shaderBuilder;d.addStructField(Ni.STRUCT_ID_FEATURE_IDS_FS,"int",n),d.addUniform("sampler2D",r,ge.FRAGMENT);let m=`v_texCoord_${a.texCoord}`,p=m,g=a.transform;if(l(g)&&!$.equals(g,$.IDENTITY)){let _=`${r}Transform`;d.addUniform("mat3",_,ge.FRAGMENT),s[_]=function(){return g},p=`vec2(${_} * vec3(${m}, 1.0))`}let f=`texture(${r}, ${p}).${c}`,x=`featureIds.${n} = czm_unpackUint(${f});`;d.addFunctionLines(Ni.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[x])}function mae(e,t,n,i){let o=e.shaderBuilder,r=ge.includesVertexShader(i);r&&o.addStructField(Ni.STRUCT_ID_FEATURE_IDS_VS,"int",n),o.addStructField(Ni.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];r&&o.addFunctionLines(Ni.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),o.addFunctionLines(Ni.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function WBe(e,t,n,i,o){let r=e.model,s,a;if(l(t.repeat)){let d=PBe(t,n);s=xt.createVertexBuffer({context:o.context,typedArray:d,usage:Me.STATIC_DRAW}),s.vertexArrayDestroyable=!1,r._pipelineResources.push(s),r.statistics.addBuffer(s,!1)}else a=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:Q.FLOAT,strideInBytes:Q.getSizeInBytes(Q.FLOAT),offsetInBytes:0};e.attributes.push(c)}function PBe(e,t){let n=e.offset,i=e.repeat,o=new Float32Array(t);for(let r=0;r<t;r++)o[r]=n+Math.floor(r/i);return o}var _g=Ni;var QRn=T(S(),1);var NRn=T(S(),1),_W=`void metadataStage(
  6584. out Metadata metadata,
  6585. out MetadataClass metadataClass,
  6586. out MetadataStatistics metadataStatistics,
  6587. ProcessedAttributes attributes
  6588. )
  6589. {
  6590. initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);
  6591. }
  6592. `;var URn=T(S(),1),TW=`void metadataStage(
  6593. out Metadata metadata,
  6594. out MetadataClass metadataClass,
  6595. out MetadataStatistics metadataStatistics,
  6596. ProcessedAttributes attributes
  6597. )
  6598. {
  6599. initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);
  6600. setMetadataVaryings();
  6601. }
  6602. `;var Vi={name:"MetadataPipelineStage",STRUCT_ID_METADATA_VS:"MetadataVS",STRUCT_ID_METADATA_FS:"MetadataFS",STRUCT_NAME_METADATA:"Metadata",STRUCT_ID_METADATA_CLASS_VS:"MetadataClassVS",STRUCT_ID_METADATA_CLASS_FS:"MetadataClassFS",STRUCT_NAME_METADATA_CLASS:"MetadataClass",STRUCT_ID_METADATA_STATISTICS_VS:"MetadataStatisticsVS",STRUCT_ID_METADATA_STATISTICS_FS:"MetadataStatisticsFS",STRUCT_NAME_METADATA_STATISTICS:"MetadataStatistics",FUNCTION_ID_INITIALIZE_METADATA_VS:"initializeMetadataVS",FUNCTION_ID_INITIALIZE_METADATA_FS:"initializeMetadataFS",FUNCTION_SIGNATURE_INITIALIZE_METADATA:"void initializeMetadata(out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)",FUNCTION_ID_SET_METADATA_VARYINGS:"setMetadataVaryings",FUNCTION_SIGNATURE_SET_METADATA_VARYINGS:"void setMetadataVaryings()",METADATA_CLASS_FIELDS:[{specName:"noData",shaderName:"noData"},{specName:"default",shaderName:"defaultValue"},{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"}],METADATA_STATISTICS_FIELDS:[{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"},{specName:"mean",shaderName:"mean",type:"float"},{specName:"median",shaderName:"median"},{specName:"standardDeviation",shaderName:"standardDeviation",type:"float"},{specName:"variance",shaderName:"variance",type:"float"},{specName:"sum",shaderName:"sum"}]};Vi.process=function(e,t,n){let{shaderBuilder:i,model:o}=e,{structuralMetadata:r={},content:s}=o,a=s?.tileset.metadataExtension?.statistics,c=vBe(r.propertyAttributes,t,a),d=FBe(r.propertyTextures,a),u=c.concat(d);MBe(i,u),UBe(i),i.addVertexLines(TW),i.addFragmentLines(_W);for(let m=0;m<c.length;m++){let p=c[m];DBe(e,p)}for(let m=0;m<d.length;m++){let p=d[m];OBe(e,p)}};function vBe(e,t,n){return l(e)?e.flatMap(i=>wBe(i,t,n)):[]}function wBe(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=qt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),d=new Array(c.length);for(let u=0;u<c.length;u++){let[m,p]=c[u],g=i(t,p.attribute),{glslType:f,variableName:x}=o(g);d[u]={metadataVariable:r(m),property:p,type:p.classProperty.type,glslType:f,variableName:x,propertyStatistics:a?.properties[m],shaderDestination:ge.BOTH}}return d}function FBe(e,t){return l(e)?e.flatMap(n=>ABe(n,t)):[]}function ABe(e,t){let{sanitizeGlslIdentifier:n}=qt,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,c])=>c.isGpuCompatible()),s=new Array(r.length);for(let a=0;a<r.length;a++){let[c,d]=r[a];s[a]={metadataVariable:n(c),property:d,type:d.classProperty.type,glslType:d.getGlslType(),propertyStatistics:o?.properties[c],shaderDestination:ge.FRAGMENT}}return s}function MBe(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:d,propertyStatistics:u}=t[a];n.add(d),l(u)&&c!==Rt.ENUM&&i.add(d)}let o=Vi.METADATA_CLASS_FIELDS;for(let a of n){let c=`${a}MetadataClass`;s(c,a,o)}let r=Vi.METADATA_STATISTICS_FIELDS;for(let a of i){let c=`${a}MetadataStatistics`;s(c,a,r)}function s(a,c,d){e.addStruct(a,a,ge.BOTH);for(let u=0;u<d.length;u++){let{shaderName:m}=d[u],p=d[u].type==="float"?kBe(c):c;e.addStructField(a,p,m)}}}var NBe={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function kBe(e){let t=NBe[e];return l(t)?t:e}function UBe(e){e.addStruct(Vi.STRUCT_ID_METADATA_VS,Vi.STRUCT_NAME_METADATA,ge.VERTEX),e.addStruct(Vi.STRUCT_ID_METADATA_FS,Vi.STRUCT_NAME_METADATA,ge.FRAGMENT),e.addStruct(Vi.STRUCT_ID_METADATA_CLASS_VS,Vi.STRUCT_NAME_METADATA_CLASS,ge.VERTEX),e.addStruct(Vi.STRUCT_ID_METADATA_CLASS_FS,Vi.STRUCT_NAME_METADATA_CLASS,ge.FRAGMENT),e.addStruct(Vi.STRUCT_ID_METADATA_STATISTICS_VS,Vi.STRUCT_NAME_METADATA_STATISTICS,ge.VERTEX),e.addStruct(Vi.STRUCT_ID_METADATA_STATISTICS_FS,Vi.STRUCT_NAME_METADATA_STATISTICS,ge.FRAGMENT),e.addFunction(Vi.FUNCTION_ID_INITIALIZE_METADATA_VS,Vi.FUNCTION_SIGNATURE_INITIALIZE_METADATA,ge.VERTEX),e.addFunction(Vi.FUNCTION_ID_INITIALIZE_METADATA_FS,Vi.FUNCTION_SIGNATURE_INITIALIZE_METADATA,ge.FRAGMENT),e.addFunction(Vi.FUNCTION_ID_SET_METADATA_VARYINGS,Vi.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,ge.VERTEX)}function DBe(e,t){BBe(e,t),hae(e.shaderBuilder,t),fae(e.shaderBuilder,t)}function BBe(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:o,glslType:r}=t,s=bae({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:r,metadataVariable:i,shaderDestination:ge.BOTH,property:o});n.addStructField(Vi.STRUCT_ID_METADATA_VS,r,i),n.addStructField(Vi.STRUCT_ID_METADATA_FS,r,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Vi.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Vi.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function OBe(e,t){YBe(e,t),hae(e.shaderBuilder,t),fae(e.shaderBuilder,t)}function YBe(e,t){let{shaderBuilder:n,uniformMap:i}=e,{metadataVariable:o,glslType:r,property:s}=t,{texCoord:a,channels:c,index:d,texture:u,transform:m}=s.textureReader,p=`u_propertyTexture_${d}`;i.hasOwnProperty(p)||(n.addUniform("sampler2D",p,ge.FRAGMENT),i[p]=()=>u),n.addStructField(Vi.STRUCT_ID_METADATA_FS,r,o);let g=`attributes.texCoord_${a}`,f=g;if(l(m)&&!$.equals(m,$.IDENTITY)){let L=`${p}Transform`;n.addUniform("mat3",L,ge.FRAGMENT),i[L]=function(){return m},f=`vec2(${L} * vec3(${g}, 1.0))`}let x=`texture(${p}, ${f}).${c}`,_=s.unpackInShader(x),C=bae({valueExpression:_,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:ge.FRAGMENT,property:s}),V=`metadata.${o} = ${C};`;n.addFunctionLines(Vi.FUNCTION_ID_INITIALIZE_METADATA_FS,[V])}function hae(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=pae(Vi.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(Vi.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Vi.FUNCTION_ID_INITIALIZE_METADATA_FS,s),ge.includesVertexShader(r)&&(e.addStructField(Vi.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Vi.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function fae(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===Rt.ENUM)return;let s=Vi.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=pae(s,n,a,r),d=`${r}MetadataStatistics`;e.addStructField(Vi.STRUCT_ID_METADATA_STATISTICS_FS,d,i),e.addFunctionLines(Vi.FUNCTION_ID_INITIALIZE_METADATA_FS,c),ge.includesVertexShader(t.shaderDestination)&&(e.addStructField(Vi.STRUCT_ID_METADATA_STATISTICS_VS,d,i),e.addFunctionLines(Vi.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function pae(e,t,n,i){function o(r){let s=t[r.specName];if(l(s))return`${n}.${r.shaderName} = ${i}(${s});`}return l(t)?e.map(o).filter(l):[]}function bae(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,o=`u_${i}_offset`,r=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:d}=e;s.addUniform(c,o,d),s.addUniform(c,r,d);let{offset:u,scale:m}=n;return a[o]=()=>u,a[r]=()=>m,`czm_valueTransform(${o}, ${r}, ${t})`}var Lu=Vi;var qRn=T(S(),1),HBe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},Tg=Object.freeze(HBe);var la={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:St};la.process=function(e,t,n){let{shaderBuilder:i,model:o,alphaOptions:r}=e,{customShader:s}=o,{lightingModel:a,translucencyMode:c}=s;l(a)&&(e.lightingOptions.lightingModel=a),c===Tg.TRANSLUCENT?r.pass=Ge.TRANSLUCENT:c===Tg.OPAQUE&&(r.pass=void 0);let d=e3e(s,t);if(!d.customShaderEnabled)return;if(o3e(i,s,d),d.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,ge.BOTH),l(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,ge.VERTEX),l(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,ge.FRAGMENT);let p=cb.getDefineName(s.mode);i.addDefine(p,void 0,ge.FRAGMENT)}let u=s.uniforms;for(let p in u)if(u.hasOwnProperty(p)){let g=u[p];i.addUniform(g.type,p)}let m=s.varyings;for(let p in m)if(m.hasOwnProperty(p)){let g=m[p];i.addVarying(g,p)}e.uniformMap=Tt(e.uniformMap,s.uniformMap)};function zBe(e){let t={};for(let n=0;n<e.length;n++){let i=qt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var KBe={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},JBe={position:"vec3(0.0)",normal:"vec3(0.0, 0.0, 1.0)",tangent:"vec3(1.0, 0.0, 0.0)",bitangent:"vec3(0.0, 1.0, 0.0)",texCoord:"vec2(0.0)",color:"vec4(1.0)",joints:"ivec4(0)",weights:"vec4(0.0)"};function gae(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=KBe[t],i=JBe[t];if(l(n))return{attributeField:[n,e],value:i}}function QBe(e,t){if(!l(e.vertexShaderText))return{enabled:!1};let n=e.usedVariablesVertex.attributeSet,i=yae(t,n,!1),o=xae(t,n,!1),r,s=[],a=[];for(let c in i){if(!i.hasOwnProperty(c))continue;let u=[i[c].glslType,c];s.push(u),r=`vsInput.attributes.${c} = attributes.${c};`,a.push(r)}for(let c=0;c<o.length;c++){let d=o[c],u=gae(d);if(!l(u))return la._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${d}, disabling custom vertex shader`),{enabled:!1};s.push(u.attributeField),r=`vsInput.attributes.${d} = ${u.value};`,a.push(r)}return{enabled:!0,attributeFields:s,initializationLines:a}}function jBe(e){let t=[],n=[],i=e.usedVariablesFragment.attributeSet;return i.hasOwnProperty("positionWC")&&(t.push(["vec3","positionWC"]),n.push("fsInput.attributes.positionWC = attributes.positionWC;")),i.hasOwnProperty("positionEC")&&(t.push(["vec3","positionEC"]),n.push("fsInput.attributes.positionEC = attributes.positionEC;")),{attributeFields:t,initializationLines:n}}function qBe(e,t){if(!l(e.fragmentShaderText))return{enabled:!1};let n=e.usedVariablesFragment.attributeSet,i=yae(t,n,!0),o=xae(t,n,!0),r,s=[],a=[];for(let d in i){if(!i.hasOwnProperty(d))continue;let m=[i[d].glslType,d];s.push(m),r=`fsInput.attributes.${d} = attributes.${d};`,a.push(r)}for(let d=0;d<o.length;d++){let u=o[d],m=gae(u);if(!l(m))return la._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${u}, disabling custom fragment shader.`),{enabled:!1};s.push(m.attributeField),r=`fsInput.attributes.${u} = ${m.value};`,a.push(r)}let c=jBe(e);return{enabled:!0,attributeFields:s.concat(c.attributeFields),initializationLines:c.initializationLines.concat(a)}}var $Be={positionWC:!0,positionEC:!0};function yae(e,t,n){let i={};for(let o in e){if(!e.hasOwnProperty(o))continue;let r=e[o],s=o;n&&o==="normalMC"?s="normalEC":n&&o==="tangentMC"&&(s="tangentEC",r.glslType="vec3"),t.hasOwnProperty(s)&&(i[s]=r)}return i}function xae(e,t,n){let i=[];for(let o in t){if(!t.hasOwnProperty(o)||$Be.hasOwnProperty(o))continue;let r=o;n&&o==="normalEC"?r="normalMC":n&&o==="tangentEC"&&(r="tangentMC"),e.hasOwnProperty(r)||i.push(o)}return i}function e3e(e,t){let n=zBe(t.attributes),i=QBe(e,n),o=qBe(e,n),s=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&o.enabled;return{vertexLines:i,fragmentLines:o,customShaderEnabled:i.enabled||o.enabled,shouldComputePositionWC:s}}function t3e(e,t){let n=la.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,la.STRUCT_NAME_ATTRIBUTES,ge.VERTEX);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=la.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,la.STRUCT_NAME_VERTEX_INPUT,ge.VERTEX),e.addStructField(n,la.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,_g.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Lu.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Lu.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Lu.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=la.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(r,la.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,ge.VERTEX),e.addFunctionLines(r,o)}function n3e(e,t){let n=la.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,la.STRUCT_NAME_ATTRIBUTES,ge.FRAGMENT);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=la.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,la.STRUCT_NAME_FRAGMENT_INPUT,ge.FRAGMENT),e.addStructField(n,la.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,_g.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Lu.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Lu.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Lu.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=la.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(r,la.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,ge.FRAGMENT),e.addFunctionLines(r,o)}var i3e=[];function o3e(e,t,n){let{vertexLines:i,fragmentLines:o}=n,r=i3e;i.enabled&&(t3e(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,bW),e.addVertexLines(r)),o.enabled&&(n3e(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,gW),e.addFragmentLines(r))}var SW=la;var xZn=T(S(),1);var CW={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};CW.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=l(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,ge.VERTEX),i.addFunction(CW.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,CW.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,ge.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],d=c.quantization;if(!l(d))continue;let u=c.semantic===Vt.POSITION,m=c.semantic===Vt.TEXCOORD;if(r&&!u&&!m)continue;let p=qt.getAttributeInfo(c);s3e(i,p),r3e(e,p)}};function r3e(e,t){let n=e.shaderBuilder,i=e.uniformMap,o=t.variableName,r=t.attribute.quantization;if(r.octEncoded){let s=`model_normalizationRange_${o}`;n.addUniform("float",s,ge.VERTEX),i[s]=function(){return r.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${o}`,a=`model_quantizedVolumeStepSize_${o}`,c=t.glslType;n.addUniform(c,s,ge.VERTEX),n.addUniform(c,a,ge.VERTEX);let d=r.quantizedVolumeOffset,u=r.quantizedVolumeStepSize;/^color_\d+$/.test(o)&&(d=_ae(d,0),u=_ae(u,1)),i[s]=function(){return d},i[a]=function(){return u}}}function _ae(e,t){return e instanceof se?e:new se(e.x,e.y,e.z,t)}function s3e(e,t){let n=t.variableName,i=t.attribute.quantization,o;i.octEncoded?o=a3e(n,i):o=c3e(n),e.addFunctionLines(CW.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[o])}function a3e(e,t){let n=`attributes.${e}`,i=`a_quantized_${e}`,o=`model_normalizationRange_${e}`,r=t.octEncodedZXY?".zxy":".xyz";return`${n} = czm_octDecode(${i}, ${o})${r};`}function c3e(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,o=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${o};`}var VW=CW;var zZn=T(S(),1);var TZn=T(S(),1),LW=`void geometryStage(out ProcessedAttributes attributes)
  6603. {
  6604. attributes.positionMC = v_positionMC;
  6605. attributes.positionEC = v_positionEC;
  6606. #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE)
  6607. attributes.positionWC = v_positionWC;
  6608. #endif
  6609. #ifdef HAS_NORMALS
  6610. // renormalize after interpolation
  6611. attributes.normalEC = normalize(v_normalEC);
  6612. #endif
  6613. #ifdef HAS_TANGENTS
  6614. attributes.tangentEC = normalize(v_tangentEC);
  6615. #endif
  6616. #ifdef HAS_BITANGENTS
  6617. attributes.bitangentEC = normalize(v_bitangentEC);
  6618. #endif
  6619. // Everything else is dynamically generated in GeometryPipelineStage
  6620. setDynamicVaryings(attributes);
  6621. }
  6622. `;var CZn=T(S(),1),RW=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal)
  6623. {
  6624. vec4 computedPosition;
  6625. // Compute positions in different coordinate systems
  6626. vec3 positionMC = attributes.positionMC;
  6627. v_positionMC = positionMC;
  6628. v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz;
  6629. #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)
  6630. vec3 position2D = attributes.position2D;
  6631. vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz;
  6632. computedPosition = czm_projection * vec4(positionEC, 1.0);
  6633. #else
  6634. computedPosition = czm_projection * vec4(v_positionEC, 1.0);
  6635. #endif
  6636. // Sometimes the custom shader and/or style needs this
  6637. #if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) || defined(ENABLE_CLIPPING_POLYGONS)
  6638. // Note that this is a 32-bit position which may result in jitter on small
  6639. // scales.
  6640. v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;
  6641. #endif
  6642. #ifdef HAS_NORMALS
  6643. v_normalEC = normalize(normal * attributes.normalMC);
  6644. #endif
  6645. #ifdef HAS_TANGENTS
  6646. v_tangentEC = normalize(normal * attributes.tangentMC);
  6647. #endif
  6648. #ifdef HAS_BITANGENTS
  6649. v_bitangentEC = normalize(normal * attributes.bitangentMC);
  6650. #endif
  6651. // All other varyings need to be dynamically generated in
  6652. // GeometryPipelineStage
  6653. setDynamicVaryings(attributes);
  6654. return computedPosition;
  6655. }
  6656. `;var PZn=T(S(),1);var LZn=T(S(),1),zC=`vec2 computeSt(float featureId)
  6657. {
  6658. float stepX = model_textureStep.x;
  6659. float centerX = model_textureStep.y;
  6660. #ifdef MULTILINE_BATCH_TEXTURE
  6661. float stepY = model_textureStep.z;
  6662. float centerY = model_textureStep.w;
  6663. float xId = mod(featureId, model_textureDimensions.x);
  6664. float yId = floor(featureId / model_textureDimensions.x);
  6665. return vec2(centerX + (xId * stepX), centerY + (yId * stepY));
  6666. #else
  6667. return vec2(centerX + (featureId * stepX), 0.5);
  6668. #endif
  6669. }
  6670. void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds)
  6671. {
  6672. int featureId = featureIds.SELECTED_FEATURE_ID;
  6673. if (featureId < model_featuresLength)
  6674. {
  6675. vec2 featureSt = computeSt(float(featureId));
  6676. feature.id = featureId;
  6677. feature.st = featureSt;
  6678. feature.color = texture(model_batchTexture, featureSt);
  6679. }
  6680. // Floating point comparisons can be unreliable in GLSL, so we
  6681. // increment the feature ID to make sure it's always greater
  6682. // then the model_featuresLength - a condition we check for in the
  6683. // pick ID, to avoid sampling the pick texture if the feature ID is
  6684. // greater than the number of features.
  6685. else
  6686. {
  6687. feature.id = model_featuresLength + 1;
  6688. feature.st = vec2(0.0);
  6689. feature.color = vec4(1.0);
  6690. }
  6691. #ifdef HAS_NULL_FEATURE_ID
  6692. if (featureId == model_nullFeatureId) {
  6693. feature.id = featureId;
  6694. feature.st = vec2(0.0);
  6695. feature.color = vec4(1.0);
  6696. }
  6697. #endif
  6698. }
  6699. `;var ZW={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};ZW.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=l3e(o,r,t),a=s.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,a),i.addDefine("SELECTED_FEATURE_ID",s.variableName,a),i.addDefine(s.featureIdDefine,void 0,a),d3e(i);let c=s.featureIds.nullFeatureId,d=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),d.model_nullFeatureId=function(){return c}),s.shaderDestination===ge.BOTH&&i.addVertexLines(zC),i.addFragmentLines(zC)};function Tae(e){return e instanceof Tn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Sae(e){return e instanceof Tn.FeatureIdTexture?ge.FRAGMENT:ge.BOTH}function l3e(e,t,n){let i,o;return l(t.instances)&&(o=qt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(o))?(i=y(o.label,o.positionalLabel),{featureIds:o,variableName:i,shaderDestination:Sae(o),featureIdDefine:Tae(o)}):(o=qt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=y(o.label,o.positionalLabel),{featureIds:o,variableName:i,shaderDestination:Sae(o),featureIdDefine:Tae(o)})}function d3e(e){e.addStructField(ZW.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(ZW.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(ZW.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var Sg=ZW;var Ds={name:"GeometryPipelineStage",STRUCT_ID_PROCESSED_ATTRIBUTES_VS:"ProcessedAttributesVS",STRUCT_ID_PROCESSED_ATTRIBUTES_FS:"ProcessedAttributesFS",STRUCT_NAME_PROCESSED_ATTRIBUTES:"ProcessedAttributes",FUNCTION_ID_INITIALIZE_ATTRIBUTES:"initializeAttributes",FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:"void initializeAttributes(out ProcessedAttributes attributes)",FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS:"setDynamicVaryingsVS",FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS:"setDynamicVaryingsFS",FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:"void setDynamicVaryings(inout ProcessedAttributes attributes)"};Ds.process=function(e,t,n){let{shaderBuilder:i,model:o}=e;i.addStruct(Ds.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",ge.VERTEX),i.addStruct(Ds.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",ge.FRAGMENT),i.addStruct(Sg.STRUCT_ID_SELECTED_FEATURE,Sg.STRUCT_NAME_SELECTED_FEATURE,ge.BOTH),i.addFunction(Ds.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Ds.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,ge.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Ds.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Ds.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Ds.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Ds.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,ge.VERTEX),i.addFunction(Ds.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Ds.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,ge.FRAGMENT),o.type===ar.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,ge.FRAGMENT);let r=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,s=l(e.runtimeNode.node.instances),a=r&&!s,c=t.attributes.length;for(let d=0;d<c;d++){let u=t.attributes[d],m=sn.getAttributeLocationCount(u.type),p=u.semantic===Vt.POSITION,g;m>1?(g=e.attributeIndex,e.attributeIndex+=m):p&&!a?g=0:g=e.attributeIndex++,u3e(e,u,g,m,r,s)}_3e(i,t.attributes),t.primitiveType===Fe.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(RW),i.addFragmentLines(LW)};function u3e(e,t,n,i,o,r){let s=e.shaderBuilder,a=qt.getAttributeInfo(t),c=o&&!r;i>1?f3e(e,t,n,i):h3e(e,t,n,c),b3e(s,a,c),p3e(s,a),l(t.semantic)&&m3e(s,t),g3e(s,a,o),y3e(s,a,c),x3e(s,a)}function m3e(e,t){let{semantic:n,setIndex:i}=t;switch(n){case Vt.NORMAL:e.addDefine("HAS_NORMALS");break;case Vt.TANGENT:e.addDefine("HAS_TANGENTS");break;case Vt.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case Vt.TEXCOORD:case Vt.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function h3e(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:c}=l(o)?o:t;r===Vt.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let d=r===Vt.POSITION,u=d?0:n,m=sn.getNumberOfComponents(a),p={index:u,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:m,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!d||!i)return;let g=e.runtimePrimitive.positionBuffer2D,f={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:m,componentDatatype:Q.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(f)}function f3e(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=l(o)?o:t,d=sn.getNumberOfComponents(s)/i,u=Q.getSizeInBytes(a),m=d*u,p=t.byteStride;for(let g=0;g<i;g++){let f=t.byteOffset+g*m,x={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:d,componentDatatype:a,offsetInBytes:f,strideInBytes:p,normalize:r};e.attributes.push(x)}}function p3e(e,t){let n=t.variableName,i=`v_${n}`,o;n==="normalMC"?(i="v_normalEC",o=t.glslType):n==="tangentMC"?(o="vec3",i="v_tangentEC"):o=t.glslType,e.addVarying(o,i)}function b3e(e,t,n){let i=t.attribute.semantic,o=t.variableName,r,s;t.isQuantized?(r=`a_quantized_${o}`,s=t.quantizedGlslType):(r=`a_${o}`,s=t.glslType);let a=i===Vt.POSITION;a?e.setPositionAttribute(s,r):e.addAttribute(s,r),a&&n&&e.addAttribute("vec3","a_position2D")}function g3e(e,t,n){let i=Ds.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=Ds.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,{variableName:r,glslType:s}=t;r==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(o,"vec3","tangentEC")):r==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(o,"vec3","normalEC")):(e.addStructField(i,s,r),e.addStructField(o,s,r)),r==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function y3e(e,t,n){let i=Ds.FUNCTION_ID_INITIALIZE_ATTRIBUTES,o=t.variableName;if(o==="positionMC"&&n&&e.addFunctionLines(i,["attributes.position2D = a_position2D;"]),t.isQuantized)return;let s=[];o==="tangentMC"?(s.push("attributes.tangentMC = a_tangentMC.xyz;"),s.push("attributes.tangentSignMC = a_tangentMC.w;")):s.push(`attributes.${o} = a_${o};`),e.addFunctionLines(i,s)}function x3e(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let o=Ds.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,r=t.variableName,s=`v_${r} = attributes.${r};`;e.addFunctionLines(o,[s]),o=Ds.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${r} = v_${r};`,e.addFunctionLines(o,[s])}function _3e(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===Vt.NORMAL?n=!0:r.semantic===Vt.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Ds.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Ds.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var GW=Ds;var iGn=T(S(),1);var JZn=T(S(),1),EW=`#ifdef USE_IBL_LIGHTING
  6700. vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material)
  6701. {
  6702. #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)
  6703. // Environment maps were provided, use them for IBL
  6704. vec3 viewDirection = -normalize(position);
  6705. vec3 iblColor = textureIBL(viewDirection, normal, material);
  6706. return iblColor;
  6707. #endif
  6708. return vec3(0.0);
  6709. }
  6710. #endif
  6711. #ifdef USE_CLEARCOAT
  6712. vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material)
  6713. {
  6714. vec3 viewDirection = -normalize(position);
  6715. vec3 halfwayDirection = normalize(viewDirection + lightDirection);
  6716. vec3 normal = material.clearcoatNormal;
  6717. float NdotL = clamp(dot(normal, lightDirection), 0.001, 1.0);
  6718. // clearcoatF0 = vec3(pow((ior - 1.0) / (ior + 1.0), 2.0)), but without KHR_materials_ior, ior is a constant 1.5.
  6719. vec3 f0 = vec3(0.04);
  6720. vec3 f90 = vec3(1.0);
  6721. // Note: clearcoat Fresnel computed with dot(n, v) instead of dot(v, h).
  6722. // This is to make it energy conserving with a simple layering function.
  6723. float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0);
  6724. vec3 F = fresnelSchlick2(f0, f90, NdotV);
  6725. // compute specular reflection from direct lighting
  6726. float roughness = material.clearcoatRoughness;
  6727. float alphaRoughness = roughness * roughness;
  6728. float directStrength = computeDirectSpecularStrength(normal, lightDirection, viewDirection, halfwayDirection, alphaRoughness);
  6729. vec3 directReflection = F * directStrength * NdotL;
  6730. vec3 color = lightColorHdr * directReflection;
  6731. #ifdef SPECULAR_IBL
  6732. // Find the direction in which to sample the environment map
  6733. vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflect(-viewDirection, normal));
  6734. vec3 iblColor = computeSpecularIBL(reflectMC, NdotV, f0, roughness);
  6735. color += iblColor * material.occlusion;
  6736. #endif
  6737. float clearcoatFactor = material.clearcoatFactor;
  6738. vec3 clearcoatColor = color * clearcoatFactor;
  6739. // Dim base layer based on transmission loss through clearcoat
  6740. return baseLayerColor * (1.0 - clearcoatFactor * F) + clearcoatColor;
  6741. }
  6742. #endif
  6743. #if defined(LIGHTING_PBR) && defined(HAS_NORMALS)
  6744. vec3 computePbrLighting(in czm_modelMaterial material, in vec3 position)
  6745. {
  6746. #ifdef USE_CUSTOM_LIGHT_COLOR
  6747. vec3 lightColorHdr = model_lightColorHdr;
  6748. #else
  6749. vec3 lightColorHdr = czm_lightColorHdr;
  6750. #endif
  6751. vec3 viewDirection = -normalize(position);
  6752. vec3 normal = material.normalEC;
  6753. vec3 lightDirection = normalize(czm_lightDirectionEC);
  6754. vec3 directLighting = czm_pbrLighting(viewDirection, normal, lightDirection, material);
  6755. vec3 directColor = lightColorHdr * directLighting;
  6756. // Accumulate colors from base layer
  6757. vec3 color = directColor + material.emissive;
  6758. #ifdef USE_IBL_LIGHTING
  6759. color += computeIBL(position, normal, lightDirection, lightColorHdr, material);
  6760. #endif
  6761. #ifdef USE_CLEARCOAT
  6762. color = addClearcoatReflection(color, position, lightDirection, lightColorHdr, material);
  6763. #endif
  6764. return color;
  6765. }
  6766. #endif
  6767. /**
  6768. * Compute the material color under the current lighting conditions.
  6769. * All other material properties are passed through so further stages
  6770. * have access to them.
  6771. *
  6772. * @param {czm_modelMaterial} material The material properties from {@MaterialStageFS}
  6773. * @param {ProcessedAttributes} attributes
  6774. */
  6775. void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes)
  6776. {
  6777. #ifdef LIGHTING_PBR
  6778. #ifdef HAS_NORMALS
  6779. vec3 color = computePbrLighting(material, attributes.positionEC);
  6780. #else
  6781. vec3 color = material.diffuse * material.occlusion + material.emissive;
  6782. #endif
  6783. // In HDR mode, the frame buffer is in linear color space. The
  6784. // post-processing stages (see PostProcessStageCollection) will handle
  6785. // tonemapping. However, if HDR is not enabled, we must tonemap else large
  6786. // values may be clamped to 1.0
  6787. #ifndef HDR
  6788. color = czm_pbrNeutralTonemapping(color);
  6789. #endif
  6790. #else // unlit
  6791. vec3 color = material.diffuse;
  6792. #endif
  6793. #ifdef HAS_POINT_CLOUD_COLOR_STYLE
  6794. // The colors resulting from point cloud styles are adjusted differently.
  6795. color = czm_gammaCorrect(color);
  6796. #elif !defined(HDR)
  6797. // If HDR is not enabled, the frame buffer stores sRGB colors rather than
  6798. // linear colors so the linear value must be converted.
  6799. color = czm_linearToSrgb(color);
  6800. #endif
  6801. material.diffuse = color;
  6802. }
  6803. `;var jZn=T(S(),1),T3e={UNLIT:0,PBR:1},df=Object.freeze(T3e);var Cae={name:"LightingPipelineStage"};Cae.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:o}=e;if(l(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,ge.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",ge.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:r}=i;r===df.PBR?o.addDefine("LIGHTING_PBR",void 0,ge.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,ge.FRAGMENT),o.addFragmentLines(EW)};var IW=Cae;var _Gn=T(S(),1);var rGn=T(S(),1),XW=`// If the style color is white, it implies the feature has not been styled.
  6804. bool isDefaultStyleColor(vec3 color)
  6805. {
  6806. return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));
  6807. }
  6808. vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend)
  6809. {
  6810. vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend);
  6811. vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor;
  6812. return color;
  6813. }
  6814. vec2 computeTextureTransform(vec2 texCoord, mat3 textureTransform)
  6815. {
  6816. return vec2(textureTransform * vec3(texCoord, 1.0));
  6817. }
  6818. #ifdef HAS_NORMAL_TEXTURE
  6819. vec2 getNormalTexCoords()
  6820. {
  6821. vec2 texCoord = TEXCOORD_NORMAL;
  6822. #ifdef HAS_NORMAL_TEXTURE_TRANSFORM
  6823. texCoord = vec2(u_normalTextureTransform * vec3(texCoord, 1.0));
  6824. #endif
  6825. return texCoord;
  6826. }
  6827. #endif
  6828. #if defined(HAS_NORMAL_TEXTURE) || defined(HAS_CLEARCOAT_NORMAL_TEXTURE)
  6829. vec3 computeTangent(in vec3 position, in vec2 normalTexCoords)
  6830. {
  6831. vec2 tex_dx = dFdx(normalTexCoords);
  6832. vec2 tex_dy = dFdy(normalTexCoords);
  6833. float determinant = tex_dx.x * tex_dy.y - tex_dy.x * tex_dx.y;
  6834. vec3 tangent = tex_dy.t * dFdx(position) - tex_dx.t * dFdy(position);
  6835. return tangent / determinant;
  6836. }
  6837. #endif
  6838. #ifdef USE_ANISOTROPY
  6839. struct NormalInfo {
  6840. vec3 tangent;
  6841. vec3 bitangent;
  6842. vec3 normal;
  6843. vec3 geometryNormal;
  6844. };
  6845. NormalInfo getNormalInfo(ProcessedAttributes attributes)
  6846. {
  6847. vec3 geometryNormal = attributes.normalEC;
  6848. #ifdef HAS_NORMAL_TEXTURE
  6849. vec2 normalTexCoords = getNormalTexCoords();
  6850. #endif
  6851. #ifdef HAS_BITANGENTS
  6852. vec3 tangent = attributes.tangentEC;
  6853. vec3 bitangent = attributes.bitangentEC;
  6854. #else // Assume HAS_NORMAL_TEXTURE
  6855. vec3 tangent = computeTangent(attributes.positionEC, normalTexCoords);
  6856. tangent = normalize(tangent - geometryNormal * dot(geometryNormal, tangent));
  6857. vec3 bitangent = normalize(cross(geometryNormal, tangent));
  6858. #endif
  6859. #ifdef HAS_NORMAL_TEXTURE
  6860. mat3 tbn = mat3(tangent, bitangent, geometryNormal);
  6861. vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb;
  6862. normalSample = 2.0 * normalSample - 1.0;
  6863. #ifdef HAS_NORMAL_TEXTURE_SCALE
  6864. normalSample.xy *= u_normalTextureScale;
  6865. #endif
  6866. vec3 normal = normalize(tbn * normalSample);
  6867. #else
  6868. vec3 normal = geometryNormal;
  6869. #endif
  6870. #ifdef HAS_DOUBLE_SIDED_MATERIAL
  6871. if (czm_backFacing()) {
  6872. tangent *= -1.0;
  6873. bitangent *= -1.0;
  6874. normal *= -1.0;
  6875. geometryNormal *= -1.0;
  6876. }
  6877. #endif
  6878. NormalInfo normalInfo;
  6879. normalInfo.tangent = tangent;
  6880. normalInfo.bitangent = bitangent;
  6881. normalInfo.normal = normal;
  6882. normalInfo.geometryNormal = geometryNormal;
  6883. return normalInfo;
  6884. }
  6885. #endif
  6886. #if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)
  6887. vec3 getNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal)
  6888. {
  6889. vec2 normalTexCoords = getNormalTexCoords();
  6890. // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set
  6891. #ifdef HAS_BITANGENTS
  6892. vec3 t = attributes.tangentEC;
  6893. vec3 b = attributes.bitangentEC;
  6894. #else
  6895. vec3 t = computeTangent(attributes.positionEC, normalTexCoords);
  6896. t = normalize(t - geometryNormal * dot(geometryNormal, t));
  6897. vec3 b = normalize(cross(geometryNormal, t));
  6898. #endif
  6899. mat3 tbn = mat3(t, b, geometryNormal);
  6900. vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb;
  6901. normalSample = 2.0 * normalSample - 1.0;
  6902. #ifdef HAS_NORMAL_TEXTURE_SCALE
  6903. normalSample.xy *= u_normalTextureScale;
  6904. #endif
  6905. return normalize(tbn * normalSample);
  6906. }
  6907. #endif
  6908. #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE
  6909. vec3 getClearcoatNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal)
  6910. {
  6911. vec2 normalTexCoords = TEXCOORD_CLEARCOAT_NORMAL;
  6912. #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_TRANSFORM
  6913. normalTexCoords = vec2(u_clearcoatNormalTextureTransform * vec3(normalTexCoords, 1.0));
  6914. #endif
  6915. // If HAS_BITANGENTS is set, then HAS_TANGENTS is also set
  6916. #ifdef HAS_BITANGENTS
  6917. vec3 t = attributes.tangentEC;
  6918. vec3 b = attributes.bitangentEC;
  6919. #else
  6920. vec3 t = computeTangent(attributes.positionEC, normalTexCoords);
  6921. t = normalize(t - geometryNormal * dot(geometryNormal, t));
  6922. vec3 b = normalize(cross(geometryNormal, t));
  6923. #endif
  6924. mat3 tbn = mat3(t, b, geometryNormal);
  6925. vec3 normalSample = texture(u_clearcoatNormalTexture, normalTexCoords).rgb;
  6926. normalSample = 2.0 * normalSample - 1.0;
  6927. #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_SCALE
  6928. normalSample.xy *= u_clearcoatNormalTextureScale;
  6929. #endif
  6930. return normalize(tbn * normalSample);
  6931. }
  6932. #endif
  6933. #ifdef HAS_NORMALS
  6934. vec3 computeNormal(ProcessedAttributes attributes)
  6935. {
  6936. // Geometry normal. This is already normalized
  6937. vec3 normal = attributes.normalEC;
  6938. #if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)
  6939. normal = getNormalFromTexture(attributes, normal);
  6940. #endif
  6941. #ifdef HAS_DOUBLE_SIDED_MATERIAL
  6942. if (czm_backFacing()) {
  6943. normal = -normal;
  6944. }
  6945. #endif
  6946. return normal;
  6947. }
  6948. #endif
  6949. #ifdef HAS_BASE_COLOR_TEXTURE
  6950. vec4 getBaseColorFromTexture()
  6951. {
  6952. vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR;
  6953. #ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM
  6954. baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform);
  6955. #endif
  6956. vec4 baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords));
  6957. #ifdef HAS_BASE_COLOR_FACTOR
  6958. baseColorWithAlpha *= u_baseColorFactor;
  6959. #endif
  6960. return baseColorWithAlpha;
  6961. }
  6962. #endif
  6963. #ifdef HAS_EMISSIVE_TEXTURE
  6964. vec3 getEmissiveFromTexture()
  6965. {
  6966. vec2 emissiveTexCoords = TEXCOORD_EMISSIVE;
  6967. #ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM
  6968. emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform);
  6969. #endif
  6970. vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb);
  6971. #ifdef HAS_EMISSIVE_FACTOR
  6972. emissive *= u_emissiveFactor;
  6973. #endif
  6974. return emissive;
  6975. }
  6976. #endif
  6977. #if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)
  6978. void setSpecularGlossiness(inout czm_modelMaterial material)
  6979. {
  6980. #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE
  6981. vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS;
  6982. #ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM
  6983. specularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform);
  6984. #endif
  6985. vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords));
  6986. vec3 specular = specularGlossiness.rgb;
  6987. float glossiness = specularGlossiness.a;
  6988. #ifdef HAS_LEGACY_SPECULAR_FACTOR
  6989. specular *= u_legacySpecularFactor;
  6990. #endif
  6991. #ifdef HAS_GLOSSINESS_FACTOR
  6992. glossiness *= u_glossinessFactor;
  6993. #endif
  6994. #else
  6995. #ifdef HAS_LEGACY_SPECULAR_FACTOR
  6996. vec3 specular = clamp(u_legacySpecularFactor, vec3(0.0), vec3(1.0));
  6997. #else
  6998. vec3 specular = vec3(1.0);
  6999. #endif
  7000. #ifdef HAS_GLOSSINESS_FACTOR
  7001. float glossiness = clamp(u_glossinessFactor, 0.0, 1.0);
  7002. #else
  7003. float glossiness = 1.0;
  7004. #endif
  7005. #endif
  7006. #ifdef HAS_DIFFUSE_TEXTURE
  7007. vec2 diffuseTexCoords = TEXCOORD_DIFFUSE;
  7008. #ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM
  7009. diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform);
  7010. #endif
  7011. vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords));
  7012. #ifdef HAS_DIFFUSE_FACTOR
  7013. diffuse *= u_diffuseFactor;
  7014. #endif
  7015. #elif defined(HAS_DIFFUSE_FACTOR)
  7016. vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0));
  7017. #else
  7018. vec4 diffuse = vec4(1.0);
  7019. #endif
  7020. material.diffuse = diffuse.rgb * (1.0 - czm_maximumComponent(specular));
  7021. // the specular glossiness extension's alpha overrides anything set
  7022. // by the base material.
  7023. material.alpha = diffuse.a;
  7024. material.specular = specular;
  7025. // glossiness is the opposite of roughness, but easier for artists to use.
  7026. material.roughness = 1.0 - glossiness;
  7027. }
  7028. #elif defined(LIGHTING_PBR)
  7029. float setMetallicRoughness(inout czm_modelMaterial material)
  7030. {
  7031. #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE
  7032. vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS;
  7033. #ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM
  7034. metallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform);
  7035. #endif
  7036. vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb;
  7037. float metalness = clamp(metallicRoughness.b, 0.0, 1.0);
  7038. float roughness = clamp(metallicRoughness.g, 0.0, 1.0);
  7039. #ifdef HAS_METALLIC_FACTOR
  7040. metalness = clamp(metalness * u_metallicFactor, 0.0, 1.0);
  7041. #endif
  7042. #ifdef HAS_ROUGHNESS_FACTOR
  7043. roughness = clamp(roughness * u_roughnessFactor, 0.0, 1.0);
  7044. #endif
  7045. #else
  7046. #ifdef HAS_METALLIC_FACTOR
  7047. float metalness = clamp(u_metallicFactor, 0.0, 1.0);
  7048. #else
  7049. float metalness = 1.0;
  7050. #endif
  7051. #ifdef HAS_ROUGHNESS_FACTOR
  7052. float roughness = clamp(u_roughnessFactor, 0.0, 1.0);
  7053. #else
  7054. float roughness = 1.0;
  7055. #endif
  7056. #endif
  7057. // dielectrics use f0 = 0.04, metals use albedo as f0
  7058. const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);
  7059. vec3 f0 = mix(REFLECTANCE_DIELECTRIC, material.baseColor.rgb, metalness);
  7060. material.specular = f0;
  7061. // diffuse only applies to dielectrics.
  7062. material.diffuse = mix(material.baseColor.rgb, vec3(0.0), metalness);
  7063. // This is perceptual roughness. The square of this value is used for direct lighting
  7064. material.roughness = roughness;
  7065. return metalness;
  7066. }
  7067. #ifdef USE_SPECULAR
  7068. void setSpecular(inout czm_modelMaterial material, in float metalness)
  7069. {
  7070. #ifdef HAS_SPECULAR_TEXTURE
  7071. vec2 specularTexCoords = TEXCOORD_SPECULAR;
  7072. #ifdef HAS_SPECULAR_TEXTURE_TRANSFORM
  7073. specularTexCoords = computeTextureTransform(specularTexCoords, u_specularTextureTransform);
  7074. #endif
  7075. float specularWeight = texture(u_specularTexture, specularTexCoords).a;
  7076. #ifdef HAS_SPECULAR_FACTOR
  7077. specularWeight *= u_specularFactor;
  7078. #endif
  7079. #else
  7080. #ifdef HAS_SPECULAR_FACTOR
  7081. float specularWeight = u_specularFactor;
  7082. #else
  7083. float specularWeight = 1.0;
  7084. #endif
  7085. #endif
  7086. #ifdef HAS_SPECULAR_COLOR_TEXTURE
  7087. vec2 specularColorTexCoords = TEXCOORD_SPECULAR_COLOR;
  7088. #ifdef HAS_SPECULAR_COLOR_TEXTURE_TRANSFORM
  7089. specularColorTexCoords = computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform);
  7090. #endif
  7091. vec3 specularColorSample = texture(u_specularColorTexture, specularColorTexCoords).rgb;
  7092. vec3 specularColorFactor = czm_srgbToLinear(specularColorSample);
  7093. #ifdef HAS_SPECULAR_COLOR_FACTOR
  7094. specularColorFactor *= u_specularColorFactor;
  7095. #endif
  7096. #else
  7097. #ifdef HAS_SPECULAR_COLOR_FACTOR
  7098. vec3 specularColorFactor = u_specularColorFactor;
  7099. #else
  7100. vec3 specularColorFactor = vec3(1.0);
  7101. #endif
  7102. #endif
  7103. material.specularWeight = specularWeight;
  7104. vec3 f0 = material.specular;
  7105. vec3 dielectricSpecularF0 = min(f0 * specularColorFactor, vec3(1.0));
  7106. material.specular = mix(dielectricSpecularF0, material.baseColor.rgb, metalness);
  7107. }
  7108. #endif
  7109. #ifdef USE_ANISOTROPY
  7110. void setAnisotropy(inout czm_modelMaterial material, in NormalInfo normalInfo)
  7111. {
  7112. mat2 rotation = mat2(u_anisotropy.xy, -u_anisotropy.y, u_anisotropy.x);
  7113. float anisotropyStrength = u_anisotropy.z;
  7114. vec2 direction = vec2(1.0, 0.0);
  7115. #ifdef HAS_ANISOTROPY_TEXTURE
  7116. vec2 anisotropyTexCoords = TEXCOORD_ANISOTROPY;
  7117. #ifdef HAS_ANISOTROPY_TEXTURE_TRANSFORM
  7118. anisotropyTexCoords = computeTextureTransform(anisotropyTexCoords, u_anisotropyTextureTransform);
  7119. #endif
  7120. vec3 anisotropySample = texture(u_anisotropyTexture, anisotropyTexCoords).rgb;
  7121. direction = anisotropySample.rg * 2.0 - vec2(1.0);
  7122. anisotropyStrength *= anisotropySample.b;
  7123. #endif
  7124. direction = rotation * direction;
  7125. mat3 tbn = mat3(normalInfo.tangent, normalInfo.bitangent, normalInfo.normal);
  7126. vec3 anisotropicT = tbn * normalize(vec3(direction, 0.0));
  7127. vec3 anisotropicB = cross(normalInfo.geometryNormal, anisotropicT);
  7128. material.anisotropicT = anisotropicT;
  7129. material.anisotropicB = anisotropicB;
  7130. material.anisotropyStrength = anisotropyStrength;
  7131. }
  7132. #endif
  7133. #ifdef USE_CLEARCOAT
  7134. void setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attributes)
  7135. {
  7136. #ifdef HAS_CLEARCOAT_TEXTURE
  7137. vec2 clearcoatTexCoords = TEXCOORD_CLEARCOAT;
  7138. #ifdef HAS_CLEARCOAT_TEXTURE_TRANSFORM
  7139. clearcoatTexCoords = computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform);
  7140. #endif
  7141. float clearcoatFactor = texture(u_clearcoatTexture, clearcoatTexCoords).r;
  7142. #ifdef HAS_CLEARCOAT_FACTOR
  7143. clearcoatFactor *= u_clearcoatFactor;
  7144. #endif
  7145. #else
  7146. #ifdef HAS_CLEARCOAT_FACTOR
  7147. float clearcoatFactor = u_clearcoatFactor;
  7148. #else
  7149. // PERFORMANCE_IDEA: this case should turn the whole extension off
  7150. float clearcoatFactor = 0.0;
  7151. #endif
  7152. #endif
  7153. #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE
  7154. vec2 clearcoatRoughnessTexCoords = TEXCOORD_CLEARCOAT_ROUGHNESS;
  7155. #ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE_TRANSFORM
  7156. clearcoatRoughnessTexCoords = computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform);
  7157. #endif
  7158. float clearcoatRoughness = texture(u_clearcoatRoughnessTexture, clearcoatRoughnessTexCoords).g;
  7159. #ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR
  7160. clearcoatRoughness *= u_clearcoatRoughnessFactor;
  7161. #endif
  7162. #else
  7163. #ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR
  7164. float clearcoatRoughness = u_clearcoatRoughnessFactor;
  7165. #else
  7166. float clearcoatRoughness = 0.0;
  7167. #endif
  7168. #endif
  7169. material.clearcoatFactor = clearcoatFactor;
  7170. // This is perceptual roughness. The square of this value is used for direct lighting
  7171. material.clearcoatRoughness = clearcoatRoughness;
  7172. #ifdef HAS_CLEARCOAT_NORMAL_TEXTURE
  7173. material.clearcoatNormal = getClearcoatNormalFromTexture(attributes, attributes.normalEC);
  7174. #else
  7175. material.clearcoatNormal = attributes.normalEC;
  7176. #endif
  7177. }
  7178. #endif
  7179. #endif
  7180. void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature)
  7181. {
  7182. #ifdef USE_ANISOTROPY
  7183. NormalInfo normalInfo = getNormalInfo(attributes);
  7184. material.normalEC = normalInfo.normal;
  7185. #elif defined(HAS_NORMALS)
  7186. material.normalEC = computeNormal(attributes);
  7187. #endif
  7188. vec4 baseColorWithAlpha = vec4(1.0);
  7189. // Regardless of whether we use PBR, set a base color
  7190. #ifdef HAS_BASE_COLOR_TEXTURE
  7191. baseColorWithAlpha = getBaseColorFromTexture();
  7192. #elif defined(HAS_BASE_COLOR_FACTOR)
  7193. baseColorWithAlpha = u_baseColorFactor;
  7194. #endif
  7195. #ifdef HAS_POINT_CLOUD_COLOR_STYLE
  7196. baseColorWithAlpha = v_pointCloudColor;
  7197. #elif defined(HAS_COLOR_0)
  7198. vec4 color = attributes.color_0;
  7199. // .pnts files store colors in the sRGB color space
  7200. #ifdef HAS_SRGB_COLOR
  7201. color = czm_srgbToLinear(color);
  7202. #endif
  7203. baseColorWithAlpha *= color;
  7204. #endif
  7205. #ifdef USE_CPU_STYLING
  7206. baseColorWithAlpha.rgb = blend(baseColorWithAlpha.rgb, feature.color.rgb, model_colorBlend);
  7207. #endif
  7208. material.baseColor = baseColorWithAlpha;
  7209. material.diffuse = baseColorWithAlpha.rgb;
  7210. material.alpha = baseColorWithAlpha.a;
  7211. #ifdef HAS_OCCLUSION_TEXTURE
  7212. vec2 occlusionTexCoords = TEXCOORD_OCCLUSION;
  7213. #ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM
  7214. occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform);
  7215. #endif
  7216. material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r;
  7217. #endif
  7218. #ifdef HAS_EMISSIVE_TEXTURE
  7219. material.emissive = getEmissiveFromTexture();
  7220. #elif defined(HAS_EMISSIVE_FACTOR)
  7221. material.emissive = u_emissiveFactor;
  7222. #endif
  7223. #if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)
  7224. setSpecularGlossiness(material);
  7225. #elif defined(LIGHTING_PBR)
  7226. float metalness = setMetallicRoughness(material);
  7227. #ifdef USE_SPECULAR
  7228. setSpecular(material, metalness);
  7229. #endif
  7230. #ifdef USE_ANISOTROPY
  7231. setAnisotropy(material, normalInfo);
  7232. #endif
  7233. #ifdef USE_CLEARCOAT
  7234. setClearcoat(material, attributes);
  7235. #endif
  7236. #endif
  7237. }
  7238. `;var{Material:S3e,MetallicRoughness:xz,SpecularGlossiness:_z,Specular:Vae,Clearcoat:Lae}=Tn,Rae={name:"MaterialPipelineStage",_processTexture:Fl,_processTextureTransform:Zae};Rae.process=function(e,t,n){let i=t.material,{model:o,uniformMap:r,shaderBuilder:s}=e,a=l(o.classificationType),c=a,{defaultTexture:d,defaultNormalTexture:u,defaultEmissiveTexture:m}=n.context;V3e(i,r,s,d,u,m,c),l(i.specularGlossiness)?L3e(i.specularGlossiness,r,s,d,c):(l(i.specular)&&qt.supportedExtensions.KHR_materials_specular&&R3e(i.specular,r,s,d,c),l(i.anisotropy)&&qt.supportedExtensions.KHR_materials_anisotropy&&G3e(i.anisotropy,r,s,d,c),l(i.clearcoat)&&qt.supportedExtensions.KHR_materials_clearcoat&&E3e(i.clearcoat,r,s,d,c),I3e(i.metallicRoughness,r,s,d,c));let p=qt.getAttributeBySemantic(t,Vt.NORMAL),g=e.lightingOptions;i.unlit||!p||a?g.lightingModel=df.UNLIT:g.lightingModel=df.PBR;let f=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=f;let x=e.alphaOptions;i.alphaMode===af.BLEND?x.pass=Ge.TRANSLUCENT:i.alphaMode===af.MASK&&(x.alphaCutoff=i.alphaCutoff),s.addFragmentLines(XW),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,ge.BOTH)};function Zae(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,ge.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,ge.FRAGMENT),t[s]=function(){return n.transform}}function C3e(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_SCALE`;e.addDefine(r,void 0,ge.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,ge.FRAGMENT),t[s]=function(){return n.scale}}function Fl(e,t,n,i,o,r){e.addUniform("sampler2D",i,ge.FRAGMENT),t[i]=function(){return y(n.texture,r)};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,ge.FRAGMENT);let c=`v_texCoord_${n.texCoord}`,d=`TEXCOORD_${o}`;e.addDefine(d,c,ge.FRAGMENT);let u=n.transform;l(u)&&!$.equals(u,$.IDENTITY)&&Zae(e,t,n,i,o);let{scale:m}=n;l(m)&&m!==1&&C3e(e,t,n,i,o)}function V3e(e,t,n,i,o,r,s){let{emissiveFactor:a,emissiveTexture:c,normalTexture:d,occlusionTexture:u}=e;l(a)&&!h.equals(a,S3e.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",ge.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,ge.FRAGMENT),l(c)&&!s&&Fl(n,t,c,"u_emissiveTexture","EMISSIVE",r)),l(d)&&!s&&Fl(n,t,d,"u_normalTexture","NORMAL",o),l(u)&&!s&&Fl(n,t,u,"u_occlusionTexture","OCCLUSION",i)}function L3e(e,t,n,i,o){let{diffuseTexture:r,diffuseFactor:s,specularGlossinessTexture:a,specularFactor:c,glossinessFactor:d}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,ge.FRAGMENT),l(r)&&!o&&Fl(n,t,r,"u_diffuseTexture","DIFFUSE",i),l(s)&&!se.equals(s,_z.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",ge.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,ge.FRAGMENT)),l(a)&&!o&&Fl(n,t,a,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(c)&&!h.equals(c,_z.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",ge.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,ge.FRAGMENT)),l(d)&&d!==_z.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",ge.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,ge.FRAGMENT))}function R3e(e,t,n,i,o){let{specularTexture:r,specularFactor:s,specularColorTexture:a,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,ge.FRAGMENT),l(r)&&!o&&Fl(n,t,r,"u_specularTexture","SPECULAR",i),l(s)&&s!==Vae.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",ge.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,ge.FRAGMENT)),l(a)&&!o&&Fl(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,Vae.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",ge.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,ge.FRAGMENT))}var Z3e=new h;function G3e(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,ge.FRAGMENT),l(a)&&!o&&Fl(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(s),d=Math.sin(s);n.addUniform("vec3","u_anisotropy",ge.FRAGMENT),t.u_anisotropy=function(){return h.fromElements(c,d,r,Z3e)}}function E3e(e,t,n,i,o){let{clearcoatFactor:r,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:c,clearcoatNormalTexture:d}=e;n.addDefine("USE_CLEARCOAT",void 0,ge.FRAGMENT),l(r)&&r!==Lae.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",ge.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,ge.FRAGMENT)),l(s)&&!o&&Fl(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&r!==Lae.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",ge.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,ge.FRAGMENT)),l(c)&&!o&&Fl(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(d)&&!o&&Fl(n,t,d,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function I3e(e,t,n,i,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,ge.FRAGMENT);let r=e.baseColorTexture;l(r)&&!o&&Fl(n,t,r,"u_baseColorTexture","BASE_COLOR",i);let s=e.baseColorFactor;l(s)&&!se.equals(s,xz.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",ge.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,ge.FRAGMENT));let a=e.metallicRoughnessTexture;l(a)&&!o&&Fl(n,t,a,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let c=e.metallicFactor;l(c)&&c!==xz.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",ge.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,ge.FRAGMENT));let d=e.roughnessFactor;l(d)&&d!==xz.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",ge.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,ge.FRAGMENT))}var WW=Rae;var CGn=T(S(),1);var zc={name:"MetadataPickingPipelineStage",METADATA_PICKING_ENABLED:"METADATA_PICKING_ENABLED",METADATA_PICKING_VALUE_TYPE:"METADATA_PICKING_VALUE_TYPE",METADATA_PICKING_VALUE_STRING:"METADATA_PICKING_VALUE_STRING",METADATA_PICKING_VALUE_COMPONENT_X:"METADATA_PICKING_VALUE_COMPONENT_X",METADATA_PICKING_VALUE_COMPONENT_Y:"METADATA_PICKING_VALUE_COMPONENT_Y",METADATA_PICKING_VALUE_COMPONENT_Z:"METADATA_PICKING_VALUE_COMPONENT_Z",METADATA_PICKING_VALUE_COMPONENT_W:"METADATA_PICKING_VALUE_COMPONENT_W"};zc.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(zc.METADATA_PICKING_VALUE_TYPE,"float",ge.FRAGMENT),i.addDefine(zc.METADATA_PICKING_VALUE_STRING,"0.0",ge.FRAGMENT),i.addDefine(zc.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",ge.FRAGMENT),i.addDefine(zc.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",ge.FRAGMENT),i.addDefine(zc.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",ge.FRAGMENT),i.addDefine(zc.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",ge.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",ge.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${zc.METADATA_PICKING_VALUE_TYPE} value = ${zc.METADATA_PICKING_VALUE_TYPE}(${zc.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${zc.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${zc.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${zc.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${zc.METADATA_PICKING_VALUE_COMPONENT_W};`],ge.FRAGMENT)};var _d=zc;var PGn=T(S(),1);var LGn=T(S(),1),PW=`void morphTargetsStage(inout ProcessedAttributes attributes)
  7239. {
  7240. vec3 positionMC = attributes.positionMC;
  7241. attributes.positionMC = getMorphedPosition(positionMC);
  7242. #ifdef HAS_NORMALS
  7243. vec3 normalMC = attributes.normalMC;
  7244. attributes.normalMC = getMorphedNormal(normalMC);
  7245. #endif
  7246. #ifdef HAS_TANGENTS
  7247. vec3 tangentMC = attributes.tangentMC;
  7248. attributes.tangentMC = getMorphedTangent(tangentMC);
  7249. #endif
  7250. }`;var va={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};va.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,ge.VERTEX),F3e(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,d=c.length;for(let u=0;u<d;u++){let m=c[u],p=m.semantic;p!==Vt.POSITION&&p!==Vt.NORMAL&&p!==Vt.TANGENT||(W3e(e,m,e.attributeIndex,a),e.attributeIndex++)}}A3e(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,ge.VERTEX),n.addVertexLines(PW);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=Tt(s,e.uniformMap)};var X3e={attributeString:void 0,functionId:void 0};function W3e(e,t,n,i){let o=e.shaderBuilder;P3e(e,t,n);let r=v3e(t,X3e);w3e(o,r,i)}function P3e(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:sn.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function v3e(e,t){switch(e.semantic){case Vt.POSITION:t.attributeString="Position",t.functionId=va.FUNCTION_ID_GET_MORPHED_POSITION;break;case Vt.NORMAL:t.attributeString="Normal",t.functionId=va.FUNCTION_ID_GET_MORPHED_NORMAL;break;case Vt.TANGENT:t.attributeString="Tangent",t.functionId=va.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function w3e(e,t,n){let i=t.attributeString,o=`a_target${i}_${n}`,r=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",o),e.addFunctionLines(t.functionId,[r])}function F3e(e){e.addFunction(va.FUNCTION_ID_GET_MORPHED_POSITION,va.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,ge.VERTEX),e.addFunctionLines(va.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(va.FUNCTION_ID_GET_MORPHED_NORMAL,va.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,ge.VERTEX),e.addFunctionLines(va.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(va.FUNCTION_ID_GET_MORPHED_TANGENT,va.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,ge.VERTEX),e.addFunctionLines(va.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function A3e(e){e.addFunctionLines(va.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(va.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(va.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var vW=va;var OGn=T(S(),1);var Gae={name:"PickingPipelineStage"};Gae.process=function(e,t,n){let i=n.context,o=e.runtimeNode,r=e.shaderBuilder,s=e.model,a=o.node.instances;if(e.hasPropertyTable)M3e(e,t,a,i);else if(l(a))N3e(e,i);else{let c=Eae(e),d=i.createPickId(c);s._pipelineResources.push(d),s._pickIds.push(d),r.addUniform("vec4","czm_pickColor",ge.FRAGMENT);let u=e.uniformMap;u.czm_pickColor=function(){return d.color},e.pickId="czm_pickColor"}};function Eae(e,t){let n=e.model;if(l(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},o;if(ar.is3DTiles(n.type)){let r=n.content;o={content:r,primitive:r.tileset,detail:i}}else o={primitive:n,detail:i};return o.id=n.id,l(t)&&(o.instanceId=t),o}function M3e(e,t,n){let i=e.model,o,r,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?o=i.featureTableId:l(n)?(r=qt.getFeatureIdsByLabel(n.featureIds,a),o=r.propertyTableId):(r=qt.getFeatureIdsByLabel(t.featureIds,s),o=r.propertyTableId);let c=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",ge.FRAGMENT);let u=c.batchTexture;e.uniformMap.model_pickTexture=function(){return y(u.pickTexture,u.defaultTexture)},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function N3e(e,t){let n=e.instanceCount,i=new Array(n),o=new Uint8Array(n*4),r=e.model,s=r._pipelineResources;for(let m=0;m<n;m++){let p=Eae(e,m),g=t.createPickId(p);s.push(g),i[m]=g;let f=g.color;o[m*4+0]=B.floatToByte(f.red),o[m*4+1]=B.floatToByte(f.green),o[m*4+2]=B.floatToByte(f.blue),o[m*4+3]=B.floatToByte(f.alpha)}r._pickIds=i;let a=xt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.statistics.addBuffer(a,!1),s.push(a);let d={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(d);let u=e.shaderBuilder;u.addDefine("USE_PICKING",void 0,ge.BOTH),u.addAttribute("vec4","a_pickColor"),u.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var wW=Gae;var hEn=T(S(),1);var HGn=T(S(),1),k3e={ADD:0,REPLACE:1},No=Object.freeze(k3e);var KGn=T(S(),1),FW=`float getPointSizeFromAttenuation(vec3 positionEC) {
  7251. // Variables are packed into a single vector to minimize gl.uniformXXX() calls
  7252. float pointSize = model_pointCloudParameters.x;
  7253. float geometricError = model_pointCloudParameters.y;
  7254. float depthMultiplier = model_pointCloudParameters.z;
  7255. float depth = -positionEC.z;
  7256. return min((geometricError / depth) * depthMultiplier, pointSize);
  7257. }
  7258. #ifdef HAS_POINT_CLOUD_SHOW_STYLE
  7259. float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
  7260. float tiles3d_tileset_time = model_pointCloudParameters.w;
  7261. return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time));
  7262. }
  7263. #endif
  7264. #ifdef HAS_POINT_CLOUD_COLOR_STYLE
  7265. vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
  7266. float tiles3d_tileset_time = model_pointCloudParameters.w;
  7267. return getColorFromStyle(attributes, metadata, tiles3d_tileset_time);
  7268. }
  7269. #endif
  7270. #ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE
  7271. float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
  7272. float tiles3d_tileset_time = model_pointCloudParameters.w;
  7273. return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time));
  7274. }
  7275. #elif defined(HAS_POINT_CLOUD_ATTENUATION)
  7276. float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
  7277. return getPointSizeFromAttenuation(v_positionEC);
  7278. }
  7279. #endif
  7280. #ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING
  7281. float pointCloudBackFaceCullingStage() {
  7282. #if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL)
  7283. // This needs to be computed in eye coordinates so we can't use attributes.normalMC
  7284. return step(-v_normalEC.z, 0.0);
  7285. #else
  7286. return 1.0;
  7287. #endif
  7288. }
  7289. #endif`;var U3e=new se,Xae={name:"PointCloudStylingPipelineStage"};Xae.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,s=o.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,d=!l(a)&&c;if(l(r)&&!d){let x=Y3e(a),_=H3e(r,x);z3e(i,_);let V=K3e(_).indexOf("normalMC")>=0,L=qt.getAttributeBySemantic(t,Vt.NORMAL);if(V&&!L)throw new de("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,ge.VERTEX),_.styleTranslucent&&(e.alphaOptions.pass=Ge.TRANSLUCENT)}let u=o.pointCloudShading;u.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,ge.VERTEX),u.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,ge.VERTEX);let m,p,g;ar.is3DTiles(o.type)&&(p=!0,m=o.content,g=m.tile.refine===No.ADD),i.addUniform("vec4","model_pointCloudParameters",ge.VERTEX),i.addVertexLines(FW);let f=e.uniformMap;f.model_pointCloudParameters=function(){let x=U3e,_=1;p&&(_=g?5:m.tileset.memoryAdjustedScreenSpaceError),x.x=y(u.maximumAttenuation,_),x.x*=n.pixelRatio;let C=D3e(e,t,u,m);x.y=C*u.geometricErrorScale;let V=n.context,L=n.camera.frustum,Z;return n.mode===oe.SCENE2D||L instanceof an?Z=Number.POSITIVE_INFINITY:Z=V.drawingBufferHeight/n.camera.frustum.sseDenominator,x.z=Z,p&&(x.w=m.tileset.timeSinceLoad),x}};var Iae=new h;function D3e(e,t,n,i){if(l(i)){let u=i.tile.geometricError;if(u>0)return u}if(l(n.baseResolution))return n.baseResolution;let o=qt.getAttributeBySemantic(t,Vt.POSITION),r=o.count,s=e.runtimeNode.transform,a=h.subtract(o.max,o.min,Iae);a=M.multiplyByPointAsVector(s,a,Iae);let c=a.x*a.y*a.z;return W.cbrt(c/r)}var B3e={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},O3e={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function Y3e(e){let t=Ye(O3e);if(!l(e))return t;for(let n=0;n<e.length;n++){let o=e[n].properties;for(let r in o)o.hasOwnProperty(r)&&(t[r]=`metadata.${r}`)}return t}var Tz="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function H3e(e,t){let n=B3e,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${Tz})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${Tz})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${Tz})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function z3e(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,ge.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,ge.VERTEX),e.addVertexLines(i));let o=t.pointSizeStyleFunction;l(o)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,ge.VERTEX),e.addVertexLines(o))}function Sz(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function K3e(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return l(t)&&Sz(t,o),l(n)&&Sz(n,o),l(i)&&Sz(i,o),o}var AW=Xae;var VEn=T(S(),1);var pEn=T(S(),1),MW=`void primitiveOutlineStage() {
  7290. v_outlineCoordinates = a_outlineCoordinates;
  7291. }
  7292. `;var gEn=T(S(),1),NW=`void primitiveOutlineStage(inout czm_modelMaterial material) {
  7293. if (!model_showOutline) {
  7294. return;
  7295. }
  7296. float outlineX =
  7297. texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r;
  7298. float outlineY =
  7299. texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r;
  7300. float outlineZ =
  7301. texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r;
  7302. float outlineness = max(outlineX, max(outlineY, outlineZ));
  7303. material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness);
  7304. }
  7305. `;var Wae={name:"PrimitiveOutlinePipelineStage"};Wae.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,ge.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:sn.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",ge.FRAGMENT);let a=h_.createTexture(n.context);o.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",ge.FRAGMENT),o.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",ge.FRAGMENT),o.model_showOutline=function(){return c.showOutline},i.addVertexLines(MW),i.addFragmentLines(NW)};var kW=Wae;var IEn=T(S(),1);var Pae={name:"PrimitiveStatisticsPipelineStage",_countGeometry:vae,_count2DPositions:wae,_countMorphTargetAttributes:Fae,_countMaterialTextures:Aae,_countFeatureIdTextures:Mae,_countBinaryMetadata:Nae};Pae.process=function(e,t,n){let i=e.model,o=i.statistics;vae(o,t),wae(o,e.runtimePrimitive),Fae(o,t),Aae(o,t.material),Mae(o,t.featureIds),Nae(o,i)};function vae(e,t){let n=l(t.indices)?t.indices.count:qt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Fe.POINTS?e.pointsLength+=n:Fe.isTriangles(i)&&(e.trianglesLength+=J3e(i,n));let o=t.attributes,r=o.length;for(let c=0;c<r;c++){let d=o[c];if(l(d.buffer)){let u=l(d.typedArray);e.addBuffer(d.buffer,u)}}let s=t.outlineCoordinates;l(s)&&l(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(l(a)&&l(a.buffer)){let c=l(a.typedArray);e.addBuffer(a.buffer,c)}}function J3e(e,t){switch(e){case Fe.TRIANGLES:return t/3;case Fe.TRIANGLE_STRIP:case Fe.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function wae(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function Fae(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,o=n.length;for(let r=0;r<o;r++){let s=n[r].attributes,a=s.length;for(let c=0;c<a;c++){let d=s[c];l(d.buffer)&&e.addBuffer(d.buffer,i)}}}function Aae(e,t){let n=Q3e(t),i=n.length;for(let o=0;o<i;o++){let r=n[o];l(r)&&l(r.texture)&&e.addTexture(r.texture)}}function Q3e(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return l(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function Mae(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof Tn.FeatureIdTexture){let r=o.textureReader;l(r.texture)&&e.addTexture(r.texture)}}}function Nae(e,t){let n=t.structuralMetadata;l(n)&&(j3e(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!l(i))return;let o=i.length;for(let r=0;r<o;r++){let s=i[r];e.addBatchTexture(s.batchTexture)}}function j3e(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let s=n[o].properties;for(let a in s)if(s.hasOwnProperty(a)){let d=s[a].textureReader;l(d.texture)&&e.addTexture(d.texture)}}}var UW=Pae;var YEn=T(S(),1);var q3e=new M,$3e=new M,kae={name:"SceneMode2DPipelineStage"};kae.process=function(e,t,n){let i=qt.getAttributeBySemantic(t,Vt.POSITION),o=e.shaderBuilder,r=e.model,s=r.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=M.multiplyTransformation(s,a,q3e),d=nOe(e,c,n),u=e.runtimePrimitive;u.boundingSphere2D=d;let m=e.runtimeNode.node.instances;if(l(m))return;if(l(i.typedArray)){let x=rOe(i,c,d,n);u.positionBuffer2D=x,r._modelResources.push(x),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,ge.VERTEX),o.addUniform("mat4","u_modelView2D",ge.VERTEX);let p=M.fromTranslation(d.center,new M),g=n.context,f={u_modelView2D:function(){return M.multiplyTransformation(g.uniformState.view,p,$3e)}};e.uniformMap=Tt(f,e.uniformMap)};var eOe=new h,tOe=new h;function nOe(e,t,n){let i=M.multiplyByPoint(t,e.positionMin,eOe),o=Mi.computeActualEllipsoidPosition(n,i,i),r=M.multiplyByPoint(t,e.positionMax,tOe),s=Mi.computeActualEllipsoidPosition(n,r,r);return ce.fromCornerPoints(o,s,new ce)}var Uae=new h;function iOe(e,t){let n=e.length,i=new Float32Array(n),o=t.quantizedVolumeOffset,r=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=h.fromArray(e,s,Uae),c=h.multiplyComponents(a,r,a),d=h.add(c,o,c);i[s]=d.x,i[s+1]=d.y,i[s+2]=d.z}return i}function oOe(e,t,n,i){let o;l(e.quantization)?o=iOe(e.typedArray,e.quantization):o=e.typedArray.slice();let r=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=o.length,a=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=r;c<s;c+=a){let d=h.fromArray(o,c,Uae);if(isNaN(d.x)||isNaN(d.y)||isNaN(d.z))continue;let u=M.multiplyByPoint(t,d,d),m=Mi.computeActualEllipsoidPosition(i,u,u),p=h.subtract(m,n,m);o[c]=p.x,o[c+1]=p.y,o[c+2]=p.z}return o}function rOe(e,t,n,i){let o=Ye(i);o.mode=oe.COLUMBUS_VIEW;let r=n.center,s=oOe(e,t,r,o),a=xt.createVertexBuffer({context:i.context,typedArray:s,usage:Me.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var DW=kae;var $En=T(S(),1);var zEn=T(S(),1),BW=`void skinningStage(inout ProcessedAttributes attributes)
  7306. {
  7307. mat4 skinningMatrix = getSkinningMatrix();
  7308. mat3 skinningMatrixMat3 = mat3(skinningMatrix);
  7309. vec4 positionMC = vec4(attributes.positionMC, 1.0);
  7310. attributes.positionMC = vec3(skinningMatrix * positionMC);
  7311. #ifdef HAS_NORMALS
  7312. vec3 normalMC = attributes.normalMC;
  7313. attributes.normalMC = skinningMatrixMat3 * normalMC;
  7314. #endif
  7315. #ifdef HAS_TANGENTS
  7316. vec3 tangentMC = attributes.tangentMC;
  7317. attributes.tangentMC = skinningMatrixMat3 * tangentMC;
  7318. #endif
  7319. }`;var g_={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};g_.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,ge.VERTEX),aOe(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,ge.VERTEX),n.addVertexLines(BW);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=Tt(r,e.uniformMap)};function sOe(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===Vt.JOINTS||r.semantic===Vt.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function aOe(e,t){e.addFunction(g_.FUNCTION_ID_GET_SKINNING_MATRIX,g_.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,ge.VERTEX),e.addFunctionLines(g_.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],s=sOe(t);for(i=0;i<=s;i++)for(o=0;o<=3;o++){let c=r[o],d=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(g_.FUNCTION_ID_GET_SKINNING_MATRIX,[d])}e.addFunctionLines(g_.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var OW=g_;var sIn=T(S(),1);var tIn=T(S(),1),YW=`void verticalExaggerationStage(
  7320. inout ProcessedAttributes attributes
  7321. ) {
  7322. // Compute the distance from the camera to the local center of curvature.
  7323. vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0);
  7324. vec2 vertexAzimuth = normalize(vertexPositionENU.xy);
  7325. // Curvature = 1 / radius of curvature.
  7326. float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCurvature);
  7327. float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight;
  7328. // Compute the approximate ellipsoid normal at the vertex position.
  7329. // Uses a circular approximation for the Earth curvature along the geodesic.
  7330. vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz;
  7331. vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC;
  7332. vec3 vertexNormal = normalize(centerToVertex);
  7333. // Estimate the (sine of the) angle between the camera direction and the vertex normal
  7334. float verticalDistance = dot(vertexPositionEC, czm_eyeEllipsoidNormalEC);
  7335. float horizontalDistance = length(vertexPositionEC - verticalDistance * czm_eyeEllipsoidNormalEC);
  7336. float sinTheta = horizontalDistance / (eyeToCenter + verticalDistance);
  7337. bool isSmallAngle = clamp(sinTheta, 0.0, 0.05) == sinTheta;
  7338. // Approximate the change in height above the ellipsoid, from camera to vertex position.
  7339. float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC, vertexNormal);
  7340. float smallAngleVersine = 0.5 * sinTheta * sinTheta;
  7341. float versine = isSmallAngle ? smallAngleVersine : exactVersine;
  7342. float dHeight = dot(vertexPositionEC, vertexNormal) - eyeToCenter * versine;
  7343. float vertexHeight = czm_eyeHeight + dHeight;
  7344. // Transform the approximate vertex normal to model coordinates.
  7345. vec3 vertexNormalMC = (czm_inverseModelView * vec4(vertexNormal, 0.0)).xyz;
  7346. vertexNormalMC = normalize(vertexNormalMC);
  7347. // Compute the exaggeration and apply it along the approximate vertex normal.
  7348. float stretch = u_verticalExaggerationAndRelativeHeight.x;
  7349. float shift = u_verticalExaggerationAndRelativeHeight.y;
  7350. float exaggeration = (vertexHeight - shift) * (stretch - 1.0);
  7351. attributes.positionMC += exaggeration * vertexNormalMC;
  7352. }
  7353. `;var Dae={name:"VerticalExaggerationPipelineStage"},cOe=new D;Dae.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(YW),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,ge.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",ge.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return D.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,cOe)}};var HW=Dae;var SIn=T(S(),1);var uIn=T(S(),1);var Cz={};function lOe(e){let t=Ae.createTypedArray(e,e*2),n=e,i=0;for(let o=0;o<n;o+=3)t[i++]=o,t[i++]=o+1,t[i++]=o+1,t[i++]=o+2,t[i++]=o+2,t[i++]=o;return t}function dOe(e,t){let n=t.length,i=Ae.createTypedArray(e,n*2),o=0;for(let r=0;r<n;r+=3){let s=t[r],a=t[r+1],c=t[r+2];i[o++]=s,i[o++]=a,i[o++]=a,i[o++]=c,i[o++]=c,i[o++]=s}return i}function uOe(e){let t=e-2,n=2+t*4,i=Ae.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=r;return i}function mOe(e,t){let i=t.length-2,o=2+i*4,r=Ae.createTypedArray(e,o),s=0;r[s++]=t[0],r[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],d=t[a+1],u=t[a+2];r[s++]=d,r[s++]=u,r[s++]=u,r[s++]=c}return r}function hOe(e){let t=e-2,n=2+t*4,i=Ae.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=0;return i}function fOe(e,t){let i=t.length-2,o=2+i*4,r=Ae.createTypedArray(e,o),s=0,a=t[0];r[s++]=a,r[s++]=t[1];for(let c=0;c<i;c++){let d=t[c+1],u=t[c+2];r[s++]=d,r[s++]=u,r[s++]=u,r[s++]=a}return r}Cz.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Fe.TRIANGLES)return i?dOe(t,n):lOe(t);if(e===Fe.TRIANGLE_STRIP)return i?mOe(t,n):uOe(t);if(e===Fe.TRIANGLE_FAN)return i?fOe(t,n):hOe(t)};Cz.getWireframeIndicesCount=function(e,t){return e===Fe.TRIANGLES?t*2:e===Fe.TRIANGLE_STRIP||e===Fe.TRIANGLE_FAN?2+(t-2)*4:t};var KC=Cz;var Bae={name:"WireframePipelineStage"};Bae.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,ge.FRAGMENT);let o=e.model,r=pOe(t,e.indices,n);o._pipelineResources.push(r),e.wireframeIndexBuffer=r,o.statistics.addBuffer(r,!1);let a=e.primitiveType,c=e.count;e.primitiveType=Fe.LINES,e.count=KC.getWireframeIndicesCount(a,c)};function pOe(e,t,n){let o=qt.getAttributeBySemantic(e,Vt.POSITION).count,r=n.context.webgl2,s;if(l(t)){let u=t.buffer,m=t.count;l(u)&&r?(s=u.sizeInBytes===m?new Uint8Array(m):Ae.createTypedArray(o,m),u.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=KC.createWireframeIndices(a,o,s),d=Ae.fromSizeInBytes(c.BYTES_PER_ELEMENT);return xt.createIndexBuffer({context:n.context,typedArray:c,usage:Me.STATIC_DRAW,indexDatatype:d})}var zW=Bae;function Oae(e){e=y(e,y.EMPTY_OBJECT);let t=e.primitive,n=e.node,i=e.model;this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.batchLengths=void 0,this.batchOffsets=void 0,this.updateStages=[]}Oae.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,o=this.model,r=o.customShader,s=o.style,a=e.context.webgl2,d=e.mode!==oe.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,u=e.verticalExaggeration!==1&&o.hasVerticalExaggeration,m=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),g=l(r),x=!(g&&l(r.fragmentShaderText))||r.mode!==cb.REPLACE_MATERIAL,_=qt.hasQuantizedAttributes(n.attributes),C=o.debugWireframe&&Fe.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),V=o.pointCloudShading,L=l(V)&&V.attenuation,Z=l(V)&&V.backFaceCulling,G=n.primitiveType===Fe.POINTS&&(l(s)||L||Z),I=o._enableShowOutline&&l(n.outlineCoordinates),v=bOe(o,i,n),P=l(o.classificationType);d&&t.push(DW),t.push(GW),C&&t.push(zW),P&&t.push(mW),m&&t.push(vW),p&&t.push(OW),G&&t.push(AW),_&&t.push(VW),x&&t.push(WW),t.push(_g),t.push(Lu),t.push(_d),v.hasPropertyTable&&(t.push(Sg),t.push(uW),t.push(pW)),u&&t.push(HW),g&&t.push(SW),t.push(IW),o.allowPicking&&t.push(wW),I&&t.push(kW),t.push(dW),t.push(UW)};function bOe(e,t,n){let i;return l(t.instances)&&(i=qt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=qt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var KW=Oae;var nXn=T(S(),1);function Vz(e){e=y(e,y.EMPTY_OBJECT),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],gOe(this)}Object.defineProperties(Vz.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function gOe(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,o=i.length,r=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<o;c++){let d=i[c].index,u=r[d];s.push(u);let m=n[c],p=Yae(u,m,new M);a.push(p)}}function Yae(e,t,n){let i=M.multiplyTransformation(e.transformToRoot,e.transform,n);return n=M.multiplyTransformation(i,t,n),n}Vz.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],o=this.inverseBindMatrices[n];e[n]=Yae(i,o,e[n])}};var JW=Vz;var dXn=T(S(),1);var oXn=T(S(),1);function yOe(){this.pass=void 0,this.alphaCutoff=void 0}var QW=yOe;function xOe(e){this.shaderBuilder=new px,this.model=e,this.uniformMap={},this.alphaOptions=new QW,this.renderStateOptions=Ue.getState(Ue.fromCache({depthTest:{enabled:!0,func:nc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1}var jW=xOe;var TXn=T(S(),1);var mXn=T(S(),1),qW=`void silhouetteStage(inout vec4 color) {
  7354. if(model_silhouettePass) {
  7355. color = czm_gammaCorrect(model_silhouetteColor);
  7356. }
  7357. }`;var fXn=T(S(),1),$W=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) {
  7358. #ifdef HAS_NORMALS
  7359. if(model_silhouettePass) {
  7360. vec3 normal = normalize(czm_normal3D * attributes.normalMC);
  7361. normal.x *= czm_projection[0][0];
  7362. normal.y *= czm_projection[1][1];
  7363. positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z;
  7364. }
  7365. #endif
  7366. }
  7367. `;var B5={name:"ModelSilhouettePipelineStage"};B5.silhouettesLength=0;B5.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++B5.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,ge.BOTH),i.addVertexLines($W),i.addFragmentLines(qW),i.addUniform("vec4","model_silhouetteColor",ge.FRAGMENT),i.addUniform("float","model_silhouetteSize",ge.VERTEX),i.addUniform("bool","model_silhouettePass",ge.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=Tt(o,e.uniformMap),e.hasSilhouette=!0};var e2=B5;var GXn=T(S(),1);var CXn=T(S(),1),t2=`void modelSplitterStage()
  7368. {
  7369. // Don't split when rendering the shadow map, because it is rendered from
  7370. // the perspective of a totally different camera.
  7371. #ifndef SHADOW_MAP
  7372. if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
  7373. if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
  7374. #endif
  7375. }
  7376. `;var O5={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};O5.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,ge.FRAGMENT),i.addFragmentLines(t2);let o={};i.addUniform("float",O5.SPLIT_DIRECTION_UNIFORM_NAME,ge.FRAGMENT),o[O5.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=Tt(o,e.uniformMap)};var n2=O5;var XXn=T(S(),1);function _Oe(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Ye(e.uniformMap),this.alphaOptions=Ye(e.alphaOptions),this.renderStateOptions=Ye(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0}var i2=_Oe;var BXn=T(S(),1);var wXn=T(S(),1);function TOe(e){e=y(e,y.EMPTY_OBJECT),this.lightingModel=y(e.lightingModel,df.UNLIT)}var o2=TOe;function SOe(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=Ye(e.uniformMap),this.alphaOptions=Ye(e.alphaOptions),this.renderStateOptions=Ye(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:qt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=qt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=h.clone(i.min,new h),this.positionMax=h.clone(i.max,new h),this.boundingSphere=ce.fromCornerPoints(this.positionMin,this.positionMax,new ce),this.lightingOptions=new o2,this.pickId=void 0}var r2=SOe;var OWn=T(S(),1);var iWn=T(S(),1);function Rz(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let o=i.classificationType;this._classificationType=o,this._classifiesTerrain=o!==kn.CESIUM_3D_TILE,this._classifies3DTiles=o!==kn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],ROe(this)}function COe(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:bt.KEEP,zFail:bt.DECREMENT_WRAP,zPass:bt.KEEP},backFunction:e,backOperation:{fail:bt.KEEP,zFail:bt.INCREMENT_WRAP,zPass:bt.KEEP},reference:Ot.CESIUM_3D_TILE_MASK,mask:Ot.CESIUM_3D_TILE_MASK},stencilMask:Ot.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:nc.LESS_OR_EQUAL},depthMask:!1}}var VOe={stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},reference:0,mask:Ot.CLASSIFICATION_MASK},stencilMask:Ot.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND},LOe={stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},backFunction:Un.NOT_EQUAL,backOperation:{fail:bt.ZERO,zFail:bt.ZERO,zPass:bt.ZERO},reference:0,mask:Ot.CLASSIFICATION_MASK},stencilMask:Ot.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},Kae=[];function ROe(e){let t=e._command,n=Kae;if(e._useDebugWireframe){t.pass=Ge.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=s2(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,s=r.length;for(let a=0;a<s;a++){let c=r[a];c.count*=2,c.offset*=2}return}let o=e.model.allowPicking;if(e._classifiesTerrain){let r=Ge.TERRAIN_CLASSIFICATION,s=Lz(t,r),a=Hae(t,r);n.length=0,n.push(s,a),e._commandListTerrain=s2(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=zae(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=Ge.CESIUM_3D_TILE_CLASSIFICATION,s=Lz(t,r),a=Hae(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=s2(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=zae(e,n,e._commandList3DTilesPicking))}}function s2(e,t,n){let i=e._runtimePrimitive,o=i.batchLengths,r=i.batchOffsets,s=o.length,a=t.length;for(let c=0;c<s;c++){let d=o[c],u=r[c];for(let m=0;m<a;m++){let p=t[m],g=tt.shallowClone(p);g.count=d,g.offset=u,n.push(g)}}return n}function Lz(e,t){let n=tt.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Ge.TERRAIN_CLASSIFICATION?Un.ALWAYS:Un.EQUAL,o=COe(i);return n.renderState=Ue.fromCache(o),n}function Hae(e,t){let n=tt.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ue.fromCache(VOe),n}var ZOe=[];function zae(e,t,n){let i=Ue.fromCache(LOe),o=t[0],r=t[1],s=tt.shallowClone(o);s.cull=!0,s.pickOnly=!0;let a=tt.shallowClone(r);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=ZOe;return c.length=0,c.push(s,a),s2(e,c,n)}Object.defineProperties(Rz.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=M.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=ce.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});Rz.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){t.push.apply(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrain),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let o=Ge.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=Lz(this._command,o),s=Kae;s.length=0,s.push(r),this._commandListIgnoreShow=s2(this,s,this._commandListIgnoreShow)}t.push.apply(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrainPicking),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTilesPicking)),t};var a2=Rz;var VWn=T(S(),1);function Y5(e){e=y(e,y.EMPTY_OBJECT);let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let o=n.runtimePrimitive;this._runtimePrimitive=o;let r=t.pass===Ge.TRANSLUCENT,a=!o.primitive.material.doubleSided&&!r,c=n.hasSilhouette,d=!r&&!c,u=n.hasSkipLevelOfDetail&&!r,m=c;this._command=t,this._modelMatrix=M.clone(t.modelMatrix),this._boundingVolume=ce.clone(t.boundingVolume),this._modelMatrix2D=new M,this._boundingVolume2D=new ce,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=d,this._needsSkipLevelOfDetailCommands=u,this._needsSilhouetteCommands=m,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,GOe(this)}function lb(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=y(e.is2D,!1),this.derivedCommand2D=void 0}lb.clone=function(e){return new lb({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function GOe(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,o=e._derivedCommands;e._originalCommand=new lb({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new lb({command:wOe(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new lb({command:UOe(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new lb({command:DOe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new lb({command:FOe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new lb({command:AOe(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand))}Object.defineProperties(Y5.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=M.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=ce.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,IOe(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,XOe(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,WOe(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,POe(this))}}});function EOe(e,t){let n=e._modelMatrix;e._modelMatrix2D=M.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=W.sign(n[13])*2*W.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=ce.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function IOe(e){let t=e.shadows,n=_n.castShadows(t),i=_n.receiveShadows(t),o=e._derivedCommands;for(let r=0;r<o.length;++r){let s=o[r];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function XOe(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateBackFaceCulling){let r=o.command,s=Ye(r.renderState,!0);s.cull.enabled=t,r.renderState=Ue.fromCache(s)}}}function WOe(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateCullFace){let r=o.command,s=Ye(r.renderState,!0);s.cull.face=t,r.renderState=Ue.fromCache(s)}}}function POe(e){let t=e.debugShowBoundingVolume,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateDebugShowBoundingVolume){let r=o.command;r.debugShowBoundingVolume=t}}}Y5.prototype.pushCommands=function(e,t){let n=Jae(this,e);n&&!this._has2DCommands&&(vOe(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(EOe(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==Hm.ALL_OPAQUE&&QC(t,this._translucentCommand,n),i===Hm.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||QC(o._backfaceCommands,this._skipLodBackfaceCommand,n),MOe(this,r,n),QC(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){QC(t,this._silhouetteModelCommand,n);return}return QC(t,this._originalCommand,n),t}};Y5.prototype.pushSilhouetteCommands=function(e,t){let n=Jae(this,e);return QC(t,this._silhouetteColorCommand,n),t};function QC(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function Jae(e,t){if(t.mode!==oe.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,o=i.center.y-i.radius,r=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*W.PI;return o<s&&r>s||o<-s&&r>-s}function JC(e,t){if(!l(t))return;let n=lb.clone(t),i=tt.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function vOe(e){JC(e,e._originalCommand),JC(e,e._translucentCommand),JC(e,e._skipLodBackfaceCommand),JC(e,e._skipLodStencilCommand),JC(e,e._silhouetteModelCommand),JC(e,e._silhouetteColorCommand)}function wOe(e){let t=tt.shallowClone(e);t.pass=Ge.TRANSLUCENT;let n=Ye(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=un.ALPHA_BLEND,t.renderState=Ue.fromCache(n),t}function FOe(e,t){let n=t._silhouetteId%255,i=tt.shallowClone(e),o=Ye(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:ie.ALWAYS,backFunction:ie.ALWAYS,reference:n,mask:-1,frontOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.REPLACE},backOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ue.fromCache(o),i}function AOe(e,t){let n=t._silhouetteId%255,i=tt.shallowClone(e),o=Ye(e.renderState,!0);o.cull.enabled=!1,(e.pass===Ge.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Ge.TRANSLUCENT,o.depthMask=!1,o.blending=un.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:ie.NOTEQUAL,backFunction:ie.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.KEEP},backOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.KEEP}};let s=Ye(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Ue.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function MOe(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=NOe(o);if(r!==s){let a=kOe(r),c=Ye(o.renderState,!0);c.stencilTest.reference=a,o.renderState=Ue.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function NOe(e){return(e.renderState.stencilTest.reference&Ot.SKIP_LOD_MASK)>>>Ot.SKIP_LOD_BIT_SHIFT}function kOe(e){return Ot.CESIUM_3D_TILE_MASK|e<<Ot.SKIP_LOD_BIT_SHIFT}function UOe(e){let t=tt.shallowClone(e),n=Ye(e.renderState,!0);n.cull.enabled=!0,n.cull.face=yi.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=Ye(t.uniformMap),o=new D(5,5);return i.u_polygonOffset=function(){return o},t.renderState=Ue.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function DOe(e){let t=tt.shallowClone(e),n=Ye(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Ot.SKIP_LOD_MASK,i.reference=Ot.CESIUM_3D_TILE_MASK,i.frontFunction=Un.GREATER_OR_EQUAL,i.frontOperation.zPass=bt.REPLACE,i.backFunction=Un.GREATER_OR_EQUAL,i.backOperation.zPass=bt.REPLACE,n.stencilMask=Ot.CESIUM_3D_TILE_MASK|Ot.SKIP_LOD_MASK,t.renderState=Ue.fromCache(n),t}var c2=Y5;var RWn=T(S(),1),l2=`precision highp float;
  7377. czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) {
  7378. czm_modelVertexOutput vsOutput;
  7379. vsOutput.positionMC = positionMC;
  7380. vsOutput.pointSize = 1.0;
  7381. return vsOutput;
  7382. }
  7383. void main()
  7384. {
  7385. // Initialize the attributes struct with all
  7386. // attributes except quantized ones.
  7387. ProcessedAttributes attributes;
  7388. initializeAttributes(attributes);
  7389. // Dequantize the quantized ones and add them to the
  7390. // attributes struct.
  7391. #ifdef USE_DEQUANTIZATION
  7392. dequantizationStage(attributes);
  7393. #endif
  7394. #ifdef HAS_MORPH_TARGETS
  7395. morphTargetsStage(attributes);
  7396. #endif
  7397. #ifdef HAS_SKINNING
  7398. skinningStage(attributes);
  7399. #endif
  7400. #ifdef HAS_PRIMITIVE_OUTLINE
  7401. primitiveOutlineStage();
  7402. #endif
  7403. // Compute the bitangent according to the formula in the glTF spec.
  7404. // Normal and tangents can be affected by morphing and skinning, so
  7405. // the bitangent should not be computed until their values are finalized.
  7406. #ifdef HAS_BITANGENTS
  7407. attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC);
  7408. #endif
  7409. FeatureIds featureIds;
  7410. featureIdStage(featureIds, attributes);
  7411. #ifdef HAS_SELECTED_FEATURE_ID
  7412. SelectedFeature feature;
  7413. selectedFeatureIdStage(feature, featureIds);
  7414. // Handle any show properties that come from the style.
  7415. cpuStylingStage(attributes.positionMC, feature);
  7416. #endif
  7417. #if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)
  7418. // The scene mode 2D pipeline stage and instancing stage add a different
  7419. // model view matrix to accurately project the model to 2D. However, the
  7420. // output positions and normals should be transformed by the 3D matrices
  7421. // to keep the data the same for the fragment shader.
  7422. mat4 modelView = czm_modelView3D;
  7423. mat3 normal = czm_normal3D;
  7424. #else
  7425. // These are used for individual model projection because they will
  7426. // automatically change based on the scene mode.
  7427. mat4 modelView = czm_modelView;
  7428. mat3 normal = czm_normal;
  7429. #endif
  7430. // Update the position for this instance in place
  7431. #ifdef HAS_INSTANCING
  7432. // The legacy instance stage is used when rendering i3dm models that
  7433. // encode instances transforms in world space, as opposed to glTF models
  7434. // that use EXT_mesh_gpu_instancing, where instance transforms are encoded
  7435. // in object space.
  7436. #ifdef USE_LEGACY_INSTANCING
  7437. mat4 instanceModelView;
  7438. mat3 instanceModelViewInverseTranspose;
  7439. legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose);
  7440. modelView = instanceModelView;
  7441. normal = instanceModelViewInverseTranspose;
  7442. #else
  7443. instancingStage(attributes);
  7444. #endif
  7445. #ifdef USE_PICKING
  7446. v_pickColor = a_pickColor;
  7447. #endif
  7448. #endif
  7449. Metadata metadata;
  7450. MetadataClass metadataClass;
  7451. MetadataStatistics metadataStatistics;
  7452. metadataStage(metadata, metadataClass, metadataStatistics, attributes);
  7453. #ifdef HAS_VERTICAL_EXAGGERATION
  7454. verticalExaggerationStage(attributes);
  7455. #endif
  7456. #ifdef HAS_CUSTOM_VERTEX_SHADER
  7457. czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC);
  7458. customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics);
  7459. #endif
  7460. // Compute the final position in each coordinate system needed.
  7461. // This returns the value that will be assigned to gl_Position.
  7462. vec4 positionClip = geometryStage(attributes, modelView, normal);
  7463. // This must go after the geometry stage as it needs v_positionWC
  7464. #ifdef HAS_ATMOSPHERE
  7465. atmosphereStage(attributes);
  7466. #endif
  7467. #ifdef ENABLE_CLIPPING_POLYGONS
  7468. modelClippingPolygonsStage(attributes);
  7469. #endif
  7470. #ifdef HAS_SILHOUETTE
  7471. silhouetteStage(attributes, positionClip);
  7472. #endif
  7473. #ifdef HAS_POINT_CLOUD_SHOW_STYLE
  7474. float show = pointCloudShowStylingStage(attributes, metadata);
  7475. #else
  7476. float show = 1.0;
  7477. #endif
  7478. #ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING
  7479. show *= pointCloudBackFaceCullingStage();
  7480. #endif
  7481. #ifdef HAS_POINT_CLOUD_COLOR_STYLE
  7482. v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata);
  7483. #endif
  7484. #ifdef PRIMITIVE_TYPE_POINTS
  7485. #ifdef HAS_CUSTOM_VERTEX_SHADER
  7486. gl_PointSize = vsOutput.pointSize;
  7487. #elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION)
  7488. gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata);
  7489. #else
  7490. gl_PointSize = 1.0;
  7491. #endif
  7492. gl_PointSize *= show;
  7493. #endif
  7494. gl_Position = show * positionClip;
  7495. }
  7496. `;var GWn=T(S(),1),d2=`
  7497. precision highp float;
  7498. czm_modelMaterial defaultModelMaterial()
  7499. {
  7500. czm_modelMaterial material;
  7501. material.diffuse = vec3(0.0);
  7502. material.specular = vec3(1.0);
  7503. material.roughness = 1.0;
  7504. material.occlusion = 1.0;
  7505. material.normalEC = vec3(0.0, 0.0, 1.0);
  7506. material.emissive = vec3(0.0);
  7507. material.alpha = 1.0;
  7508. return material;
  7509. }
  7510. vec4 handleAlpha(vec3 color, float alpha)
  7511. {
  7512. #ifdef ALPHA_MODE_MASK
  7513. if (alpha < u_alphaCutoff) {
  7514. discard;
  7515. }
  7516. #endif
  7517. return vec4(color, alpha);
  7518. }
  7519. SelectedFeature selectedFeature;
  7520. void main()
  7521. {
  7522. #ifdef HAS_MODEL_SPLITTER
  7523. modelSplitterStage();
  7524. #endif
  7525. czm_modelMaterial material = defaultModelMaterial();
  7526. ProcessedAttributes attributes;
  7527. geometryStage(attributes);
  7528. FeatureIds featureIds;
  7529. featureIdStage(featureIds, attributes);
  7530. Metadata metadata;
  7531. MetadataClass metadataClass;
  7532. MetadataStatistics metadataStatistics;
  7533. metadataStage(metadata, metadataClass, metadataStatistics, attributes);
  7534. //========================================================================
  7535. // When not picking metadata START
  7536. #ifndef METADATA_PICKING_ENABLED
  7537. #ifdef HAS_SELECTED_FEATURE_ID
  7538. selectedFeatureIdStage(selectedFeature, featureIds);
  7539. #endif
  7540. #ifndef CUSTOM_SHADER_REPLACE_MATERIAL
  7541. materialStage(material, attributes, selectedFeature);
  7542. #endif
  7543. #ifdef HAS_CUSTOM_FRAGMENT_SHADER
  7544. customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics);
  7545. #endif
  7546. lightingStage(material, attributes);
  7547. #ifdef HAS_SELECTED_FEATURE_ID
  7548. cpuStylingStage(material, selectedFeature);
  7549. #endif
  7550. #ifdef HAS_MODEL_COLOR
  7551. modelColorStage(material);
  7552. #endif
  7553. #ifdef HAS_PRIMITIVE_OUTLINE
  7554. primitiveOutlineStage(material);
  7555. #endif
  7556. vec4 color = handleAlpha(material.diffuse, material.alpha);
  7557. // When not picking metadata END
  7558. //========================================================================
  7559. #else
  7560. //========================================================================
  7561. // When picking metadata START
  7562. vec4 metadataValues = vec4(0.0, 0.0, 0.0, 0.0);
  7563. metadataPickingStage(metadata, metadataClass, metadataValues);
  7564. vec4 color = metadataValues;
  7565. #endif
  7566. // When picking metadata END
  7567. //========================================================================
  7568. #ifdef HAS_CLIPPING_PLANES
  7569. modelClippingPlanesStage(color);
  7570. #endif
  7571. #ifdef ENABLE_CLIPPING_POLYGONS
  7572. modelClippingPolygonsStage();
  7573. #endif
  7574. //========================================================================
  7575. // When not picking metadata START
  7576. #ifndef METADATA_PICKING_ENABLED
  7577. #if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS)
  7578. silhouetteStage(color);
  7579. #endif
  7580. #ifdef HAS_ATMOSPHERE
  7581. atmosphereStage(color, attributes);
  7582. #endif
  7583. #endif
  7584. // When not picking metadata END
  7585. //========================================================================
  7586. out_FragColor = color;
  7587. }
  7588. `;function Qae(){}Qae.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=BOe(e,n,t),o=OOe(e,i,t),r=e.model;return l(r.classificationType)?new a2({primitiveRenderResources:e,command:o}):new c2({primitiveRenderResources:e,command:o})};function BOe(e,t,n){t.addVertexLines(l2),t.addFragmentLines(d2);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function OOe(e,t,n){let i=YOe(e),o=new ti({context:n.context,indexBuffer:i,attributes:e.attributes}),r=e.model;r._pipelineResources.push(o);let s=e.alphaOptions.pass,a=r.sceneGraph,c=n.mode===oe.SCENE3D,d,u;if(!c&&!n.scene3DOnly&&r._projectTo2D)d=M.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new M),u=e.runtimePrimitive.boundingSphere2D;else{let C=c?a._computedModelMatrix:a._computedModelMatrix2D;d=M.multiplyTransformation(C,e.runtimeNode.computedTransform,new M),u=ce.transform(e.boundingSphere,d)}let m=Ye(Ue.fromCache(e.renderStateOptions),!0);m.cull.face=qt.getCullFace(d,e.primitiveType),m=Ue.fromCache(m);let p=l(r.classificationType),g=p?!1:_n.castShadows(r.shadows),f=p?!1:_n.receiveShadows(r.shadows),x=p?void 0:e.pickId;return new tt({boundingVolume:u,modelMatrix:d,uniformMap:e.uniformMap,renderState:m,vertexArray:o,shaderProgram:t,cull:r.cull,pass:s,count:e.count,owner:r,pickId:x,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:r.debugShowBoundingVolume,castShadows:g,receiveShadows:f})}function YOe(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var u2=Qae;function Td(e){e=y(e,y.EMPTY_OBJECT);let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=M.clone(M.IDENTITY),this._computedModelMatrix2D=M.clone(M.IDENTITY),this._axisCorrectionMatrix=qt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new M),this._runtimeArticulations={},HOe(this)}Object.defineProperties(Td.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function HOe(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;jae(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let V=0;V<s;V++){let L=r[V],Z=new KX({articulation:L,sceneGraph:e}),G=Z.name;a[G]=Z}let c=t.nodes,d=c.length;e._runtimeNodes=new Array(d);let m=n.nodes.length,p=M.IDENTITY;for(let V=0;V<m;V++){let L=n.nodes[V],Z=qae(e,L,p);e._rootNodes.push(Z)}let g=t.skins,f=e._runtimeSkins,x=g.length;for(let V=0;V<x;V++){let L=g[V];f.push(new JW({skin:L,sceneGraph:e}))}let _=e._skinnedNodes,C=_.length;for(let V=0;V<C;V++){let L=_[V],Z=e._runtimeNodes[L],I=c[L].skin.index;Z._runtimeSkin=f[I],Z.updateJointMatrices()}e.applyArticulations()}function jae(e,t){let n=e._components,i=e._model;e._computedModelMatrix=M.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=M.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=M.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var zOe=new h;function KOe(e,t){let n=e._computedModelMatrix,i=M.getTranslation(n,zOe);if(!h.equals(i,h.ZERO))e._computedModelMatrix2D=Ft.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=Ft.ellipsoidTo2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=M.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=ce.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function qae(e,t,n){let i=[],o=qt.getNodeTransform(t),r=t.children.length;for(let u=0;u<r;u++){let m=t.children[u],p=M.multiplyTransformation(n,o,new M),g=qae(e,m,p);i.push(g)}let s=new lW({node:t,transform:o,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let u=0;u<a;u++)s.runtimePrimitives.push(new KW({primitive:t.primitives[u],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let d=t.name;if(l(d)){let u=e._model,m=new tW(u,s);u._nodesByName[d]=m}return c}var JOe=new h,QOe=new h,jOe=new h,qOe=new h;Td.prototype.buildDrawCommands=function(e){let t=this._model,n=new jW(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages,o,r,s;for(o=0;o<i.length;o++)i[o].process(n,t,e);let a=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,JOe),c=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,QOe);for(o=0;o<this._runtimeNodes.length;o++){let d=this._runtimeNodes[o];if(!l(d))continue;d.configurePipeline();let u=d.pipelineStages,m=new i2(n,d);for(r=0;r<u.length;r++)u[r].process(m,d.node,e);let p=d.computedTransform;for(r=0;r<d.runtimePrimitives.length;r++){let g=d.runtimePrimitives[r];g.configurePipeline(e);let f=g.pipelineStages,x=new r2(m,g);for(s=0;s<f.length;s++)f[s].process(x,g.primitive,e);g.boundingSphere=ce.clone(x.boundingSphere,new ce);let _=M.multiplyByPoint(p,x.positionMin,jOe),C=M.multiplyByPoint(p,x.positionMax,qOe);h.minimumByComponent(a,_,a),h.maximumByComponent(c,C,c);let V=u2.buildModelDrawCommand(x,e);g.drawCommand=V}}this._boundingSphere=ce.fromCornerPoints(a,c,new ce),this._boundingSphere=ce.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=ce.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=ce.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};Td.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;l(n.color)&&t.push(xg),!l(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(HX),n.isClippingEnabled()&&t.push(jX),n.isClippingPolygonsEnabled()&&t.push(eW),n.hasSilhouette(e)&&t.push(e2),l(n.splitDirection)&&n.splitDirection!==vr.NONE&&t.push(n2),ar.is3DTiles(n.type)&&t.push(UX),i&&t.push(OX))};Td.prototype.update=function(e,t){let n,i,o;for(n=0;n<this._runtimeNodes.length;n++){let r=this._runtimeNodes[n];if(!l(r))continue;for(i=0;i<r.updateStages.length;i++)r.updateStages[i].update(r,this,e);let s=e.mode!==oe.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<r.runtimePrimitives.length;i++){let a=r.runtimePrimitives[i];for(o=0;o<a.updateStages.length;o++)a.updateStages[o].update(a,this)}}};Td.prototype.updateModelMatrix=function(e,t){jae(this,e),t.mode!==oe.SCENE3D&&KOe(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};Td.prototype.updateJointMatrices=function(){let e=this._skinnedNodes,t=e.length;for(let n=0;n<t;n++){let i=e[n];this._runtimeNodes[i].updateJointMatrices()}};function $ae(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let c=0;c<r;c++){let d=t.getChild(c);$ae(e,d,n,i,o)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let d=s[c];i(d,o)}}function H5(e,t,n,i){let o=e._rootNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s],c=e._runtimeNodes[a];$ae(e,c,t,n,i)}}var $Oe={backFaceCulling:void 0};Td.prototype.updateBackFaceCulling=function(e){let t=$Oe;t.backFaceCulling=e,H5(this,!1,eYe,t)};function eYe(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var tYe={shadowMode:void 0};Td.prototype.updateShadows=function(e){let t=tYe;t.shadowMode=e,H5(this,!1,nYe,t)};function nYe(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var iYe={debugShowBoundingVolume:void 0};Td.prototype.updateShowBoundingVolume=function(e){let t=iYe;t.debugShowBoundingVolume=e,H5(this,!1,oYe,t)};function oYe(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var ece=[],rYe={frameState:void 0,hasSilhouette:void 0};Td.prototype.pushDrawCommands=function(e){let t=ece;t.length=0;let n=rYe;n.hasSilhouette=this._model.hasSilhouette(e),n.frameState=e,H5(this,!0,sYe,n),e.commandList.push.apply(e.commandList,t)};function sYe(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=ece,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!o.pick&&s.pushSilhouetteCommands(n,r)}Td.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],o=n[1],r=this._runtimeArticulations[i];l(r)&&r.setArticulationStage(o,t)};Td.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var m2=Td;var S2n=T(S(),1);function jC(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdSet={},this._batchTextureIdMap=new Zt}Object.defineProperties(jC.prototype,{batchTexturesByteLength:{get:function(){let e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values,n=0;for(let i=0;i<e;i++)n+=t[i].byteLength;return n}}});jC.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdSet={},this._batchTextureIdMap.removeAll()};jC.prototype.addBuffer=function(e,t){if(!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};jC.prototype.addTexture=function(e){this._textureIdSet.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes),this._textureIdSet[e._id]=!0};jC.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var h2=jC;var rPn=T(S(),1);var oce=T(B9(),1);var w2n=T(S(),1);var tce={},y_=Uint32Array.BYTES_PER_ELEMENT;tce.parse=function(e,t){t=y(t,0);let n=new Uint8Array(e),i=new DataView(e);t+=y_;let o=i.getUint32(t,!0);if(o!==1)throw new de(`Only Point Cloud tile version 1 is supported. Version ${o} is not.`);t+=y_,t+=y_;let r=i.getUint32(t,!0);if(r===0)throw new de("Feature table must have a byte length greater than zero");t+=y_;let s=i.getUint32(t,!0);t+=y_;let a=i.getUint32(t,!0);t+=y_;let c=i.getUint32(t,!0);t+=y_;let d=Wo(n,t,r);t+=r;let u=new Uint8Array(e,t,s);t+=s;let m,p;a>0&&(m=Wo(n,t,a),t+=a,c>0&&(p=new Uint8Array(e,t,c),t+=c));let g=new Om(d,u),f=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=f,!l(f))throw new de("Feature table global property: POINTS_LENGTH must be defined");let x=g.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(x)&&(x=h.unpack(x));let _=aYe(g,m);if(_.rtcCenter=x,_.pointsLength=f,!_.hasPositions){let C=cYe(g);_.positions=C,_.hasPositions=_.hasPositions||l(C)}if(!_.hasPositions)throw new de("Either POSITION or POSITION_QUANTIZED must be defined.");if(!_.hasNormals){let C=dYe(g);_.normals=C,_.hasNormals=_.hasNormals||l(C)}if(!_.hasColors){let C=lYe(g);_.colors=C,_.hasColors=_.hasColors||l(C),_.hasConstantColor=l(_.constantColor),_.isTranslucent=l(C)&&C.isTranslucent}if(!_.hasBatchIds){let C=uYe(g);_.batchIds=C,_.hasBatchIds=_.hasBatchIds||l(C)}if(_.hasBatchIds){let C=g.getGlobalProperty("BATCH_LENGTH");if(!l(C))throw new de("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");_.batchLength=C}return l(p)&&(p=new Uint8Array(p),_.batchTableJson=m,_.batchTableBinary=p),_};function aYe(e,t){let n=e.json,i,o,r,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(r=a.properties);let c,d,u,m,p;if(l(s)){o=s.properties;let f=s.byteOffset,x=s.byteLength;if(!l(o)||!l(f)||!l(x))throw new de("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(f,f+x),c=l(o.POSITION),d=l(o.RGB)||l(o.RGBA),u=l(o.NORMAL),m=l(o.BATCH_ID),p=l(o.RGBA)}let g;return l(i)&&(g={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:Tt(o,r),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:d,isTranslucent:p,hasNormals:u,hasBatchIds:m}}function cYe(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",Q.FLOAT,3),{name:Vt.POSITION,semantic:Vt.POSITION,typedArray:n,isQuantized:!1,componentDatatype:Q.FLOAT,type:sn.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",Q.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Q.FLOAT,3);if(!l(i))throw new de("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Q.FLOAT,3);if(!l(r))throw new de("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:Vt.POSITION,semantic:Vt.POSITION,typedArray:n,isQuantized:!0,componentDatatype:Q.FLOAT,type:sn.VEC3,quantizedRange:o,quantizedVolumeOffset:h.unpack(r),quantizedVolumeScale:h.unpack(i),quantizedComponentDatatype:Q.UNSIGNED_SHORT,quantizedType:sn.VEC3}}}function lYe(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",Q.UNSIGNED_BYTE,4),{name:Vt.COLOR,semantic:Vt.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.UNSIGNED_BYTE,type:sn.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",Q.UNSIGNED_BYTE,3),{name:"COLOR",semantic:Vt.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.UNSIGNED_BYTE,type:sn.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",Q.UNSIGNED_SHORT,1),{name:"COLOR",semantic:Vt.COLOR,setIndex:0,typedArray:n,componentDatatype:Q.FLOAT,type:sn.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",Q.UNSIGNED_BYTE,4),o=i[3],r=B.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:Vt.COLOR,semantic:Vt.COLOR,setIndex:0,constantColor:r,componentDatatype:Q.FLOAT,type:sn.VEC4,isQuantized:!1,isTranslucent:s}}}function dYe(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",Q.FLOAT,3),{name:Vt.NORMAL,semantic:Vt.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:Q.FLOAT,type:sn.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",Q.UNSIGNED_BYTE,2),{name:Vt.NORMAL,semantic:Vt.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:sn.VEC2,quantizedComponentDatatype:Q.UNSIGNED_BYTE,componentDatatype:Q.FLOAT,type:sn.VEC3}}function uYe(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",Q.UNSIGNED_SHORT,1);return{name:Vt.FEATURE_ID,semantic:Vt.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:Q.fromTypedArray(n),type:sn.SCALAR}}}var x_=tce;var mYe=Tn.Components,hYe=Tn.Scene,fYe=Tn.Node,pYe=Tn.Primitive,bYe=Tn.Attribute,nce=Tn.Quantization,gYe=Tn.FeatureIdAttribute,yYe=Tn.Material,xYe=Tn.MetallicRoughness;function Cg(e){e=y(e,y.EMPTY_OBJECT);let t=e.arrayBuffer,n=y(e.byteOffset,0);this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=y(e.loadAttributesFor2D,!1),this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=yt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=M.IDENTITY}l(Object.create)&&(Cg.prototype=Object.create(Hi.prototype),Cg.prototype.constructor=Cg);Object.defineProperties(Cg.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});Cg.prototype.load=function(){if(l(this._promise))return this._promise;this._parsedContent=x_.parse(this._arrayBuffer,this._byteOffset),this._state=yt.PROCESSING,this._promise=Promise.resolve(this)};Cg.prototype.process=function(e){if(l(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===yt.READY)return!0;if(this._state===yt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=_Ye(this,e.context)}return!1};function _Ye(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=Op.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&TYe(e,i,r),WYe(e,t),e._state=yt.READY,e}).catch(function(r){e.unload(),e._state=yt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function TYe(e,t,n){e._state=yt.READY;let i=e._parsedContent,o;if(l(n.POSITION)){if(o={name:"POSITION",semantic:Vt.POSITION,typedArray:n.POSITION.array,componentDatatype:Q.FLOAT,type:sn.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,d=h.fromElements(c,c,c),u=h.unpack(a.minValues),m=(1<<a.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=m,o.quantizedVolumeOffset=u,o.quantizedVolumeScale=d,o.quantizedComponentDatatype=m<=255?Q.UNSIGNED_BYTE:Q.UNSIGNED_SHORT,o.quantizedType=sn.VEC3}i.positions=o}if(l(n.NORMAL)){if(o={name:"NORMAL",semantic:Vt.NORMAL,typedArray:n.NORMAL.array,componentDatatype:Q.FLOAT,type:sn.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;o.quantizedRange=a,o.octEncoded=!0,o.octEncodedZXY=!0,o.quantizedComponentDatatype=Q.UNSIGNED_BYTE,o.quantizedType=sn.VEC2}i.normals=o}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:Vt.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:Q.UNSIGNED_BYTE,type:sn.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:Vt.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:Q.UNSIGNED_BYTE,type:sn.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:Vt.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:Q.fromTypedArray(a),type:sn.SCALAR}}let r=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];l(r)||(r={}),i.hasDracoBatchTable=!0;let d=c.data;r[a]={byteOffset:d.byteOffset,type:SYe(d.componentsPerAttribute),componentType:CYe(d.componentDatatype),typedArray:c.array}}i.batchTableJson=r}function SYe(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function CYe(e){switch(e){case ie.BYTE:return"BYTE";case ie.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case ie.SHORT:return"SHORT";case ie.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case ie.INT:return"INT";case ie.UNSIGNED_INT:return"UNSIGNED_INT";case ie.DOUBLE:return"DOUBLE";case ie.FLOAT:return"FLOAT"}}function f2(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new nce,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new nce;let a=t.quantizedRange;o.normalizationRange=a,o.quantizedVolumeOffset=h.ZERO;let c=t.quantizedVolumeScale;o.quantizedVolumeDimensions=c,o.quantizedVolumeStepSize=h.divideByScalar(c,a,new h),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new bYe;if(r.name=t.name,r.semantic=t.semantic,r.setIndex=t.setIndex,r.componentDatatype=t.componentDatatype,r.type=t.type,r.normalized=y(t.normalized,!1),r.min=t.min,r.max=t.max,r.quantization=o,t.isRGB565&&(i=wn.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);r.constant=B.pack(t.constantColor,a)}else{let a=xt.createVertexBuffer({typedArray:i,context:n,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),r.buffer=a}let s=e._loadAttributesFor2D;return r.semantic===Vt.POSITION&&s&&(r.typedArray=i),r}var ice,z5;function VYe(e){if(!l(z5)){ice=new oce.default(0),z5=new Array(e);for(let t=0;t<e;++t)z5[t]=ice.random()}return z5}var LYe=new h,RYe=new h,ZYe=new h;function GYe(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=VYe(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,LYe),d=h.fromElements(a,a,a,RYe),u,m,p;if(e.isQuantized)c=h.ZERO,d=e.quantizedVolumeScale;else for(u=0;u<o;++u)m=Math.floor(r[u]*i),p=h.unpack(t,m*3,ZYe),h.minimumByComponent(c,p,c),h.maximumByComponent(d,p,d);e.min=h.clone(c),e.max=h.clone(d)}var EYe={name:Vt.COLOR,semantic:Vt.COLOR,setIndex:0,constantColor:B.DARKGRAY,componentDatatype:Q.FLOAT,type:sn.VEC4,isQuantized:!1,isTranslucent:!1};function IYe(e,t,n){let i=[],o,r=t.positions;return l(r)&&(GYe(r),o=f2(e,r,n),o.count=t.pointsLength,i.push(o)),l(t.normals)&&(o=f2(e,t.normals,n),i.push(o)),l(t.colors)?(o=f2(e,t.colors,n),i.push(o)):(o=f2(e,EYe,n),i.push(o)),l(t.batchIds)&&(o=f2(e,t.batchIds,n),i.push(o)),i}function XYe(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableBinary,r=!l(e.batchIds);if(l(o)||e.hasDracoBatchTable){let s=y(n,i);return ob({count:s,batchTable:e.batchTableJson,binaryBody:o,parseAsPropertyAttributes:r,customAttributeOutput:t})}return new Us({schema:{},propertyTables:[]})}function WYe(e,t){let n=e._parsedContent,i=new xYe;i.metallicFactor=0,i.roughnessFactor=.9;let o=new yYe;o.metallicRoughness=i;let r=n.colors;l(r)&&r.isTranslucent&&(o.alphaMode=af.BLEND);let s=!l(n.normals);o.unlit=s;let a=new pYe;if(a.attributes=IYe(e,n,t),a.primitiveType=Fe.POINTS,a.material=o,l(n.batchIds)){let g=new gYe;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let c=new fYe;c.index=0,c.primitives=[a];let d=new hYe;d.nodes=[c],d.upAxis=Xo.Z,d.forwardAxis=Xo.X;let u=new mYe;u.scene=d,u.nodes=[c];let m=[];u.structuralMetadata=XYe(n,m),m.length>0&&PYe(e,a,m,t),l(n.rtcCenter)&&(u.transform=M.multiplyByTranslation(u.transform,n.rtcCenter,u.transform));let p=n.positions;l(p)&&p.isQuantized&&(u.transform=M.multiplyByTranslation(u.transform,p.quantizedVolumeOffset,u.transform)),e._components=u,e._parsedContent=void 0,e._arrayBuffer=void 0}function PYe(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=xt.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Me.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,o.push(a)}t.propertyAttributeIds=[0]}Cg.prototype.unload=function(){let e=this._buffers;for(let t=0;t<e.length;t++)e[t].destroy();e.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0};var p2=Cg;var LPn=T(S(),1);var vYe=new h,wYe=new h,FYe=new h,AYe=new M,MYe=new M,NYe=new M,kYe=new he,UYe=new ce;function qC(e,t,n,i,o,r,s){if(!e._ready||n.mode===oe.MORPHING)return;let a=Number.MAX_VALUE,c=e.sceneGraph,d=c._runtimeNodes;for(let u=0;u<d.length;u++){let m=d[u],p=m.node,g=M.clone(m.computedTransform,AYe),f=M.clone(c.computedModelMatrix,MYe),x=p.instances;l(x)&&x.transformInWorldSpace&&(f=M.multiplyTransformation(e.modelMatrix,c.components.transform,f),g=M.multiplyTransformation(c.axisCorrectionMatrix,m.computedTransform,g));let _=M.multiplyTransformation(f,g,NYe);n.mode!==oe.SCENE3D&&(_=Ft.basisTo2D(n.mapProjection,_,_));let C=[];if(l(x)){let L=x.attributes[0].count,Z=x.attributes[0].componentDatatype,G=12,I=m.transformsTypedArray;if(!l(I)){let v=m.instancingTransformsBuffer;l(v)&&n.context.webgl2&&(I=Q.createTypedArray(Z,L*G),v.getBufferData(I))}if(l(I))for(let v=0;v<L;v++){let P=v*G,w=new M(I[P],I[P+1],I[P+2],I[P+3],I[P+4],I[P+5],I[P+6],I[P+7],I[P+8],I[P+9],I[P+10],I[P+11],0,0,0,1);x.transformInWorldSpace?(M.multiplyTransformation(w,g,w),M.multiplyTransformation(f,w,w)):M.multiplyTransformation(w,_,w),C.push(w)}}C.length===0&&C.push(_);let V=m.runtimePrimitives.length;for(let L=0;L<V;L++){let Z=m.runtimePrimitives[L],G=Z.primitive;if(l(Z.boundingSphere)&&!l(x)){let J=ce.transform(Z.boundingSphere,_,UYe),te=qn.raySphere(t,J);if(!l(te))continue}let I=qt.getAttributeBySemantic(G,Vt.POSITION),v=I.byteOffset,P=I.byteStride,w=I.count;if(!l(G.indices))continue;let F=G.indices.typedArray;if(!l(F)){let J=G.indices.buffer,te=G.indices.count,z=G.indices.indexDatatype;l(J)&&n.context.webgl2&&(z===Ae.UNSIGNED_BYTE?F=new Uint8Array(te):z===Ae.UNSIGNED_SHORT?F=new Uint16Array(te):z===Ae.UNSIGNED_INT&&(F=new Uint32Array(te)),J.getBufferData(F))}let b=I.typedArray,R=I.componentDatatype,E=I.type,X=I.quantization;l(X)&&(R=I.quantization.componentDatatype,E=I.quantization.type);let A=sn.getNumberOfComponents(E),N=Q.getSizeInBytes(R),O=!l(b)&&l(P)&&P!==A*N,U=A,Y=0;O&&(U=P/N,Y=v/N);let k=w*U;if(!l(b)){let J=I.buffer;l(J)&&n.context.webgl2&&(b=Q.createTypedArray(R,k),J.getBufferData(b,O?0:v,0,k)),X&&I.normalized&&(b=wn.dequantize(b,R,E,w))}if(!l(F)||!l(b))return;r=y(r,ne.default),i=y(i,1),o=y(o,0);let H=F.length;for(let J=0;J<H;J+=3){let te=F[J],z=F[J+1],q=F[J+2];for(let ee of C){let fe=Zz(b,te,Y,U,X,ee,i,o,r,vYe),_e=Zz(b,z,Y,U,X,ee,i,o,r,wYe),le=Zz(b,q,Y,U,X,ee,i,o,r,FYe),ye=qn.rayTriangleParametric(t,fe,_e,le,y(e.backFaceCulling,!0));l(ye)&&ye<a&&ye>=0&&(a=ye)}}}}if(a!==Number.MAX_VALUE){if(s=pn.getPoint(t,a,s),n.mode!==oe.SCENE3D){h.fromElements(s.y,s.z,s.x,s);let u=n.mapProjection,m=u.ellipsoid,p=u.unproject(s,kYe);m.cartographicToCartesian(p,s)}return s}}function Zz(e,t,n,i,o,r,s,a,c,d){let u=n+t*i;if(d.x=e[u],d.y=e[u+1],d.z=e[u+2],l(o))if(o.octEncoded){if(d=wn.octDecodeInRange(d,o.normalizationRange,d),o.octEncodedZXY){let m=d.x;d.x=d.z,d.z=d.y,d.y=m}}else d=h.multiplyComponents(d,o.quantizedVolumeStepSize,d),d=h.add(d,o.quantizedVolumeOffset,d);return d=M.multiplyByPoint(r,d,d),s!==1&&_r.getPosition(d,c,s,a,d),d}function ro(e){e=y(e,y.EMPTY_OBJECT),this._loader=e.loader,this._resource=e.resource,this.type=y(e.type,ar.GLTF),this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this._modelMatrix=M.clone(this.modelMatrix),this._scale=y(e.scale,1),this._minimumPixelSize=y(e.minimumPixelSize,0),this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=$.clone($.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new AX(this),this._clampAnimations=y(e.clampAnimations,!0),this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=B.clone(e.color),this._colorBlendMode=y(e.colorBlendMode,lc.HIGHLIGHT),this._colorBlendAmount=y(e.colorBlendAmount,.5);let t=y(e.silhouetteColor,B.RED);this._silhouetteColor=B.clone(t),this._silhouetteSize=y(e.silhouetteSize,0),this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=y(e.cull,!0),this._opaquePass=y(e.opaquePass,Ge.OPAQUE),this._allowPicking=y(e.allowPicking,!0),this._show=y(e.show,!0),this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=y(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new ce,this._initialRadius=void 0,this._heightReference=y(e.heightReference,Qe.NONE),this._heightDirty=this._heightReference!==Qe.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=y(e.enableVerticalExaggeration,!0),this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0;let o=e.scene;l(o)&&l(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;let r=new lf(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?hs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=M.clone(M.IDENTITY);let a=e.clippingPolygons;l(a)&&a.owner===void 0?km.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new Ux,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new jp(e.environmentMapOptions);jp.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=y(e.backFaceCulling,!0),this._backFaceCullingDirty=!1,this._shadows=y(e.shadows,_n.ENABLED),this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this._enableShowOutline=y(e.enableShowOutline,!0),this._debugWireframe=y(e.debugWireframe,!1),this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===ar.GLTF&&St("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let d=e.credit;typeof d=="string"&&(d=new Et(d)),this._credits=[],this._credit=d,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._showCreditsOnScreenDirty=!0,this._splitDirection=y(e.splitDirection,vr.NONE),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,B.BLACK),this._classificationType=e.classificationType,this._statistics=new h2,this._sceneMode=void 0,this._projectTo2D=y(e.projectTo2D,!1),this._enablePick=y(e.enablePick,!1),this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=y(e.ignoreCommands,!1),this._errorEvent=new be,this._readyEvent=new be,this._texturesReadyEvent=new be,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function Gz(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function DYe(e,t){let n=e._featureTables,i=t.propertyTables,o=i.length;for(let r=0;r<o;r++){let s=i[r],a=new kX({model:e,propertyTable:s});n.push(a)}return n}function BYe(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,o,r,s,a;for(o=0;o<e.nodes.length;o++)if(a=e.nodes[o],l(a.instances)&&(s=qt.getFeatureIdsByLabel(a.instances.featureIds,i),l(s)&&l(s.propertyTableId)))return s.propertyTableId;for(o=0;o<e.nodes.length;o++)for(a=e.nodes[o],r=0;r<a.primitives.length;r++){let c=a.primitives[r],d=qt.getFeatureIdsByLabel(c.featureIds,n);if(l(d))return d.propertyTableId}if(t._featureTables.length===1)return 0}function Xz(e,t){if(!l(e)&&!l(t))return!1;if(l(e)!==l(t))return!0;let n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}Object.defineProperties(ro.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return y(this._loader.incrementallyLoadTextures,!1)}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=At.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}},color:{get:function(){return this._color},set:function(e){Xz(e,this._color)&&this.resetDrawCommands(),this._color=B.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!B.equals(e,this._silhouetteColor)){let t=Xz(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=B.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return ace(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===ar.GLTF&&St("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(hs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(km.setOwner(e,this,"_clippingPolygons"),this.resetDrawCommands())}},enableVerticalExaggeration:{get:function(){return this._enableVerticalExaggeration},set:function(e){e!==this._enableVerticalExaggeration&&this.resetDrawCommands(),this._enableVerticalExaggeration=e}},hasVerticalExaggeration:{get:function(){return this._hasVerticalExaggeration}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=h.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},environmentMapManager:{get:function(){return this._environmentMapManager},set:function(e){e!==this.environmentMapManager&&(jp.setOwner(e,this,"_environmentMapManager"),this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});ro.prototype.getNode=function(e){return this._nodesByName[e]};ro.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};ro.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};ro.prototype.getExtension=function(e){return this._loader.components.extensions[e]};ro.prototype.makeStyleDirty=function(){this._styleDirty=!0};ro.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var OYe=new M,YYe=new $,HYe=new M;ro.prototype.update=function(e){let t=!1;try{t=zYe(this,e)}catch(n){if(!this._loader.incrementallyLoadTextures&&n.name==="TextureError")Gz(this,n);else{let i=qt.getError("model",this._resource,n);Gz(this,i)}}if(KYe(this,e),JYe(this,e),QYe(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!l(n)){if(this._loader.isUnloaded())return;let r=qt.getError("model",this._resource,new de("Failed to load model."));Gz(r),this._rejectLoad=this._rejectLoad&&this._rejectLoad(r)}let i=n.structuralMetadata;l(i)&&i.propertyTableCount>0&&DYe(this,i);let o=new m2({model:this,modelComponents:n});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===oe.MORPHING)){if(jYe(this),qYe(this),$Ye(this,e),eHe(this),tHe(this,e),nHe(this,e),iHe(this,e),oHe(this,e),rHe(this,e),sHe(this,e),aHe(this,e),this._defaultTexture=e.context.defaultTexture,cHe(this,e),lHe(this,e),dHe(this),uHe(this,e),pHe(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this)});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this)),hHe(this),bHe(this,e),gHe(this),yHe(this,e)}};function zYe(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function KYe(e,t){l(e._customShader)&&e._customShader.update(t)}function JYe(e,t){let n=e._environmentMapManager,i=t.passes.pick||t.passes.pickVoxel;e._ready&&n.owner===e&&!i&&(n.position=e._boundingSphere.center,n.shouldUpdate=!l(e._imageBasedLighting.sphericalHarmonicCoefficients)||!l(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function QYe(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function jYe(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=BYe(t,e),e._styleDirty=!0,e.resetDrawCommands())}function qYe(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function $Ye(e,t){let n=e._featureTables,i=n.length,o=!1;for(let r=0;r<i;r++)n[r].update(t),n[r].styleCommandsNeededDirty&&(o=!0);o&&sce(e)}function sce(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=Hm.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function eHe(e){let t=e.pointCloudShading;t.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=t.attenuation),t.backFaceCulling!==e._pointCloudBackFaceCulling&&(e.resetDrawCommands(),e._pointCloudBackFaceCulling=t.backFaceCulling)}function tHe(e,t){e._silhouetteDirty&&(cce(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function nHe(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function iHe(e,t){let n=0;e.isClippingEnabled()&&(e._clippingPlanes.owner===e&&e._clippingPlanes.update(t),n=e._clippingPlanes.clippingPlanesState),n!==e._clippingPlanesState&&(e.resetDrawCommands(),e._clippingPlanesState=n)}function oHe(e,t){let n=0;e.isClippingPolygonsEnabled()&&(e._clippingPolygons.owner===e&&(e._clippingPolygons.update(t),e._clippingPolygons.queueCommands(t)),n=e._clippingPolygons.clippingPolygonsState),n!==e._clippingPolygonsState&&(e.resetDrawCommands(),e._clippingPolygonsState=n)}function rHe(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function sHe(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function aHe(e,t){if(e.enableVerticalExaggeration){let n=t.verticalExaggeration!==1;e.hasVerticalExaggeration!==n&&(e.resetDrawCommands(),e._hasVerticalExaggeration=n)}else e.hasVerticalExaggeration&&(e.resetDrawCommands(),e._hasVerticalExaggeration=!1)}function cHe(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function lHe(e,t){M.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=M.clone(e.modelMatrix,e._modelMatrix))}var Vg=new h,Ez=new he;function dHe(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!l(t)||e.heightReference===Qe.NONE){e._clampedModelMatrix=void 0;return}let n=y(t.ellipsoid,ne.default),i=e.modelMatrix;Vg.x=i[12],Vg.y=i[13],Vg.z=i[14];let o=n.cartesianToCartographic(Vg);l(e._clampedModelMatrix)||(e._clampedModelMatrix=M.clone(i,new M)),e._removeUpdateHeightCallback=t.updateHeight(o,rce(e,n,o),e.heightReference);let r=t.getHeight(o,e.heightReference);if(l(r)){let s=rce(e,n,o);he.clone(o,Ez),Ez.height=r,s(Ez)}e._heightDirty=!1,e._updateModelMatrix=!0}function uHe(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;ace(e,n),mHe(e,n,t)}function ace(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=h.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=ce.transform(e._boundingSphere,t,e._boundingSphere)}function mHe(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);M.getTranslation(t,Vg),e._sceneMode!==oe.SCENE3D&&Mi.computeActualEllipsoidPosition(n,Vg,Vg);let s=e._boundingSphere.radius,a=xHe(Vg,s,n),c=1/a;Math.min(c*(2*s),r)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function hHe(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let o=0;o<i;++o)n[o].object.id=t}var fHe=new $(1,0,0,0,0,1,0,-1,0);function pHe(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=y(e.referenceMatrix,n),o=t.context,r=YYe,s=OYe;if(s=M.multiply(o.uniformState.view3D,i,s),r=M.getRotation(s,r),r=$.transpose(r,r),e._iblReferenceFrameMatrix=$.multiply(fHe,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=HYe;a=M.multiply(o.uniformState.view3D,i,a),a=M.multiply(a,e._clippingPlanes.modelMatrix,a),e._clippingPlanesMatrix=M.inverseTranspose(a,e._clippingPlanesMatrix)}}function bHe(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let o=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(o,t),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let i=!1;l(e.classificationType)||(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function gHe(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let s=Et.clone(e._credit);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}let n=e._resourceCredits,i=n.length;for(let s=0;s<i;s++){let a=Et.clone(n[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}let o=e._gltfCredits,r=o.length;for(let s=0;s<r;s++){let a=Et.clone(o[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function yHe(e,t){let n=THe(e,t),i=e.isInvisible(),o=e.hasSilhouette(t),r=e._show&&e._computedScale!==0&&n&&(!i||o),s=t.passes,a=s.render||s.pick&&e.allowPicking;r&&!e._ignoreCommands&&a&&(SHe(e,t),e._sceneGraph.pushDrawCommands(t))}var Iz=new ce;function xHe(e,t,n){return Iz.center=e,Iz.radius=t,n.camera.getPixelSize(Iz,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var K5=new h;function rce(e,t,n){return function(i){JS(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,K5);let o=e._clampedModelMatrix;M.clone(e.modelMatrix,o),o[12]=K5.x,o[13]=K5.y,o[14]=K5.z,e._heightDirty=!0}}var _He=new h;function THe(e,t){let n=e.distanceDisplayCondition;if(!l(n))return!0;let i=n.near*n.near,o=n.far*n.far,r;if(t.mode===oe.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=a*a}else{let s=M.getTranslation(e.modelMatrix,_He);Mi.computeActualEllipsoidPosition(t,s,s),r=h.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function SHe(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}ro.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};ro.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function cce(e){return e.context.stencilBuffer}ro.prototype.hasSilhouette=function(e){return cce(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};ro.prototype.hasSkipLevelOfDetail=function(e){if(!ar.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};ro.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};ro.prototype.pick=function(e,t,n,i,o){return qC(this,e,t,n,i,o)};ro.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};ro.prototype.isDestroyed=function(){return!1};ro.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let r=t.length;for(let s=0;s<r;s++)t[s].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0;let i=this._clippingPolygons;l(i)&&!i.isDestroyed()&&i.owner===this&&i.destroy(),this._clippingPolygons=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0;let o=this._environmentMapManager;!o.isDestroyed()&&o.owner===this&&o.destroy(),this._environmentMapManager=void 0,me(this)};ro.prototype.destroyPipelineResources=function(){let e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0};ro.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};ro.fromGltfAsync=async function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.url,e.gltf),n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},i=y(e.basePath,""),o=Ee.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=o,n.gltfResource=o):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=o,n.gltfResource=o):n.gltfResource=Ee.createIfNeeded(t);let r=new eb(n),a=l(e.content)?ar.TILE_GLTF:ar.GLTF,c=n.gltfResource,d=b2(r,a,e);d.resource=c,d.environmentMapOptions=e.environmentMapOptions;try{await r.load()}catch(g){throw r.destroy(),qt.getError("model",c,g)}let u=e.gltfCallback;l(u)&&u(r.gltfJson);let m=new ro(d),p=m._resource.credits;if(l(p)){let g=p.length;for(let f=0;f<g;f++)m._resourceCredits.push(Et.clone(p[f]))}return m};ro.fromB3dm=async function(e){let t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},n=new GX(t);try{await n.load();let i=b2(n,ar.TILE_B3DM,e);return new ro(i)}catch(i){throw n.destroy(),i}};ro.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new p2(t);try{await n.load();let i=b2(n,ar.TILE_PNTS,e);return new ro(i)}catch(i){throw n.destroy(),i}};ro.fromI3dm=async function(e){let t={i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},n=new XX(t);try{await n.load();let i=b2(n,ar.TILE_I3DM,e);return new ro(i)}catch(i){throw n.destroy(),i}};ro.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new EX(t),i=b2(n,ar.TILE_GEOJSON,e);return new ro(i)};var CHe=new B;ro.prototype.applyColorAndShow=function(e){let t=B.clone(this._color,CHe),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):B.clone(B.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,Xz(t,this._color)&&this.resetDrawCommands()};ro.prototype.applyStyle=function(e){let t=this.type===ar.TILE_PNTS,n=l(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,o=l(i)&&l(i[0]);if(t&&(!n||o)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),sce(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function b2(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,enableVerticalExaggeration:n.enableVerticalExaggeration,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,clippingPolygons:n.clippingPolygons,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,enablePick:n.enablePick,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject}}var zm=ro;function fs(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(fs.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return l(t)&&l(t[n])?t[n].featuresLength:0}},pointsLength:{get:function(){return this._model.statistics.pointsLength}},trianglesLength:{get:function(){return this._model.statistics.trianglesLength}},geometryByteLength:{get:function(){return this._model.statistics.geometryByteLength}},texturesByteLength:{get:function(){return this._model.statistics.texturesByteLength}},batchTableByteLength:{get:function(){let e=this._model.statistics;return e.propertyTablesByteLength+e.batchTexturesByteLength}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;if(l(t)&&l(t[n]))return t[n]}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});fs.prototype.getExtension=function(e){return this._model.getExtension(e)};fs.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};fs.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};fs.prototype.applyDebugSettings=function(e,t){t=e?t:B.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};fs.prototype.applyStyle=function(e){this._model.style=e};fs.prototype.update=function(e,t){let n=this._model,i=this._tile;n.colorBlendAmount=e.colorBlendAmount,n.colorBlendMode=e.colorBlendMode,n.modelMatrix=i.computedTransform,n.customShader=e.customShader,n.featureIdLabel=e.featureIdLabel,n.instanceFeatureIdLabel=e.instanceFeatureIdLabel,n.lightColor=e.lightColor,n.imageBasedLighting=e.imageBasedLighting,n.backFaceCulling=e.backFaceCulling,n.shadows=e.shadows,n.showCreditsOnScreen=e.showCreditsOnScreen,n.splitDirection=e.splitDirection,n.debugWireframe=e.debugWireframe,n.showOutline=e.showOutline,n.outlineColor=e.outlineColor,n.pointCloudShading=e.pointCloudShading;let o=e.clippingPlanes;n.referenceMatrix=e.clippingPlanesOriginMatrix,l(o)&&i.clippingPlanesDirty&&(n._clippingPlanes=o.enabled&&i._isClipped?o:void 0);let r=e.environmentMapManager;n.environmentMapManager!==o&&(n._environmentMapManager=r),l(o)&&l(n._clippingPlanes)&&n._clippingPlanes!==o&&(n._clippingPlanes=o,n._clippingPlanesState=0);let s=e.clippingPolygons;l(s)&&i.clippingPolygonsDirty&&(n._clippingPolygons=s.enabled&&i._isClippedByPolygon?s:void 0),l(s)&&l(n._clippingPolygons)&&n._clippingPolygons!==s&&(n._clippingPolygons=s,n._clippingPolygonsState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:vl.REPEAT}),this._ready=!0)};fs.prototype.isDestroyed=function(){return!1};fs.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),me(this)};fs.fromGltf=async function(e,t,n,i){let o=new fs(e,t,n),s=g2(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let c=await zm.fromGltfAsync(s);return o._model=c,o};fs.fromB3dm=async function(e,t,n,i,o){let r=new fs(e,t,n),a=g2(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=c;let d=await zm.fromB3dm(a);return r._model=d,r};fs.fromI3dm=async function(e,t,n,i,o){let r=new fs(e,t,n),a=g2(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await zm.fromI3dm(a);return r._model=c,r};fs.fromPnts=async function(e,t,n,i,o){let r=new fs(e,t,n),a=g2(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await zm.fromPnts(a);return r._model=c,r};fs.fromGeoJson=async function(e,t,n,i){let o=new fs(e,t,n),s=g2(e,t,o,{geoJson:i,resource:n}),a=await zm.fromGeoJson(s);return o._model=a,o};fs.prototype.pick=function(e,t,n){if(!l(this._model)||!this._ready)return;let i=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight;return this._model.pick(e,t,i,o,ne.WGS84,n)};function g2(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:Ge.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return Tt(i,o)}var uf=fs;var Zvn=T(S(),1);function Ru(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(Ru.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Ru.fromJson=function(e,t,n,i){let o=new Ru(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};Ru.prototype.hasProperty=function(e,t){return!1};Ru.prototype.getFeature=function(e){};Ru.prototype.applyDebugSettings=function(e,t){};Ru.prototype.applyStyle=function(e){};Ru.prototype.update=function(e,t){};Ru.prototype.pick=function(e,t,n){};Ru.prototype.isDestroyed=function(){return!1};Ru.prototype.destroy=function(){return me(this)};var y2=Ru;var WNn=T(S(),1);var XMn=T(S(),1);var qwn=T(S(),1);var Evn=T(S(),1),x2=`uniform sampler2D u_atlas;
  7589. #ifdef VECTOR_TILE
  7590. uniform vec4 u_highlightColor;
  7591. #endif
  7592. in vec2 v_textureCoordinates;
  7593. in vec4 v_pickColor;
  7594. in vec4 v_color;
  7595. in float v_splitDirection;
  7596. #ifdef SDF
  7597. in vec4 v_outlineColor;
  7598. in float v_outlineWidth;
  7599. #endif
  7600. #ifdef FRAGMENT_DEPTH_CHECK
  7601. in vec4 v_textureCoordinateBounds; // the min and max x and y values for the texture coordinates
  7602. in vec4 v_originTextureCoordinateAndTranslate; // texture coordinate at the origin, billboard translate (used for label glyphs)
  7603. in vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize
  7604. in mat2 v_rotationMatrix;
  7605. const float SHIFT_LEFT12 = 4096.0;
  7606. const float SHIFT_LEFT1 = 2.0;
  7607. const float SHIFT_RIGHT12 = 1.0 / 4096.0;
  7608. const float SHIFT_RIGHT1 = 1.0 / 2.0;
  7609. float getGlobeDepth(vec2 adjustedST, vec2 depthLookupST, bool applyTranslate, vec2 dimensions, vec2 imageSize)
  7610. {
  7611. vec2 lookupVector = imageSize * (depthLookupST - adjustedST);
  7612. lookupVector = v_rotationMatrix * lookupVector;
  7613. vec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y)); // aligns label glyph with bounding rectangle. Will be zero for billboards because dimensions and imageSize will be equal
  7614. vec2 translation = v_originTextureCoordinateAndTranslate.zw;
  7615. if (applyTranslate)
  7616. {
  7617. // this is only needed for labels where the horizontal origin is not LEFT
  7618. // it moves the label back to where the "origin" should be since all label glyphs are set to HorizontalOrigin.LEFT
  7619. translation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0));
  7620. }
  7621. vec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw;
  7622. float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st));
  7623. if (logDepthOrDepth == 0.0)
  7624. {
  7625. return 0.0; // not on the globe
  7626. }
  7627. vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
  7628. return eyeCoordinate.z / eyeCoordinate.w;
  7629. }
  7630. #endif
  7631. #ifdef SDF
  7632. // Get the distance from the edge of a glyph at a given position sampling an SDF texture.
  7633. float getDistance(vec2 position)
  7634. {
  7635. return texture(u_atlas, position).r;
  7636. }
  7637. // Samples the sdf texture at the given position and produces a color based on the fill color and the outline.
  7638. vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing)
  7639. {
  7640. float distance = getDistance(position);
  7641. if (outlineWidth > 0.0)
  7642. {
  7643. // Don't get the outline edge exceed the SDF_EDGE
  7644. float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE);
  7645. float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);
  7646. vec4 sdfColor = mix(outlineColor, v_color, outlineFactor);
  7647. float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance);
  7648. return vec4(sdfColor.rgb, sdfColor.a * alpha);
  7649. }
  7650. else
  7651. {
  7652. float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);
  7653. return vec4(v_color.rgb, v_color.a * alpha);
  7654. }
  7655. }
  7656. #endif
  7657. void main()
  7658. {
  7659. if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
  7660. if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
  7661. vec4 color = texture(u_atlas, v_textureCoordinates);
  7662. #ifdef SDF
  7663. float outlineWidth = v_outlineWidth;
  7664. vec4 outlineColor = v_outlineColor;
  7665. // Get the current distance
  7666. float distance = getDistance(v_textureCoordinates);
  7667. #if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
  7668. float smoothing = fwidth(distance);
  7669. // Get an offset that is approximately half the distance to the neighbor pixels
  7670. // 0.354 is approximately half of 1/sqrt(2)
  7671. vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates));
  7672. // Sample the center point
  7673. vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);
  7674. // Sample the 4 neighbors
  7675. vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);
  7676. vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);
  7677. vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);
  7678. vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);
  7679. // Equally weight the center sample and the 4 neighboring samples
  7680. color = (center + color1 + color2 + color3 + color4)/5.0;
  7681. #else
  7682. // If no derivatives available (IE 10?), just do a single sample
  7683. float smoothing = 1.0/32.0;
  7684. color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);
  7685. #endif
  7686. color = czm_gammaCorrect(color);
  7687. #else
  7688. color = czm_gammaCorrect(color);
  7689. color *= czm_gammaCorrect(v_color);
  7690. #endif
  7691. // Fully transparent parts of the billboard are not pickable.
  7692. #if !defined(OPAQUE) && !defined(TRANSLUCENT)
  7693. if (color.a < 0.005) // matches 0/255 and 1/255
  7694. {
  7695. discard;
  7696. }
  7697. #else
  7698. // The billboard is rendered twice. The opaque pass discards translucent fragments
  7699. // and the translucent pass discards opaque fragments.
  7700. #ifdef OPAQUE
  7701. if (color.a < 0.995) // matches < 254/255
  7702. {
  7703. discard;
  7704. }
  7705. #else
  7706. if (color.a >= 0.995) // matches 254/255 and 255/255
  7707. {
  7708. discard;
  7709. }
  7710. #endif
  7711. #endif
  7712. #ifdef VECTOR_TILE
  7713. color *= u_highlightColor;
  7714. #endif
  7715. out_FragColor = color;
  7716. #ifdef LOG_DEPTH
  7717. czm_writeLogDepth();
  7718. #endif
  7719. #ifdef FRAGMENT_DEPTH_CHECK
  7720. float temp = v_compressed.y;
  7721. temp = temp * SHIFT_RIGHT1;
  7722. float temp2 = (temp - floor(temp)) * SHIFT_LEFT1;
  7723. bool enableDepthTest = temp2 != 0.0;
  7724. bool applyTranslate = floor(temp) != 0.0;
  7725. if (enableDepthTest) {
  7726. temp = v_compressed.z;
  7727. temp = temp * SHIFT_RIGHT12;
  7728. vec2 dimensions;
  7729. dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;
  7730. dimensions.x = floor(temp);
  7731. temp = v_compressed.w;
  7732. temp = temp * SHIFT_RIGHT12;
  7733. vec2 imageSize;
  7734. imageSize.y = (temp - floor(temp)) * SHIFT_LEFT12;
  7735. imageSize.x = floor(temp);
  7736. vec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy;
  7737. adjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y);
  7738. float epsilonEyeDepth = v_compressed.x + czm_epsilon1;
  7739. float globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize);
  7740. // negative values go into the screen
  7741. if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth)
  7742. {
  7743. float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize); // top left corner
  7744. if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth)
  7745. {
  7746. float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize); // top right corner
  7747. if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth)
  7748. {
  7749. discard;
  7750. }
  7751. }
  7752. }
  7753. }
  7754. #endif
  7755. }
  7756. `;var Xvn=T(S(),1),_2=`#ifdef INSTANCED
  7757. in vec2 direction;
  7758. #endif
  7759. in vec4 positionHighAndScale;
  7760. in vec4 positionLowAndRotation;
  7761. in vec4 compressedAttribute0; // pixel offset, translate, horizontal origin, vertical origin, show, direction, texture coordinates (texture offset)
  7762. in vec4 compressedAttribute1; // aligned axis, translucency by distance, image width
  7763. in vec4 compressedAttribute2; // label horizontal origin, image height, color, pick color, size in meters, valid aligned axis, 13 bits free
  7764. in vec4 eyeOffset; // eye offset in meters, 4 bytes free (texture range)
  7765. in vec4 scaleByDistance; // near, nearScale, far, farScale
  7766. in vec4 pixelOffsetScaleByDistance; // near, nearScale, far, farScale
  7767. in vec4 compressedAttribute3; // distance display condition near, far, disableDepthTestDistance, dimensions
  7768. in vec2 sdf; // sdf outline color (rgb) and width (w)
  7769. in float splitDirection; // splitDirection
  7770. #if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)
  7771. in vec4 textureCoordinateBoundsOrLabelTranslate; // the min and max x and y values for the texture coordinates
  7772. #endif
  7773. #ifdef VECTOR_TILE
  7774. in float a_batchId;
  7775. #endif
  7776. out vec2 v_textureCoordinates;
  7777. #ifdef FRAGMENT_DEPTH_CHECK
  7778. out vec4 v_textureCoordinateBounds;
  7779. out vec4 v_originTextureCoordinateAndTranslate;
  7780. out vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize
  7781. out mat2 v_rotationMatrix;
  7782. #endif
  7783. out vec4 v_pickColor;
  7784. out vec4 v_color;
  7785. out float v_splitDirection;
  7786. #ifdef SDF
  7787. out vec4 v_outlineColor;
  7788. out float v_outlineWidth;
  7789. #endif
  7790. const float UPPER_BOUND = 32768.0;
  7791. const float SHIFT_LEFT16 = 65536.0;
  7792. const float SHIFT_LEFT12 = 4096.0;
  7793. const float SHIFT_LEFT8 = 256.0;
  7794. const float SHIFT_LEFT7 = 128.0;
  7795. const float SHIFT_LEFT5 = 32.0;
  7796. const float SHIFT_LEFT3 = 8.0;
  7797. const float SHIFT_LEFT2 = 4.0;
  7798. const float SHIFT_LEFT1 = 2.0;
  7799. const float SHIFT_RIGHT12 = 1.0 / 4096.0;
  7800. const float SHIFT_RIGHT8 = 1.0 / 256.0;
  7801. const float SHIFT_RIGHT7 = 1.0 / 128.0;
  7802. const float SHIFT_RIGHT5 = 1.0 / 32.0;
  7803. const float SHIFT_RIGHT3 = 1.0 / 8.0;
  7804. const float SHIFT_RIGHT2 = 1.0 / 4.0;
  7805. const float SHIFT_RIGHT1 = 1.0 / 2.0;
  7806. vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp)
  7807. {
  7808. // Note the halfSize cannot be computed in JavaScript because it is sent via
  7809. // compressed vertex attributes that coerce it to an integer.
  7810. vec2 halfSize = imageSize * scale * 0.5;
  7811. halfSize *= ((direction * 2.0) - 1.0);
  7812. vec2 originTranslate = origin * abs(halfSize);
  7813. #if defined(ROTATION) || defined(ALIGNED_AXIS)
  7814. if (validAlignedAxis || rotation != 0.0)
  7815. {
  7816. float angle = rotation;
  7817. if (validAlignedAxis)
  7818. {
  7819. vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0);
  7820. angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) /
  7821. (projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y));
  7822. }
  7823. float cosTheta = cos(angle);
  7824. float sinTheta = sin(angle);
  7825. rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);
  7826. halfSize = rotationMatrix * halfSize;
  7827. }
  7828. else
  7829. {
  7830. rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);
  7831. }
  7832. #endif
  7833. mpp = czm_metersPerPixel(positionEC);
  7834. positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp);
  7835. positionEC.xy += (translate + pixelOffset) * mpp;
  7836. return positionEC;
  7837. }
  7838. #ifdef VERTEX_DEPTH_CHECK
  7839. float getGlobeDepth(vec4 positionEC)
  7840. {
  7841. vec4 posWC = czm_eyeToWindowCoordinates(positionEC);
  7842. float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw));
  7843. if (globeDepth == 0.0)
  7844. {
  7845. return 0.0; // not on the globe
  7846. }
  7847. vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth);
  7848. return eyeCoordinate.z / eyeCoordinate.w;
  7849. }
  7850. #endif
  7851. void main()
  7852. {
  7853. // Modifying this shader may also require modifications to Billboard._computeScreenSpacePosition
  7854. // unpack attributes
  7855. vec3 positionHigh = positionHighAndScale.xyz;
  7856. vec3 positionLow = positionLowAndRotation.xyz;
  7857. float scale = positionHighAndScale.w;
  7858. #if defined(ROTATION) || defined(ALIGNED_AXIS)
  7859. float rotation = positionLowAndRotation.w;
  7860. #else
  7861. float rotation = 0.0;
  7862. #endif
  7863. float compressed = compressedAttribute0.x;
  7864. vec2 pixelOffset;
  7865. pixelOffset.x = floor(compressed * SHIFT_RIGHT7);
  7866. compressed -= pixelOffset.x * SHIFT_LEFT7;
  7867. pixelOffset.x -= UPPER_BOUND;
  7868. vec2 origin;
  7869. origin.x = floor(compressed * SHIFT_RIGHT5);
  7870. compressed -= origin.x * SHIFT_LEFT5;
  7871. origin.y = floor(compressed * SHIFT_RIGHT3);
  7872. compressed -= origin.y * SHIFT_LEFT3;
  7873. #ifdef FRAGMENT_DEPTH_CHECK
  7874. vec2 depthOrigin = origin.xy;
  7875. #endif
  7876. origin -= vec2(1.0);
  7877. float show = floor(compressed * SHIFT_RIGHT2);
  7878. compressed -= show * SHIFT_LEFT2;
  7879. #ifdef INSTANCED
  7880. vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);
  7881. vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);
  7882. vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;
  7883. #else
  7884. vec2 direction;
  7885. direction.x = floor(compressed * SHIFT_RIGHT1);
  7886. direction.y = compressed - direction.x * SHIFT_LEFT1;
  7887. vec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);
  7888. #endif
  7889. float temp = compressedAttribute0.y * SHIFT_RIGHT8;
  7890. pixelOffset.y = -(floor(temp) - UPPER_BOUND);
  7891. vec2 translate;
  7892. translate.y = (temp - floor(temp)) * SHIFT_LEFT16;
  7893. temp = compressedAttribute0.z * SHIFT_RIGHT8;
  7894. translate.x = floor(temp) - UPPER_BOUND;
  7895. translate.y += (temp - floor(temp)) * SHIFT_LEFT8;
  7896. translate.y -= UPPER_BOUND;
  7897. temp = compressedAttribute1.x * SHIFT_RIGHT8;
  7898. float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2);
  7899. vec2 imageSize = vec2(floor(temp), temp2);
  7900. #ifdef FRAGMENT_DEPTH_CHECK
  7901. float labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2));
  7902. float applyTranslate = 0.0;
  7903. if (labelHorizontalOrigin != 0.0) // is a billboard, so set apply translate to false
  7904. {
  7905. applyTranslate = 1.0;
  7906. labelHorizontalOrigin -= 2.0;
  7907. depthOrigin.x = labelHorizontalOrigin + 1.0;
  7908. }
  7909. depthOrigin = vec2(1.0) - (depthOrigin * 0.5);
  7910. #endif
  7911. #ifdef EYE_DISTANCE_TRANSLUCENCY
  7912. vec4 translucencyByDistance;
  7913. translucencyByDistance.x = compressedAttribute1.z;
  7914. translucencyByDistance.z = compressedAttribute1.w;
  7915. translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
  7916. temp = compressedAttribute1.y * SHIFT_RIGHT8;
  7917. translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
  7918. #endif
  7919. #if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)
  7920. temp = compressedAttribute3.w;
  7921. temp = temp * SHIFT_RIGHT12;
  7922. vec2 dimensions;
  7923. dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;
  7924. dimensions.x = floor(temp);
  7925. #endif
  7926. #ifdef ALIGNED_AXIS
  7927. vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));
  7928. temp = compressedAttribute2.z * SHIFT_RIGHT5;
  7929. bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;
  7930. #else
  7931. vec3 alignedAxis = vec3(0.0);
  7932. bool validAlignedAxis = false;
  7933. #endif
  7934. vec4 pickColor;
  7935. vec4 color;
  7936. temp = compressedAttribute2.y;
  7937. temp = temp * SHIFT_RIGHT8;
  7938. pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
  7939. temp = floor(temp) * SHIFT_RIGHT8;
  7940. pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
  7941. pickColor.r = floor(temp);
  7942. temp = compressedAttribute2.x;
  7943. temp = temp * SHIFT_RIGHT8;
  7944. color.b = (temp - floor(temp)) * SHIFT_LEFT8;
  7945. temp = floor(temp) * SHIFT_RIGHT8;
  7946. color.g = (temp - floor(temp)) * SHIFT_LEFT8;
  7947. color.r = floor(temp);
  7948. temp = compressedAttribute2.z * SHIFT_RIGHT8;
  7949. bool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;
  7950. temp = floor(temp) * SHIFT_RIGHT8;
  7951. pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
  7952. pickColor /= 255.0;
  7953. color.a = floor(temp);
  7954. color /= 255.0;
  7955. ///////////////////////////////////////////////////////////////////////////
  7956. vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
  7957. vec4 positionEC = czm_modelViewRelativeToEye * p;
  7958. #if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK)
  7959. float eyeDepth = positionEC.z;
  7960. #endif
  7961. positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);
  7962. positionEC.xyz *= show;
  7963. ///////////////////////////////////////////////////////////////////////////
  7964. #if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)
  7965. float lengthSq;
  7966. if (czm_sceneMode == czm_sceneMode2D)
  7967. {
  7968. // 2D camera distance is a special case
  7969. // treat all billboards as flattened to the z=0.0 plane
  7970. lengthSq = czm_eyeHeight2D.y;
  7971. }
  7972. else
  7973. {
  7974. lengthSq = dot(positionEC.xyz, positionEC.xyz);
  7975. }
  7976. #endif
  7977. #ifdef EYE_DISTANCE_SCALING
  7978. float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq);
  7979. scale *= distanceScale;
  7980. translate *= distanceScale;
  7981. // push vertex behind near plane for clipping
  7982. if (scale == 0.0)
  7983. {
  7984. positionEC.xyz = vec3(0.0);
  7985. }
  7986. #endif
  7987. float translucency = 1.0;
  7988. #ifdef EYE_DISTANCE_TRANSLUCENCY
  7989. translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);
  7990. // push vertex behind near plane for clipping
  7991. if (translucency == 0.0)
  7992. {
  7993. positionEC.xyz = vec3(0.0);
  7994. }
  7995. #endif
  7996. #ifdef EYE_DISTANCE_PIXEL_OFFSET
  7997. float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);
  7998. pixelOffset *= pixelOffsetScale;
  7999. #endif
  8000. #ifdef DISTANCE_DISPLAY_CONDITION
  8001. float nearSq = compressedAttribute3.x;
  8002. float farSq = compressedAttribute3.y;
  8003. if (lengthSq < nearSq || lengthSq > farSq)
  8004. {
  8005. positionEC.xyz = vec3(0.0);
  8006. }
  8007. #endif
  8008. mat2 rotationMatrix;
  8009. float mpp;
  8010. #ifdef DISABLE_DEPTH_DISTANCE
  8011. float disableDepthTestDistance = compressedAttribute3.z;
  8012. #endif
  8013. #ifdef VERTEX_DEPTH_CHECK
  8014. if (lengthSq < disableDepthTestDistance) {
  8015. float depthsilon = 10.0;
  8016. vec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy;
  8017. vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
  8018. float globeDepth1 = getGlobeDepth(pEC1);
  8019. if (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1)
  8020. {
  8021. vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
  8022. float globeDepth2 = getGlobeDepth(pEC2);
  8023. if (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2)
  8024. {
  8025. vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
  8026. float globeDepth3 = getGlobeDepth(pEC3);
  8027. if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3)
  8028. {
  8029. positionEC.xyz = vec3(0.0);
  8030. }
  8031. }
  8032. }
  8033. }
  8034. #endif
  8035. positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
  8036. gl_Position = czm_projection * positionEC;
  8037. v_textureCoordinates = textureCoordinates;
  8038. #ifdef LOG_DEPTH
  8039. czm_vertexLogDepth();
  8040. #endif
  8041. #ifdef DISABLE_DEPTH_DISTANCE
  8042. if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
  8043. {
  8044. disableDepthTestDistance = czm_minimumDisableDepthTestDistance;
  8045. }
  8046. if (disableDepthTestDistance != 0.0)
  8047. {
  8048. // Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w.
  8049. float zclip = gl_Position.z / gl_Position.w;
  8050. bool clipped = (zclip < -1.0 || zclip > 1.0);
  8051. if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))
  8052. {
  8053. // Position z on the near plane.
  8054. gl_Position.z = -gl_Position.w;
  8055. #ifdef LOG_DEPTH
  8056. v_depthFromNearPlusOne = 1.0;
  8057. #endif
  8058. }
  8059. }
  8060. #endif
  8061. #ifdef FRAGMENT_DEPTH_CHECK
  8062. if (sizeInMeters) {
  8063. translate /= mpp;
  8064. dimensions /= mpp;
  8065. imageSize /= mpp;
  8066. }
  8067. #if defined(ROTATION) || defined(ALIGNED_AXIS)
  8068. v_rotationMatrix = rotationMatrix;
  8069. #else
  8070. v_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);
  8071. #endif
  8072. float enableDepthCheck = 0.0;
  8073. if (lengthSq < disableDepthTestDistance)
  8074. {
  8075. enableDepthCheck = 1.0;
  8076. }
  8077. float dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12));
  8078. float dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12));
  8079. float iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12));
  8080. float ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12));
  8081. v_compressed.x = eyeDepth;
  8082. v_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck;
  8083. v_compressed.z = dw * SHIFT_LEFT12 + dh;
  8084. v_compressed.w = iw * SHIFT_LEFT12 + ih;
  8085. v_originTextureCoordinateAndTranslate.xy = depthOrigin;
  8086. v_originTextureCoordinateAndTranslate.zw = translate;
  8087. v_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate;
  8088. #endif
  8089. #ifdef SDF
  8090. vec4 outlineColor;
  8091. float outlineWidth;
  8092. temp = sdf.x;
  8093. temp = temp * SHIFT_RIGHT8;
  8094. outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
  8095. temp = floor(temp) * SHIFT_RIGHT8;
  8096. outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
  8097. outlineColor.r = floor(temp);
  8098. temp = sdf.y;
  8099. temp = temp * SHIFT_RIGHT8;
  8100. float temp3 = (temp - floor(temp)) * SHIFT_LEFT8;
  8101. temp = floor(temp) * SHIFT_RIGHT8;
  8102. outlineWidth = (temp - floor(temp)) * SHIFT_LEFT8;
  8103. outlineColor.a = floor(temp);
  8104. outlineColor /= 255.0;
  8105. v_outlineWidth = outlineWidth / 255.0;
  8106. v_outlineColor = outlineColor;
  8107. v_outlineColor.a *= translucency;
  8108. #endif
  8109. v_pickColor = pickColor;
  8110. v_color = color;
  8111. v_color.a *= translucency;
  8112. v_splitDirection = splitDirection;
  8113. }
  8114. `;var $vn=T(S(),1);function xi(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Ut.clone(n)),l(i)&&(i=Ut.clone(i)),l(o)&&(o=Ut.clone(o)),l(r)&&(r=At.clone(r)),this._show=y(e.show,!0),this._position=h.clone(y(e.position,h.ZERO)),this._actualPosition=h.clone(this._position),this._pixelOffset=D.clone(y(e.pixelOffset,D.ZERO)),this._translate=new D(0,0),this._eyeOffset=h.clone(y(e.eyeOffset,h.ZERO)),this._heightReference=y(e.heightReference,Qe.NONE),this._verticalOrigin=y(e.verticalOrigin,Pn.CENTER),this._horizontalOrigin=y(e.horizontalOrigin,gi.CENTER),this._scale=y(e.scale,1),this._color=B.clone(y(e.color,B.WHITE)),this._rotation=y(e.rotation,0),this._alignedAxis=h.clone(y(e.alignedAxis,h.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=y(e.sizeInMeters,!1),this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=y(e.collection,t),this._pickId=void 0,this._pickPrimitive=y(e._pickPrimitive,this),this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image,a=e.imageId;l(s)&&(l(a)||(typeof s=="string"?a=s:l(s.src)?a=s.src:a=Bn()),this._imageId=a,this._image=s),l(e.imageSubRegion)&&(this._imageId=a,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=oe.SCENE3D,this._clusterShow=!0,this._outlineColor=B.clone(y(e.outlineColor,B.BLACK)),this._outlineWidth=y(e.outlineWidth,0),this._updateClamping(),this._splitDirection=y(e.splitDirection,vr.NONE)}var lce=xi.SHOW_INDEX=0,Q5=xi.POSITION_INDEX=1,hce=xi.PIXEL_OFFSET_INDEX=2,VHe=xi.EYE_OFFSET_INDEX=3,LHe=xi.HORIZONTAL_ORIGIN_INDEX=4,RHe=xi.VERTICAL_ORIGIN_INDEX=5,ZHe=xi.SCALE_INDEX=6,j5=xi.IMAGE_INDEX_INDEX=7,dce=xi.COLOR_INDEX=8,GHe=xi.ROTATION_INDEX=9,EHe=xi.ALIGNED_AXIS_INDEX=10,IHe=xi.SCALE_BY_DISTANCE_INDEX=11,XHe=xi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,WHe=xi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,PHe=xi.DISTANCE_DISPLAY_CONDITION=14,vHe=xi.DISABLE_DEPTH_DISTANCE=15;xi.TEXTURE_COORDINATE_BOUNDS=16;var uce=xi.SDF_INDEX=17,wHe=xi.SPLIT_DIRECTION_INDEX=18;xi.NUMBER_OF_PROPERTIES=19;function vo(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(xi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,vo(this,lce))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),this._updateClamping(),vo(this,Q5))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),vo(this,Q5))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;D.equals(t,e)||(D.clone(e,t),vo(this,hce))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Ut.equals(t,e)||(this._scaleByDistance=Ut.clone(e,t),vo(this,IHe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Ut.equals(t,e)||(this._translucencyByDistance=Ut.clone(e,t),vo(this,XHe))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Ut.equals(t,e)||(this._pixelOffsetScaleByDistance=Ut.clone(e,t),vo(this,WHe))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),vo(this,VHe))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,vo(this,LHe))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,vo(this,RHe))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,vo(this,ZHe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;B.equals(t,e)||(B.clone(e,t),vo(this,dce))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,vo(this,GHe))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),vo(this,EHe))}},width:{get:function(){return y(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,vo(this,j5))}},height:{get:function(){return y(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,vo(this,j5))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,vo(this,dce))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){At.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=At.clone(e,this._distanceDisplayCondition),vo(this,PHe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,vo(this,vHe))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(e){l(e)?typeof e=="string"?this.setImage(e,e):e instanceof Ee?this.setImage(e.url,e):l(e.src)?this.setImage(e.src,e):this.setImage(Bn(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,vo(this,j5))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=h.clone(e,this._actualClampedPosition),vo(this,Q5)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,vo(this,lce))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;B.equals(t,e)||(B.clone(e,t),vo(this,uce))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,vo(this,uce))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,vo(this,wHe))}}});xi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};xi.prototype._updateClamping=function(){xi._updateClamping(this._billboardCollection,this)};var q5=new he;xi._updateClamping=function(e,t){let n=e._scene;if(!l(n))return;let i=y(n.ellipsoid,ne.default),o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===Qe.NONE||r)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===Qe.NONE||!l(t._position))return;l(t._removeCallbackFunc)&&t._removeCallbackFunc();let s=i.cartesianToCartographic(t._position);if(!l(s)){t._actualClampedPosition=void 0;return}function a(d){let u=i.cartographicToCartesian(d,t._clampedPosition);JS(t._heightReference)&&(t._mode===oe.SCENE3D?(d.height+=s.height,i.cartographicToCartesian(d,u)):u.x+=s.height),t._clampedPosition=u}t._removeCallbackFunc=n.updateHeight(s,a,t._heightReference),he.clone(s,q5);let c=n.getHeight(s,t._heightReference);l(c)&&(q5.height=c),a(q5)};xi.prototype._loadImage=function(){let e=this._billboardCollection._textureAtlas,t=this._imageId,n=this._image,i=this._imageSubRegion,o,r=this;function s(c){if(r._imageId!==t||r._image!==n||!Ke.equals(r._imageSubRegion,i))return;let d=e.textureCoordinates[c];r._imageWidth=e.texture.width*d.width,r._imageHeight=e.texture.height*d.height,r._imageIndex=c,r._ready=!0,r._image=void 0,r._imageIndexPromise=void 0,vo(r,j5);let u=r._billboardCollection._scene;l(u)&&u.frameState.afterRender.push(()=>!0)}if(l(n)&&(o=e.addImage(t,n)),l(i)&&(o=e.addSubRegion(t,i)),this._imageIndexPromise=o,!l(o))return;let a=e.getImageIndex(t);if(l(a)&&!l(i)){s(a);return}o.then(s).catch(function(c){console.error(`Error loading image for billboard: ${c}`),r._imageIndexPromise=void 0})};xi.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())};xi.prototype.setImageSubRegion=function(e,t){this._imageId===e&&Ke.equals(this._imageSubRegion,t)||(this._imageIndex=-1,this._imageId=e,this._imageSubRegion=Ke.clone(t),l(this._billboardCollection._textureAtlas)&&this._loadImage())};xi.prototype._setTranslate=function(e){let t=this._translate;D.equals(t,e)||(D.clone(e,t),vo(this,hce))};xi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};xi.prototype._setActualPosition=function(e){l(this._clampedPosition)||h.clone(e,this._actualPosition),vo(this,Q5)};var mce=new se;xi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===oe.SCENE3D?t:(M.multiplyByPoint(i,t,mce),Mi.computeActualEllipsoidPosition(n,mce))};var fce=new h;xi._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=M.multiplyByPoint(e,t,fce),a=Mi.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(l(a))return D.add(a,i,a),a};var J5=new D(0,0);xi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new D),D.clone(this._pixelOffset,J5),D.add(J5,this._translate,J5);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==oe.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(o,q5);o=a.cartographicToCartesian(c,fce),i=M.IDENTITY}return xi._computeScreenSpacePosition(i,o,this._eyeOffset,J5,e,t)};xi.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height,r=e.scale;i*=r,o*=r;let s=t.x;e.horizontalOrigin===gi.RIGHT?s-=i:e.horizontalOrigin===gi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Pn.BOTTOM||e.verticalOrigin===Pn.BASELINE?a-=o:e.verticalOrigin===Pn.CENTER&&(a-=o*.5),l(n)||(n=new Ke),n.x=s,n.y=a,n.width=i,n.height=o,n};xi.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&this._imageId===e._imageId&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&Ke.equals(this._imageSubRegion,e._imageSubRegion)&&B.equals(this._color,e._color)&&D.equals(this._pixelOffset,e._pixelOffset)&&D.equals(this._translate,e._translate)&&h.equals(this._eyeOffset,e._eyeOffset)&&Ut.equals(this._scaleByDistance,e._scaleByDistance)&&Ut.equals(this._translucencyByDistance,e._translucencyByDistance)&&Ut.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&At.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};xi.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var so=xi;var twn=T(S(),1),FHe={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},Lo=Object.freeze(FHe);var iwn=T(S(),1),AHe={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Bs=Object.freeze(AHe);var bwn=T(S(),1);function db(e,t,n,i,o){this.bottomLeft=y(e,D.ZERO),this.topRight=y(t,D.ZERO),this.childNode1=n,this.childNode2=i,this.imageIndex=o}var MHe=new D(16,16);function Lg(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.borderWidthInPixels,1),n=y(e.initialSize,MHe);this._context=e.context,this._pixelFormat=y(e.pixelFormat,ot.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=Bn(),this._idHash={},this._indexHash={},this._initialSize=n,this._root=void 0}Object.defineProperties(Lg.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return l(this._texture)||(this._texture=new Pt({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}});function NHe(e,t){let n=e._context,i=e.numberOfImages,o=2,r=e._borderWidthInPixels;if(i>0){let s=e._texture.width,a=e._texture.height,c=o*(s+t.width+r),d=o*(a+t.height+r),u=s/c,m=a/d,p=new db(new D(s+r,r),new D(c,a)),g=new db(new D,new D(c,a),e._root,p),f=new db(new D(r,a+r),new D(c,d)),x=new db(new D,new D(c,d),g,f);for(let V=0;V<e._textureCoordinates.length;V++){let L=e._textureCoordinates[V];l(L)&&(L.x*=u,L.y*=m,L.width*=u,L.height*=m)}let _=new Pt({context:e._context,width:c,height:d,pixelFormat:e._pixelFormat}),C=new Wr({context:n,colorTextures:[e._texture],destroyAttachments:!1});C._bind(),_.copyFromFramebuffer(0,0,0,0,c,d),C._unBind(),C.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=_,e._root=x}else{let s=o*(t.width+2*r),a=o*(t.height+2*r);s<e._initialSize.x&&(s=e._initialSize.x),a<e._initialSize.y&&(a=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new Pt({context:e._context,width:s,height:a,pixelFormat:e._pixelFormat}),e._root=new db(new D(r,r),new D(s,a))}}function $5(e,t,n){if(l(t)){if(!l(t.childNode1)&&!l(t.childNode2)){if(l(t.imageIndex))return;let i=t.topRight.x-t.bottomLeft.x,o=t.topRight.y-t.bottomLeft.y,r=i-n.width,s=o-n.height;if(r<0||s<0)return;if(r===0&&s===0)return t;if(r>s){t.childNode1=new db(new D(t.bottomLeft.x,t.bottomLeft.y),new D(t.bottomLeft.x+n.width,t.topRight.y));let a=t.bottomLeft.x+n.width+e._borderWidthInPixels;a<t.topRight.x&&(t.childNode2=new db(new D(a,t.bottomLeft.y),new D(t.topRight.x,t.topRight.y)))}else{t.childNode1=new db(new D(t.bottomLeft.x,t.bottomLeft.y),new D(t.topRight.x,t.bottomLeft.y+n.height));let a=t.bottomLeft.y+n.height+e._borderWidthInPixels;a<t.topRight.y&&(t.childNode2=new db(new D(t.bottomLeft.x,a),new D(t.topRight.x,t.topRight.y)))}return $5(e,t.childNode1,n)}return $5(e,t.childNode1,n)||$5(e,t.childNode2,n)}}function pce(e,t,n){let i=$5(e,e._root,t);if(l(i)){i.imageIndex=n;let o=e._texture.width,r=e._texture.height,s=i.topRight.x-i.bottomLeft.x,a=i.topRight.y-i.bottomLeft.y,c=i.bottomLeft.x/o,d=i.bottomLeft.y/r,u=s/o,m=a/r;e._textureCoordinates[n]=new Ke(c,d,u,m),e._texture.copyFrom({source:t,xOffset:i.bottomLeft.x,yOffset:i.bottomLeft.y})}else NHe(e,t),pce(e,t,n);e._guid=Bn()}function bce(e,t){if(!l(e)||e.isDestroyed())return-1;let n=e.numberOfImages;return pce(e,t,n),n}Lg.prototype.getImageIndex=function(e){return this._indexHash[e]};Lg.prototype.addImageSync=function(e,t){let n=this._indexHash[e];return l(n)||(n=bce(this,t),this._idHash[e]=Promise.resolve(n),this._indexHash[e]=n),n};Lg.prototype.addImage=function(e,t){let n=this._idHash[e];if(l(n))return n;typeof t=="function"?t=t(e):(typeof t=="string"||t instanceof Ee)&&(t=Ee.createIfNeeded(t).fetchImage());let i=this;return n=Promise.resolve(t).then(function(o){let r=bce(i,o);return i._indexHash[e]=r,r}),this._idHash[e]=n,n};Lg.prototype.addSubRegion=function(e,t){let n=this._idHash[e];if(!l(n))throw new de(`image with id "${e}" not found in the atlas.`);let i=this;return Promise.resolve(n).then(function(o){if(o===-1)return-1;let r=i._texture.width,s=i._texture.height,a=i._textureCoordinates[o],c=a.x+t.x/r,d=a.y+t.y/s,u=t.width/r,m=t.height/s,p=i._textureCoordinates.push(new Ke(c,d,u,m))-1;return i._indexHash[e]=p,i._guid=Bn(),p})};Lg.prototype.isDestroyed=function(){return!1};Lg.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),me(this)};var Rg=Lg;var kHe=so.SHOW_INDEX,S2=so.POSITION_INDEX,gce=so.PIXEL_OFFSET_INDEX,yce=so.EYE_OFFSET_INDEX,UHe=so.HORIZONTAL_ORIGIN_INDEX,DHe=so.VERTICAL_ORIGIN_INDEX,BHe=so.SCALE_INDEX,T2=so.IMAGE_INDEX_INDEX,xce=so.COLOR_INDEX,OHe=so.ROTATION_INDEX,YHe=so.ALIGNED_AXIS_INDEX,_ce=so.SCALE_BY_DISTANCE_INDEX,Tce=so.TRANSLUCENCY_BY_DISTANCE_INDEX,Sce=so.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Cce=so.DISTANCE_DISPLAY_CONDITION,HHe=so.DISABLE_DEPTH_DISTANCE,zHe=so.TEXTURE_COORDINATE_BOUNDS,Vce=so.SDF_INDEX,Lce=so.SPLIT_DIRECTION_INDEX,Mz=so.NUMBER_OF_PROPERTIES,ao,KHe={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,compressedAttribute3:8,textureCoordinateBoundsOrLabelTranslate:9,a_batchId:10,sdf:11,splitDirection:12},JHe={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12,splitDirection:13};function Eu(e){e=y(e,y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(Mz),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new ce,this._baseVolumeWC=new ce,this._baseVolume2D=new ce,this._boundingVolume=new ce,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowTextureAtlas=y(e.debugShowTextureAtlas,!1),this.blendOption=y(e.blendOption,Lo.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=oe.SCENE3D,this._buffersUsage=[Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW],this._highlightColor=B.clone(B.WHITE);let t=this;this._uniforms={u_atlas:function(){return t._textureAtlas.texture},u_highlightColor:function(){return t._highlightColor}};let n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,o=i.length;for(let r=0;r<o;++r)l(i[r])&&i[r]._updateClamping()},this))}Object.defineProperties(Eu.prototype,{length:{get:function(){return Nz(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}});function Rce(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Eu.prototype.add=function(e){let t=new so(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Eu.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Eu.prototype.removeAll=function(){Rce(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function Nz(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(s._index=r++,t.push(s))}e._billboards=t}}Eu.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Eu.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};Eu.prototype.get=function(e){return Nz(this),this._billboards[e]};var Wz;function QHe(e){let n=e.cache.billboardCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s+0,o[r+4]=s+2,o[r+5]=s+3;return n=xt.createIndexBuffer({context:e,typedArray:o,usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function jHe(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=xt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function qHe(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=xt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Me.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}Eu.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<Mz;++i){let o=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function $He(e,t,n,i,o,r){let s=[{index:ao.positionHighAndScale,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[S2]},{index:ao.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[S2]},{index:ao.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[gce]},{index:ao.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Tce]},{index:ao.compressedAttribute2,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[xce]},{index:ao.eyeOffset,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[yce]},{index:ao.scaleByDistance,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[_ce]},{index:ao.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Sce]},{index:ao.compressedAttribute3,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[Cce]},{index:ao.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[zHe]},{index:ao.splitDirection,componentsPerAttribute:1,componentDatatype:Q.FLOAT,usage:n[Lce]}];i&&s.push({index:ao.direction,componentsPerAttribute:2,componentDatatype:Q.FLOAT,vertexBuffer:qHe(e)}),l(o)&&s.push({index:ao.a_batchId,componentsPerAttribute:1,componentDatatype:Q.FLOAT,bufferUsage:Me.STATIC_DRAW}),r&&s.push({index:ao.sdf,componentsPerAttribute:2,componentDatatype:Q.FLOAT,usage:n[Vce]});let a=i?t:4*t;return new Sp(e,s,a,i)}var Pz=new On;function Zce(e,t,n,i,o){let r,s=i[ao.positionHighAndScale],a=i[ao.positionLowAndRotation],c=o._getActualPosition();e._mode===oe.SCENE3D&&(ce.expand(e._baseVolume,c,e._baseVolume),e._boundingVolumeDirty=!0),On.fromCartesian(c,Pz);let d=o.scale,u=o.rotation;u!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,d);let m=Pz.high,p=Pz.low;e._instanced?(r=o._index,s(r,m.x,m.y,m.z,d),a(r,p.x,p.y,p.z,u)):(r=o._index*4,s(r+0,m.x,m.y,m.z,d),s(r+1,m.x,m.y,m.z,d),s(r+2,m.x,m.y,m.z,d),s(r+3,m.x,m.y,m.z,d),a(r+0,p.x,p.y,p.z,u),a(r+1,p.x,p.y,p.z,u),a(r+2,p.x,p.y,p.z,u),a(r+3,p.x,p.y,p.z,u))}var Gu=new D,Zu=32768,$C=65536,vz=4096,mf=256,eze=128,tze=32,nze=8,Gce=4,ize=1/256,Ece=0,Ice=2,Xce=3,Wce=1;function Pce(e,t,n,i,o){let r,s=i[ao.compressedAttribute0],a=o.pixelOffset,c=a.x,d=a.y,u=o._translate,m=u.x,p=u.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(c+m),Math.abs(-d+p));let g=o.horizontalOrigin,f=o._verticalOrigin,x=o.show&&o.clusterShow;o.color.alpha===0&&(x=!1),f===Pn.BASELINE&&(f=Pn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&g===gi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&f===Pn.CENTER;let _=0,C=0,V=0,L=0,Z=o._imageIndex;if(Z!==-1){let O=n[Z];_=O.x,C=O.y,V=O.width,L=O.height}let G=_+V,I=C+L,v=Math.floor(W.clamp(c,-Zu,Zu)+Zu)*eze;v+=(g+1)*tze,v+=(f+1)*nze,v+=(x?1:0)*Gce;let P=Math.floor(W.clamp(d,-Zu,Zu)+Zu)*mf,w=Math.floor(W.clamp(m,-Zu,Zu)+Zu)*mf,F=(W.clamp(p,-Zu,Zu)+Zu)*ize,b=Math.floor(F),R=Math.floor((F-b)*mf);P+=b,w+=R,Gu.x=_,Gu.y=C;let E=wn.compressTextureCoordinates(Gu);Gu.x=G;let X=wn.compressTextureCoordinates(Gu);Gu.y=I;let A=wn.compressTextureCoordinates(Gu);Gu.x=_;let N=wn.compressTextureCoordinates(Gu);e._instanced?(r=o._index,s(r,v,P,w,E)):(r=o._index*4,s(r+0,v+Ece,P,w,E),s(r+1,v+Ice,P,w,X),s(r+2,v+Xce,P,w,A),s(r+3,v+Wce,P,w,N))}function vce(e,t,n,i,o){let r,s=i[ao.compressedAttribute1],a=o.alignedAxis;h.equals(a,h.ZERO)||(e._shaderAlignedAxis=!0);let c=0,d=1,u=1,m=1,p=o.translucencyByDistance;l(p)&&(c=p.near,d=p.nearValue,u=p.far,m=p.farValue,(d!==1||m!==1)&&(e._shaderTranslucencyByDistance=!0));let g=0,f=o._imageIndex;f!==-1&&(g=n[f].width);let x=e._textureAtlas.texture.width,_=Math.round(y(o.width,x*g));e._maxSize=Math.max(e._maxSize,_);let C=W.clamp(_,0,$C),V=0;Math.abs(h.magnitudeSquared(a)-1)<W.EPSILON6&&(V=wn.octEncodeFloat(a)),d=W.clamp(d,0,1),d=d===1?255:d*255|0,C=C*mf+d,m=W.clamp(m,0,1),m=m===1?255:m*255|0,V=V*mf+m,e._instanced?(r=o._index,s(r,C,V,c,u)):(r=o._index*4,s(r+0,C,V,c,u),s(r+1,C,V,c,u),s(r+2,C,V,c,u),s(r+3,C,V,c,u))}function Fz(e,t,n,i,o){let r,s=i[ao.compressedAttribute2],a=o.color,c=l(e._batchTable)?B.WHITE:o.getPickId(t.context).color,d=o.sizeInMeters?1:0,u=Math.abs(h.magnitudeSquared(o.alignedAxis)-1)<W.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&d===1;let m=0,p=o._imageIndex;p!==-1&&(m=n[p].height);let g=e._textureAtlas.texture.dimensions,f=Math.round(y(o.height,g.y*m));e._maxSize=Math.max(e._maxSize,f);let x=y(o._labelHorizontalOrigin,-2);x+=2;let _=f*Gce+x,C=B.floatToByte(a.red),V=B.floatToByte(a.green),L=B.floatToByte(a.blue),Z=C*$C+V*mf+L;C=B.floatToByte(c.red),V=B.floatToByte(c.green),L=B.floatToByte(c.blue);let G=C*$C+V*mf+L,I=B.floatToByte(a.alpha)*$C+B.floatToByte(c.alpha)*mf;I+=d*2+u,e._instanced?(r=o._index,s(r,Z,G,I,_)):(r=o._index*4,s(r+0,Z,G,I,_),s(r+1,Z,G,I,_),s(r+2,Z,G,I,_),s(r+3,Z,G,I,_))}function Az(e,t,n,i,o){let r,s=i[ao.eyeOffset],a=o.eyeOffset,c=a.z;if(o._heightReference!==Qe.NONE&&(c*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(a.x),Math.abs(a.y),Math.abs(c)),e._instanced){let d=0,u=0,m=o._imageIndex;if(m!==-1){let g=n[m];d=g.width,u=g.height}Gu.x=d,Gu.y=u;let p=wn.compressTextureCoordinates(Gu);r=o._index,s(r,a.x,a.y,c,p)}else r=o._index*4,s(r+0,a.x,a.y,c,0),s(r+1,a.x,a.y,c,0),s(r+2,a.x,a.y,c,0),s(r+3,a.x,a.y,c,0)}function wce(e,t,n,i,o){let r,s=i[ao.scaleByDistance],a=0,c=1,d=1,u=1,m=o.scaleByDistance;l(m)&&(a=m.near,c=m.nearValue,d=m.far,u=m.farValue,(c!==1||u!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(r=o._index,s(r,a,c,d,u)):(r=o._index*4,s(r+0,a,c,d,u),s(r+1,a,c,d,u),s(r+2,a,c,d,u),s(r+3,a,c,d,u))}function Fce(e,t,n,i,o){let r,s=i[ao.pixelOffsetScaleByDistance],a=0,c=1,d=1,u=1,m=o.pixelOffsetScaleByDistance;l(m)&&(a=m.near,c=m.nearValue,d=m.far,u=m.farValue,(c!==1||u!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(r=o._index,s(r,a,c,d,u)):(r=o._index*4,s(r+0,a,c,d,u),s(r+1,a,c,d,u),s(r+2,a,c,d,u),s(r+3,a,c,d,u))}function Ace(e,t,n,i,o){let r,s=i[ao.compressedAttribute3],a=0,c=Number.MAX_VALUE,d=o.distanceDisplayCondition;l(d)&&(a=d.near,c=d.far,a*=a,c*=c,e._shaderDistanceDisplayCondition=!0);let u=o.disableDepthTestDistance,m=bu(o.heightReference)&&t.context.depthTexture;l(u)||(u=m?5e3:0),u*=u,(m||u>0)&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let p,g;if(l(o._labelDimensions))g=o._labelDimensions.x,p=o._labelDimensions.y;else{let C=0,V=0,L=o._imageIndex;if(L!==-1){let G=n[L];C=G.height,V=G.width}p=Math.round(y(o.height,e._textureAtlas.texture.dimensions.y*C));let Z=e._textureAtlas.texture.width;g=Math.round(y(o.width,Z*V))}let f=Math.floor(W.clamp(g,0,vz)),x=Math.floor(W.clamp(p,0,vz)),_=f*vz+x;e._instanced?(r=o._index,s(r,a,c,u,_)):(r=o._index*4,s(r+0,a,c,u,_),s(r+1,a,c,u,_),s(r+2,a,c,u,_),s(r+3,a,c,u,_))}function Mce(e,t,n,i,o){if(bu(o.heightReference)){let f=e._scene,x=t.context,_=t.globeTranslucencyState.translucent,C=l(f.globe)&&f.globe.depthTestAgainstTerrain;e._shaderClampToGround=x.depthTexture&&!_&&C}let r,s=i[ao.textureCoordinateBoundsOrLabelTranslate];if(Bt.maximumVertexTextureImageUnits>0){let f=0,x=0;l(o._labelTranslate)&&(f=o._labelTranslate.x,x=o._labelTranslate.y),e._instanced?(r=o._index,s(r,f,x,0,0)):(r=o._index*4,s(r+0,f,x,0,0),s(r+1,f,x,0,0),s(r+2,f,x,0,0),s(r+3,f,x,0,0));return}let a=0,c=0,d=0,u=0,m=o._imageIndex;if(m!==-1){let f=n[m];a=f.x,c=f.y,d=f.width,u=f.height}let p=a+d,g=c+u;e._instanced?(r=o._index,s(r,a,c,p,g)):(r=o._index*4,s(r+0,a,c,p,g),s(r+1,a,c,p,g),s(r+2,a,c,p,g),s(r+3,a,c,p,g))}function oze(e,t,n,i,o){if(!l(e._batchTable))return;let r=i[ao.a_batchId],s=o._batchIndex,a;e._instanced?(a=o._index,r(a,s)):(a=o._index*4,r(a+0,s),r(a+1,s),r(a+2,s),r(a+3,s))}function Nce(e,t,n,i,o){if(!e._sdf)return;let r,s=i[ao.sdf],a=o.outlineColor,c=o.outlineWidth,d=B.floatToByte(a.red),u=B.floatToByte(a.green),m=B.floatToByte(a.blue),p=d*$C+u*mf+m,g=c/Bs.RADIUS,f=B.floatToByte(a.alpha)*$C+B.floatToByte(g)*mf;e._instanced?(r=o._index,s(r,p,f)):(r=o._index*4,s(r+0,p+Ece,f),s(r+1,p+Ice,f),s(r+2,p+Xce,f),s(r+3,p+Wce,f))}function kce(e,t,n,i,o){let r=i[ao.splitDirection],s=0,a=o.splitDirection;l(a)&&(s=a);let c;e._instanced?(c=o._index,r(c,s)):(c=o._index*4,r(c+0,s),r(c+1,s),r(c+2,s),r(c+3,s))}function rze(e,t,n,i,o){Zce(e,t,n,i,o),Pce(e,t,n,i,o),vce(e,t,n,i,o),Fz(e,t,n,i,o),Az(e,t,n,i,o),wce(e,t,n,i,o),Fce(e,t,n,i,o),Ace(e,t,n,i,o),Mce(e,t,n,i,o),oze(e,t,n,i,o),Nce(e,t,n,i,o),kce(e,t,n,i,o)}function wz(e,t,n,i,o,r){let s;i.mode===oe.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let d=t[c],u=d.position,m=so._computeActualPosition(d,u,i,o);l(m)&&(d._setActualPosition(m),r?a.push(m):ce.expand(s,m,s))}r&&ce.fromPoints(a,s)}function sze(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==oe.SCENE3D&&!M.equals(r,e.modelMatrix)?(e._mode=n,M.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===oe.SCENE3D||n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&wz(e,i,i.length,t,r,!0)):n===oe.MORPHING?wz(e,i,i.length,t,r,!0):(n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&wz(e,o,e._billboardsToUpdateIndex,t,r,!1)}function aze(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let o=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(o*=.5);let r=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=o+r}function cze(e,t){let i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture;
  8115. in vec2 v_textureCoordinates;
  8116. void main()
  8117. {
  8118. out_FragColor = texture(billboard_texture, v_textureCoordinates);
  8119. }
  8120. `,{uniformMap:{billboard_texture:function(){return e._textureAtlas.texture}}});return i.pass=Ge.OVERLAY,i}var lze=[];Eu.prototype.update=function(e){if(Nz(this),!this.show)return;let t=this._billboards,n=t.length,i=e.context;this._instanced=i.instancedArrays,ao=this._instanced?JHe:KHe,Wz=this._instanced?jHe:QHe;let o=this._textureAtlas;if(!l(o)){o=this._textureAtlas=new Rg({context:i});for(let P=0;P<n;++P)t[P]._loadImage()}let r=o.textureCoordinates;if(r.length===0)return;sze(this,e),t=this._billboards,n=t.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,d=o.guid,u=this._createVertexArray||this._textureAtlasGUID!==d;this._textureAtlasGUID=d;let m,p=e.passes,g=p.pick;if(u||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let P=0;P<Mz;++P)c[P]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=$He(i,n,this._buffersUsage,this._instanced,this._batchTable,this._sdf),m=this._vaf.writers;for(let P=0;P<n;++P){let w=this._billboards[P];w._dirty=!1,rze(this,e,r,m,w)}this._vaf.commit(Wz(i))}this._billboardsToUpdateIndex=0}else if(a>0){let P=lze;P.length=0,(c[S2]||c[OHe]||c[BHe])&&P.push(Zce),(c[T2]||c[gce]||c[UHe]||c[DHe]||c[kHe])&&(P.push(Pce),this._instanced&&P.push(Az)),(c[T2]||c[YHe]||c[Tce])&&(P.push(vce),P.push(Fz)),(c[T2]||c[xce])&&P.push(Fz),c[yce]&&P.push(Az),c[_ce]&&P.push(wce),c[Sce]&&P.push(Fce),(c[Cce]||c[HHe]||c[T2]||c[S2])&&P.push(Ace),(c[T2]||c[S2])&&P.push(Mce),c[Vce]&&P.push(Nce),c[Lce]&&P.push(kce);let w=P.length;if(m=this._vaf.writers,a/n>.1){for(let F=0;F<a;++F){let b=s[F];b._dirty=!1;for(let R=0;R<w;++R)P[R](this,e,r,m,b)}this._vaf.commit(Wz(i))}else{for(let F=0;F<a;++F){let b=s[F];b._dirty=!1;for(let R=0;R<w;++R)P[R](this,e,r,m,b);this._instanced?this._vaf.subCommit(b._index,1):this._vaf.subCommit(b._index*4,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>n*1.5&&(s.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ce.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let f,x=M.IDENTITY;e.mode===oe.SCENE3D?(x=this.modelMatrix,f=ce.clone(this._baseVolumeWC,this._boundingVolume)):f=ce.clone(this._baseVolume2D,this._boundingVolume),aze(this,e,f);let _=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,_){this._blendOption===Lo.OPAQUE||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ue.fromCache({depthTest:{enabled:!0,func:ie.LESS},depthMask:!0}):this._rsOpaque=void 0;let P=this._blendOption===Lo.TRANSLUCENT;this._blendOption===Lo.TRANSLUCENT||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ue.fromCache({depthTest:{enabled:!0,func:P?ie.LEQUAL:ie.LESS},depthMask:P,blending:un.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let C,V,L,Z,G,I=Bt.maximumVertexTextureImageUnits>0;if(_||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){C=_2,V=x2,G=[],l(this._batchTable)&&(G.push("VECTOR_TILE"),C=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(C),V=this._batchTable.getFragmentShaderCallback(!1,void 0)(V)),L=new De({defines:G,sources:[C]}),this._instanced&&L.defines.push("INSTANCED"),this._shaderRotation&&L.defines.push("ROTATION"),this._shaderAlignedAxis&&L.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&L.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&L.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&L.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&L.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&L.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(I?L.defines.push("VERTEX_DEPTH_CHECK"):L.defines.push("FRAGMENT_DEPTH_CHECK"));let P=1-Bs.CUTOFF;this._sdf&&L.defines.push("SDF");let w=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT&&(Z=new De({defines:["OPAQUE",w],sources:[V]}),this._shaderClampToGround&&(I?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${P}`)),this._sp=tn.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:ao}),Z=new De({defines:["TRANSLUCENT",w],sources:[V]}),this._shaderClampToGround&&(I?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=tn.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:ao})),this._blendOption===Lo.OPAQUE&&(Z=new De({defines:[w],sources:[V]}),this._shaderClampToGround&&(I?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${P}`)),this._sp=tn.replaceCache({context:i,shaderProgram:this._sp,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:ao})),this._blendOption===Lo.TRANSLUCENT&&(Z=new De({defines:[w],sources:[V]}),this._shaderClampToGround&&(I?Z.defines.push("VERTEX_DEPTH_CHECK"):Z.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(Z.defines.push("SDF"),Z.defines.push(`SDF_EDGE ${P}`)),this._spTranslucent=tn.replaceCache({context:i,shaderProgram:this._spTranslucent,vertexShaderSource:L,fragmentShaderSource:Z,attributeLocations:ao})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let v=e.commandList;if(p.render||p.pick){let P=this._colorCommands,w=this._blendOption===Lo.OPAQUE,F=this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT,b=this._vaf.va,R=b.length,E=this._uniforms,X;l(this._batchTable)?(E=this._batchTable.getUniformMapCallback()(E),X=this._batchTable.getPickId()):X="v_pickColor",P.length=R;let A=F?R*2:R;for(let N=0;N<A;++N){let O=P[N];l(O)||(O=P[N]=new tt);let U=w||F&&N%2===0;O.pass=U||!F?Ge.OPAQUE:Ge.TRANSLUCENT,O.owner=this;let Y=F?Math.floor(N/2):N;O.boundingVolume=f,O.modelMatrix=x,O.count=b[Y].indicesCount,O.shaderProgram=U?this._sp:this._spTranslucent,O.uniformMap=E,O.vertexArray=b[Y].va,O.renderState=U?this._rsOpaque:this._rsTranslucent,O.debugShowBoundingVolume=this.debugShowBoundingVolume,O.pickId=X,this._instanced&&(O.count=6,O.instanceCount=n),v.push(O)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=cze(this,e.context)),v.push(this.debugCommand))}};Eu.prototype.isDestroyed=function(){return!1};Eu.prototype.destroy=function(){return l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),Rce(this._billboards),me(this)};var Sd=Eu;var cFn=T(S(),1);var eFn=T(S(),1);function dze(e,t,n,i,o){return function(){let r=document.createElement("canvas"),s=o+2*i;r.height=r.width=s;let a=r.getContext("2d");return a.clearRect(0,0,s,s),i!==0&&(a.beginPath(),a.arc(s/2,s/2,s/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=n,a.fill(),e<1&&(a.save(),a.globalCompositeOperation="destination-out",a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),r}}var __=dze;function da(e,t,n,i,o){this._content=e,this._billboard=n,this._label=i,this._polyline=o,this._batchId=t,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),e1(this)}var uze=new he;Object.defineProperties(da.prototype,{show:{get:function(){return this._label.show},set:function(e){this._label.show=e,this._billboard.show=e,this._polyline.show=e}},color:{get:function(){return this._color},set:function(e){this._color=B.clone(e,this._color),e1(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,e1(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=B.clone(e,this._pointOutlineColor),e1(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,e1(this)}},labelColor:{get:function(){return this._label.fillColor},set:function(e){this._label.fillColor=e,this._polyline.show=this._label.show&&e.alpha>0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){l(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){let t=y(this._heightOffset,0),n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,uze);i.height=i.height-t+e;let o=n.cartographicToCartesian(i);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=B.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){let t=this._billboardImage!==e;this._billboardImage=e,t&&e1(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){let e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}});da.defaultColor=B.WHITE;da.defaultPointOutlineColor=B.BLACK;da.defaultPointOutlineWidth=0;da.defaultPointSize=8;function e1(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=y(e._color,da.defaultColor),i=y(e._pointOutlineColor,da.defaultPointOutlineColor),o=y(e._pointOutlineWidth,da.defaultPointOutlineWidth),r=y(e._pointSize,da.defaultPointSize),s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,d=e._billboardSize;if(B.equals(n,s)&&B.equals(i,a)&&o===c&&r===d)return;e._billboardColor=B.clone(n,e._billboardColor),e._billboardOutlineColor=B.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let u=n.alpha,m=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([m,r,p,o]);t.setImage(g,__(u,m,p,o,r))}da.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};da.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};da.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};da.prototype.getPropertyInherited=function(e){return Ns.getPropertyInherited(this._content,this._batchId,e)};da.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};da.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};da.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};da.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var ub=da;var eAn=T(S(),1);var hFn=T(S(),1);function mze(e,t,n,i,o){let r=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),c=document.createElement("canvas"),d=100,u=r.width+d|0,m=3*a,p=m/2;c.width=u,c.height=m;let g=c.getContext("2d");g.font=n,g.fillStyle="white",g.fillRect(0,0,c.width+1,c.height+1),i&&(g.strokeStyle="black",g.lineWidth=e.lineWidth,g.strokeText(t,d/2,p)),o&&(g.fillStyle="black",g.fillText(t,d/2,p));let f=g.getImageData(0,0,u,m).data,x=f.length,_=u*4,C,V,L,Z;for(C=0;C<x;++C)if(f[C]!==255){L=C/_|0;break}for(C=x-1;C>=0;--C)if(f[C]!==255){Z=C/_|0;break}let G=-1;for(C=0;C<u&&G===-1;++C)for(V=0;V<m;++V){let I=C*4+V*_;if(f[I]!==255||f[I+1]!==255||f[I+2]!==255||f[I+3]!==255){G=C;break}}return{width:r.width,height:Z-L,ascent:p-L,descent:Z-p,minx:G-d/2}}return{width:r.width,height:0,ascent:0,descent:0,minx:0}}var T_;function hze(e,t){if(e==="")return;t=y(t,y.EMPTY_OBJECT);let n=y(t.font,"10px sans-serif"),i=y(t.stroke,!1),o=y(t.fill,!0),r=y(t.strokeWidth,1),s=y(t.backgroundColor,B.TRANSPARENT),a=y(t.padding,0),c=a*2,d=document.createElement("canvas");d.width=1,d.height=1,d.style.font=n;let u=d.getContext("2d",{willReadFrequently:!0});l(T_)||(l(u.imageSmoothingEnabled)?T_="imageSmoothingEnabled":l(u.mozImageSmoothingEnabled)?T_="mozImageSmoothingEnabled":l(u.webkitImageSmoothingEnabled)?T_="webkitImageSmoothingEnabled":l(u.msImageSmoothingEnabled)&&(T_="msImageSmoothingEnabled")),u.font=n,u.lineJoin="round",u.lineWidth=r,u[T_]=!1,d.style.visibility="hidden",document.body.appendChild(d);let m=mze(u,e,n,i,o);d.dimensions=m,document.body.removeChild(d),d.style.visibility="";let p=-m.minx,g=Math.ceil(m.width)+p+c,f=m.height+c,x=f-m.ascent+a,_=f-x+c;if(d.width=g,d.height=f,u.font=n,u.lineJoin="round",u.lineWidth=r,u[T_]=!1,s!==B.TRANSPARENT&&(u.fillStyle=s.toCssColorString(),u.fillRect(0,0,d.width,d.height)),i){let C=y(t.strokeColor,B.BLACK);u.strokeStyle=C.toCssColorString(),u.strokeText(e,p+a,_)}if(o){let C=y(t.fillColor,B.WHITE);u.fillStyle=C.toCssColorString(),u.fillText(e,p+a,_)}return d}var S_=hze;var jce=T(Oce(),1);var PFn=T(S(),1);var gFn=T(S(),1),pze={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},Uo=Object.freeze(pze);var Yce={},Hce=0,bze=256,gze=new B(.165,.165,.165,.8),yze=new D(7,5),ps=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function C_(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function V2(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function L2(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Kce(e){let t=Yce[e._font];if(!l(t)){let n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(L2(n,"line-height"));isNaN(i)&&(i=void 0),t={family:L2(n,"font-family"),size:L2(n,"font-size").replace("px",""),style:L2(n,"font-style"),weight:L2(n,"font-weight"),lineHeight:i},document.body.removeChild(n),Hce<bze&&(Yce[e._font]=t,Hce++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function mb(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Ut.clone(n)),l(i)&&(i=Ut.clone(i)),l(o)&&(o=Ut.clone(o)),l(r)&&(r=At.clone(r)),this._renderedText=void 0,this._text=void 0,this._show=y(e.show,!0),this._font=y(e.font,"30px sans-serif"),this._fillColor=B.clone(y(e.fillColor,B.WHITE)),this._outlineColor=B.clone(y(e.outlineColor,B.BLACK)),this._outlineWidth=y(e.outlineWidth,1),this._showBackground=y(e.showBackground,!1),this._backgroundColor=B.clone(y(e.backgroundColor,gze)),this._backgroundPadding=D.clone(y(e.backgroundPadding,yze)),this._style=y(e.style,Uo.FILL),this._verticalOrigin=y(e.verticalOrigin,Pn.BASELINE),this._horizontalOrigin=y(e.horizontalOrigin,gi.LEFT),this._pixelOffset=D.clone(y(e.pixelOffset,D.ZERO)),this._eyeOffset=h.clone(y(e.eyeOffset,h.ZERO)),this._position=h.clone(y(e.position,h.ZERO)),this._scale=y(e.scale,1),this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=y(e.heightReference,Qe.NONE),this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this.text=y(e.text,""),this._relativeSize=1,Kce(this),this._updateClamping()}Object.defineProperties(mb.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.show=e)}let n=this._backgroundBillboard;l(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){let t=this._position;if(!h.equals(t,e)){h.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o].billboard;l(s)&&(s.position=e)}let i=this._backgroundBillboard;l(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.heightReference=e)}let n=this._backgroundBillboard;l(n)&&(n.heightReference=e),V2(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=e.replace(/\u00ad/g,"");this._renderedText=mb.enableRightToLeftDetection?Vze(t):t,C_(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,C_(this),Kce(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;B.equals(t,e)||(B.clone(e,t),C_(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;B.equals(t,e)||(B.clone(e,t),C_(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,C_(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,C_(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!B.equals(t,e)){B.clone(e,t);let n=this._backgroundBillboard;l(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){let t=this._backgroundPadding;D.equals(t,e)||(D.clone(e,t),V2(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,C_(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!D.equals(t,e)){D.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;if(!Ut.equals(t,e)){this._translucencyByDistance=Ut.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;if(!Ut.equals(t,e)){this._pixelOffsetScaleByDistance=Ut.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;if(!Ut.equals(t,e)){this._scaleByDistance=Ut.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;if(!h.equals(t,e)){h.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,V2(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;l(n)&&(n.verticalOrigin=e),V2(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;l(n)&&(n.scale=e*this._relativeSize),V2(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!At.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=At.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;l(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;l(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.id=e)}let n=this._backgroundBillboard;l(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!l(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=h.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard._clampedPosition=e)}let n=this._backgroundBillboard;l(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.clusterShow=e)}let n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}}});mb.prototype._updateClamping=function(){so._updateClamping(this._labelCollection,this)};mb.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new D);let i=this._labelCollection.modelMatrix,o=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return so._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};mb.getScreenSpaceBoundingBox=function(e,t,n){let i=0,o=0,r=0,s=0,a=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,o=t.y-c._translate.y,r=c.width*a,s=c.height*a,e.verticalOrigin===Pn.BOTTOM||e.verticalOrigin===Pn.BASELINE?o-=s:e.verticalOrigin===Pn.CENTER&&(o-=s*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let d=0,u=0,m=e._glyphs,p=m.length;for(let g=0;g<p;++g){let f=m[g],x=f.billboard;if(!l(x))continue;let _=t.x+x._translate.x,C=t.y-x._translate.y,V=f.dimensions.width*a,L=f.dimensions.height*a;e.verticalOrigin===Pn.BOTTOM||e.verticalOrigin===Pn.BASELINE?C-=L:e.verticalOrigin===Pn.CENTER&&(C-=L*.5),e._verticalOrigin===Pn.TOP?C+=Bs.PADDING*a:(e._verticalOrigin===Pn.BOTTOM||e._verticalOrigin===Pn.BASELINE)&&(C-=Bs.PADDING*a),i=Math.min(i,_),o=Math.min(o,C),d=Math.max(d,_+V),u=Math.max(u,C+L)}r=d-i,s=u-o}return l(n)||(n=new Ke),n.x=i,n.y=o,n.width=r,n.height=s,n};mb.prototype.equals=function(e){return this===e||l(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&h.equals(this._position,e._position)&&B.equals(this._fillColor,e._fillColor)&&B.equals(this._outlineColor,e._outlineColor)&&B.equals(this._backgroundColor,e._backgroundColor)&&D.equals(this._backgroundPadding,e._backgroundPadding)&&D.equals(this._pixelOffset,e._pixelOffset)&&h.equals(this._eyeOffset,e._eyeOffset)&&Ut.equals(this._translucencyByDistance,e._translucencyByDistance)&&Ut.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Ut.equals(this._scaleByDistance,e._scaleByDistance)&&At.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};mb.prototype.isDestroyed=function(){return!1};mb.enableRightToLeftDetection=!1;function xze(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",s=ps.LTR,a="",c=e.length;for(let d=0;d<c;++d){let u=e.charAt(d);t.test(u)?a=ps.RTL:n.test(u)?a=ps.LTR:i.test(u)?a=ps.BRACKETS:a=ps.WEAK,d===0&&(s=a),s===a&&a!==ps.BRACKETS?r+=u:(r!==""&&o.push({Type:s,Word:r}),s=a,r=u)}return o.push({Type:a,Word:r}),o}function _ze(e){return e.split("").reverse().join("")}function R2(e,t,n){return e.slice(0,t)+n+e.slice(t)}function Tze(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var Sze="\u05D0-\u05EA",Cze="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",zce=new RegExp(`[${Sze}${Cze}]`);function Vze(e){let t=e.split(`
  8121. `),n="";for(let i=0;i<t.length;i++){let o=t[i],r=zce.test(o.charAt(0)),s=xze(o,zce),a=0,c="";for(let d=0;d<s.length;++d){let u=s[d],m=u.Type===ps.BRACKETS?Tze(u.Word):_ze(u.Word);r?u.Type===ps.RTL?(c=m+c,a=0):u.Type===ps.LTR?(c=R2(c,a,u.Word),a+=u.Word.length):(u.Type===ps.WEAK||u.Type===ps.BRACKETS)&&(u.Type===ps.WEAK&&s[d-1].Type===ps.BRACKETS?c=m+c:s[d-1].Type===ps.RTL?(c=m+c,a=0):s.length>d+1?s[d+1].Type===ps.RTL?(c=m+c,a=0):(c=R2(c,a,u.Word),a+=u.Word.length):c=R2(c,0,m)):u.Type===ps.RTL?c=R2(c,a,m):u.Type===ps.LTR?(c+=u.Word,a=c.length):(u.Type===ps.WEAK||u.Type===ps.BRACKETS)&&(d>0&&s[d-1].Type===ps.RTL?s.length>d+1?s[d+1].Type===ps.RTL?c=R2(c,a,m):(c+=u.Word,a=c.length):c+=u.Word:(c+=u.Word,a=c.length))}n+=c,i<t.length-1&&(n+=`
  8122. `)}return n}var Zg=mb;var qce=T(Jce(),1);function Rze(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function Zze(e,t,n){this.labelCollection=e,this.index=t,this.dimensions=n}var Gze=1.2,$ce="ID_WHITE_PIXEL",kz=new D(4,4),Eze=new Ke(1,1,1,1);function Ize(e){let t=document.createElement("canvas");t.width=kz.x,t.height=kz.y;let n=t.getContext("2d");return n.fillStyle="#fff",n.fillRect(0,0,t.width,t.height),e.addImage($ce,t)}var Iu={};function Xze(e,t,n,i,o,r,s){return Iu.font=t,Iu.fillColor=n,Iu.strokeColor=i,Iu.strokeWidth=o,Iu.padding=Bs.PADDING,s===Pn.CENTER?Iu.textBaseline="middle":s===Pn.TOP?Iu.textBaseline="top":Iu.textBaseline="bottom",Iu.fill=r===Uo.FILL||r===Uo.FILL_AND_OUTLINE,Iu.stroke=r===Uo.OUTLINE||r===Uo.FILL_AND_OUTLINE,Iu.backgroundColor=B.BLACK,S_(e,Iu)}function Uz(e,t){t.textureInfo=void 0,t.dimensions=void 0;let n=t.billboard;l(n)&&(n.show=!1,n.image=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}function Wze(e,t,n,i){i.index=e.addImageSync(t,n)}var Pze=new qce.default;function vze(e,t){let n=t._renderedText,i=Pze.splitGraphemes(n),o=i.length,r=t._glyphs,s=r.length,a,c,d;if(t._relativeSize=t._fontSize/Bs.FONT_SIZE,o<s)for(c=o;c<s;++c)Uz(e,r[c]);r.length=o;let u=t.show&&t._showBackground&&n.split(`
  8123. `).join("").length>0,m=t._backgroundBillboard,p=e._backgroundBillboardCollection;u?(l(m)||(m=p.add({collection:e,image:$ce,imageSubRegion:Eze}),t._backgroundBillboard=m),m.color=t._backgroundColor,m.show=t._show,m.position=t._position,m.eyeOffset=t._eyeOffset,m.pixelOffset=t._pixelOffset,m.horizontalOrigin=gi.LEFT,m.verticalOrigin=t._verticalOrigin,m.heightReference=t._heightReference,m.scale=t.totalScale,m.pickPrimitive=t,m.id=t._id,m.translucencyByDistance=t._translucencyByDistance,m.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,m.scaleByDistance=t._scaleByDistance,m.distanceDisplayCondition=t._distanceDisplayCondition,m.disableDepthTestDistance=t._disableDepthTestDistance,m.clusterShow=t.clusterShow):l(m)&&(p.remove(m),t._backgroundBillboard=m=void 0);let g=e._glyphTextureCache;for(d=0;d<o;++d){let f=i[d],x=t._verticalOrigin,_=JSON.stringify([f,t._fontFamily,t._fontStyle,t._fontWeight,+x]),C=g[_];if(!l(C)){let V=`${t._fontStyle} ${t._fontWeight} ${Bs.FONT_SIZE}px ${t._fontFamily}`,L=Xze(f,V,B.WHITE,B.WHITE,0,Uo.FILL,x);if(C=new Zze(e,-1,L.dimensions),g[_]=C,L.width>0&&L.height>0){let Z=(0,jce.default)(L,{cutoff:Bs.CUTOFF,radius:Bs.RADIUS}),G=L.getContext("2d"),I=L.width,v=L.height,P=G.getImageData(0,0,I,v);for(let w=0;w<I;w++)for(let F=0;F<v;F++){let b=F*I+w,R=Z[b]*255,E=b*4;P.data[E+0]=R,P.data[E+1]=R,P.data[E+2]=R,P.data[E+3]=R}G.putImageData(P,0,0),f!==" "&&Wze(e._textureAtlas,_,L,C)}}if(a=r[d],l(a)?C.index===-1?Uz(e,a):l(a.textureInfo)&&(a.textureInfo=void 0):(a=new Rze,r[d]=a),a.textureInfo=C,a.dimensions=C.dimensions,C.index!==-1){let V=a.billboard,L=e._spareBillboards;l(V)||(L.length>0?V=L.pop():(V=e._billboardCollection.add({collection:e}),V._labelDimensions=new D,V._labelTranslate=new D),a.billboard=V),V.show=t._show,V.position=t._position,V.eyeOffset=t._eyeOffset,V.pixelOffset=t._pixelOffset,V.horizontalOrigin=gi.LEFT,V.verticalOrigin=t._verticalOrigin,V.heightReference=t._heightReference,V.scale=t.totalScale,V.pickPrimitive=t,V.id=t._id,V.image=_,V.translucencyByDistance=t._translucencyByDistance,V.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,V.scaleByDistance=t._scaleByDistance,V.distanceDisplayCondition=t._distanceDisplayCondition,V.disableDepthTestDistance=t._disableDepthTestDistance,V._batchIndex=t._batchIndex,V.outlineColor=t.outlineColor,t.style===Uo.FILL_AND_OUTLINE?(V.color=t._fillColor,V.outlineWidth=t.outlineWidth):t.style===Uo.FILL?(V.color=t._fillColor,V.outlineWidth=0):t.style===Uo.OUTLINE&&(V.color=B.TRANSPARENT,V.outlineWidth=t.outlineWidth)}}t._repositionAllGlyphs=!0}function Qce(e,t,n){return t===gi.CENTER?-e/2:t===gi.RIGHT?-(e+n.x):n.x}var cr=new D,wze=new D;function Fze(e){let t=e._glyphs,n=e._renderedText,i,o,r=0,s=0,a=[],c=Number.NEGATIVE_INFINITY,d=0,u=1,m,p=t.length,g=e._backgroundBillboard,f=D.clone(l(g)?e._backgroundPadding:D.ZERO,wze);for(f.x/=e._relativeSize,f.y/=e._relativeSize,m=0;m<p;++m)n.charAt(m)===`
  8124. `?(a.push(r),++u,r=0):(i=t[m],o=i.dimensions,d=Math.max(d,o.height-o.descent),c=Math.max(c,o.descent),r+=o.width-o.minx,m<p-1&&(r+=t[m+1].dimensions.minx),s=Math.max(s,r));a.push(r);let x=d+c,_=e.totalScale,C=e._horizontalOrigin,V=e._verticalOrigin,L=0,Z=a[L],G=Qce(Z,C,f),I=(l(e._lineHeight)?e._lineHeight:Gze*e._fontSize)/e._relativeSize,v=I*(u-1),P=s,w=x+v;l(g)&&(P+=f.x*2,w+=f.y*2,g._labelHorizontalOrigin=C),cr.x=G*_,cr.y=0;let F=!0,b=0;for(m=0;m<p;++m)if(n.charAt(m)===`
  8125. `)++L,b+=I,Z=a[L],G=Qce(Z,C,f),cr.x=G*_,F=!0;else if(i=t[m],o=i.dimensions,V===Pn.TOP?(cr.y=o.height-d-f.y,cr.y+=Bs.PADDING):V===Pn.CENTER?cr.y=(v+o.height-d)/2:V===Pn.BASELINE?(cr.y=v,cr.y-=Bs.PADDING):(cr.y=v+c+f.y,cr.y-=Bs.PADDING),cr.y=(cr.y-o.descent-b)*_,F&&(cr.x-=Bs.PADDING*_,F=!1),l(i.billboard)&&(i.billboard._setTranslate(cr),i.billboard._labelDimensions.x=P,i.billboard._labelDimensions.y=w,i.billboard._labelHorizontalOrigin=C),m<p-1){let R=t[m+1];cr.x+=(o.width-o.minx+R.dimensions.minx)*_}if(l(g)&&n.split(`
  8126. `).join("").length>0&&(C===gi.CENTER?G=-s/2-f.x:C===gi.RIGHT?G=-(s+f.x*2):G=0,cr.x=G*_,V===Pn.TOP?cr.y=x-d-c:V===Pn.CENTER?cr.y=(x-d)/2-c:V===Pn.BASELINE?cr.y=-f.y-c:cr.y=0,cr.y=cr.y*_,g.width=P,g.height=w,g._setTranslate(cr),g._labelTranslate=D.clone(cr,g._labelTranslate)),bu(e.heightReference))for(m=0;m<p;++m){i=t[m];let R=i.billboard;l(R)&&(R._labelTranslate=D.clone(cr,R._labelTranslate))}}function ele(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)Uz(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),me(t)}function hf(e){e=y(e,y.EMPTY_OBJECT),this._scene=e.scene,this._batchTable=e.batchTable,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._backgroundBillboardCollection=new Sd({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new Sd({scene:this._scene,batchTable:this._batchTable}),this._billboardCollection.destroyTextureAtlas=!1,this._billboardCollection._sdf=!0,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=B.clone(B.WHITE),this.show=y(e.show,!0),this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,Lo.OPAQUE_AND_TRANSLUCENT)}Object.defineProperties(hf.prototype,{length:{get:function(){return this._labels.length}}});hf.prototype.add=function(e){let t=new Zg(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};hf.prototype.remove=function(e){if(l(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),ele(this,e),!0}return!1};hf.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)ele(this,e[t]);e.length=0};hf.prototype.contains=function(e){return l(e)&&e._labelCollection===this};hf.prototype.get=function(e){return this._labels[e]};hf.prototype.update=function(e){if(!this.show)return;let t=this._billboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=e.context;l(this._textureAtlas)||(this._textureAtlas=new Rg({context:i}),t.textureAtlas=this._textureAtlas),l(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new Rg({context:i,initialSize:kz}),n.textureAtlas=this._backgroundTextureAtlas,Ize(this._backgroundTextureAtlas));let o=this._labelsToUpdate.length;for(let s=0;s<o;++s){let a=this._labelsToUpdate[s];if(a.isDestroyed())continue;let c=a._glyphs.length;a._rebindAllGlyphs&&(vze(this,a),a._rebindAllGlyphs=!1),a._repositionAllGlyphs&&(Fze(a),a._repositionAllGlyphs=!1);let d=a._glyphs.length-c;this._totalGlyphCount+=d}let r=n.length>0?Lo.TRANSLUCENT:this.blendOption;t.blendOption=r,n.blendOption=r,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};hf.prototype.isDestroyed=function(){return!1};hf.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),me(this)};var ff=hf;var mMn=T(S(),1);var nAn=T(S(),1),Z2=`in vec3 position3DHigh;
  8127. in vec3 position3DLow;
  8128. in vec3 position2DHigh;
  8129. in vec3 position2DLow;
  8130. in vec3 prevPosition3DHigh;
  8131. in vec3 prevPosition3DLow;
  8132. in vec3 prevPosition2DHigh;
  8133. in vec3 prevPosition2DLow;
  8134. in vec3 nextPosition3DHigh;
  8135. in vec3 nextPosition3DLow;
  8136. in vec3 nextPosition2DHigh;
  8137. in vec3 nextPosition2DLow;
  8138. in vec4 texCoordExpandAndBatchIndex;
  8139. out vec2 v_st;
  8140. out float v_width;
  8141. out vec4 v_pickColor;
  8142. out float v_polylineAngle;
  8143. void main()
  8144. {
  8145. float texCoord = texCoordExpandAndBatchIndex.x;
  8146. float expandDir = texCoordExpandAndBatchIndex.y;
  8147. bool usePrev = texCoordExpandAndBatchIndex.z < 0.0;
  8148. float batchTableIndex = texCoordExpandAndBatchIndex.w;
  8149. vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex);
  8150. float width = widthAndShow.x + 0.5;
  8151. float show = widthAndShow.y;
  8152. if (width < 1.0)
  8153. {
  8154. show = 0.0;
  8155. }
  8156. vec4 pickColor = batchTable_getPickColor(batchTableIndex);
  8157. vec4 p, prev, next;
  8158. if (czm_morphTime == 1.0)
  8159. {
  8160. p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);
  8161. prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);
  8162. next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);
  8163. }
  8164. else if (czm_morphTime == 0.0)
  8165. {
  8166. p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);
  8167. prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);
  8168. next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);
  8169. }
  8170. else
  8171. {
  8172. p = czm_columbusViewMorph(
  8173. czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),
  8174. czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),
  8175. czm_morphTime);
  8176. prev = czm_columbusViewMorph(
  8177. czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),
  8178. czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),
  8179. czm_morphTime);
  8180. next = czm_columbusViewMorph(
  8181. czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),
  8182. czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),
  8183. czm_morphTime);
  8184. }
  8185. #ifdef DISTANCE_DISPLAY_CONDITION
  8186. vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex);
  8187. vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex);
  8188. vec3 centerLow = centerLowAndRadius.xyz;
  8189. float radius = centerLowAndRadius.w;
  8190. vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex);
  8191. float lengthSq;
  8192. if (czm_sceneMode == czm_sceneMode2D)
  8193. {
  8194. lengthSq = czm_eyeHeight2D.y;
  8195. }
  8196. else
  8197. {
  8198. vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz);
  8199. lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius);
  8200. }
  8201. float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;
  8202. float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;
  8203. if (lengthSq < nearSq || lengthSq > farSq)
  8204. {
  8205. show = 0.0;
  8206. }
  8207. #endif
  8208. float polylineAngle;
  8209. vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle);
  8210. gl_Position = czm_viewportOrthographic * positionWC * show;
  8211. v_st.s = texCoord;
  8212. v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w);
  8213. v_width = width;
  8214. v_pickColor = pickColor;
  8215. v_polylineAngle = polylineAngle;
  8216. }
  8217. `;var ZAn=T(S(),1);var pAn=T(S(),1);var Kc={};Kc.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};Kc.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var Aze=new he;Kc.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let o=0;o<n;o++){let r=e[o];i[o]=t.cartesianToCartographic(r,Aze).height}return i};var Mze=new M,Nze=new h,tle=new h,kze=new ln(h.UNIT_X,0),nle=new h,Uze=new ln(h.UNIT_X,0),Dze=new h,Bze=new h,Bz=[];function ole(e,t,n){let i=Bz;i.length=e;let o;if(t===n){for(o=0;o<e;o++)i[o]=t;return i}let s=(n-t)/e;for(o=0;o<e;o++){let a=t+o*s;i[o]=a}return i}var nk=new he,tk=new he,Gg=new h,Oz=new h,Oze=new h,Dz=new Rp,G2=new Ea;function Yze(e,t,n,i,o,r,s,a){let c=i.scaleToGeodeticSurface(e,Oz),d=i.scaleToGeodeticSurface(t,Oze),u=Kc.numberOfPoints(e,t,n),m=i.cartesianToCartographic(c,nk),p=i.cartesianToCartographic(d,tk),g=ole(u,o,r);Dz.setEndPoints(m,p);let f=Dz.surfaceDistance/u,x=a;m.height=o;let _=i.cartographicToCartesian(m,Gg);h.pack(_,s,x),x+=3;for(let C=1;C<u;C++){let V=Dz.interpolateUsingSurfaceDistance(C*f,tk);V.height=g[C],_=i.cartographicToCartesian(V,Gg),h.pack(_,s,x),x+=3}return x}function Hze(e,t,n,i,o,r,s,a){let c=i.cartesianToCartographic(e,nk),d=i.cartesianToCartographic(t,tk),u=Kc.numberOfPointsRhumbLine(c,d,n);c.height=0,d.height=0;let m=ole(u,o,r);G2.ellipsoid.equals(i)||(G2=new Ea(void 0,void 0,i)),G2.setEndPoints(c,d);let p=G2.surfaceDistance/u,g=a;c.height=o;let f=i.cartographicToCartesian(c,Gg);h.pack(f,s,g),g+=3;for(let x=1;x<u;x++){let _=G2.interpolateUsingSurfaceDistance(x*p,tk);_.height=m[x],f=i.cartographicToCartesian(_,Gg),h.pack(f,s,g),g+=3}return g}Kc.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=y(t,M.IDENTITY);let o=M.inverseTransformation(t,Mze),r=M.multiplyByPoint(o,h.ZERO,Nze),s=h.normalize(M.multiplyByPointAsVector(o,h.UNIT_Y,tle),tle),a=ln.fromPointNormal(r,s,kze),c=h.normalize(M.multiplyByPointAsVector(o,h.UNIT_X,nle),nle),d=ln.fromPointNormal(r,c,Uze),u=1;n.push(h.clone(e[0]));let m=n[0],p=e.length;for(let g=1;g<p;++g){let f=e[g];if(ln.getPointDistance(d,m)<0||ln.getPointDistance(d,f)<0){let x=qn.lineSegmentPlane(m,f,a,Dze);if(l(x)){let _=h.multiplyByScalar(s,5e-9,Bze);ln.getPointDistance(a,m)<0&&h.negate(_,_),n.push(h.add(x,_,new h)),i.push(u+1),h.negate(_,_),n.push(h.add(x,_,new h)),u=1}}n.push(h.clone(e[g])),u++,m=f}i.push(u)}return{positions:n,lengths:i}};Kc.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,ne.default),o=y(e.height,0),r=Array.isArray(o);if(n<1)return[];if(n===1){let x=i.scaleToGeodeticSurface(t[0],Oz);if(o=r?o[0]:o,o!==0){let _=i.geodeticSurfaceNormal(x,Gg);h.multiplyByScalar(_,o,_),h.add(x,_,x)}return[x.x,x.y,x.z]}let s=e.minDistance;if(!l(s)){let x=y(e.granularity,W.RADIANS_PER_DEGREE);s=W.chordLength(x,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=Kc.numberOfPoints(t[c],t[c+1],s);let d=(a+1)*3,u=new Array(d),m=0;for(c=0;c<n-1;c++){let x=t[c],_=t[c+1],C=r?o[c]:o,V=r?o[c+1]:o;m=Yze(x,_,s,i,C,V,u,m)}Bz.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,nk);g.height=r?o[n-1]:o;let f=i.cartographicToCartesian(g,Gg);return h.pack(f,u,d-3),u};var ile=new he,zze=new he;Kc.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=y(e.ellipsoid,ne.default),o=y(e.height,0),r=Array.isArray(o);if(n<1)return[];if(n===1){let C=i.scaleToGeodeticSurface(t[0],Oz);if(o=r?o[0]:o,o!==0){let V=i.geodeticSurfaceNormal(C,Gg);h.multiplyByScalar(V,o,V),h.add(C,V,C)}return[C.x,C.y,C.z]}let s=y(e.granularity,W.RADIANS_PER_DEGREE),a=0,c,d=i.cartesianToCartographic(t[0],ile),u;for(c=0;c<n-1;c++)u=i.cartesianToCartographic(t[c+1],zze),a+=Kc.numberOfPointsRhumbLine(d,u,s),d=he.clone(u,ile);let m=(a+1)*3,p=new Array(m),g=0;for(c=0;c<n-1;c++){let C=t[c],V=t[c+1],L=r?o[c]:o,Z=r?o[c+1]:o;g=Hze(C,V,s,i,L,Z,p,g)}Bz.length=0;let f=t[n-1],x=i.cartesianToCartographic(f,nk);x.height=r?o[n-1]:o;let _=i.cartographicToCartesian(x,Gg);return h.pack(_,p,m-3),p};Kc.generateCartesianArc=function(e){let t=Kc.generateArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=h.unpack(t,o*3);return i};Kc.generateCartesianRhumbArc=function(e){let t=Kc.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=h.unpack(t,o*3);return i};var Gi=Kc;function Cd(e,t){e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._width=y(e.width,1),this._loop=y(e.loop,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=Oi.fromType(Oi.ColorType,{color:new B(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=xo(n,h.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(h.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=M.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Gi.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(sle),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=ce.fromPoints(this._actualPositions),this._boundingVolumeWC=ce.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new ce}var rle=Cd.POSITION_INDEX=0,Kze=Cd.SHOW_INDEX=1,Jze=Cd.WIDTH_INDEX=2,Qze=Cd.MATERIAL_INDEX=3,E2=Cd.POSITION_SIZE_INDEX=4,jze=Cd.DISTANCE_DISPLAY_CONDITION=5,sle=Cd.NUMBER_OF_PROPERTIES=6;function hb(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Cd.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,hb(this,Kze))}},positions:{get:function(){return this._positions},set:function(e){let t=xo(e,h.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(h.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&hb(this,E2),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=ce.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=ce.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),hb(this,rle),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,hb(this,Qze))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,hb(this,Jze))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!h.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(h.clone(t[0]))):t.length>2&&h.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,hb(this,E2)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){At.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=At.clone(e,this._distanceDisplayCondition),hb(this,jze))}}});Cd.prototype.update=function(){let e=M.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[rle]>0||this._propertiesChanged[E2]>0;if((!M.equals(e,this._modelMatrix)||i)&&(this._segments=Gi.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ce.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=M.clone(e,this._modelMatrix),this._segments.positions.length!==t)hb(this,E2);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){hb(this,E2);break}}};Cd.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};Cd.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<sle-1;++t)e[t]=0};Cd.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var Xu=Cd;var qze=Xu.SHOW_INDEX,$ze=Xu.WIDTH_INDEX,Hz=Xu.POSITION_INDEX,eKe=Xu.MATERIAL_INDEX,ale=Xu.POSITION_SIZE_INDEX,tKe=Xu.DISTANCE_DISPLAY_CONDITION,fle=Xu.NUMBER_OF_PROPERTIES,Al={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function Km(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(fle),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Me.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=B.clone(B.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(Km.prototype,{length:{get:function(){return zz(this),this._polylines.length}}});Km.prototype.add=function(e){let t=new Xu(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};Km.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};Km.prototype.removeAll=function(){Kz(this),xle(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};Km.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};Km.prototype.get=function(e){return zz(this),this._polylines[e]};function nKe(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:Q.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:Q.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:Q.FLOAT,componentsPerAttribute:2}];e._batchTable=new _x(t,n,e._polylines.length)}var ple=new On,ble=new se,gle=new D;Km.prototype.update=function(e){if(zz(this),this._polylines.length===0||!this.show)return;cKe(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(Bt.maximumVertexTextureImageUnits===0)throw new de("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");nKe(this,t),this._createBatchTable=!1}if(this._createVertexArray||oKe(this))dle(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==oe.SCENE3D){let d=c.length;for(let u=0;u<d;++u)i=c[u],i.update()}if(o[ale]||o[eKe])dle(this,t,n);else{let d=c.length,u=this._polylineBuckets;for(let m=0;m<d;++m){i=c[m],o=i._propertiesChanged;let p=i._bucket,g=0;for(let f in u)if(u.hasOwnProperty(f)){if(u[f]===p){o[Hz]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=u[f].lengthOfPositions}if((o[qze]||o[$ze])&&this._batchTable.setBatchedAttribute(i._index,0,new D(i._width,i._show)),this._batchTable.attributes.length>2){if(o[Hz]||o[ale]){let f=e.mode===oe.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,x=On.fromCartesian(f.center,ple),_=se.fromElements(x.low.x,x.low.y,x.low.z,f.radius,ble);this._batchTable.setBatchedAttribute(i._index,2,x.high),this._batchTable.setBatchedAttribute(i._index,3,_)}if(o[tKe]){let f=gle;f.x=0,f.y=Number.MAX_VALUE;let x=i.distanceDisplayCondition;l(x)&&(f.x=x.near,f.y=x.far),this._batchTable.setBatchedAttribute(i._index,4,f)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c<fle;++c)o[c]=0;let r=M.IDENTITY;e.mode===oe.SCENE3D&&(r=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=Ue.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=Ue.fromCache({blending:un.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;iKe(this,e,c,r)}};var I2=new ce,cle=new ce;function iKe(e,t,n,i){let o=t.context,r=t.commandList,s=n.length,a=0,c=!0,d=e._vertexArrays,u=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),g=d.length;for(let f=0;f<g;++f){let x=d[f],_=x.buckets,C=_.length;for(let V=0;V<C;++V){let L=_[V],Z=L.offset,G=L.bucket.shaderProgram,I=L.bucket.polylines,v=I.length,P,w,F=0,b,R;for(let E=0;E<v;++E){let X=I[E],A=sKe(X._material);if(A!==P){if(l(P)&&F>0){let Y=w.isTranslucent();a>=s?(b=new tt({owner:e}),n.push(b)):b=n[a],++a,R=Tt(p(w._uniforms),e._uniformMap),b.boundingVolume=ce.clone(I2,b.boundingVolume),b.modelMatrix=i,b.shaderProgram=G,b.vertexArray=x.va,b.renderState=Y?e._translucentRS:e._opaqueRS,b.pass=Y?Ge.TRANSLUCENT:Ge.OPAQUE,b.debugShowBoundingVolume=u,b.pickId="v_pickColor",b.uniformMap=R,b.count=F,b.offset=Z,Z+=F,F=0,c=!0,r.push(b)}w=X._material,w.update(o),P=A}let N=X._locatorBuckets,O=N.length;for(let Y=0;Y<O;++Y){let k=N[Y];k.locator===L&&(F+=k.count)}let U;t.mode===oe.SCENE3D?U=X._boundingVolumeWC:t.mode===oe.COLUMBUS_VIEW?U=X._boundingVolume2D:t.mode===oe.SCENE2D?l(X._boundingVolume2D)&&(U=ce.clone(X._boundingVolume2D,cle),U.center.x=0):l(X._boundingVolumeWC)&&l(X._boundingVolume2D)&&(U=ce.union(X._boundingVolumeWC,X._boundingVolume2D,cle)),c?(c=!1,ce.clone(U,I2)):ce.union(U,I2,I2)}l(P)&&F>0&&(a>=s?(b=new tt({owner:e}),n.push(b)):b=n[a],++a,R=Tt(p(w._uniforms),e._uniformMap),b.boundingVolume=ce.clone(I2,b.boundingVolume),b.modelMatrix=i,b.shaderProgram=G,b.vertexArray=x.va,b.renderState=w.isTranslucent()?e._translucentRS:e._opaqueRS,b.pass=w.isTranslucent()?Ge.TRANSLUCENT:Ge.OPAQUE,b.debugShowBoundingVolume=u,b.pickId="v_pickColor",b.uniformMap=R,b.count=F,b.offset=Z,c=!0,r.push(b)),P=void 0}}n.length=a}Km.prototype.isDestroyed=function(){return!1};Km.prototype.destroy=function(){return yle(this),Kz(this),xle(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),me(this)};function oKe(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[Hz]?(i.bufferUsage!==Me.STREAM_DRAW&&(t=!0,i.bufferUsage=Me.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Me.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Me.STATIC_DRAW):i.frameCount--),t}var lle=[0,0,0];function dle(e,t,n){e._createVertexArray=!1,Kz(e),yle(e),aKe(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],c=0,d=[[]],u=0,m=e._polylineBuckets,p,g;for(p in m)m.hasOwnProperty(p)&&(g=m[p],g.updateShader(t,r,s),u+=g.lengthOfPositions);if(u>0){let f=e._mode,x=new Float32Array(6*u*3),_=new Float32Array(u*4),C,V=0,L=0,Z=0;for(p in m)if(m.hasOwnProperty(p)){g=m[p],g.write(x,_,V,L,Z,r,t,n),f===oe.MORPHING&&(l(C)||(C=new Float32Array(6*u*3)),g.writeForMorph(C,V));let R=g.lengthOfPositions;V+=6*R*3,L+=R*4,Z+=R*4,c=g.updateIndices(i,a,d,c)}let G=e._positionBufferUsage.bufferUsage,I=Me.STATIC_DRAW;e._positionBuffer=xt.createVertexBuffer({context:t,typedArray:x,usage:G});let v;l(C)&&(v=xt.createVertexBuffer({context:t,typedArray:C,usage:G})),e._texCoordExpandAndBatchIndexBuffer=xt.createVertexBuffer({context:t,typedArray:_,usage:I});let P=3*Float32Array.BYTES_PER_ELEMENT,w=4*Float32Array.BYTES_PER_ELEMENT,F=0,b=i.length;for(let R=0;R<b;++R)if(o=i[R],o.length>0){let E=new Uint16Array(o),X=xt.createIndexBuffer({context:t,typedArray:E,usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT});F+=a[R];let A=6*(R*(P*W.SIXTY_FOUR_KILOBYTES)-F*P),N=P+A,O=P+N,U=P+O,Y=P+U,k=P+Y,H=R*(w*W.SIXTY_FOUR_KILOBYTES)-F*w,J=[{index:Al.position3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:A,strideInBytes:6*P},{index:Al.position3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:N,strideInBytes:6*P},{index:Al.position2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:A,strideInBytes:6*P},{index:Al.position2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:N,strideInBytes:6*P},{index:Al.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:O,strideInBytes:6*P},{index:Al.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:U,strideInBytes:6*P},{index:Al.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:O,strideInBytes:6*P},{index:Al.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:U,strideInBytes:6*P},{index:Al.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:Y,strideInBytes:6*P},{index:Al.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:k,strideInBytes:6*P},{index:Al.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:Y,strideInBytes:6*P},{index:Al.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:Q.FLOAT,offsetInBytes:k,strideInBytes:6*P},{index:Al.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:Q.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:H}],te,z,q,ee;f===oe.SCENE3D?(z=e._positionBuffer,te="vertexBuffer",q=lle,ee="value"):f===oe.SCENE2D||f===oe.COLUMBUS_VIEW?(z=lle,te="value",q=e._positionBuffer,ee="vertexBuffer"):(z=v,te="vertexBuffer",q=e._positionBuffer,ee="vertexBuffer"),J[0][te]=z,J[1][te]=z,J[2][ee]=q,J[3][ee]=q,J[4][te]=z,J[5][te]=z,J[6][ee]=q,J[7][ee]=q,J[8][te]=z,J[9][te]=z,J[10][ee]=q,J[11][ee]=q;let fe=new ti({context:t,attributes:J,indexBuffer:X});e._vertexArrays.push({va:fe,buckets:d[R]})}}}function rKe(e,t){return t instanceof Pt?t.id:t}var ik=[];function sKe(e){let t=Oi._uniformList[e.type],n=t.length;ik.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];ik[i]=r,ik[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(ik,rKe)}`}function aKe(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},o=e._polylines,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a._actualPositions.length>1){a.update();let c=a.material,d=i[c.type];l(d)||(d=i[c.type]=new pf(c,t,n)),d.addPolyline(a)}}}function cKe(e,t){let n=t.mode;(e._mode!==n||!M.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=M.clone(e.modelMatrix),e._createVertexArray=!0)}function zz(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,o,r=e._polylines.length;for(let s=0;s<r;++s)o=e._polylines[s],o.isDestroyed||(o._index=i++,n.push(o),t.push(o));e._polylines=t,e._polylinesToUpdate=n}}function Kz(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let o=t[i]._bucket;l(o)&&(o.shaderProgram=o.shaderProgram&&o.shaderProgram.destroy())}}function yle(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}Km.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function xle(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function Yz(e,t,n){this.count=e,this.offset=t,this.bucket=n}function pf(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}pf.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};pf.prototype.updateShader=function(e,t,n){if(l(this.shaderProgram))return;let i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&i.push("POLYLINE_DASH"),zt.isInternetExplorer()||i.push("CLIP_POLYLINE");let o=new De({defines:i,sources:[`in vec4 v_pickColor;
  8218. `,this.material.shaderSource,Rx]}),r=t.getVertexShaderCallback()(Z2),s=new De({defines:i,sources:[md,r]});this.shaderProgram=tn.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:Al})};function _le(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(ln.ORIGIN_ZX_PLANE)===Jt.INTERSECTING}pf.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===oe.SCENE3D||!_le(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let o=0;o<t;++o)n+=i[o]*4-4;return n};var Cs=new h,Wu=new h,Pu=new h,ok=new h,lKe=new se,dKe=new D;pf.prototype.write=function(e,t,n,i,o,r,s,a){let c=this.mode,d=a.ellipsoid.maximumRadius*W.PI,u=this.polylines,m=u.length;for(let p=0;p<m;++p){let g=u[p],f=g.width,x=g.show&&f>0,_=g._index,C=this.getSegments(g,a),V=C.positions,L=C.lengths,Z=V.length,G=g.getPickId(s).color,I=0,v=0,P;for(let O=0;O<Z;++O){O===0?g._loop?P=V[Z-2]:(P=ok,h.subtract(V[0],V[1],P),h.add(V[0],P,P)):P=V[O-1],h.clone(P,Wu),h.clone(V[O],Cs),O===Z-1?g._loop?P=V[1]:(P=ok,h.subtract(V[Z-1],V[Z-2],P),h.add(V[Z-1],P,P)):P=V[O+1],h.clone(P,Pu);let U=L[I];O===v+U&&(v+=U,++I);let Y=O-v===0,k=O===v+L[I]-1;c===oe.SCENE2D&&(Wu.z=0,Cs.z=0,Pu.z=0),(c===oe.SCENE2D||c===oe.MORPHING)&&(Y||k)&&d-Math.abs(Cs.x)<1&&((Cs.x<0&&Wu.x>0||Cs.x>0&&Wu.x<0)&&h.clone(Cs,Wu),(Cs.x<0&&Pu.x>0||Cs.x>0&&Pu.x<0)&&h.clone(Cs,Pu));let H=Y?2:0,J=k?2:4;for(let te=H;te<J;++te){On.writeElements(Cs,e,n),On.writeElements(Wu,e,n+6),On.writeElements(Pu,e,n+12);let z=te-2<0?-1:1;t[o]=O/(Z-1),t[o+1]=2*(te%2)-1,t[o+2]=z,t[o+3]=_,n+=6*3,o+=4}}let w=lKe;w.x=B.floatToByte(G.red),w.y=B.floatToByte(G.green),w.z=B.floatToByte(G.blue),w.w=B.floatToByte(G.alpha);let F=dKe;F.x=f,F.y=x?1:0;let b=c===oe.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,R=On.fromCartesian(b.center,ple),E=R.high,X=se.fromElements(R.low.x,R.low.y,R.low.z,b.radius,ble),A=gle;A.x=0,A.y=Number.MAX_VALUE;let N=g.distanceDisplayCondition;l(N)&&(A.x=N.near,A.y=N.far),r.setBatchedAttribute(_,0,F),r.setBatchedAttribute(_,1,w),r.attributes.length>2&&(r.setBatchedAttribute(_,2,E),r.setBatchedAttribute(_,3,X),r.setBatchedAttribute(_,4,A))}};var uKe=new h,mKe=new h,hKe=new h,ule=new h;pf.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=s._segments.positions,c=s._segments.lengths,d=a.length,u=0,m=0;for(let p=0;p<d;++p){let g;p===0?s._loop?g=a[d-2]:(g=ule,h.subtract(a[0],a[1],g),h.add(a[0],g,g)):g=a[p-1],g=M.multiplyByPoint(n,g,mKe);let f=M.multiplyByPoint(n,a[p],uKe),x;p===d-1?s._loop?x=a[1]:(x=ule,h.subtract(a[d-1],a[d-2],x),h.add(a[d-1],x,x)):x=a[p+1],x=M.multiplyByPoint(n,x,hKe);let _=c[u];p===m+_&&(m+=_,++u);let C=p-m===0,V=p===m+c[u]-1,L=C?2:0,Z=V?2:4;for(let G=L;G<Z;++G)On.writeElements(f,e,t),On.writeElements(g,e,t+6),On.writeElements(x,e,t+12),t+=6*3}}};var fKe=new Array(1);pf.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new Yz(0,i,this);n[o].push(r);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let d=this.polylines,u=d.length;for(let m=0;m<u;++m){let p=d[m];p._locatorBuckets=[];let g;if(this.mode===oe.SCENE3D){g=fKe;let x=p._actualPositions.length;if(x>0)g[0]=x;else continue}else g=p._segments.lengths;let f=g.length;if(f>0){let x=0;for(let _=0;_<f;++_){let C=g[_]-1;for(let V=0;V<C;++V)c+4>W.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:x}),x=0,t.push(4),a=[],e.push(a),c=0,r.count=s,s=0,i=0,r=new Yz(0,0,this),n[++o]=[r]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),x+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:r,count:x}),c+4>W.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,r.count=s,i=0,s=0,r=new Yz(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};pf.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let o=0;o<i;++o){let r=t[o];if(r===e)break;n+=r._actualLength}return n};var t1={positions:void 0,lengths:void 0},mle=new Array(1),pKe=new h,bKe=new he;pf.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===oe.SCENE3D)return mle[0]=n.length,t1.positions=n,t1.lengths=mle,t1;_le(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,c=pKe;for(let d=0;d<s;++d)a=n[d],c=M.multiplyByPoint(r,a,c),o.push(t.project(i.cartesianToCartographic(c,bKe)));if(o.length>0){e._boundingVolume2D=ce.fromPoints(o,e._boundingVolume2D);let d=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(d.z,d.x,d.y)}return t1.positions=o,t1.lengths=e._segments.lengths,t1};var hle;pf.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*W.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=hle,c=6*s*3;!l(a)||a.length<c?a=hle=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let d=this.getSegments(t,i),u=d.positions,m=d.lengths,p=0,g=0,f=0,x;s=u.length;for(let _=0;_<s;++_){_===0?t._loop?x=u[s-2]:(x=ok,h.subtract(u[0],u[1],x),h.add(u[0],x,x)):x=u[_-1],h.clone(x,Wu),h.clone(u[_],Cs),_===s-1?t._loop?x=u[1]:(x=ok,h.subtract(u[s-1],u[s-2],x),h.add(u[s-1],x,x)):x=u[_+1],h.clone(x,Pu);let C=m[g];_===f+C&&(f+=C,++g);let V=_-f===0,L=_===f+m[g]-1;o===oe.SCENE2D&&(Wu.z=0,Cs.z=0,Pu.z=0),(o===oe.SCENE2D||o===oe.MORPHING)&&(V||L)&&r-Math.abs(Cs.x)<1&&((Cs.x<0&&Wu.x>0||Cs.x>0&&Wu.x<0)&&h.clone(Cs,Wu),(Cs.x<0&&Pu.x>0||Cs.x>0&&Pu.x<0)&&h.clone(Cs,Pu));let Z=V?2:0,G=L?2:4;for(let I=Z;I<G;++I)On.writeElements(Cs,a,p),On.writeElements(Wu,a,p+6),On.writeElements(Pu,a,p+12),p+=6*3}n.copyFromArrayView(a,6*3*Float32Array.BYTES_PER_ELEMENT*e)}};var Jm=Km;function Eg(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._billboardCollection=new Sd({batchTable:e.batchTable}),this._labelCollection=new ff({batchTable:e.batchTable}),this._polylineCollection=new Jm,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Eg.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.textureAtlas.texture.sizeInBytes,t=this._labelCollection._textureAtlas.texture.sizeInBytes;return e+t}}});function gKe(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+ae.packedLength+ne.packedLength,s=new Float64Array(r),a=0;return s[a++]=i,s[a++]=o,ae.pack(n,s,a),a+=ae.packedLength,ne.pack(t,s,a),s}var yKe=new bi("createVectorTilePoints",5),xKe=new h;function _Ke(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=gKe(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=yKe.scheduleTask(r,o);if(l(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,d=e._labelCollection,u=e._polylineCollection;n=e._positions;let m=e._batchIds,p=n.length/3;for(let g=0;g<p;++g){let f=m[g],x=h.unpack(n,g*3,xKe),_=c.add();_.position=x,_._batchIndex=f;let C=d.add();C.text=" ",C.position=x,C._batchIndex=f;let V=u.add();V.positions=[h.clone(x),h.clone(x)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}Eg.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,o=this._polylineCollection,r=this._batchIds,s=r.length;for(let a=0;a<s;++a){let c=r[a],d=n.get(a),u=i.get(a),m=o.get(a);t[c]=new ub(e,c,d,u,m)}};Eg.prototype.applyDebugSettings=function(e,t){e?(B.clone(t,this._billboardCollection._highlightColor),B.clone(t,this._labelCollection._highlightColor),B.clone(t,this._polylineCollection._highlightColor)):(B.clone(B.WHITE,this._billboardCollection._highlightColor),B.clone(B.WHITE,this._labelCollection._highlightColor),B.clone(B.WHITE,this._polylineCollection._highlightColor))};function TKe(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.pointSize=ub.defaultPointSize,s.color=ub.defaultColor,s.pointOutlineColor=ub.defaultPointOutlineColor,s.pointOutlineWidth=ub.defaultPointOutlineWidth,s.labelColor=B.WHITE,s.labelOutlineColor=B.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=Uo.FILL,s.labelText=void 0,s.backgroundColor=new B(.165,.165,.165,.8),s.backgroundPadding=new D(7,5),s.backgroundEnabled=!1,s.scaleByDistance=void 0,s.translucencyByDistance=void 0,s.distanceDisplayCondition=void 0,s.heightOffset=0,s.anchorLineEnabled=!1,s.anchorLineColor=B.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=gi.CENTER,s.verticalOrigin=Pn.CENTER,s.labelHorizontalOrigin=gi.RIGHT,s.labelVerticalOrigin=Pn.BASELINE}}var SKe=new B,CKe=new B,VKe=new B,LKe=new B,RKe=new B,ZKe=new B,X2=new Ut,W2=new Ut,Jz=new At;Eg.prototype.applyStyle=function(e,t){if(!l(e)){TKe(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];if(l(e.show)&&(s.show=e.show.evaluate(s)),l(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),l(e.color)&&(s.color=e.color.evaluateColor(s,SKe)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,CKe)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,VKe)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,LKe)),l(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),l(e.font)&&(s.font=e.font.evaluate(s)),l(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),l(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,l(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,RKe)),l(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),l(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),l(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);l(a)?(X2.near=a.x,X2.nearValue=a.y,X2.far=a.z,X2.farValue=a.w,s.scaleByDistance=X2):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(W2.near=a.x,W2.nearValue=a.y,W2.far=a.z,W2.farValue=a.w,s.translucencyByDistance=W2):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(Jz.near=a.x,Jz.far=a.y,s.distanceDisplayCondition=Jz):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;l(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),l(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),l(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,ZKe)),l(e.image)?s.image=e.image.evaluate(s):s.image=void 0,l(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),l(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),l(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),l(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),l(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};Eg.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=_Ke(this,e.mapProjection.ellipsoid)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};Eg.prototype.isDestroyed=function(){return!1};Eg.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),me(this)};var P2=Eg;var HMn=T(S(),1);function fb(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=y(e.ellipsoid,ne.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=y(e.center,h.ZERO),this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=kn.BOTH}Object.defineProperties(fb.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function GKe(e){let t=new Float64Array(3+h.packedLength+ne.packedLength+ae.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,h.pack(e._center,t,n),n+=h.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,ae.pack(e._rectangle,t,n),t}function EKe(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)o[a]=En.unpack(t,n),n+=En.packedLength;let r=t[n++],s=e._batchedIndices=new Array(r);for(let a=0;a<r;++a){let c=B.unpack(t,n);n+=B.packedLength;let d=t[n++],u=t[n++],m=t[n++],p=new Array(m);for(let g=0;g<m;++g)p[g]=t[n++];s[a]=new nf({color:c,offset:d,count:u,batchIds:p})}}var IKe=new bi("createVectorTilePolygons",5),XKe=new B;function WKe(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,o=e._indices,r=e._transferrableBatchIds,s=e._batchTableColors,a=e._packedBuffer;if(!l(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),o=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(ae.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(r.length);let g=e._batchTable,f=s.length;for(let x=0;x<f;++x){let _=g.getColor(x,XKe);s[x]=_.toRgba()}a=e._packedBuffer=GKe(e)}let c=[t.buffer,n.buffer,i.buffer,o.buffer,r.buffer,s.buffer,a.buffer],d={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:o.buffer,batchIds:r.buffer,batchTableColors:s.buffer},u=e._polygonMinimumHeights,m=e._polygonMaximumHeights;l(u)&&l(m)&&(u=u.slice(),m=m.slice(),c.push(u.buffer,m.buffer),d.minimumHeights=u,d.maximumHeights=m);let p=IKe.scheduleTask(d,c);if(l(p))return p.then(g=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let f=new Float64Array(g.packedBuffer),x=f[0];EKe(e,f),e._indices=Ae.getSizeInBytes(x)===2?new Uint16Array(g.indices):new Uint32Array(g.indices),e._indexOffsets=new Uint32Array(g.indexOffsets),e._indexCounts=new Uint32Array(g.indexCounts),e._batchedPositions=new Float32Array(g.positions),e._vertexBatchIds=new Uint16Array(g.batchIds),PKe(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function PKe(e){l(e._primitive)||(e._primitive=new Hx({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}fb.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};fb.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};fb.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};fb.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};fb.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=WKe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};fb.prototype.isDestroyed=function(){return!1};fb.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};var v2=fb;var _9n=T(S(),1);var KMn=T(S(),1),w2=`in vec4 currentPosition;
  8219. in vec4 previousPosition;
  8220. in vec4 nextPosition;
  8221. in vec2 expandAndWidth;
  8222. in float a_batchId;
  8223. uniform mat4 u_modifiedModelView;
  8224. void main()
  8225. {
  8226. float expandDir = expandAndWidth.x;
  8227. float width = abs(expandAndWidth.y) + 0.5;
  8228. bool usePrev = expandAndWidth.y < 0.0;
  8229. vec4 p = u_modifiedModelView * currentPosition;
  8230. vec4 prev = u_modifiedModelView * previousPosition;
  8231. vec4 next = u_modifiedModelView * nextPosition;
  8232. float angle;
  8233. vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle);
  8234. gl_Position = czm_viewportOrthographic * positionWC;
  8235. }
  8236. `;function Qm(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,ne.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=B.clone(B.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Qm.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function vKe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ae.packedLength+ne.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ae.pack(t,a,c),c+=ae.packedLength,ne.pack(o,a,c),c+=ne.packedLength,h.pack(r,a,c),a}var wKe=new bi("createVectorTilePolylines",5),n1={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function FKe(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=vKe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},d=wKe.scheduleTask(c,a);if(l(d))return d.then(function(u){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(u.decodedPositions),e._decodedPositionOffsets=new Uint32Array(u.decodedPositionOffsets)),e._currentPositions=new Float32Array(u.currentPositions),e._previousPositions=new Float32Array(u.previousPositions),e._nextPositions=new Float32Array(u.nextPositions),e._expandAndWidth=new Float32Array(u.expandAndWidth),e._vertexBatchIds=new Uint16Array(u.batchIds);let m=u.indexDatatype;e._indices=m===Ae.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),AKe(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function AKe(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+o.byteLength;c+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let d=xt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),u=xt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),m=xt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),p=xt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),g=xt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),f=xt.createIndexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Ae.UNSIGNED_SHORT:Ae.UNSIGNED_INT}),x=[{index:n1.previousPosition,vertexBuffer:d,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:n1.currentPosition,vertexBuffer:u,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:n1.nextPosition,vertexBuffer:m,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:n1.expandAndWidth,vertexBuffer:p,componentDatatype:Q.FLOAT,componentsPerAttribute:2},{index:n1.a_batchId,vertexBuffer:g,componentDatatype:Q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ti({context:t,attributes:x,indexBuffer:f}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var F2=new M,Tle=new h;function MKe(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,F2),M.multiplyByPoint(F2,e._center,Tle),M.setTranslation(F2,Tle,F2),F2},u_highlightColor:function(){return e._highlightColor}})}function NKe(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ue.fromCache({blending:un.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var kKe=`uniform vec4 u_highlightColor;
  8237. void main()
  8238. {
  8239. out_FragColor = u_highlightColor;
  8240. }
  8241. `;function UKe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(w2),o=n.getFragmentShaderCallback(!1,void 0,!1)(kKe),r=new De({defines:["VECTOR_TILE",zt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[md,i]}),s=new De({defines:["VECTOR_TILE"],sources:[o]});e._sp=tn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:n1})}function DKe(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new tt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Ge.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}Qm.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let r,s,a=n.length,c=0,d=0;for(r=0;r<a;++r)n[r]===t&&(c+=o[r+1]-o[r]);if(c===0)return;let u=new Float64Array(c*3);for(r=0;r<a;++r)if(n[r]===t){let m=o[r],p=o[r+1]-m;for(s=0;s<p;++s){let g=(m+s)*3;u[d++]=i[g],u[d++]=i[g+1],u[d++]=i[g+2]}}return u};Qm.prototype.getPositions=function(e){return Qm.getPolylinePositions(this,e)};Qm.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new Ns(e,r)}};Qm.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function BKe(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=B.WHITE}}var OKe=new B,YKe=B.WHITE,HKe=!0;Qm.prototype.applyStyle=function(e,t){if(!l(e)){BKe(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,OKe):YKe,s.show=l(e.show)?e.show.evaluate(s):HKe}};Qm.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=FKe(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}MKe(this,t),UKe(this,t),NKe(this);let n=e.passes;(n.render||n.pick)&&DKe(this,e)};Qm.prototype.isDestroyed=function(){return!1};Qm.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),me(this)};var V_=Qm;var sNn=T(S(),1);var S9n=T(S(),1),A2=`in vec3 startEllipsoidNormal;
  8242. in vec3 endEllipsoidNormal;
  8243. in vec4 startPositionAndHeight;
  8244. in vec4 endPositionAndHeight;
  8245. in vec4 startFaceNormalAndVertexCorner;
  8246. in vec4 endFaceNormalAndHalfWidth;
  8247. in float a_batchId;
  8248. uniform mat4 u_modifiedModelView;
  8249. uniform vec2 u_minimumMaximumVectorHeights;
  8250. out vec4 v_startPlaneEC;
  8251. out vec4 v_endPlaneEC;
  8252. out vec4 v_rightPlaneEC;
  8253. out float v_halfWidth;
  8254. out vec3 v_volumeUpEC;
  8255. void main()
  8256. {
  8257. // vertex corner IDs
  8258. // 3-----------7
  8259. // /| left /|
  8260. // / | 1 / |
  8261. // 2-----------6 5 end
  8262. // | / | /
  8263. // start |/ right |/
  8264. // 0-----------4
  8265. //
  8266. float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); // 0 for front, 1 for end
  8267. float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); // 0 for bottom, 1 for top
  8268. vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz;
  8269. vec3 right = normalize(cross(forward, startEllipsoidNormal));
  8270. vec4 position = vec4(startPositionAndHeight.xyz, 1.0);
  8271. position.xyz += forward * isEnd;
  8272. v_volumeUpEC = czm_normal * normalize(cross(right, forward));
  8273. // Push for volume height
  8274. float offset;
  8275. vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd);
  8276. // offset height to create volume
  8277. offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd);
  8278. offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset;
  8279. position.xyz += offset * ellipsoidNormal;
  8280. // move from RTC to EC
  8281. position = u_modifiedModelView * position;
  8282. right = czm_normal * right;
  8283. // Push for width in a direction that is in the start or end plane and in a plane with right
  8284. // N = normalEC ("right-facing" direction for push)
  8285. // R = right
  8286. // p = angle between N and R
  8287. // w = distance to push along R if R == N
  8288. // d = distance to push along N
  8289. //
  8290. // N R
  8291. // { p| } * cos(p) = dot(N, R) = w / d
  8292. // d | |w * d = w / dot(N, R)
  8293. // { | }
  8294. // o---------- polyline segment ---->
  8295. //
  8296. vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd);
  8297. scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd));
  8298. vec3 miterPushNormal = czm_normal * normalize(scratchNormal);
  8299. offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC
  8300. offset = offset / dot(miterPushNormal, right);
  8301. position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0)));
  8302. gl_Position = czm_depthClamp(czm_projection * position);
  8303. position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0);
  8304. vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz;
  8305. v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz));
  8306. v_rightPlaneEC = vec4(right, -dot(right, position.xyz));
  8307. position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0);
  8308. vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz;
  8309. v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz));
  8310. v_halfWidth = endFaceNormalAndHalfWidth.w;
  8311. }
  8312. `;var V9n=T(S(),1),M2=`in vec4 v_startPlaneEC;
  8313. in vec4 v_endPlaneEC;
  8314. in vec4 v_rightPlaneEC;
  8315. in float v_halfWidth;
  8316. in vec3 v_volumeUpEC;
  8317. uniform vec4 u_highlightColor;
  8318. void main()
  8319. {
  8320. float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));
  8321. // Discard for sky
  8322. if (logDepthOrDepth == 0.0) {
  8323. #ifdef DEBUG_SHOW_VOLUME
  8324. out_FragColor = vec4(0.0, 0.0, 1.0, 0.5);
  8325. return;
  8326. #else // DEBUG_SHOW_VOLUME
  8327. discard;
  8328. #endif // DEBUG_SHOW_VOLUME
  8329. }
  8330. vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
  8331. eyeCoordinate /= eyeCoordinate.w;
  8332. float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate);
  8333. // Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction
  8334. halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC));
  8335. // Check distance of the eye coordinate against the right-facing plane
  8336. float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);
  8337. // Check eye coordinate against the mitering planes
  8338. float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz);
  8339. float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz);
  8340. if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {
  8341. #ifdef DEBUG_SHOW_VOLUME
  8342. out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5);
  8343. return;
  8344. #else // DEBUG_SHOW_VOLUME
  8345. discard;
  8346. #endif // DEBUG_SHOW_VOLUME
  8347. }
  8348. out_FragColor = u_highlightColor;
  8349. czm_writeDepthClamp();
  8350. }
  8351. `;function pb(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=y(e.ellipsoid,ne.WGS84),this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new D(li._defaultMinTerrainHeight,li._defaultMaxTerrainHeight),this._boundingVolume=En.fromRectangle(e.rectangle,li._defaultMinTerrainHeight,li._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=B.clone(B.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(pb.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function zKe(e,t,n){let i=li.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=o,s.y=r;let a=e._boundingVolume,c=e._rectangle;En.fromRectangle(c,o,r,n,a)}function KKe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ae.packedLength+ne.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ae.pack(t,a,c),c+=ae.packedLength,ne.pack(o,a,c),c+=ne.packedLength,h.pack(r,a,c),a}var JKe=new bi("createVectorTileClampedPolylines"),Ig={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function QKe(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=KKe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},d=JKe.scheduleTask(c,a);if(l(d))return d.then(function(u){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(u.decodedPositions),e._decodedPositionOffsets=new Uint32Array(u.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(u.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(u.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(u.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(u.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(u.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(u.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(u.vertexBatchIds);let m=u.indexDatatype;e._indices=m===Ae.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),jKe(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function jKe(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,d=e._indices,u=n.byteLength+i.byteLength;u+=o.byteLength+r.byteLength,u+=s.byteLength+a.byteLength,u+=c.byteLength+d.byteLength,e._trianglesLength=d.length/3,e._geometryByteLength=u;let m=xt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),p=xt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),g=xt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),f=xt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),x=xt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),_=xt.createVertexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW}),C=xt.createVertexBuffer({context:t,typedArray:c,usage:Me.STATIC_DRAW}),V=xt.createIndexBuffer({context:t,typedArray:d,usage:Me.STATIC_DRAW,indexDatatype:d.BYTES_PER_ELEMENT===2?Ae.UNSIGNED_SHORT:Ae.UNSIGNED_INT}),L=[{index:Ig.startEllipsoidNormal,vertexBuffer:m,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:Ig.endEllipsoidNormal,vertexBuffer:p,componentDatatype:Q.FLOAT,componentsPerAttribute:3},{index:Ig.startPositionAndHeight,vertexBuffer:g,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:Ig.endPositionAndHeight,vertexBuffer:f,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:Ig.startFaceNormalAndVertexCorner,vertexBuffer:x,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:Ig.endFaceNormalAndHalfWidth,vertexBuffer:_,componentDatatype:Q.FLOAT,componentsPerAttribute:4},{index:Ig.a_batchId,vertexBuffer:C,componentDatatype:Q.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ti({context:t,attributes:L,indexBuffer:V}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var N2=new M,Sle=new h;function qKe(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,N2),M.multiplyByPoint(N2,e._center,Sle),M.setTranslation(N2,Sle,N2),N2},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function Cle(e){return Ue.fromCache({cull:{enabled:!0,face:yi.FRONT},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Un.EQUAL,frontOperation:{fail:bt.KEEP,zFail:bt.KEEP,zPass:bt.KEEP},backFunction:Un.EQUAL,backOperation:{fail:bt.KEEP,zFail:bt.KEEP,zPass:bt.KEEP},reference:Ot.CESIUM_3D_TILE_MASK,mask:Ot.CESIUM_3D_TILE_MASK}})}function $Ke(e){l(e._rs)||(e._rs=Cle(!1),e._rs3DTiles=Cle(!0))}function eJe(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(A2),o=n.getFragmentShaderCallback(!1,void 0,!0)(M2),r=new De({defines:["VECTOR_TILE",zt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[md,i]}),s=new De({defines:["VECTOR_TILE"],sources:[o]});e._sp=tn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:Ig})}function tJe(e,t){let n=e._command;if(!l(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new tt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:Ge.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=tt.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=Ge.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===kn.TERRAIN||i===kn.BOTH)&&t.commandList.push(n),(i===kn.CESIUM_3D_TILE||i===kn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}pb.prototype.getPositions=function(e){return V_.getPolylinePositions(this,e)};pb.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new Ns(e,r)}};pb.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function nJe(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=B.WHITE}}var iJe=new B,oJe=B.WHITE,rJe=!0;pb.prototype.applyStyle=function(e,t){if(!l(e)){nJe(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,iJe):oJe,s.show=l(e.show)?e.show.evaluate(s):rJe}};function sJe(e){return li.initialize().then(function(){zKe(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}pb.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=sJe(this).then(QKe(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}qKe(this,t),eJe(this,t),$Ke(this);let n=e.passes;(n.render||n.pick)&&tJe(this,e)};pb.prototype.isDestroyed=function(){return!1};pb.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),me(this)};var k2=pb;var mNn=T(S(),1);var Qz=32767,aJe=new he,cJe=new h;function lJe(e,t,n,i,o){let r=e.length/3,s=e.subarray(0,r),a=e.subarray(r,2*r),c=e.subarray(2*r,3*r);wn.zigZagDeltaDecode(s,a,c);let d=new Float64Array(e.length);for(let u=0;u<r;++u){let m=s[u],p=a[u],g=c[u],f=W.lerp(t.west,t.east,m/Qz),x=W.lerp(t.south,t.north,p/Qz),_=W.lerp(n,i,g/Qz),C=he.fromRadians(f,x,_,aJe),V=o.cartographicToCartesian(C,cJe);h.pack(V,d,u*3)}return d}var U2=lJe;function qm(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,fJe(this,i,o)}Object.defineProperties(qm.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return l(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.trianglesLength),l(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.geometryByteLength),l(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return l(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function dJe(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function uJe(e,t){let n,i,o,r,s=y(e.POLYGONS_LENGTH,0),a=y(e.POLYLINES_LENGTH,0),c=y(e.POINTS_LENGTH,0);if(s>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,c)}let d=l(n)||l(i)||l(o),u=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(o);if(d&&u)throw new de("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),r=0;r<s;++r)n[r]=p++;if(!l(i)&&a>0)for(i=new Uint16Array(a),r=0;r<a;++r)i[r]=p++;if(!l(o)&&c>0)for(o=new Uint16Array(c),r=0;r<c;++r)o[r]=p++}return{polygons:n,polylines:i,points:o}}var jm=Uint32Array.BYTES_PER_ELEMENT;function mJe(e){return new V_(e)}function hJe(e){return new k2(e)}function fJe(e,t,n){n=y(n,0);let i=new Uint8Array(t),o=new DataView(t);n+=jm;let r=o.getUint32(n,!0);if(r!==1)throw new de(`Only Vector tile version 1 is supported. Version ${r} is not.`);n+=jm;let s=o.getUint32(n,!0);if(n+=jm,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=jm,a===0)throw new de("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=jm;let d=o.getUint32(n,!0);n+=jm;let u=o.getUint32(n,!0);n+=jm;let m=o.getUint32(n,!0);n+=jm;let p=o.getUint32(n,!0);n+=jm;let g=o.getUint32(n,!0);n+=jm;let f=o.getUint32(n,!0);n+=jm;let x=Wo(i,n,a);n+=a;let _=new Uint8Array(t,n,c);n+=c;let C,V;d>0&&(C=Wo(i,n,d),n+=d,u>0&&(V=new Uint8Array(t,n,u),V=new Uint8Array(V),n+=u));let L=y(x.POLYGONS_LENGTH,0),Z=y(x.POLYLINES_LENGTH,0),G=y(x.POINTS_LENGTH,0),I=L+Z+G,v=new Ap(e,I,C,V,dJe(e));if(e._batchTable=v,I===0)return;let P=new Om(x,_),w=P.getGlobalProperty("REGION");if(!l(w))throw new de("Feature table global property: REGION must be defined");let F=ae.unpack(w),b=w[4],R=w[5],E=e._tile.computedTransform,X=P.getGlobalProperty("RTC_CENTER",Q.FLOAT,3);l(X)?(X=h.unpack(X),M.multiplyByPoint(E,X,X)):(X=ae.center(F),X.height=W.lerp(b,R,.5),X=ne.WGS84.cartographicToCartesian(X));let A=uJe(x,_);if(n+=(4-n%4)%4,L>0){P.featuresLength=L;let N=y(P.getPropertyArray("POLYGON_COUNTS",Q.UNSIGNED_INT,1),P.getPropertyArray("POLYGON_COUNT",Q.UNSIGNED_INT,1));if(!l(N))throw new de("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let O=y(P.getPropertyArray("POLYGON_INDEX_COUNTS",Q.UNSIGNED_INT,1),P.getPropertyArray("POLYGON_INDEX_COUNT",Q.UNSIGNED_INT,1));if(!l(O))throw new de("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let U=N.reduce(function(z,q){return z+q*2},0),Y=O.reduce(function(z,q){return z+q},0),k=new Uint32Array(t,n,Y);n+=m;let H=new Uint16Array(t,n,U);n+=p;let J,te;l(x.POLYGON_MINIMUM_HEIGHTS)&&l(x.POLYGON_MAXIMUM_HEIGHTS)&&(J=P.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",Q.FLOAT,1),te=P.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",Q.FLOAT,1)),e._polygons=new v2({positions:H,counts:N,indexCounts:O,indices:k,minimumHeight:b,maximumHeight:R,polygonMinimumHeights:J,polygonMaximumHeights:te,center:X,rectangle:F,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:v,batchIds:A.polygons,modelMatrix:E})}if(Z>0){P.featuresLength=Z;let N=y(P.getPropertyArray("POLYLINE_COUNTS",Q.UNSIGNED_INT,1),P.getPropertyArray("POLYLINE_COUNT",Q.UNSIGNED_INT,1));if(!l(N))throw new de("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let O=P.getPropertyArray("POLYLINE_WIDTHS",Q.UNSIGNED_SHORT,1);if(!l(O)){O=new Uint16Array(Z);for(let te=0;te<Z;++te)O[te]=2}let U=N.reduce(function(te,z){return te+z*3},0),Y=new Uint16Array(t,n,U);n+=g;let k=e._tileset,H=k.examineVectorLinesFunction;if(l(H)){let te=U2(new Uint16Array(Y),F,b,R,ne.WGS84);pJe(te,N,A.polylines,v,e.url,H)}let J=mJe;l(k.classificationType)&&(J=hJe),e._polylines=J({positions:Y,widths:O,counts:N,batchIds:A.polylines,minimumHeight:b,maximumHeight:R,center:X,rectangle:F,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:v,classificationType:k.classificationType,keepDecodedPositions:k.vectorKeepDecodedPositions})}if(G>0){let N=new Uint16Array(t,n,G*3);n+=f,e._points=new P2({positions:N,batchIds:A.points,minimumHeight:b,maximumHeight:R,rectangle:F,batchTable:v})}}function jz(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}qm.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};qm.prototype.getFeature=function(e){return l(this._features)||jz(this),this._features[e]};qm.prototype.applyDebugSettings=function(e,t){l(this._polygons)&&this._polygons.applyDebugSettings(e,t),l(this._polylines)&&this._polylines.applyDebugSettings(e,t),l(this._points)&&this._points.applyDebugSettings(e,t)};qm.prototype.applyStyle=function(e){l(this._features)||jz(this),l(this._polygons)&&this._polygons.applyStyle(e,this._features),l(this._polylines)&&this._polylines.applyStyle(e,this._features),l(this._points)&&this._points.applyStyle(e,this._features)};qm.prototype.update=function(e,t){let n=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),l(this._points)&&(this._points.update(t),n=n&&this._points.ready),l(this._batchTable)&&n&&(l(this._features)||jz(this),this._batchTable.update(e,t),this._ready=!0)};qm.prototype.pick=function(e,t,n){};qm.prototype.getPolylinePositions=function(e){let t=this._polylines;if(l(t))return t.getPositions(e)};qm.prototype.isDestroyed=function(){return!1};qm.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),me(this)};function pJe(e,t,n,i,o,r){let s=t.length,a=0;for(let c=0;c<s;c++){let d=t[c]*3,u=e.slice(a,a+d);a+=d,r(u,n[c],o,i)}}var D2=qm;var Vle={b3dm:function(e,t,n,i,o){return uf.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return uf.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return uf.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return SI.fromTileType(e,t,n,i,o,Vle)},externalTileset:function(e,t,n,i){return y2.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new VI(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new D2(e,t,n,i,o)},subt:function(e,t,n,i,o){return LC.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return LC.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,o){if(i.byteLength<12)throw new de("Invalid glb content");let a=new DataView(i,o).getUint32(8,!0),c=new Uint8Array(i,o,a);return uf.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return uf.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return uf.fromGeoJson(e,t,n,i)}},L_=Vle;var BNn=T(S(),1),bJe={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},Do=Object.freeze(bJe);var YNn=T(S(),1),$m={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson",VOXEL_BINARY:"voxl",VOXEL_JSON:"voxelJson"};$m.isBinaryFormat=function(e){switch(e){case $m.BATCHED_3D_MODEL:case $m.INSTANCED_3D_MODEL:case $m.COMPOSITE:case $m.POINT_CLOUD:case $m.VECTOR:case $m.GEOMETRY:case $m.IMPLICIT_SUBTREE:case $m.VOXEL_BINARY:case $m.GLTF_BINARY:return!0;default:return!1}};var Vs=Object.freeze($m);var zNn=T(S(),1),gJe={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},vu=Object.freeze(gJe);var JNn=T(S(),1),Os={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},bb=new Array(Os.NUMBER_OF_PASSES);bb[Os.RENDER]=Object.freeze({pass:Os.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});bb[Os.PICK]=Object.freeze({pass:Os.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});bb[Os.SHADOW]=Object.freeze({pass:Os.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});bb[Os.PRELOAD]=Object.freeze({pass:Os.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});bb[Os.PRELOAD_FLIGHT]=Object.freeze({pass:Os.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});bb[Os.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Os.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});bb[Os.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Os.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});bb[Os.MOST_DETAILED_PICK]=Object.freeze({pass:Os.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Os.getPassOptions=function(e){return bb[e]};var wo=Object.freeze(Os);var qNn=T(S(),1);function bf(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(bf.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return!0}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(e){}},batchTable:{get:function(){}},group:{get:function(){},set:function(e){}}});bf.prototype.hasProperty=function(e,t){return!1};bf.prototype.getFeature=function(e){};bf.prototype.applyDebugSettings=function(e,t){};bf.prototype.applyStyle=function(e){};bf.prototype.update=function(e,t){};bf.prototype.pick=function(e,t,n){};bf.prototype.isDestroyed=function(){return!1};bf.prototype.destroy=function(){return me(this)};var i1=bf;var l5n=T(S(),1);var n5n=T(S(),1);function gb(e){e=y(e,y.EMPTY_OBJECT);let t=e.content,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(gb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});gb.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,this._class)};gb.prototype.hasPropertyBySemantic=function(e){return Mn.hasPropertyBySemantic(e,this._properties,this._class)};gb.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,this._class,e)};gb.prototype.getProperty=function(e){return Mn.getProperty(e,this._properties,this._class)};gb.prototype.setProperty=function(e,t){return Mn.setProperty(e,t,this._properties,this._class)};gb.prototype.getPropertyBySemantic=function(e){return Mn.getPropertyBySemantic(e,this._properties,this._class)};gb.prototype.setPropertyBySemantic=function(e,t){return Mn.setPropertyBySemantic(e,t,this._properties,this._class)};var B2=gb;function qz(e,t){let n=oi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){qz._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let o=i[n.class];return new B2({content:n,class:o})}}qz._oneTimeWarning=St;var R_=qz;var h5n=T(S(),1);function yJe(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,o=oi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof o=="number")return i[o];let r=n.groupIds.findIndex(function(s){return s===o});return r>=0?i[r]:void 0}var Z_=yJe;var V5n=T(S(),1);var g5n=T(S(),1);function yb(e){e=y(e,y.EMPTY_OBJECT);let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(yb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});yb.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,this._class)};yb.prototype.hasPropertyBySemantic=function(e){return Mn.hasPropertyBySemantic(e,this._properties,this._class)};yb.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,this._class,e)};yb.prototype.getProperty=function(e){return Mn.getProperty(e,this._properties,this._class)};yb.prototype.setProperty=function(e,t){return Mn.setProperty(e,t,this._properties,this._class)};yb.prototype.getPropertyBySemantic=function(e){return Mn.getPropertyBySemantic(e,this._properties,this._class)};yb.prototype.setPropertyBySemantic=function(e,t){return Mn.setPropertyBySemantic(e,t,this._properties,this._class)};var O2=yb;function $z(e,t){let n=oi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){$z._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=y(e.schema.classes,y.EMPTY_OBJECT);if(l(n.class)){let o=i[n.class];return new O2({tile:n,class:o})}}$z._oneTimeWarning=St;var Y2=$z;var z5n=T(S(),1);var X5n=T(S(),1);function xJe(e){let t=new Uint8Array(e),n=vm(t);if(n==="glTF"&&(n="glb"),Vs.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=_Je(t);if(l(i.root))return{contentType:Vs.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Vs.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Vs.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Vs.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:Vs.VOXEL_JSON,jsonPayload:i};throw new de("Invalid tile content.")}function _Je(e){let t;try{t=Wo(e)}catch{throw new de("Invalid tile content.")}return t}var gf=xJe;function wu(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let o=l(i.contents)?i.contents:i.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0;let r=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(r),this._requests=new Array(r),this._ready=!1,this._innerContentResources=new Array(r),this._serverKeys=new Array(r);for(let s=0;s<r;s++){let a=n.getDerivedResource({url:o[s].uri}),c=ja.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=c}}Object.defineProperties(wu.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._contentsCreated?this._ready:!1}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){},set:function(){}},innerContentUrls:{get:function(){return this._innerContentHeaders.map(function(e){return e.uri})}}});function eK(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function Lle(e,t){e._cancelCount++,e._tile._contentState=t;let n=e.tileset.statistics;n.numberOfPendingRequests-=e._requestsInFlight,n.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;let i=e._innerContentHeaders.length;e._arrayFetchPromises=new Array(i)}wu.prototype.requestInnerContents=function(){if(!TJe(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;eK(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=SJe(this,n,t,this._tile._contentState);return CJe(this)};function TJe(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];l(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!ja.serverHasOpenSlots(n,t[n]))return!1;return ja.heapHasOpenSlots(e.length)}function SJe(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,s=function(){return r._priority},a=e._serverKeys[t],c=new Ho({throttle:!0,throttleByServer:!0,type:cs.TILES3D,priorityFunction:s,serverKey:a});o.request=c,e._requests[t]=c;let d=o.fetchArrayBuffer();if(l(d))return d.then(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===jn.CANCELLED){Lle(e,i);return}return eK(e,-1),u}}).catch(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===jn.CANCELLED){Lle(e,i);return}eK(e,-1),Rle(e,t,u)}})}async function CJe(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>VJe(e,r,s)),o=await Promise.all(i);return e._contentsCreated=!0,e._contents=o.filter(l),o}async function VJe(e,t,n){if(l(t))try{let i=gf(t);if(i.contentType===Vs.EXTERNAL_TILESET)throw new de("External tilesets are disallowed inside multiple contents");e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Vs.GEOMETRY||i.contentType===Vs.VECTOR;let o=e._tileset,r=e._innerContentResources[n],s=e._tile,a,c=L_[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(o,s,r,i.jsonPayload));let d=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let m=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=m.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=R_(o,d));let u=Z_(o,d);return l(u)&&(a.group=new Dx({metadata:u})),a}catch(i){Rle(e,n,i)}}function Rle(e,t,n){let i=e._tileset,o=e._innerContentResources[t].url,r=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:o,message:r}):(console.log(`A content failed to load: ${o}`),console.log(`Error: ${r}`))}wu.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];l(t)&&t.cancel()}};wu.prototype.hasProperty=function(e,t){return!1};wu.prototype.getFeature=function(e){};wu.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};wu.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};wu.prototype.update=function(e,t){let n=this._contents,i=n.length,o=!0;for(let r=0;r<i;++r)n[r].update(e,t),o=o&&n[r].ready;!this._ready&&o&&(this._ready=!0)};wu.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let c=r[a].pick(e,t,n);if(!l(c))continue;let d=h.distance(e.origin,c);d<o&&(i=c,o=d)}if(l(i))return n};wu.prototype.isDestroyed=function(){return!1};wu.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return me(this)};var H2=wu;var Dkn=T(S(),1);var Skn=T(S(),1);var ikn=T(S(),1);var Zle=Math.cos,Gle=Math.sin,LJe=Math.sqrt,tK={};tK.computePosition=function(e,t,n,i,o,r,s){let a=t.radiiSquared,c=e.nwCorner,d=e.boundingRectangle,u=c.latitude-e.granYCos*i+o*e.granXSin,m=Zle(u),p=Gle(u),g=a.z*p,f=c.longitude+i*e.granYSin+o*e.granXCos,x=m*Zle(f),_=m*Gle(f),C=a.x*x,V=a.y*_,L=LJe(C*x+V*_+g*p);if(r.x=C/L,r.y=V/L,r.z=g/L,n){let Z=e.stNwCorner;l(Z)?(u=Z.latitude-e.stGranYCos*i+o*e.stGranXSin,f=Z.longitude+i*e.stGranYSin+o*e.stGranXCos,s.x=(f-e.stWest)*e.lonScalar,s.y=(u-e.stSouth)*e.latScalar):(s.x=(f-d.west)*e.lonScalar,s.y=(u-d.south)*e.latScalar)}};var RJe=new wi,Fu=new h,ZJe=new he,rk=new h,z2=new Ri;function Ele(e,t,n,i,o,r,s){let a=Math.cos(t),c=i*a,d=n*a,u=Math.sin(t),m=i*u,p=n*u;z2._ellipsoid=ne.default,Fu=z2.project(e,Fu),Fu=h.subtract(Fu,rk,Fu);let g=wi.fromRotation(t,RJe);Fu=wi.multiplyByVector(g,Fu,Fu),Fu=h.add(Fu,rk,Fu),e=z2.unproject(Fu,e),r-=1,s-=1;let f=e.latitude,x=f+r*p,_=f-c*s,C=f-c*s+r*p,V=Math.max(f,x,_,C),L=Math.min(f,x,_,C),Z=e.longitude,G=Z+r*d,I=Z+s*m,v=Z+s*m+r*d,P=Math.max(Z,G,I,v),w=Math.min(Z,G,I,v);return{north:V,south:L,east:P,west:w,granYCos:c,granYSin:m,granXCos:d,granXSin:p,nwCorner:e}}tK.computeOptions=function(e,t,n,i,o,r,s){let a=e.east,c=e.west,d=e.north,u=e.south,m=!1,p=!1;d===W.PI_OVER_TWO&&(m=!0),u===-W.PI_OVER_TWO&&(p=!0);let g,f=d-u;c>a?g=W.TWO_PI-c+a:g=a-c;let x=Math.ceil(g/t)+1,_=Math.ceil(f/t)+1,C=g/(x-1),V=f/(_-1),L=ae.northwest(e,r),Z=ae.center(e,ZJe);(n!==0||i!==0)&&(Z.longitude<L.longitude&&(Z.longitude+=W.TWO_PI),z2._ellipsoid=ne.default,rk=z2.project(Z,rk));let G=V,I=C,v=0,P=0,w=ae.clone(e,o),F={granYCos:G,granYSin:v,granXCos:I,granXSin:P,nwCorner:L,boundingRectangle:w,width:x,height:_,northCap:m,southCap:p};if(n!==0){let b=Ele(L,n,C,V,Z,x,_);d=b.north,u=b.south,a=b.east,c=b.west,F.granYCos=b.granYCos,F.granYSin=b.granYSin,F.granXCos=b.granXCos,F.granXSin=b.granXSin,w.north=d,w.south=u,w.east=a,w.west=c}if(i!==0){n=n-i;let b=ae.northwest(w,s),R=Ele(b,n,C,V,Z,x,_);F.stGranYCos=R.granYCos,F.stGranXCos=R.granXCos,F.stGranYSin=R.granYSin,F.stGranXSin=R.granXSin,F.stNwCorner=b,F.stWest=R.west,F.stSouth=R.south}return F};var Ls=tK;var GJe=new ce,EJe=new ce,IJe=new h,XJe=new ae;function Ile(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,s=t.southCap,a=i,c=2,d=0,u=4;r&&(c-=1,a-=1,d+=1,u-=2),s&&(c-=1,a-=1,d+=1,u-=2),d+=c*o+2*a-u;let m=new Float64Array(d*3),p=0,g=0,f,x=IJe;if(r)Ls.computePosition(t,n,!1,g,0,x),m[p++]=x.x,m[p++]=x.y,m[p++]=x.z;else for(f=0;f<o;f++)Ls.computePosition(t,n,!1,g,f,x),m[p++]=x.x,m[p++]=x.y,m[p++]=x.z;for(f=o-1,g=1;g<i;g++)Ls.computePosition(t,n,!1,g,f,x),m[p++]=x.x,m[p++]=x.y,m[p++]=x.z;if(g=i-1,!s)for(f=o-2;f>=0;f--)Ls.computePosition(t,n,!1,g,f,x),m[p++]=x.x,m[p++]=x.y,m[p++]=x.z;for(f=0,g=i-2;g>0;g--)Ls.computePosition(t,n,!1,g,f,x),m[p++]=x.x,m[p++]=x.y,m[p++]=x.z;let _=m.length/3*2,C=Ae.createTypedArray(m.length/3,_),V=0;for(let Z=0;Z<m.length/3-1;Z++)C[V++]=Z,C[V++]=Z+1;C[V++]=m.length/3-1,C[V++]=0;let L=new ht({attributes:new mn,primitiveType:Fe.LINES});return L.attributes.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:m}),L.indices=C,L}function WJe(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=Ile(e,t),s=t.height,a=t.width,c=si.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),d=c.length,u=new Float64Array(d*2);u.set(c);let m=si.scaleToGeodeticHeight(r.attributes.position.values,i,o);u.set(m,d),r.attributes.position.values=u;let p=t.northCap,g=t.southCap,f=4;p&&(f-=1),g&&(f-=1);let x=(u.length/3+f)*2,_=Ae.createTypedArray(u.length/3,x);d=u.length/6;let C=0;for(let L=0;L<d-1;L++)_[C++]=L,_[C++]=L+1,_[C++]=L+d,_[C++]=L+d+1;_[C++]=d-1,_[C++]=0,_[C++]=d+d-1,_[C++]=d,_[C++]=0,_[C++]=d;let V;if(p)V=s-1;else{let L=a-1;_[C++]=L,_[C++]=L+d,V=a+s-2}if(_[C++]=V,_[C++]=V+d,!g){let L=a+V-1;_[C++]=L,_[C]=L+d}return r.indices=_,r}function r1(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.granularity,W.RADIANS_PER_DEGREE),i=y(e.ellipsoid,ne.default),o=y(e.rotation,0),r=y(e.height,0),s=y(e.extrudedHeight,r);this._rectangle=ae.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(r,s),this._rotation=o,this._extrudedHeight=Math.min(r,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}r1.packedLength=ae.packedLength+ne.packedLength+5;r1.pack=function(e,t,n){return n=y(n,0),ae.pack(e._rectangle,t,n),n+=ae.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=y(e._offsetAttribute,-1),t};var Xle=new ae,Wle=ne.clone(ne.UNIT_SPHERE),o1={rectangle:Xle,ellipsoid:Wle,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};r1.unpack=function(e,t,n){t=y(t,0);let i=ae.unpack(e,t,Xle);t+=ae.packedLength;let o=ne.unpack(e,t,Wle);t+=ne.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],d=e[t];return l(n)?(n._rectangle=ae.clone(i,n._rectangle),n._ellipsoid=ne.clone(o,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=d===-1?void 0:d,n):(o1.granularity=r,o1.height=s,o1.rotation=a,o1.extrudedHeight=c,o1.offsetAttribute=d===-1?void 0:d,new r1(o1))};var PJe=new he;r1.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Ls.computeOptions(t,e._granularity,e._rotation,0,XJe,PJe),o,r;if(W.equalsEpsilon(t.north,t.south,W.EPSILON10)||W.equalsEpsilon(t.east,t.west,W.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!W.equalsEpsilon(s,a,0,W.EPSILON2),d;if(c){if(o=WJe(e,i),l(e._offsetAttribute)){let p=o.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===cn.TOP?g=g.fill(1,0,p/2):(d=e._offsetAttribute===cn.NONE?0:1,g=g.fill(d)),o.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let u=ce.fromRectangle3D(t,n,s,EJe),m=ce.fromRectangle3D(t,n,a,GJe);r=ce.union(u,m)}else{if(o=Ile(e,i),o.attributes.position.values=si.scaleToGeodeticHeight(o.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let u=o.attributes.position.values.length;d=e._offsetAttribute===cn.NONE?0:1;let m=new Uint8Array(u/3).fill(d);o.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}r=ce.fromRectangle3D(t,n,s)}return new ht({attributes:o.attributes,indices:o.indices,primitiveType:Fe.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var G_=r1;function a1(e){this.rectangle=ae.clone(e.rectangle),this.minimumHeight=y(e.minimumHeight,0),this.maximumHeight=y(e.maximumHeight,0),this.southwestCornerCartesian=new h,this.northeastCornerCartesian=new h,this.westNormal=new h,this.southNormal=new h,this.eastNormal=new h,this.northNormal=new h;let t=y(e.ellipsoid,ne.WGS84);MJe(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,y(e.computeBoundingVolumes,!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(a1.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});a1.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=En.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ce.fromOrientedBoundingBox(this._orientedBoundingBox)};var Ple=new h,sk=new h,vle=new h,vJe=new h,wJe=new h,FJe=new h,AJe=new h,Au=new he,wle=new ln(h.UNIT_X,0),s1=new pn;function MJe(e,t,n){n.cartographicToCartesian(ae.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ae.northeast(t),e.northeastCornerCartesian),Au.longitude=t.west,Au.latitude=(t.south+t.north)*.5,Au.height=0;let i=n.cartographicToCartesian(Au,FJe),o=h.cross(i,h.UNIT_Z,vJe);h.normalize(o,e.westNormal),Au.longitude=t.east;let r=n.cartographicToCartesian(Au,AJe),s=h.cross(h.UNIT_Z,r,Ple);h.normalize(s,e.eastNormal);let a=h.subtract(i,r,Ple);h.magnitude(a)===0&&(a=h.clone(o,a));let c=h.normalize(a,wJe),d=t.south,u;if(d>0){Au.longitude=(t.west+t.east)*.5,Au.latitude=d;let x=n.cartographicToCartesian(Au,s1.origin);h.clone(c,s1.direction);let _=ln.fromPointNormal(e.southwestCornerCartesian,e.westNormal,wle);qn.rayPlane(s1,_,e.southwestCornerCartesian),u=n.geodeticSurfaceNormal(x,sk)}else u=n.geodeticSurfaceNormalCartographic(ae.southeast(t),sk);let m=h.cross(u,a,vle);h.normalize(m,e.southNormal);let p=t.north,g;if(p<0){Au.longitude=(t.west+t.east)*.5,Au.latitude=p;let x=n.cartographicToCartesian(Au,s1.origin);h.negate(c,s1.direction);let _=ln.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,wle);qn.rayPlane(s1,_,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(x,sk)}else g=n.geodeticSurfaceNormalCartographic(ae.northwest(t),sk);let f=h.cross(a,g,vle);h.normalize(f,e.northNormal)}var NJe=new h,kJe=new h,UJe=new h(0,-1,0),DJe=new h(0,0,-1),Fle=new h;function BJe(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!ae.contains(e.rectangle,o)){let d=e.southwestCornerCartesian,u=e.northeastCornerCartesian,m=e.westNormal,p=e.southNormal,g=e.eastNormal,f=e.northNormal;t.mode!==oe.SCENE3D&&(d=t.mapProjection.project(ae.southwest(e.rectangle),NJe),d.z=d.y,d.y=d.x,d.x=0,u=t.mapProjection.project(ae.northeast(e.rectangle),kJe),u.z=u.y,u.y=u.x,u.x=0,m=UJe,g=h.UNIT_Y,p=DJe,f=h.UNIT_Z);let x=h.subtract(i,d,Fle),_=h.dot(x,m),C=h.dot(x,p),V=h.subtract(i,u,Fle),L=h.dot(V,g),Z=h.dot(V,f);_>0?r+=_*_:L>0&&(r+=L*L),C>0?r+=C*C:Z>0&&(r+=Z*Z)}let s,a,c;if(t.mode===oe.SCENE3D?(s=o.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let d=s-c;r+=d*d}else if(s<a){let d=a-s;r+=d*d}return Math.sqrt(r)}a1.prototype.distanceToCamera=function(e){let t=BJe(this,e);if(e.mode===oe.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};a1.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};a1.prototype.createDebugVolume=function(e){let t=new M.clone(M.IDENTITY),n=new G_({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Gt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Kt.fromColor(e)}});return new In({geometryInstances:i,appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1})};var Mu=a1;var EUn=T(S(),1);var uUn=T(S(),1);var Kkn=T(S(),1);var K2={},OJe=new h,Ale=new h,Mle=new h,Nle=new h,kle=new En;K2.validOutline=function(e){let n=En.fromPoints(e,kle).halfAxes,i=$.getColumn(n,0,Ale),o=$.getColumn(n,1,Mle),r=$.getColumn(n,2,Nle),s=h.magnitude(i),a=h.magnitude(o),c=h.magnitude(r);return!(s===0&&(a===0||c===0)||a===0&&c===0)};K2.computeProjectTo2DArguments=function(e,t,n,i){let o=En.fromPoints(e,kle),r=o.halfAxes,s=$.getColumn(r,0,Ale),a=$.getColumn(r,1,Mle),c=$.getColumn(r,2,Nle),d=h.magnitude(s),u=h.magnitude(a),m=h.magnitude(c),p=Math.min(d,u,m);if(d===0&&(u===0||m===0)||u===0&&m===0)return!1;let g,f;return(p===u||p===m)&&(g=s),p===d?g=a:p===m&&(f=a),(p===d||p===u)&&(f=c),h.normalize(g,n),h.normalize(f,i),h.clone(o.center,t),!0};function Ule(e,t,n,i,o){let r=h.subtract(e,t,OJe),s=h.dot(n,r),a=h.dot(i,r);return D.fromElements(s,a,o)}K2.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=Ule(i[r],e,t,n);return o}};K2.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return Ule(i,e,t,n,o)}};var xb=K2;function YJe(e){let t=e.length,n=new Float64Array(t*3),i=Ae.createTypedArray(t,t*2),o=0,r=0;for(let a=0;a<t;a++){let c=e[a];n[o++]=c.x,n[o++]=c.y,n[o++]=c.z,i[r++]=a,i[r++]=(a+1)%t}let s=new mn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:n})});return new ht({attributes:s,indices:i,primitiveType:Fe.LINES})}function E_(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=Dn.computeHierarchyPackedLength(t,h)+1}E_.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions}};return new E_(t)};E_.pack=function(e,t,n){return n=y(n,0),n=Dn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var HJe={polygonHierarchy:{}};E_.unpack=function(e,t,n){t=y(t,0);let i=Dn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=e[t];return l(n)||(n=new E_(HJe)),n._polygonHierarchy=i,n.packedLength=o,n};E_.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=xo(n,h.equalsEpsilon,!0),n.length<3||!xb.validOutline(n))return;let o=Dn.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let c=0;c<o.length;c++){let d=new Gt({geometry:YJe(o[c])});r.push(d)}let s=Fn.combineInstances(r)[0],a=ce.fromPoints(t.positions);return new ht({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var Nu=E_;var ak=new he;function J2(e){let t=kp.fromToken(e.token),n=y(e.minimumHeight,0),i=y(e.maximumHeight,0),o=y(e.ellipsoid,ne.WGS84);this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=tQe(t,n,i,o);this._boundingPlanes=r;let s=rQe(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=lK(r[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=h.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=lK(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=lK(r[2+a],[s[a%4],s[(a+1)%4],s[4+(a+1)%4],s[4+a]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],a=0;a<4;a++)this._planeVertices.push([this._vertices[a%4],this._vertices[(a+1)%4],this._vertices[4+(a+1)%4],this._vertices[4+a]]);let c=t.getCenter();ak=o.cartesianToCartographic(c,ak),ak.height=(i+n)/2,this.center=o.cartographicToCartesian(ak,c),this._boundingSphere=ce.fromPoints(s)}var zJe=new h,KJe=new he,JJe=new h,QJe=new he,jJe=new h,qJe=new h,$Je=new h,eQe=new h;function tQe(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,zJe),a=i.cartesianToCartographic(r,KJe);a.height=n;let c=i.cartographicToCartesian(a,JJe),d=ln.fromPointNormal(c,s);o[0]=d;let u=0,m,p=[],g,f;for(m=0;m<4;m++){g=e.getVertex(m),p[m]=g,f=i.cartesianToCartographic(g,QJe),f.height=t;let _=ln.getPointDistance(d,i.cartographicToCartesian(f,jJe));_<u&&(u=_)}let x=ln.clone(d);for(x.normal=h.negate(x.normal,x.normal),x.distance=x.distance*-1+u,o[1]=x,m=0;m<4;m++){g=p[m];let _=p[(m+1)%4],C=i.geodeticSurfaceNormal(g,qJe),V=h.subtract(_,g,eQe),L=h.cross(V,C,$Je);L=h.normalize(L,L),o[2+m]=ln.fromPointNormal(g,L)}return o}var I_=new h,X_=new h,W_=new h,nK=new h,iK=new h,oK=new h,nQe=new h,iQe=new h,oQe=new h,rK=new h,sK=new h,aK=new h,Xg=new h,yf=new $;function Dle(e,t,n){I_=e.normal,X_=t.normal,W_=n.normal,nK=h.multiplyByScalar(e.normal,-e.distance,nK),iK=h.multiplyByScalar(t.normal,-t.distance,iK),oK=h.multiplyByScalar(n.normal,-n.distance,oK),rK=h.multiplyByScalar(h.cross(X_,W_,nQe),h.dot(nK,I_),rK),sK=h.multiplyByScalar(h.cross(W_,I_,iQe),h.dot(iK,X_),sK),aK=h.multiplyByScalar(h.cross(I_,X_,oQe),h.dot(oK,W_),aK),yf[0]=I_.x,yf[1]=X_.x,yf[2]=W_.x,yf[3]=I_.y,yf[4]=X_.y,yf[5]=W_.y,yf[6]=I_.z,yf[7]=X_.z,yf[8]=W_.z;let i=$.determinant(yf);return Xg=h.add(rK,sK,Xg),Xg=h.add(Xg,aK,Xg),new h(Xg.x/i,Xg.y/i,Xg.z/i)}function rQe(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=Dle(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=Dle(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var cK=new h,c1=new h;function lK(e,t){let n=[];for(let i=0;i<4;i++)cK=h.subtract(t[(i+1)%4],t[i],cK),c1=h.cross(e.normal,cK,c1),c1=h.normalize(c1,c1),n[i]=h.clone(c1);return n}Object.defineProperties(J2.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var dK=new h;J2.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],o;ln.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):ln.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),o=this._edgeNormals[1]);let r,s;for(r=0;r<4;r++)s=2+r,ln.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),o=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=uK(ln.projectPointOntoPlane(c,t,dK),i[0],c,o),h.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=Ble(t,p[0],p[1]),h.distance(a,t)}let u=Number.MAX_VALUE,m;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],a=uK(ln.projectPointOntoPlane(c,t,dK),i[r],c,this._edgeNormals[n[r]]),m=h.distanceSquared(a,t),m<u&&(u=m);return Math.sqrt(u)}else if(n.length>3)return a=uK(ln.projectPointOntoPlane(this._boundingPlanes[1],t,dK),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),h.distance(a,t);let d=n[1]===2&&n[2]===5?0:1;return n[0]===0?h.distance(t,this._vertices[(n[1]-2+d)%4]):h.distance(t,this._vertices[4+(n[1]-2+d)%4])};var sQe=new h,aQe=new h;function Ble(e,t,n){let i=h.subtract(n,t,sQe),o=h.subtract(e,t,aQe),r=h.dot(i,o);if(r<=0)return t;let s=h.dot(i,i);return r>=s?n:(r=r/s,new h((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var cQe=new ln(h.UNIT_X,0);function uK(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let c=0;c<t.length;c++){let d=ln.fromPointNormal(t[c],i[c],cQe);ln.getPointDistance(d,e)<0||(a=Ble(e,t[c],t[(c+1)%4]),r=h.distance(e,a),r<o&&(o=r,s=a))}return l(s)?s:e}J2.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)h.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?Jt.INSIDE:n===this._vertices.length?Jt.OUTSIDE:Jt.INTERSECTING};J2.prototype.createDebugVolume=function(e){let t=new M.clone(M.IDENTITY),n=new Nu({polygonHierarchy:{positions:this._planeVertices[0]}}),i=Nu.createGeometry(n),o=new Gt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Kt.fromColor(e)}}),r=new Nu({polygonHierarchy:{positions:this._planeVertices[1]}}),s=Nu.createGeometry(r),a=new Gt({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Kt.fromColor(e)}}),c=[];for(let d=0;d<4;d++){let u=new Nu({polygonHierarchy:{positions:this._planeVertices[2+d]}}),m=Nu.createGeometry(u);c[d]=new Gt({geometry:m,id:"outline",modelMatrix:t,attributes:{color:Kt.fromColor(e)}})}return new In({geometryInstances:[c[0],c[1],c[2],c[3],a,o],appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1})};var Q2=J2;var aDn=T(S(),1);var QUn=T(S(),1);var OUn=T(S(),1);var lQe=new h(1,1,1),ck=Math.cos,lk=Math.sin;function l1(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,lQe),n=y(e.innerRadii,t),i=y(e.minimumClock,0),o=y(e.maximumClock,W.TWO_PI),r=y(e.minimumCone,0),s=y(e.maximumCone,W.PI),a=Math.round(y(e.stackPartitions,10)),c=Math.round(y(e.slicePartitions,8)),d=Math.round(y(e.subdivisions,128));this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=d,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}l1.packedLength=2*h.packedLength+8;l1.pack=function(e,t,n){return n=y(n,0),h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=y(e._offsetAttribute,-1),t};var Ole=new h,Yle=new h,_b={radii:Ole,innerRadii:Yle,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};l1.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,Ole);t+=h.packedLength;let o=h.unpack(e,t,Yle);t+=h.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(o,n._innerRadii),n._minimumClock=r,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=d,n._slicePartitions=u,n._subdivisions=m,n._offsetAttribute=p===-1?void 0:p,n):(_b.minimumClock=r,_b.maximumClock=s,_b.minimumCone=a,_b.maximumCone=c,_b.stackPartitions=d,_b.slicePartitions=u,_b.subdivisions=m,_b.offsetAttribute=p===-1?void 0:p,new l1(_b))};l1.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=ne.fromCartesian3(t),d=e._slicePartitions+1,u=e._stackPartitions+1;d=Math.round(d*Math.abs(o-i)/W.TWO_PI),u=Math.round(u*Math.abs(s-r)/W.PI),d<2&&(d=2),u<2&&(u=2);let m=0,p=1,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,f=!1,x=!1;g&&(p=2,r>0&&(f=!0,m+=d),s<Math.PI&&(x=!0,m+=d));let _=a*p*(u+d),C=new Float64Array(_*3),V=2*(_+m-(d+u)*p),L=Ae.createTypedArray(_,V),Z,G,I,v,P=0,w=new Array(u),F=new Array(u);for(Z=0;Z<u;Z++)v=r+Z*(s-r)/(u-1),w[Z]=lk(v),F[Z]=ck(v);let b=new Array(a),R=new Array(a);for(Z=0;Z<a;Z++)I=i+Z*(o-i)/(a-1),b[Z]=lk(I),R[Z]=ck(I);for(Z=0;Z<u;Z++)for(G=0;G<a;G++)C[P++]=t.x*w[Z]*R[G],C[P++]=t.y*w[Z]*b[G],C[P++]=t.z*F[Z];if(g)for(Z=0;Z<u;Z++)for(G=0;G<a;G++)C[P++]=n.x*w[Z]*R[G],C[P++]=n.y*w[Z]*b[G],C[P++]=n.z*F[Z];for(w.length=a,F.length=a,Z=0;Z<a;Z++)v=r+Z*(s-r)/(a-1),w[Z]=lk(v),F[Z]=ck(v);for(b.length=d,R.length=d,Z=0;Z<d;Z++)I=i+Z*(o-i)/(d-1),b[Z]=lk(I),R[Z]=ck(I);for(Z=0;Z<a;Z++)for(G=0;G<d;G++)C[P++]=t.x*w[Z]*R[G],C[P++]=t.y*w[Z]*b[G],C[P++]=t.z*F[Z];if(g)for(Z=0;Z<a;Z++)for(G=0;G<d;G++)C[P++]=n.x*w[Z]*R[G],C[P++]=n.y*w[Z]*b[G],C[P++]=n.z*F[Z];for(P=0,Z=0;Z<u*p;Z++){let A=Z*a;for(G=0;G<a-1;G++)L[P++]=A+G,L[P++]=A+G+1}let E=u*a*p;for(Z=0;Z<d;Z++)for(G=0;G<a-1;G++)L[P++]=E+Z+G*d,L[P++]=E+Z+(G+1)*d;if(g)for(E=u*a*p+d*a,Z=0;Z<d;Z++)for(G=0;G<a-1;G++)L[P++]=E+Z+G*d,L[P++]=E+Z+(G+1)*d;if(g){let A=u*a*p,N=A+a*d;if(f)for(Z=0;Z<d;Z++)L[P++]=A+Z,L[P++]=N+Z;if(x)for(A+=a*d-d,N+=a*d-d,Z=0;Z<d;Z++)L[P++]=A+Z,L[P++]=N+Z}let X=new mn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:C})});if(l(e._offsetAttribute)){let A=C.length,N=e._offsetAttribute===cn.NONE?0:1,O=new Uint8Array(A/3).fill(N);X.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:O})}return new ht({attributes:X,indices:L,primitiveType:Fe.LINES,boundingSphere:ce.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var Vd=l1;function d1(e){let t=y(e.radius,1),i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new Vd(i),this._workerName="createSphereOutlineGeometry"}d1.packedLength=Vd.packedLength;d1.pack=function(e,t,n){return Vd.pack(e._ellipsoidGeometry,t,n)};var dQe=new Vd,P_={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};d1.unpack=function(e,t,n){let i=Vd.unpack(e,t,dQe);return P_.stackPartitions=i._stackPartitions,P_.slicePartitions=i._slicePartitions,P_.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,P_.radii),n._ellipsoidGeometry=new Vd(P_),n):(P_.radius=i._radii.x,new d1(P_))};d1.createGeometry=function(e){return Vd.createGeometry(e._ellipsoidGeometry)};var Tb=d1;function u1(e,t){t===0&&(t=W.EPSILON7),this._boundingSphere=new ce(e,t)}Object.defineProperties(u1.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}});u1.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};u1.prototype.intersectPlane=function(e){return ce.intersectPlane(this._boundingSphere,e)};u1.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};u1.prototype.createDebugVolume=function(e){let t=new Tb({radius:this.radius}),n=M.fromTranslation(this.center,new M.clone(M.IDENTITY)),i=new Gt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Kt.fromColor(e)}});return new In({geometryInstances:i,appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1})};var Sb=u1;var _Dn=T(S(),1);var uQe=new h,mQe=new h,hQe=new h,fQe=new h;function v_(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,W.EPSILON7/i,n)}function mK(e,t){let n=h.normalize(e,fQe),i=h.equalsEpsilon(n,h.UNIT_X,W.EPSILON6)?h.UNIT_Y:h.UNIT_X;return v_(e,i,t)}function Hle(e){let t=$.getColumn(e,0,uQe),n=$.getColumn(e,1,mQe),i=$.getColumn(e,2,hQe),o=h.equals(t,h.ZERO),r=h.equals(n,h.ZERO),s=h.equals(i,h.ZERO);return!o&&!r&&!s?e:o&&r&&s?(e[0]=W.EPSILON7,e[4]=W.EPSILON7,e[8]=W.EPSILON7,e):(o&&!r&&!s?t=v_(n,i,t):!o&&r&&!s?n=v_(t,i,n):!o&&!r&&s?i=v_(n,t,i):o?r?s||(t=mK(i,t),n=v_(i,t,n)):(t=mK(n,t),i=v_(n,t,i)):(n=mK(t,n),i=v_(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function m1(e,t){t=Hle(t),this._orientedBoundingBox=new En(e,t),this._boundingSphere=ce.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(m1.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});m1.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};m1.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};m1.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=Hle(t),$.clone(t,this._orientedBoundingBox.halfAxes),ce.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};m1.prototype.createDebugVolume=function(e){let t=new Lm({minimum:new h(-1,-1,-1),maximum:new h(1,1,1)}),n=M.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Gt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Kt.fromColor(e)}});return new In({geometryInstances:i,appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1})};var Ld=m1;function $o(e,t,n,i){this._tileset=e,this._header=n;let o=l(n.contents),r=o&&n.contents.length>1||oi(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?M.unpack(n.transform):M.clone(M.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=M.multiply(a,this.transform,new M),d=l(i)?i._initialTransform:M.IDENTITY;this._initialTransform=M.multiply(d,this.transform,new M),this.computedTransform=c,this.metadata=Y2(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let u;l(s)&&l(s.boundingVolume)&&(u=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=u,this._contentBoundingVolume2D=void 0;let m;l(n.viewerRequestVolume)&&(m=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=m,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,$o._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&$o._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?No.REPLACE:No.ADD):l(i)?p=i.refine:p=No.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,f=!1,x,_,C;if(t=Ee.createIfNeeded(t),r)x=Do.UNLOADED,_=t.clone();else if(l(s)){let G=s.uri;l(s.url)&&($o._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),G=s.url),G===""?($o._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),g=new i1(e,this),f=!0,x=Do.READY):(x=Do.UNLOADED,_=t.getDerivedResource({url:G}),C=ja.getServerKey(_.getUrlComponent()))}else g=new i1(e,this),f=!0,x=Do.READY;this._content=g,this._contentResource=_,this._contentState=x,this._expiredContent=void 0,this._serverKey=C,this.hasEmptyContent=f,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let V=n.expire,L,Z;l(V)&&(L=V.duration,l(V.date)&&(Z=j.fromIso8601(V.date))),this.expireDuration=L,this.expireDate=Z,this.lastStyleTime=0,this._optimChildrenWithinParent=vu.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._wasSelectedLastFrame=!1,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._isClippedByPolygon=!1,this._clippingPlanesState=0,this._clippingPolygonsState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=B.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new j,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}$o._deprecationWarning=ls;Object.defineProperties($o.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return y(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new B),B.clone(this._color)},set:function(e){this._color=B.clone(e,this._color),this._colorDirty=!0}},hasRenderableContent:{get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent&&!this.hasImplicitContent}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Do.READY}},contentUnloaded:{get:function(){return this._contentState===Do.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Do.EXPIRED}},contentFailed:{get:function(){return this._contentState===Do.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var Wg=new h;function pQe(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=h.multiplyByScalar(s.directionWC,e._centerZDepth,Wg),c=h.add(s.positionWC,a,Wg),d=h.subtract(c,r,Wg);if(h.magnitude(d)>o){let Z=h.normalize(d,Wg),G=h.multiplyByScalar(Z,o,Wg),I=h.add(r,G,Wg),v=h.subtract(I,s.positionWC,Wg),P=h.normalize(v,Wg);e._foveatedFactor=1-Math.abs(h.dot(s.directionWC,P))}else e._foveatedFactor=0;let p=e.refine===No.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===wo.PRELOAD_FLIGHT||n._pass===wo.PRELOAD)return!1;let f=1-Math.cos(s.frustum.fov*.5),x=n.foveatedConeSize*f;if(e._foveatedFactor<=x)return!1;let _=f-x,C=W.clamp((e._foveatedFactor-x)/_,0,1),V=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,C),L=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-V<=L}var Qle=new j;$o.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=y(n,1),r=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,d=a.frustum,u=c.drawingBufferWidth,m=c.drawingBufferHeight*o,p;if(e.mode===oe.SCENE2D||d instanceof an){let g=d.offCenterFrustum;l(g)&&(d=g);let f=Math.max(d.top-d.bottom,d.right-d.left)/Math.max(u,m);p=s/f}else{let g=Math.max(this._distanceToCamera,W.EPSILON7),f=d.sseDenominator;if(p=s*m/(g*f),i.dynamicScreenSpaceError){let x=i._dynamicScreenSpaceErrorComputedDensity,_=i.dynamicScreenSpaceErrorFactor,C=W.fog(g,x)*_;p-=C}}return p/=e.pixelRatio,p};function bQe(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=e.memoryAdjustedScreenSpaceError,i=t._screenSpaceErrorProgressiveResolution>n;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let o=t.parent,r=t._screenSpaceErrorProgressiveResolution<=n,s=l(o)&&o._screenSpaceErrorProgressiveResolution>n;return r&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function gQe(e,t){let n=t.parent,o=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-o}$o.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,o=l(t)?t._visibilityPlaneMask:ms.MASK_INDETERMINATE;this.updateTransform(i,e),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,o),this._visible=this._visibilityPlaneMask!==ms.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=gQe(n,this),this._priorityProgressiveResolution=bQe(n,this),this.priorityDeferred=pQe(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};$o.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=j.now(Qle);j.lessThan(this.expireDate,e)&&(this._contentState=Do.EXPIRED,this._expiredContent=this._content)}};function yQe(e){if(!l(e.expireDuration))return;let t=j.now(Qle);j.addSeconds(t,e.expireDuration,t),l(e.expireDate)?j.lessThan(e.expireDate,t)&&j.clone(t,e.expireDate):e.expireDate=j.clone(t)}function xQe(e){return function(){return e._priority}}$o.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?_Qe(this):SQe(this)};function _Qe(e){let t=e._content,n=e._tileset;if(!l(t)){let o=oi(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new H2(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Do.LOADING,i.then(o=>{if(!e.isDestroyed()&&l(o))return e._contentState=Do.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=Do.FAILED,o})}async function TQe(e,t,n,i,o){let r=e._contentState;e._contentState=Do.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===jn.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=Do.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===jn.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await CQe(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=Do.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Do.FAILED,a}}function SQe(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Ho({throttle:!0,throttleByServer:!0,type:cs.TILES3D,priorityFunction:xQe(e),serverKey:e._serverKey});e._request=i,t.request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!l(r)){++o.statistics.numberOfAttemptedRequests;return}return TQe(e,o,i,n,r)}async function CQe(e,t){let n=gf(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===Vs.GEOMETRY||n.contentType===Vs.VECTOR,(n.contentType===Vs.IMPLICIT_SUBTREE||n.contentType===Vs.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0),n.contentType===Vs.EXTERNAL_TILESET&&(e.hasTilesetContent=!0);let o,r=L_[n.contentType];if(e.isDestroyed())return;l(n.binaryPayload)?o=await Promise.resolve(r(i,e,e._contentResource,n.binaryPayload.buffer,0)):o=await Promise.resolve(r(i,e,e._contentResource,n.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,d=e.implicitCoordinates;o.metadata=c.getContentMetadataView(d,0)}else e.hasImplicitContent||(o.metadata=R_(i,s));let a=Z_(i,s);return l(a)&&(o.group=new Dx({metadata:a})),o}$o.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};$o.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Do.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this.clippingPolygonsDirty=this._clippingPolygonsState===0,this._clippingPolygonsState=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var jle=new ce;function fK(e,t){if(t.mode!==oe.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ce.projectTo2D(n,t.mapProjection,jle);e._boundingVolume2D=new Sb(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._boundingVolume2D:e._boundingVolume}function VQe(e,t){if(t.mode!==oe.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ce.projectTo2D(n,t.mapProjection,jle);e._contentBoundingVolume2D=new Sb(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}$o.prototype.visibility=function(e,t){let n=e.cullingVolume,i=fK(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==Jt.INSIDE,a===Jt.OUTSIDE)return ms.MASK_OUTSIDE}let s=o.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==Jt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};$o.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return Jt.INSIDE;if(this._visibilityPlaneMask===ms.MASK_INSIDE)return Jt.INSIDE;let t=e.cullingVolume,n=VQe(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==Jt.INSIDE,s===Jt.OUTSIDE)return Jt.OUTSIDE}let r=i.clippingPolygons;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==Jt.OUTSIDE,s===Jt.INSIDE)return Jt.OUTSIDE}return t.computeVisibility(n)};$o.prototype.distanceToTile=function(e){return fK(this,e).distanceToCamera(e)};var LQe=new h;$o.prototype.distanceToTileCenter=function(e){let n=fK(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,LQe);return h.dot(e.camera.directionWC,i)};$o.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var qle=new $,$le=new h,RQe=new $,pK=new h,ede=new ae,tde=new En,hK=new M;function ZQe(e,t,n){let i=h.fromElements(e[0],e[1],e[2],pK),o=$.fromArray(e,3,RQe);i=M.multiplyByPoint(t,i,i);let r=M.getMatrix3(t,qle);return o=$.multiply(r,o,o),l(n)?(n.update(i,o),n):new Ld(i,o)}function GQe(e,t,n,i){let o=ae.unpack(e,0,ede),r=e[4],s=e[5],a=En.fromRectangle(o,r,s,ne.WGS84,tde),c=a.center,d=a.halfAxes;t=M.multiplyTransformation(t,M.inverseTransformation(n,hK),hK),c=M.multiplyByPoint(t,c,c);let u=M.getMatrix3(t,qle);return d=$.multiply(u,d,d),l(i)&&i instanceof Ld?(i.update(c,d),i):new Ld(c,d)}function EQe(e,t,n,i){if(!M.equalsEpsilon(t,n,W.EPSILON8))return GQe(e,t,n,i);let o=ae.unpack(e,0,ede);return l(i)?(i.rectangle=ae.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ne.WGS84),i):new Mu({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function IQe(e,t,n){let i=h.fromElements(e[0],e[1],e[2],pK),o=e[3];i=M.multiplyByPoint(t,i,i);let r=M.getScale(t,$le),s=h.maximumComponent(r);return o*=s,l(n)?(n.update(i,o),n):new Sb(i,o)}$o.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=s_.parseBoundingVolumeSemantic("TILE",i)),l(o)&&(e=o),!l(e))throw new de("boundingVolume must be defined");if(oi(e,"3DTILES_bounding_volume_S2"))return new Q2(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(l(r)){let c=ZQe(r,t,n);return this._verticalExaggeration!==1&&zle(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=EQe(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof Ld?zle(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=_r.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=_r.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(ne.WGS84))),c}if(l(a)){let c=IQe(a,t,n);if(this._verticalExaggeration!==1){let d=_r.getPosition(c.center,ne.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,pK),u=c.radius*this._verticalExaggeration;c.update(d,u)}return c}throw new de("boundingVolume must contain a sphere, region, or box")};var XQe=h.unpackArray(new Array(8*3).fill(0));function zle(e,t,n){let i=e.boundingVolume.computeCorners(XQe).map(r=>_r.getPosition(r,ne.WGS84,t,n,r)),o=En.fromPoints(i,tde);e.update(o.center,o.halfAxes)}$o.prototype.updateTransform=function(e,t){e=y(e,M.IDENTITY);let n=M.multiplyTransformation(e,this.transform,hK),i=!M.equals(n,this.computedTransform),o=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&M.clone(n,this.computedTransform),o&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let r=this._header,s=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};$o.prototype.updateGeometricErrorScale=function(){let e=M.getScale(this.computedTransform,$le),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function WQe(e,t,n,i){if(!i.isRender)return;let o=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),r=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(r){let c;e._finalResolution?e.hasRenderableContent?c=B.WHITE:c=B.DARKGRAY:c=B.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let d=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");d.color=Kt.toValue(c,d.color)}else!r&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(B.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(B.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=B.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function PQe(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&l(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(l(e.content))try{e.content.update(t,n)}catch(o){throw e._contentState=Do.FAILED,o}}function vQe(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}function wQe(e,t){let n=t.clippingPolygons,i=0;l(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}$o.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;vQe(this,e),wQe(this,e),WQe(this,e,t,n),PQe(this,e,t);let r=i.length;this._commandsLength=r-o;for(let s=o;s<r;++s){let a=i[s],c=a.pass===Ge.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1};var Kle=[];$o.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(yQe(this),this._selectedFrame=0,this.lastStyleTime=0,j.now(this._loadTimestamp),this._contentState=Do.READY,!this.hasTilesetContent&&!this.hasImplicitContent&&(e._statistics.incrementLoadCounts(this.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(this)));let n=t.commandList;t.commandList=Kle;try{this._content.update(e,t)}catch(i){throw this._contentState=Do.FAILED,i}Kle.length=0,t.commandList=n};function Jle(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function dk(e,t,n){return Math.max(W.normalize(e,t,n)-W.EPSILON7,0)}$o.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,o=4,r=1,s=0,a=o,c=s+a,d=o,u=c+d,m=r,p=Math.pow(10,u),g=u+m,f=r,x=Math.pow(10,g),_=g+f,C=Math.pow(10,_),V=dk(this._depth,n.depth,i.depth);V=t?1-V:V;let Z=!e.isSkippingLevelOfDetail&&this.refine===No.REPLACE?dk(this._priorityHolder._distanceToCamera,n.distance,i.distance):dk(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),G=Jle(Z,a,s),I=this._priorityProgressiveResolution?0:p,v=dk(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),P=Jle(v,d,c),w=this.priorityDeferred?x:0,F=e._pass===wo.PRELOAD_FLIGHT?0:C;this._priority=V+G+I+P+w+F};$o.prototype.isDestroyed=function(){return!1};$o.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),me(this)};var ku=$o;var IBn=T(S(),1);var xBn=T(S(),1);function Cb(e){e=y(e,y.EMPTY_OBJECT);let t=e.id,n=e.group,i=e.class,o=l(n.properties)?n.properties:{};this._class=i,this._properties=o,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(Cb.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Cb.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,this._class)};Cb.prototype.hasPropertyBySemantic=function(e){return Mn.hasPropertyBySemantic(e,this._properties,this._class)};Cb.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,this._class,e)};Cb.prototype.getProperty=function(e){return Mn.getProperty(e,this._properties,this._class)};Cb.prototype.setProperty=function(e,t){return Mn.setProperty(e,t,this._properties,this._class)};Cb.prototype.getPropertyBySemantic=function(e){return Mn.getPropertyBySemantic(e,this._properties,this._class)};Cb.prototype.setPropertyBySemantic=function(e,t){return Mn.setPropertyBySemantic(e,t,this._properties,this._class)};var h1=Cb;var VBn=T(S(),1);function Vb(e){e=y(e,y.EMPTY_OBJECT);let t=e.tileset,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Vb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Vb.prototype.hasProperty=function(e){return Mn.hasProperty(e,this._properties,this._class)};Vb.prototype.hasPropertyBySemantic=function(e){return Mn.hasPropertyBySemantic(e,this._properties,this._class)};Vb.prototype.getPropertyIds=function(e){return Mn.getPropertyIds(this._properties,this._class,e)};Vb.prototype.getProperty=function(e){return Mn.getProperty(e,this._properties,this._class)};Vb.prototype.setProperty=function(e,t){return Mn.setProperty(e,t,this._properties,this._class)};Vb.prototype.getPropertyBySemantic=function(e){return Mn.getPropertyBySemantic(e,this._properties,this._class)};Vb.prototype.setPropertyBySemantic=function(e,t){return Mn.setPropertyBySemantic(e,t,this._properties,this._class)};var j2=Vb;function nde(e){e=y(e,y.EMPTY_OBJECT);let t=e.metadataJson,n=e.schema,i=y(t.metadata,t.tileset),o;l(i)&&(o=new j2({tileset:i,class:n.classes[i.class]}));let r=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let d=0;d<c;d++){let u=a[d];s.push(new h1({group:u,class:n.classes[u.class]}))}}else if(l(a)){r=Object.keys(a).sort();let c=r.length;for(let d=0;d<c;d++){let u=r[d];if(a.hasOwnProperty(u)){let m=a[u];s.push(new h1({id:u,group:a[u],class:n.classes[m.class]}))}}}this._schema=n,this._groups=s,this._groupIds=r,this._tileset=o,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(nde.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var w_=nde;var FBn=T(S(),1);var ide={},FQe=new h;ide.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof Ld||i instanceof Mu){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=vu.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof Ld||a instanceof Mu)){e._optimChildrenWithinParent=vu.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,d=h.subtract(c.center,o.center,FQe),u=h.magnitude(d);h.divideByScalar(d,u,d);let m=Math.abs(o.halfAxes[0]*d.x)+Math.abs(o.halfAxes[1]*d.y)+Math.abs(o.halfAxes[2]*d.z)+Math.abs(o.halfAxes[3]*d.x)+Math.abs(o.halfAxes[4]*d.y)+Math.abs(o.halfAxes[5]*d.z)+Math.abs(o.halfAxes[6]*d.x)+Math.abs(o.halfAxes[7]*d.y)+Math.abs(o.halfAxes[8]*d.z),p=Math.abs(c.halfAxes[0]*d.x)+Math.abs(c.halfAxes[1]*d.y)+Math.abs(c.halfAxes[2]*d.z)+Math.abs(c.halfAxes[3]*d.x)+Math.abs(c.halfAxes[4]*d.y)+Math.abs(c.halfAxes[5]*d.z)+Math.abs(c.halfAxes[6]*d.x)+Math.abs(c.halfAxes[7]*d.y)+Math.abs(c.halfAxes[8]*d.z);if(m<=p+u){e._optimChildrenWithinParent=vu.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===vu.USE_OPTIMIZATION};var q2=ide;var BBn=T(S(),1);var NBn=T(S(),1);function $2(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties($2.prototype,{length:{get:function(){return this._length}}});function AQe(e,t,n){this.item=e,this.previous=t,this.next=n}$2.prototype.add=function(e){let t=new AQe(e,this.tail,void 0);return l(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function ode(e,t){l(t.previous)&&l(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):l(t.previous)?(t.previous.next=void 0,e.tail=t.previous):l(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}$2.prototype.remove=function(e){l(e)&&(ode(this,e),--this._length)};$2.prototype.splice=function(e,t){if(e===t)return;ode(this,t);let n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e};var eP=$2;function F_(){this._list=new eP,this._sentinel=this._list.add(),this._trimTiles=!1}F_.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};F_.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};F_.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};F_.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};F_.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,o=this._sentinel,r=i.head;for(;r!==o&&(e.totalMemoryUsageInBytes>e.cacheBytes||n);){let s=r.item;r=r.next,this.unloadTile(e,s,t)}};F_.prototype.trim=function(){this._trimTiles=!0};var tP=F_;var JBn=T(S(),1);function uk(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function gK(e,t){let n;return t==="_loadTimestamp"?n=j.toDate(e).getTime():n=e,n}uk.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=gK(e,n),this._referenceMaximum[n]=gK(t,n)};function MQe(e,t){let n=e.tilePropertyName;if(l(n)){let i=gK(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var bK=[new B(.1,.1,.1,1),new B(.153,.278,.878,1),new B(.827,.231,.49,1),new B(.827,.188,.22,1),new B(1,.592,.259,1),new B(1,.843,0,1)];uk.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=MQe(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+W.EPSILON7,c=W.clamp(i-o,0,s)/s,d=bK.length-1,u=c*d,m=Math.floor(u),p=Math.ceil(u),g=u-m,f=bK[m],x=bK[p],_=B.clone(B.WHITE);_.red=W.lerp(f.red,x.red,g),_.green=W.lerp(f.green,x.green,g),_.blue=W.lerp(f.blue,x.blue,g),e._debugColor=_};uk.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var nP=uk;var qBn=T(S(),1);function f1(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.batchTableByteLength=0}f1.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};function mk(e,t,n,i){let o=t.innerContents,r=t.pointsLength,s=t.trianglesLength,a=t.featuresLength,c=t.geometryByteLength,d=t.texturesByteLength,u=t.batchTableByteLength;if(i?(e.numberOfFeaturesLoaded+=n?-a:a,e.numberOfPointsLoaded+=n?-r:r,e.geometryByteLength+=n?-c:c,e.texturesByteLength+=n?-d:d,e.batchTableByteLength+=n?-u:u):(e.numberOfFeaturesSelected+=n?-a:a,e.numberOfPointsSelected+=n?-r:r,e.numberOfTrianglesSelected+=n?-s:s),l(o)){let m=o.length;for(let p=0;p<m;++p)mk(e,o[p],n,i)}}f1.prototype.incrementSelectionCounts=function(e){mk(this,e,!1,!1)};f1.prototype.incrementLoadCounts=function(e){mk(this,e,!1,!0)};f1.prototype.decrementLoadCounts=function(e){mk(this,e,!0,!0)};f1.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.selected=e.selected,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.batchTableByteLength=e.batchTableByteLength};var Lb=f1;var t3n=T(S(),1);function iP(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(iP.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});iP.prototype.makeDirty=function(){this._styleDirty=!0};iP.prototype.resetDirty=function(){this._styleDirty=!1};iP.prototype.applyStyle=function(e){if(!l(e.root)||l(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,o=t?e._selectedTiles:e._selectedTilesToStyle,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a.lastStyleTime!==n){let c=a.content;a.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var oP=iP;var l3n=T(S(),1);function NQe(e,t,n){let i=oi(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let o=t.boundingVolume;if(!l(o.box)&&!l(o.region)&&!oi(o,"3DTILES_bounding_volume_S2")&&!oi(o,"3DTILES_bounding_volume_cylinder"))throw new de("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=o,this.refine=t.refine,this.subtreeUriTemplate=new Ee({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=kQe(t);for(let s=0;s<r.length;s++){let a=r[s];this.contentHeaders.push(Ye(a,!0));let c=new Ee({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=UQe(t),this.subdivisionScheme=jr[i.subdivisionScheme],this.branchingFactor=jr.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function kQe(e){if(oi(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return l(t.contents)?t.contents:t.content}return l(e.contents)?e.contents:l(e.content)?[e.content]:[]}function UQe(e){let t=Ye(e,!0);return l(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],Object.keys(t.extensions).length===0&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}var A_=NQe;var g3n=T(S(),1);var m3n=T(S(),1);var rP={};function rde(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function yK(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function sde(e){return e&=1431655765,e=(e^e>>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function xK(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}rP.encode2D=function(e,t){return(rde(e)|rde(t)<<1)>>>0};rP.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=sde(e),t[1]=sde(e>>1),t};rP.encode3D=function(e,t,n){return yK(e)|yK(t)<<1|yK(n)<<2};rP.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=xK(e),t[1]=xK(e>>1),t[2]=xK(e>>2),t};var Pg=rP;function Bo(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===jr.OCTREE&&(this.z=e.z)}Object.defineProperties(Bo.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===jr.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===jr.OCTREE?Pg.encode3D(this.x,this.y,this.z):Pg.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===jr.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});Bo.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===jr.OCTREE){let o=(this.z<<e.level)+e.z;return new Bo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Bo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Bo.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),o=Math.floor(this.y/t);if(this.subdivisionScheme===jr.OCTREE){let r=Math.floor(this.z/t);return new Bo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new Bo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};Bo.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===jr.OCTREE){let r=e.z%n;return new Bo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new Bo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};Bo.prototype.getChildCoordinates=function(e){let t=this.level+1,n=2*this.x+e%2,i=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===jr.OCTREE){let o=2*this.z+Math.floor(e/4)%2;return new Bo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Bo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Bo.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};Bo.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};Bo.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,o=this.x===n,r=this.y===i;if(this.subdivisionScheme===jr.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};Bo.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===jr.OCTREE?this.z===e.z:!0)};Bo.prototype.isImplicitTilesetRoot=function(){return this.level===0};Bo.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Bo.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Bo.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===jr.OCTREE&&(e.z=this.z),e};var ade=[0,0,0];Bo.fromMortonIndex=function(e,t,n,i){let o;return e===jr.OCTREE?(o=Pg.decode3D(i,ade),new Bo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=Pg.decode2D(i,ade),new Bo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};Bo.fromTileIndex=function(e,t,n){let i,o,r;return e===jr.OCTREE?(i=Math.floor(W.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(W.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),Bo.fromMortonIndex(e,t,i,r)};var M_=Bo;var I3n=T(S(),1);var V3n=T(S(),1);function Rb(){}Rb.selectTiles=function(e,t){pe.throwInstantiationError()};Rb.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};Rb.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};Rb.selectTile=function(e,t){if(e.contentVisibility(t)===Jt.OUTSIDE)return;e._wasSelectedLastFrame=!0;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame<t.frameNumber-1&&(i._selectedTilesToStyle.push(e),e._wasSelectedLastFrame=!1),e._selectedFrame=t.frameNumber,i._selectedTiles.push(e)};Rb.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};Rb.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};Rb.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!DQe(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function DQe(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:o}=t.camera,r=i!==0?i:o,s=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*r/s<1}Rb.updateTile=function(e,t){cde(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,YQe(e),e._shouldSelect=!1,e._finalResolution=!0};function cde(e,t){if(e.updateVisibility(t),!e.isVisible)return;let n=e.children.length>0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let r=e.children[0];cde(r,t),e._visible=r._visible;return}if(BQe(e,t)){e._visible=!1;return}let i=e.refine===No.REPLACE,o=e._optimChildrenWithinParent===vu.USE_OPTIMIZATION;if(i&&o&&n&&!OQe(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function BQe(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==No.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function OQe(e,t){let n=!1,i=e.children;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(t),n=n||r.isVisible}return n}function YQe(e){let t=e.tileset._minimumPriority,n=e.tileset._maximumPriority,i=e._priorityHolder;n.distance=Math.max(i._distanceToCamera,n.distance),t.distance=Math.min(i._distanceToCamera,t.distance),n.depth=Math.max(e._depth,n.depth),t.depth=Math.min(e._depth,t.depth),n.foveatedFactor=Math.max(i._foveatedFactor,n.foveatedFactor),t.foveatedFactor=Math.min(i._foveatedFactor,t.foveatedFactor),n.reverseScreenSpaceError=Math.max(e._priorityReverseScreenSpaceError,n.reverseScreenSpaceError),t.reverseScreenSpaceError=Math.min(e._priorityReverseScreenSpaceError,t.reverseScreenSpaceError)}var Ys=Rb;function lde(){}var sP={stack:new Dc,stackMaximumLength:0};lde.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e.hasMixedContent=!1;let n=!0,i=e.root;if(i.updateVisibility(t),!i.isVisible)return n;let{touchTile:o,visitTile:r}=Ys,s=sP.stack;for(s.push(i);s.length>0;){sP.stackMaximumLength=Math.max(sP.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===No.ADD,d=a.refine===No.REPLACE,u=HQe(a);u&&zQe(a,s,t),(c||d&&!u)&&(KQe(e,a),o(a,t),JQe(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return sP.stack.trim(sP.stackMaximumLength),n};function HQe(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function zQe(e,t,n){let{children:i}=e;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(n),r.isVisible&&t.push(r)}}function KQe(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function JQe(e,t){e.contentAvailable&&e.contentVisibility(t)!==Jt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var aP=lde;var F3n=T(S(),1);function dde(){}var cP={stack:new Dc,stackMaximumLength:0},lP={stack:new Dc,stackMaximumLength:0};dde.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Ys.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;jQe(n,t),cP.stack.trim(cP.stackMaximumLength),lP.stack.trim(lP.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function _K(e,t){e.contentAvailable&&Ys.selectTile(e,t)}function QQe(e,t,n){let i=e.refine===No.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:c}=Ys;for(let f=0;f<r.length;++f)s(r[f],n);r.sort(Ys.sortChildrenByDistanceToCamera);let d=i&&e.hasRenderableContent,u=!0,m=!1,p=-1,g=Number.MAX_VALUE;for(let f=0;f<r.length;++f){let x=r[f];if(x.isVisible?(t.push(x),x._foveatedFactor<g&&(p=f,g=x._foveatedFactor),m=!0):(d||o.loadSiblings)&&(x._foveatedFactor<g&&(p=f,g=x._foveatedFactor),a(x,n),c(x,n)),d){let _;x._inRequestVolume?x.hasRenderableContent?_=x.contentAvailable:_=qQe(x,n):_=!1,u=u&&_}}if(m||(u=!1),p!==-1&&i){let f=r[p];f._wasMinPriorityChild=!0;let x=(e._wasMinPriorityChild||e===o.root)&&g<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;x._foveatedFactor=Math.min(f._foveatedFactor,x._foveatedFactor),x._distanceToCamera=Math.min(f._distanceToCamera,x._distanceToCamera);for(let _=0;_<r.length;++_)r[_]._priorityHolder=x}return u}function jQe(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=Ys,a=cP.stack;for(a.push(e);a.length>0;){cP.stackMaximumLength=Math.max(cP.stackMaximumLength,a.length);let c=a.pop(),d=c.parent,u=!l(d)||d._refines;c._refines=i(c)?QQe(c,a,t)&&u:!1;let m=!c._refines&&u;c.hasRenderableContent?c.refine===No.ADD?(_K(c,t),o(c,t)):c.refine===No.REPLACE&&(o(c,t),m&&_K(c,t)):(n._emptyTiles.push(c),o(c,t),m&&_K(c,t)),r(c,t),s(c,t)}}function qQe(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=Ys,s=!0,a=lP.stack;for(a.push(e);a.length>0;){lP.stackMaximumLength=Math.max(lP.stackMaximumLength,a.length);let c=a.pop(),d=c.children,u=d.length,m=!c.hasRenderableContent&&n(c);if(!m&&!c.contentAvailable&&(s=!1),i(c,t),c.isVisible||(o(c,t),r(c,t)),m)for(let p=0;p<u;++p){let g=d[p];a.push(g)}}return e.hasEmptyContent||s}var dP=dde;var D3n=T(S(),1);function ude(){}var uP={stack:new Dc,stackMaximumLength:0},mP={stack:new Dc,stackMaximumLength:0},Zb={stack:new Dc,stackMaximumLength:0,ancestorStack:new Dc,ancestorStackMaximumLength:0},$Qe=2;ude.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Ys.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;r4e(n,t),s4e(n,t),uP.stack.trim(uP.stackMaximumLength),mP.stack.trim(mP.stackMaximumLength),Zb.stack.trim(Zb.stackMaximumLength),Zb.ancestorStack.trim(Zb.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function e4e(e,t){let{updateTile:n,touchTile:i,selectTile:o}=Ys,r=mP.stack;for(r.push(e);r.length>0;){mP.stackMaximumLength=Math.max(mP.stackMaximumLength,r.length);let a=r.pop().children;for(let c=0;c<a.length;++c){let d=a[c];d.isVisible&&(d.contentAvailable?(n(d,t),i(d,t),o(d,t)):d._depth-e._depth<$Qe&&r.push(d))}}}function hk(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:e4e(e,t)}function t4e(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!l(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function n4e(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||l(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function i4e(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=Ys;for(let d=0;d<o.length;++d)r(o[d],n);o.sort(Ys.sortChildrenByDistanceToCamera);let c=!1;for(let d=0;d<o.length;++d){let u=o[d];u.isVisible?(t.push(u),c=!0):i.loadSiblings&&(s(u,n),a(u,n))}return c}function o4e(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:l(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function r4e(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:o,loadTile:r,visitTile:s,touchTile:a}=Ys,c=uP.stack;for(c.push(e);c.length>0;){uP.stackMaximumLength=Math.max(uP.stackMaximumLength,c.length);let d=c.pop();t4e(d,t);let u=d.parent,m=!l(u)||u._refines;d._refines=o(d)?i4e(d,c,t)&&m:!1;let p=!d._refines&&m;d.hasRenderableContent?d.refine===No.ADD?(hk(d,t),r(d,t)):d.refine===No.REPLACE&&(o4e(d,i)?(r(d,t),p&&hk(d,t)):p?(hk(d,t),r(d,t)):n4e(n,d)&&r(d,t)):(n._emptyTiles.push(d),r(d,t),p&&hk(d,t)),s(d,t),a(d,t)}}function s4e(e,t){let{selectTile:n,canTraverse:i}=Ys,{stack:o,ancestorStack:r}=Zb,s;for(o.push(e);o.length>0||r.length>0;){if(Zb.stackMaximumLength=Math.max(Zb.stackMaximumLength,o.length),Zb.ancestorStackMaximumLength=Math.max(Zb.ancestorStackMaximumLength,r.length),r.length>0){let d=r.peek();if(d._stackLength===o.length){r.pop(),d!==s&&(d._finalResolution=!1),n(d,t);continue}}let a=o.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===No.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}r.push(a),a._stackLength=o.length}if(c){let d=a.children;for(let u=0;u<d.length;++u){let m=d[u];m.isVisible&&o.push(m)}}}}var hP=ude;function er(e){e=y(e,y.EMPTY_OBJECT),this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new tP,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._showCreditsOnScreen=y(e.showCreditsOnScreen,!1),this._cullWithChildrenBounds=y(e.cullWithChildrenBounds,!0),this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new Dc,this._maximumScreenSpaceError=y(e.maximumScreenSpaceError,16),this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=y(e.cacheBytes,512*1024*1024);let t=y(e.maximumCacheOverflowBytes,512*1024*1024);this._maximumCacheOverflowBytes=t,this._styleEngine=new oP,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?M.clone(e.modelMatrix):M.clone(M.IDENTITY),this._addHeightCallbacks=[],this._statistics=new Lb,this._statisticsLast=new Lb,this._statisticsPerPass=new Array(wo.NUMBER_OF_PASSES);for(let o=0;o<wo.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new Lb;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new nP(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=y(e.cullRequestsWhileMoving,!0),this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=y(e.cullRequestsWhileMovingMultiplier,60),this.progressiveResolutionHeightFraction=W.clamp(y(e.progressiveResolutionHeightFraction,.3),0,.5),this.preferLeaves=y(e.preferLeaves,!1),this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._ellipsoid=y(e.ellipsoid,ne.WGS84),this._initialClippingPlanesOriginMatrix=M.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=y(e.vectorClassificationOnly,!1),this._vectorKeepDecodedPositions=y(e.vectorKeepDecodedPositions,!1),this.preloadWhenHidden=y(e.preloadWhenHidden,!1),this.preloadFlightDestinations=y(e.preloadFlightDestinations,!0),this._pass=void 0,this.dynamicScreenSpaceError=y(e.dynamicScreenSpaceError,!0),this.foveatedScreenSpaceError=y(e.foveatedScreenSpaceError,!0),this._foveatedConeSize=y(e.foveatedConeSize,.1),this._foveatedMinimumScreenSpaceErrorRelaxation=y(e.foveatedMinimumScreenSpaceErrorRelaxation,0),this.foveatedInterpolationCallback=y(e.foveatedInterpolationCallback,W.lerp),this.foveatedTimeDelay=y(e.foveatedTimeDelay,.2),this.dynamicScreenSpaceErrorDensity=y(e.dynamicScreenSpaceErrorDensity,2e-4),this.dynamicScreenSpaceErrorFactor=y(e.dynamicScreenSpaceErrorFactor,24),this.dynamicScreenSpaceErrorHeightFalloff=y(e.dynamicScreenSpaceErrorHeightFalloff,.25),this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=y(e.shadows,_n.ENABLED),this.show=y(e.show,!0),this.colorBlendMode=Gl.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new lf(e.pointCloudShading),this._pointCloudEyeDomeLighting=new tb,this.loadProgress=new be,this.allTilesLoaded=new be,this.initialTilesLoaded=new be,this.tileLoad=new be,this.tileUnload=new be,this.tileFailed=new be,this.tileVisible=new be,this.skipLevelOfDetail=y(e.skipLevelOfDetail,!1),this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=y(e.baseScreenSpaceError,1024),this.skipScreenSpaceErrorFactor=y(e.skipScreenSpaceErrorFactor,16),this.skipLevels=y(e.skipLevels,1),this.immediatelyLoadDesiredLevelOfDetail=y(e.immediatelyLoadDesiredLevelOfDetail,!1),this.loadSiblings=y(e.loadSiblings,!1),this._clippingPlanes=void 0,l(e.clippingPlanes)&&hs.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,l(e.clippingPolygons)&&km.setOwner(e.clippingPolygons,this,"_clippingPolygons"),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new Ux,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new jp(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=y(e.backFaceCulling,!0),this._enableShowOutline=y(e.enableShowOutline,!0),this.showOutline=y(e.showOutline,!0),this.outlineColor=y(e.outlineColor,B.BLACK),this.splitDirection=y(e.splitDirection,vr.NONE),this.enableCollision=y(e.enableCollision,!1),this._projectTo2D=y(e.projectTo2D,!1),this._enablePick=y(e.enablePick,!1),this.debugFreezeFrame=y(e.debugFreezeFrame,!1),this.debugColorizeTiles=y(e.debugColorizeTiles,!1),this._enableDebugWireframe=y(e.enableDebugWireframe,!1),this.debugWireframe=y(e.debugWireframe,!1),this.debugWireframe===!0&&this._enableDebugWireframe===!1&&St("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.debugShowContentBoundingVolume=y(e.debugShowContentBoundingVolume,!1),this.debugShowViewerRequestVolume=y(e.debugShowViewerRequestVolume,!1),this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=y(e.debugShowGeometricError,!1),this.debugShowRenderingStatistics=y(e.debugShowRenderingStatistics,!1),this.debugShowMemoryUsage=y(e.debugShowMemoryUsage,!1),this.debugShowUrl=y(e.debugShowUrl,!1),this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=y(e.featureIdLabel,"featureId_0");typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=y(e.instanceFeatureIdLabel,"instanceFeatureId_0");typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties(er.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){hs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){km.setOwner(e,this,"_clippingPolygons")}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return ls("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){this._maximumCacheOverflowBytes=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=M.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(M.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):M.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},environmentMapManager:{get:function(){return this._environmentMapManager}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e,xde(this)}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});er.fromIonAssetId=async function(e,t){let n=await fd.fromAssetId(e);return er.fromUrl(n,t)};er.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Ee.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await er.loadJson(n),r=await a4e(n,o),s=new er(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=r,s._geometricError=o.geometricError,s._scaledGeometricError=o.geometricError;let a=o.asset;s._asset=a,s._extras=o.extras,xde(s);let c=l(o.asset.gltfUpAxis)?Xo.fromName(o.asset.gltfUpAxis):Xo.Y,d=y(t.modelUpAxis,c),u=y(t.modelForwardAxis,Xo.X);s._properties=o.properties,s._extensionsUsed=o.extensionsUsed,s._extensions=o.extensions,s._modelUpAxis=d,s._modelForwardAxis=u,s._root=s.loadTileset(n,o);let p=s._root.createBoundingVolume(o.root.boundingVolume,M.IDENTITY).boundingSphere.center,g=s._ellipsoid.cartesianToCartographic(p);return l(g)&&g.height>li._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=Ft.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=M.clone(s._initialClippingPlanesOriginMatrix),s};er.loadJson=function(e){return Ee.createIfNeeded(e).fetchJson()};er.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};er.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new de("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new de("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&er.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics,r=i.tilesetVersion;l(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let s=mde(this,e,t.root,n);l(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===No.ADD;let d=c._header.children;if(l(d))for(let u=0;u<d.length;++u){let m=d[u],p=mde(this,e,m,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&q2.checkChildrenWithinParent(c)}return s};function mde(e,t,n,i){if(!(l(n.implicitTiling)||oi(n,"3DTILES_implicit_tiling")))return new ku(e,t,n,i);let r=e.schema,s=new A_(t,n,r),a=new M_({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,u=Ye(n,!0);u.contents=[{uri:c}],delete u.content,delete u.extensions;let m=new ku(e,t,u,i);return m.implicitTileset=s,m.implicitCoordinates=a,m}async function a4e(e,t){let n=oi(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Ci.getSchemaLoader({resource:e});else if(l(n.schema))i=Ci.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new w_({schema:i.schema,metadataJson:n});return Ci.unload(i),o}var hde=new h,c4e=new he,l4e=new M,d4e=new h,u4e=new h,m4e=new h,h4e=new h;function f4e(e,t){let n,i,o,r,s,a=t.camera,c=e._root,d=c.contentBoundingVolume;if(d instanceof Mu)n=h.normalize(a.positionWC,hde),i=a.directionWC,o=a.positionCartographic.height,r=d.minimumHeight,s=d.maximumHeight;else{let x=M.inverseTransformation(c.computedTransform,l4e),_=t.mapProjection.ellipsoid,C=d.boundingVolume,V=M.multiplyByPoint(x,C.center,d4e);if(h.magnitude(V)>_.minimumRadius){let L=he.fromCartesian(V,_,c4e);n=h.normalize(a.positionWC,hde),i=a.directionWC,o=a.positionCartographic.height,r=0,s=L.height*2}else{let L=M.multiplyByPoint(x,a.positionWC,u4e);if(n=h.UNIT_Z,i=M.multiplyByPointAsVector(x,a.directionWC,m4e),i=h.normalize(i,i),o=L.z,d instanceof Ld){let Z=$.getColumn(C.halfAxes,2,h4e),G=h.magnitude(Z);r=V.z-G,s=V.z+G}else if(d instanceof Sb){let Z=C.radius;r=V.z-Z,s=V.z+Z}}}let u=e.dynamicScreenSpaceErrorHeightFalloff,m=r+(s-r)*u,p=s,g=W.clamp((o-m)/(p-m),0,1),f=1-Math.abs(h.dot(i,n));f=f*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*f}function p4e(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,o=t.requestContent();l(o)&&(o.then(r=>{!l(r)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(r=>{bde(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?E4e(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function pde(e,t){return e._priority-t._priority}er.prototype.postPassesUpdate=function(e){l(this._root)&&(b4e(this,e),X4e(this,e),this._cache.unloadTiles(this,yde),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};er.prototype.prePassesUpdate=function(e){if(!l(this._root))return;C4e(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;l(n)&&n.enabled&&n.update(e),l(this._loadTimestamp)||(this._loadTimestamp=j.clone(e.time)),this._timeSinceLoad=Math.max(j.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&f4e(this,e),e.newFrame&&this._cache.reset()};function b4e(e,t){let n=e._requestedTilesInFlight,i=0;for(let o=0;o<n.length;++o){let r=n[o],s=t.frameNumber-r._touchedFrame>=1;if(r._contentState!==Do.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function g4e(e){let t=e._requestedTiles;t.sort(pde);for(let n=0;n<t.length;++n)p4e(e,t[n])}function bde(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let o=l(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:o}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${o}`),console.log(e.stack))}function y4e(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==Do.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}var x4e=new he,_4e=new he,T4e=new h;function S4e(e,t,n){if(!e.enableCollision||!e.show)return;let i=e._addHeightCallbacks,o=t.boundingSphere;for(let r of i){if(r.invoked||t._wasSelectedLastFrame)continue;let s=r.ellipsoid,a=he.clone(r.positionCartographic,x4e),c=he.fromCartesian(o.center,s,_4e);l(c)&&(a.height=c.height);let d=he.toCartesian(a,s,T4e);h.distance(d,o.center)<=o.radius&&n.afterRender.push(()=>{l(r.callback)&&r.callback(a),r.invoked=!1})}}function C4e(e,t){y4e(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,s=i+o,a=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>s){a=!0;break}let d=n[c];try{d.process(e,t),d.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(d))}catch(u){--r.numberOfTilesProcessing,bde(u,e,d)}}e.totalMemoryUsageInBytes<i?L4e(e):a&&n.length>0&&V4e(e)}function V4e(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(pde)}function L4e(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var fk=new h,R4e={maximumFractionDigits:3};function fde(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,R4e):Math.round(t).toLocaleString()}function TK(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=h.clone(i,fk);if(l(t))o.x+=.75*(t[0]+t[3]+t[6]),o.y+=.75*(t[1]+t[4]+t[7]),o.z+=.75*(t[2]+t[5]+t[8]);else if(l(n)){let r=h.normalize(i,fk);r=h.multiplyByScalar(r,.75*n,fk),o=h.add(r,i,fk)}return o}function SK(e,t,n){let i="",o=0;if(t.debugShowGeometricError&&(i+=`
  8352. Geometric error: ${e.geometricError}`,o++),t.debugShowRenderingStatistics&&(i+=`
  8353. Commands: ${e.commandsLength}`,o++,e.content.pointsLength>0&&(i+=`
  8354. Points: ${e.content.pointsLength}`,o++),e.content.trianglesLength>0&&(i+=`
  8355. Triangles: ${e.content.trianglesLength}`,o++),i+=`
  8356. Features: ${e.content.featuresLength}`,o++),t.debugShowMemoryUsage&&(i+=`
  8357. Texture Memory: ${fde(e.content.texturesByteLength)}`,i+=`
  8358. Geometry Memory: ${fde(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=`
  8359. Urls:`;let s=e.content.innerContentUrls;for(let a=0;a<s.length;a++)i+=`
  8360. - ${s[a]}`;o+=s.length}else i+=`
  8361. Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${19-o}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(r)}function Z4e(e,t){let n=e._selectedTiles,i=n.length,o=e._emptyTiles,r=o.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(l(e.debugPickedTile)){let s=l(e.debugPickPosition)?e.debugPickPosition:TK(e.debugPickedTile),a=SK(e.debugPickedTile,e,s);a.pixelOffset=new D(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];SK(a,e,TK(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&SK(a,e,TK(a))}}e._tileDebugLabels.update(t)}function G4e(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:o}=t,r=i.length,s=e._selectedTiles,a=e.isSkippingLevelOfDetail&&e._hasMixedContent&&o.stencilBuffer&&s.length>0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new ei({stencil:0,pass:Ge.CESIUM_3D_TILE,renderState:Ue.fromCache({stencilMask:Ot.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:d}=e,u=n.isRender,m=i.length;for(let f=0;f<s.length;++f){let x=s[f];u&&d.raiseEvent(x),S4e(e,x,t),x.update(e,t,n),c.incrementSelectionCounts(x.content),++c.selected}let p=e._emptyTiles;for(let f=0;f<p.length;++f)p[f].update(e,t,n);let g=i.length-m;if(e._backfaceCommands.trim(),a){let f=e._backfaceCommands.values,x=f.length;i.length+=x;for(let _=g-1;_>=0;--_)i[m+x+_]=i[m+_];for(let _=0;_<x;++_)i[m+_]=f[_]}g=i.length-r,c.numberOfCommands=g,u&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&g>0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new ff),Z4e(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var gde=[];function E4e(e,t){let n=t,i=gde;for(i.push(t);i.length>0;){t=i.pop();let o=t.children;for(let r=0;r<o.length;++r)i.push(o[r]);t!==n&&(I4e(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function yde(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function I4e(e,t){e._cache.unloadTile(e,t,yde),t.destroy()}er.prototype.trimLoadedTiles=function(){this._cache.trim()};function X4e(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;Lb.clone(n,i);let c=o!==s||r!==a;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(o,r),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,c&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}function W4e(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function P4e(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!M.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=M.clone(e.modelMatrix,e._previousModelMatrix)))}function v4e(e,t,n,i){if(t.mode===oe.MORPHING||!l(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,W4e(e),P4e(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&g4e(e),G4e(e,t,i),Lb.clone(o,n),i.isRender){let s=e._credits;if(l(s)&&o.selected!==0)for(let a=0;a<s.length;++a){let c=s[a];t.creditDisplay.addCreditToNextFrame(c)}}return r}function xde(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(Et.clone(i))});let n=e.asset.extras;if(l(n)&&l(n.cesium)&&l(n.cesium.credits)){let i=n.cesium.credits;for(let o=0;o<i.length;++o){let r=i[o];t.push(new Et(r.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}er.prototype.getTraversal=function(e){let{pass:t}=e;return t===wo.MOST_DETAILED_PRELOAD||t===wo.MOST_DETAILED_PICK?aP:this.isSkippingLevelOfDetail?hP:dP};er.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};er.prototype.updateForPass=function(e,t){let n=t.pass;if(n===wo.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===wo.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===wo.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,o=e.camera,r=e.cullingVolume;t.ready=!1;let s=wo.getPassOptions(n),a=s.ignoreCommands,c=y(t.commandList,i),d=c.length;if(e.commandList=c,e.camera=y(t.camera,o),e.cullingVolume=y(t.cullingVolume,r),s.isRender){let p=this._environmentMapManager;l(this._root)&&(p.position=this.boundingSphere.center),p.update(e)}let u=this._clippingPolygons;l(u)&&u.enabled&&u.queueCommands(e);let m=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=v4e(this,e,m,s)),a&&(c.length=d),e.commandList=i,e.camera=o,e.cullingVolume=r};er.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};er.prototype.isDestroyed=function(){return!1};er.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),l(this._root)){let e=gde;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i<n.length;++i)e.push(n[i])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,this._environmentMapManager.isDestroyed()||this._environmentMapManager.destroy(),this._environmentMapManager=void 0,me(this)};er.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};er.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!er.supportedExtensions[e[t]])throw new de(`Unsupported 3D Tiles Extension: ${e[t]}`)};var w4e=new pn,F4e=new h,A4e=new he;er.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ne.WGS84);let i=w4e,o=n.cartographicToCartesian(e,i.direction);h.normalize(i.direction,i.direction),i.direction=h.normalize(o,i.direction),i.direction=h.negate(o,i.direction),i.origin=h.multiplyByScalar(i.direction,-2*n.maximumRadius,i.origin);let r=this.pick(i,t.frameState,F4e);if(l(r))return n.cartesianToCartographic(r,A4e)?.height};er.prototype.updateHeight=function(e,t,n){n=y(n,ne.WGS84);let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},o=()=>{let r=this._addHeightCallbacks,s=r.length;for(let a=0;a<s;++a)if(r[a]===i){r.splice(a,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),o};var M4e=new La,N4e=new h;er.prototype.pick=function(e,t,n){if(!t.context.webgl2&&!this._enablePick)return;let i=this._selectedTiles,o=i.length,r=[];for(let c=0;c<o;++c){let d=i[c],u=qn.raySphere(e,d.contentBoundingVolume.boundingSphere,M4e);!l(u)||!l(d.content)||r.push(d)}let s=r.length;r.sort((c,d)=>{let u=ce.distanceSquaredTo(c.contentBoundingVolume.boundingSphere,e.origin),m=ce.distanceSquaredTo(d.contentBoundingVolume.boundingSphere,e.origin);return u-m});let a;for(let c=0;c<s;++c){let u=r[c].content.pick(e,t,N4e);if(l(u))return a=h.clone(u,n),a}};var ua=er;var k4e=new M;function vg(e,t){t.collectionChanged.addEventListener(vg.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Zt,this._onCollectionChanged(t,t.values,[],[])}vg.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._tileset,c,d=n[s.id],u=s.isShowing&&s.isAvailable(e)&&K.getValueOrDefault(a._show,e,!0),m;u&&(m=s.computeModelMatrix(e,k4e),c=Ee.createIfNeeded(K.getValueOrUndefined(a._uri,e)));let p=l(d)?d.tilesetPrimitive:void 0;if(!u){l(p)&&(p.show=!1);continue}(!l(d)||c.url!==d.url)&&(l(p)&&i.removeAndDestroy(p),delete n[s.id],U4e(c,n,s,i)),l(p)&&(p.show=!0,l(m)&&(p.modelMatrix=m),p.maximumScreenSpaceError=K.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};vg.prototype.isDestroyed=function(){return!1};vg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(vg.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)CK(this,e[i],t,n);return me(this)};vg.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return ft.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(ce.clone(i.boundingSphere,t),ft.DONE):ft.FAILED:ft.PENDING};vg.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._tileset)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._tileset)?s.set(r.id,r):(CK(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],CK(this,r,a,c),s.remove(r.id)};function CK(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function U4e(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await ua.fromUrl(e);if(o.id=n,i.add(o),!l(t[n.id]))return;t[n.id].tilesetPrimitive=o}catch(o){console.error(o),t[n.id].loadFail=!0}}var fP=vg;var _Yn=T(S(),1);var D4e=B.WHITE,B4e=B.BLACK,O4e=new D(2,2);function p1(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(p1.prototype,{isConstant:{get:function(){return K.isConstant(this._evenColor)&&K.isConstant(this._oddColor)&&K.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:ue("evenColor"),oddColor:ue("oddColor"),repeat:ue("repeat")});p1.prototype.getType=function(e){return"Checkerboard"};var Y4e=new j;p1.prototype.getValue=function(e,t){return l(e)||(e=j.now(Y4e)),l(t)||(t={}),t.lightColor=K.getValueOrClonedDefault(this._evenColor,e,D4e,t.lightColor),t.darkColor=K.getValueOrClonedDefault(this._oddColor,e,B4e,t.darkColor),t.repeat=K.getValueOrDefault(this._repeat,e,O4e),t};p1.prototype.equals=function(e){return this===e||e instanceof p1&&K.equals(this._evenColor,e._evenColor)&&K.equals(this._oddColor,e._oddColor)&&K.equals(this._repeat,e._repeat)};var b1=p1;var MYn=T(S(),1);var XYn=T(S(),1);var _de={id:void 0};function pP(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let o=t.values.slice(0),r=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,r,s)}while(e._refire);e._firing=!1}}}function hc(e){this._owner=e,this._entities=new Zt,this._addedEntities=new Zt,this._removedEntities=new Zt,this._changedEntities=new Zt,this._suspendCount=0,this._collectionChanged=new be,this._id=Bn(),this._show=!0,this._firing=!1,this._refire=!1}hc.prototype.suspendEvents=function(){this._suspendCount++};hc.prototype.resumeEvents=function(){this._suspendCount--,pP(this)};Object.defineProperties(hc.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,o=i.length;for(t=0;t<o;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<o;t++){let r=n[t],s=i[t];r!==s.isShowing&&s.definitionChanged.raiseEvent(s,"isShowing",s.isShowing,r)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});hc.prototype.computeAvailability=function(){let e=Be.MAXIMUM_VALUE,t=Be.MINIMUM_VALUE,n=this._entities.values;for(let i=0,o=n.length;i<o;i++){let s=n[i].availability;if(l(s)){let a=s.start,c=s.stop;j.lessThan(a,e)&&!a.equals(Be.MINIMUM_VALUE)&&(e=a),j.greaterThan(c,t)&&!c.equals(Be.MAXIMUM_VALUE)&&(t=c)}}return Be.MAXIMUM_VALUE.equals(e)&&(e=Be.MINIMUM_VALUE),Be.MINIMUM_VALUE.equals(t)&&(t=Be.MAXIMUM_VALUE),new Vn({start:e,stop:t})};hc.prototype.add=function(e){e instanceof jo||(e=new jo(e));let t=e.id,n=this._entities;if(n.contains(t))throw new pe(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(hc.prototype._onEntityDefinitionChanged,this),pP(this),e};hc.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};hc.prototype.contains=function(e){return this._entities.get(e.id)===e};hc.prototype.removeById=function(e){if(!l(e))return!1;let n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener(hc.prototype._onEntityDefinitionChanged,this),pP(this),!0):!1};hc.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,o=this._removedEntities;for(let r=0;r<t;r++){let s=n[r],a=s.id,c=i.get(a);l(c)||(s.definitionChanged.removeEventListener(hc.prototype._onEntityDefinitionChanged,this),o.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),pP(this)};hc.prototype.getById=function(e){return this._entities.get(e)};hc.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(_de.id=e,t=new jo(_de),this.add(t)),t};hc.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),pP(this)};var Hs=hc;var pk={id:void 0},g1=new Array(2);function VK(e){let t=e.propertyNames,n=t.length;for(let i=0;i<n;i++)e[t[i]]=void 0;e._name=void 0,e._availability=void 0}function Tde(e,t,n,i){g1[0]=n,g1[1]=i.id,t[JSON.stringify(g1)]=i.definitionChanged.addEventListener(Nr.prototype._onDefinitionChanged,e)}function Sde(e,t,n,i){g1[0]=n,g1[1]=i.id;let o=JSON.stringify(g1);t[o](),t[o]=void 0}function wg(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,o=i.length,r,s,a,c,d,u=e._composite,m=new Hs(e),p=e._eventHash,g;for(r=0;r<o;r++)for(d=i[r],d.collectionChanged.removeEventListener(Nr.prototype._onCollectionChanged,e),a=d.values,g=d.id,c=a.length-1;c>-1;c--)s=a[c],Sde(e,p,g,s);for(r=n-1;r>=0;r--)for(d=t[r],d.collectionChanged.addEventListener(Nr.prototype._onCollectionChanged,e),a=d.values,g=d.id,c=a.length-1;c>-1;c--){s=a[c],Tde(e,p,g,s);let x=m.getById(s.id);l(x)||(x=u.getById(s.id),l(x)?VK(x):(pk.id=s.id,x=new jo(pk)),m.add(x)),x.merge(s)}e._collectionsCopy=t.slice(0),u.suspendEvents(),u.removeAll();let f=m.values;for(r=0;r<f.length;r++)u.add(f[r]);u.resumeEvents()}function Nr(e,t){this._owner=t,this._composite=new Hs(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Bn(),this._eventHash={},wg(this),this._shouldRecomposite=!1}Object.defineProperties(Nr.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}});Nr.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),wg(this)};Nr.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),wg(this),!0):!1};Nr.prototype.removeAllCollections=function(){this._collections.length=0,wg(this)};Nr.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Nr.prototype.contains=function(e){return this._composite.contains(e)};Nr.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Nr.prototype.getCollection=function(e){return this._collections[e]};Nr.prototype.getCollectionsLength=function(){return this._collections.length};function bk(e,t){return e.indexOf(t)}function Cde(e,t,n){let i=e._collections;if(t=W.clamp(t,0,i.length-1),n=W.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,wg(e)}Nr.prototype.raiseCollection=function(e){let t=bk(this._collections,e);Cde(this,t,t+1)};Nr.prototype.lowerCollection=function(e){let t=bk(this._collections,e);Cde(this,t,t-1)};Nr.prototype.raiseCollectionToTop=function(e){let t=bk(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),wg(this))};Nr.prototype.lowerCollectionToBottom=function(e){let t=bk(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),wg(this))};Nr.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Nr.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(wg(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Nr.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Nr.prototype.getById=function(e){return this._composite.getById(e)};Nr.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let s,a,c,d,u=n.length,m=this._eventHash,p=e.id;for(s=0;s<u;s++){let f=n[s];Sde(this,m,p,f);let x=f.id;for(a=o-1;a>=0;a--)c=i[a].getById(x),l(c)&&(l(d)||(d=r.getById(x),VK(d)),d.merge(c));l(d)||r.removeById(x),d=void 0}let g=t.length;for(s=0;s<g;s++){let f=t[s];Tde(this,m,p,f);let x=f.id;for(a=o-1;a>=0;a--)c=i[a].getById(x),l(c)&&(l(d)||(d=r.getById(x),l(d)?VK(d):(pk.id=x,d=new jo(pk),r.add(d))),d.merge(c));d=void 0}r.resumeEvents()};Nr.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,c=r.getById(a),d=c[t],u=!l(d),m=!0;for(let p=s-1;p>=0;p--){let g=o[p].getById(e.id);if(l(g)){let f=g[t];if(l(f)){if(m)if(m=!1,l(f.merge)&&l(f.clone))d=f.clone(d);else{d=f;break}d.merge(f)}}}u&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=d};var LK=Nr;var mHn=T(S(),1);var rHn=T(S(),1);var kYn=T(S(),1);function RK(){this._removalFunctions=[]}RK.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let o=this;return function(){i();let r=o._removalFunctions;r.splice(r.indexOf(i),1)}};RK.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var lr=RK;var jYn=T(S(),1);function EK(e,t){return j.compare(e.start,t.start)}function kr(e){if(this._intervals=[],this._changedEvent=new be,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(kr.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){let e=this._intervals;return e.length===0?void 0:e[0].start}},isStartIncluded:{get:function(){let e=this._intervals;return e.length===0?!1:e[0].isStartIncluded}},stop:{get:function(){let e=this._intervals,t=e.length;return t===0?void 0:e[t-1].stop}},isStopIncluded:{get:function(){let e=this._intervals,t=e.length;return t===0?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return this._intervals.length===0}}});kr.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof kr))return!1;let n=this._intervals,i=e._intervals,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;r++)if(!Vn.equals(n[r],i[r],t))return!1;return!0};kr.prototype.get=function(e){return this._intervals[e]};kr.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};kr.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};kr.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};kr.prototype.contains=function(e){return this.indexOf(e)>=0};var ZK=new Vn;kr.prototype.indexOf=function(e){let t=this._intervals;ZK.start=e,ZK.stop=e;let n=Eo(t,ZK,EK);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&Vn.contains(t[n-1],e)?n-1:~n)};kr.prototype.findInterval=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.start,n=e.stop,i=e.isStartIncluded,o=e.isStopIncluded,r=this._intervals;for(let s=0,a=r.length;s<a;s++){let c=r[s];if((!l(t)||c.start.equals(t))&&(!l(n)||c.stop.equals(n))&&(!l(i)||c.isStartIncluded===i)&&(!l(o)||c.isStopIncluded===o))return r[s]}};kr.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||j.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Eo(n,e,EK);i<0?i=~i:i>0&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i<n.length&&!e.isStartIncluded&&n[i].isStartIncluded&&n[i].start.equals(e.start)&&++i;let o;for(i>0&&(o=j.compare(n[i-1].stop,e.start),(o>0||o===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(j.greaterThan(e.stop,n[i-1].stop)?e=new Vn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Vn({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(o=j.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Vn({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new Vn({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(o=j.compare(e.stop,n[i].start),o>0||o===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new Vn({start:e.start,stop:j.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:j.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Vn({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};kr.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Eo(t,e,EK);n<0&&(n=~n);let i=!1;for(n>0&&(j.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(j.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new Vn({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new Vn({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n<t.length&&!e.isStartIncluded&&t[n].isStartIncluded&&e.start.equals(t[n].start)&&(i=!0,t.splice(n,0,new Vn({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&j.greaterThan(e.stop,t[n].stop);)i=!0,t.splice(n,1);return n<t.length&&e.stop.equals(t[n].stop)&&(i=!0,!e.isStopIncluded&&t[n].isStopIncluded?n+1<t.length&&t[n+1].start.equals(e.stop)&&t[n].data===t[n+1].data?(t.splice(n,1),t[n]=new Vn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new Vn({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(j.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new Vn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};kr.prototype.intersect=function(e,t,n){let i=new kr,o=0,r=0,s=this._intervals,a=e._intervals;for(;o<s.length&&r<a.length;){let c=s[o],d=a[r];if(j.lessThan(c.stop,d.start))++o;else if(j.lessThan(d.stop,c.start))++r;else{if(l(n)||l(t)&&t(c.data,d.data)||!l(t)&&d.data===c.data){let u=Vn.intersect(c,d,new Vn,n);u.isEmpty||i.addInterval(u,t)}j.lessThan(c.stop,d.stop)||c.stop.equals(d.stop)&&!c.isStopIncluded&&d.isStopIncluded?++o:++r}}return i};kr.fromJulianDateArray=function(e,t){l(t)||(t=new kr);let n=e.julianDates,i=n.length,o=e.dataCallback,r=y(e.isStartIncluded,!0),s=y(e.isStopIncluded,!0),a=y(e.leadingInterval,!1),c=y(e.trailingInterval,!1),d,u=0;a&&(++u,d=new Vn({start:Be.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d));for(let m=0;m<i-1;++m){let p=n[m],g=n[m+1];d=new Vn({start:p,stop:g,isStartIncluded:t.length===u?r:!0,isStopIncluded:m===i-2?s:!1}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d),p=g}return c&&(d=new Vn({start:n[i-1],stop:Be.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d)),t};var fc=new mp,bP=[0,31,28,31,30,31,30,31,31,30,31,30,31];function GK(e,t,n){l(n)||(n=new j),j.toGregorianDate(e,fc);let i=fc.millisecond+t.millisecond,o=fc.second+t.second,r=fc.minute+t.minute,s=fc.hour+t.hour,a=fc.day+t.day,c=fc.month+t.month,d=fc.year+t.year;for(i>=1e3&&(o+=Math.floor(i/1e3),i=i%1e3),o>=60&&(r+=Math.floor(o/60),o=o%60),r>=60&&(s+=Math.floor(r/60),r=r%60),s>=24&&(a+=Math.floor(s/24),s=s%24),bP[2]=pm(d)?29:28;a>bP[c]||c>=13;)a>bP[c]&&(a-=bP[c],++c),c>=13&&(--c,d+=Math.floor(c/12),c=c%12,++c),bP[2]=pm(d)?29:28;return fc.millisecond=i,fc.second=o,fc.minute=r,fc.hour=s,fc.day=a,fc.month=c,fc.year=d,j.fromGregorianDate(fc,n)}var H4e=new j,z4e=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function Vde(e,t){if(!l(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(z4e);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),j.toGregorianDate(j.fromIso8601(e,H4e),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var gP=new mp;kr.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=j.fromIso8601(n[0]),o=j.fromIso8601(n[1]),r=[];if(!Vde(n[2],gP))r.push(i,o);else{let s=j.clone(i);for(r.push(s);j.compare(s,o)<0;)s=GK(s,gP),j.compare(o,s)<=0&&j.clone(o,s),r.push(s)}return kr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};kr.fromIso8601DateArray=function(e,t){return kr.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return j.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};kr.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=y(e.relativeToPrevious,!1),r=[],s,a,c=i.length;for(let d=0;d<c;++d)(Vde(i[d],gP)||d===0)&&(o&&l(a)?s=GK(a,gP):s=GK(n,gP),r.push(s),a=s);return kr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Ur=kr;function K4e(e,t,n,i){function o(){n.raiseEvent(e)}let r=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let c=i.get(a);l(c.data)&&r.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,o)}}function N_(){this._eventHelper=new lr,this._definitionChanged=new be,this._intervals=new Ur,this._intervals.changedEvent.addEventListener(N_.prototype._intervalsChanged,this)}Object.defineProperties(N_.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var J4e=new j;N_.prototype.getValue=function(e,t){l(e)||(e=j.now(J4e));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};N_.prototype.equals=function(e){return this===e||e instanceof N_&&this._intervals.equals(e._intervals,K.equals)};N_.prototype._intervalsChanged=function(){K4e(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var pc=N_;function Fg(){this._definitionChanged=new be,this._composite=new pc,this._composite.definitionChanged.addEventListener(Fg.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Fg.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});Fg.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var Q4e=new j;Fg.prototype.getValue=function(e,t){l(e)||(e=j.now(Q4e));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};Fg.prototype.equals=function(e){return this===e||e instanceof Fg&&this._composite.equals(e._composite,K.equals)};Fg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var y1=Fg;var THn=T(S(),1);function Ag(e){this._referenceFrame=y(e,Ai.FIXED),this._definitionChanged=new be,this._composite=new pc,this._composite.definitionChanged.addEventListener(Ag.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Ag.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}});var j4e=new j;Ag.prototype.getValue=function(e,t){return l(e)||(e=j.now(j4e)),this.getValueInReferenceFrame(e,Ai.FIXED,t)};Ag.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};Ag.prototype.equals=function(e){return this===e||e instanceof Ag&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,K.equals)};Ag.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var ma=Ag;var gKn=T(S(),1);var bzn=T(S(),1);var CHn=T(S(),1),q4e={ROUNDED:0,MITERED:1,BEVELED:2},Ei=Object.freeze(q4e);var KHn=T(S(),1);var MHn=T(S(),1);var ha=[new h,new h],$4e=new h,eje=new h,tje=new h,nje=new h,ije=new h,oje=new h,rje=new h,sje=new h,aje=new h,x1=new h,gk=new h,yP={},IK=new he;function cje(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];IK=t.cartesianToCartographic(o,IK),n[i]=IK.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function XK(e,t,n,i){let o=e[0],r=e[1],s=h.angleBetween(o,r),a=Math.ceil(s/i),c=new Array(a),d;if(t===n){for(d=0;d<a;d++)c[d]=t;return c.push(n),c}let m=(n-t)/a;for(d=1;d<a;d++){let p=t+d*m;c[d]=p}return c[0]=t,c.push(n),c}var yk=new h,xk=new h;function lje(e,t,n,i){let o=new Kr(n,i),r=o.projectPointOntoPlane(h.add(n,e,yk),yk),s=o.projectPointOntoPlane(h.add(n,t,xk),xk),a=D.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var dje=new h(-1,0,0),k_=new M,uje=new M,WK=new $,mje=$.IDENTITY.clone(),hje=new h,fje=new se,Lde=new h;function Gb(e,t,n,i,o,r,s,a){let c=hje,d=fje;k_=Ft.eastNorthUpToFixedFrame(e,o,k_),c=M.multiplyByPointAsVector(k_,dje,c),c=h.normalize(c,c);let u=lje(c,t,e,o);WK=$.fromRotationZ(u,WK),Lde.z=r,k_=M.multiplyTransformation(k_,M.fromRotationTranslation(WK,Lde,uje),k_);let m=mje;m[0]=s;for(let p=0;p<a;p++)for(let g=0;g<n.length;g+=3)d=h.fromArray(n,g,d),d=$.multiplyByVector(m,d,d),d=M.multiplyByPoint(k_,d,d),i.push(d.x,d.y,d.z);return i}var pje=new h;function PK(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let c=h.fromArray(e,a,pje);i=Gb(c,t,n,i,o,r[a/3],s,1)}return i}function bje(e,t){let n=e.length,i=new Array(n*6),o=0,r=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let d=a.x-r,u=a.y-s;i[o++]=d,i[o++]=0,i[o++]=u,i[o++]=d,i[o++]=0,i[o++]=u}return a=e[0],i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s,i}function Rde(e,t){let n=e.length,i=new Array(n*3),o=0,r=t.x+t.width/2,s=t.y+t.height/2;for(let a=0;a<n;a++)i[o++]=e[a].x-r,i[o++]=0,i[o++]=e[a].y-s;return i}var Zde=new we,Gde=new h,Ede=new $;function Ide(e,t,n,i,o,r,s,a,c,d){let u=h.angleBetween(h.subtract(t,e,x1),h.subtract(n,e,gk)),m=i===Ei.BEVELED?0:Math.ceil(u/W.toRadians(5)),p;o?p=$.fromQuaternion(we.fromAxisAngle(h.negate(e,x1),u/(m+1),Zde),Ede):p=$.fromQuaternion(we.fromAxisAngle(e,u/(m+1),Zde),Ede);let g,f;if(t=h.clone(t,Gde),m>0){let x=d?2:1;for(let _=0;_<m;_++)t=$.multiplyByVector(p,t,t),g=h.subtract(t,e,x1),g=h.normalize(g,g),o||(g=h.negate(g,g)),f=r.scaleToGeodeticSurface(t,gk),s=Gb(f,g,a,s,r,c,1,x)}else g=h.subtract(t,e,x1),g=h.normalize(g,g),o||(g=h.negate(g,g)),f=r.scaleToGeodeticSurface(t,gk),s=Gb(f,g,a,s,r,c,1,1),n=h.clone(n,Gde),g=h.subtract(n,e,x1),g=h.normalize(g,g),o||(g=h.negate(g,g)),f=r.scaleToGeodeticSurface(n,gk),s=Gb(f,g,a,s,r,c,1,1);return s}yP.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];D.equals(r,s)||n.push(s)}return n};yP.angleIsGreaterThanPi=function(e,t,n,i){let o=new Kr(n,i),r=o.projectPointOntoPlane(h.add(n,e,yk),yk),s=o.projectPointOntoPlane(h.add(n,t,xk),xk);return s.x*r.y-s.y*r.x>=0};var gje=new h,yje=new h;yP.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=cje(e,r),a=i._granularity,c=i._cornerType,d=o?bje(t,n):Rde(t,n),u=o?Rde(t,n):void 0,m=n.height/2,p=n.width/2,g=e.length,f=[],x=o?[]:void 0,_=$4e,C=eje,V=tje,L=nje,Z=ije,G=oje,I=rje,v=sje,P=aje,w=e[0],F=e[1];L=r.geodeticSurfaceNormal(w,L),_=h.subtract(F,w,_),_=h.normalize(_,_),v=h.cross(L,_,v),v=h.normalize(v,v);let b=s[0],R=s[1];o&&(x=Gb(w,v,u,x,r,b+m,1,1)),P=h.clone(w,P),w=F,C=h.negate(_,C);let E,X;for(let O=1;O<g-1;O++){let U=o?2:1;if(F=e[O+1],w.equals(F)){St("Positions are too close and are considered equivalent with rounding error.");continue}_=h.subtract(F,w,_),_=h.normalize(_,_),L=r.geodeticSurfaceNormal(w,L);let Y=h.multiplyByScalar(L,h.dot(_,L),gje);h.subtract(_,Y,Y),h.normalize(Y,Y);let k=h.multiplyByScalar(L,h.dot(C,L),yje);if(h.subtract(C,k,k),h.normalize(k,k),!W.equalsEpsilon(Math.abs(h.dot(Y,k)),1,W.EPSILON7)){V=h.add(_,C,V),V=h.normalize(V,V),V=h.cross(V,L,V),V=h.cross(L,V,V),V=h.normalize(V,V);let J=1/Math.max(.25,h.magnitude(h.cross(V,C,x1))),te=yP.angleIsGreaterThanPi(_,C,w,r);te?(Z=h.add(w,h.multiplyByScalar(V,J*p,V),Z),G=h.add(Z,h.multiplyByScalar(v,p,G),G),ha[0]=h.clone(P,ha[0]),ha[1]=h.clone(G,ha[1]),E=XK(ha,b+m,R+m,a),X=Gi.generateArc({positions:ha,granularity:a,ellipsoid:r}),f=PK(X,v,d,f,r,E,1),v=h.cross(L,_,v),v=h.normalize(v,v),I=h.add(Z,h.multiplyByScalar(v,p,I),I),c===Ei.ROUNDED||c===Ei.BEVELED?Ide(Z,G,I,c,te,r,f,d,R+m,o):(V=h.negate(V,V),f=Gb(w,V,d,f,r,R+m,J,U)),P=h.clone(I,P)):(Z=h.add(w,h.multiplyByScalar(V,J*p,V),Z),G=h.add(Z,h.multiplyByScalar(v,-p,G),G),ha[0]=h.clone(P,ha[0]),ha[1]=h.clone(G,ha[1]),E=XK(ha,b+m,R+m,a),X=Gi.generateArc({positions:ha,granularity:a,ellipsoid:r}),f=PK(X,v,d,f,r,E,1),v=h.cross(L,_,v),v=h.normalize(v,v),I=h.add(Z,h.multiplyByScalar(v,-p,I),I),c===Ei.ROUNDED||c===Ei.BEVELED?Ide(Z,G,I,c,te,r,f,d,R+m,o):f=Gb(w,V,d,f,r,R+m,J,U),P=h.clone(I,P)),C=h.negate(_,C)}else f=Gb(P,v,d,f,r,b+m,1,1),P=w;b=R,R=s[O+1],w=F}ha[0]=h.clone(P,ha[0]),ha[1]=h.clone(w,ha[1]),E=XK(ha,b+m,R+m,a),X=Gi.generateArc({positions:ha,granularity:a,ellipsoid:r}),f=PK(X,v,d,f,r,E,1),o&&(x=Gb(w,v,u,x,r,R+m,1,1)),g=f.length;let A=o?g+x.length:g,N=new Float64Array(A);return N.set(f),o&&N.set(x,g),N};var eh=yP;var wK={},_1=new h,wde=new h,xje=new h,Xde=new h,Jc=[new h,new h],Fde=new h,Ade=new h,Mde=new h,_je=new h,Tje=new h,Sje=new h,Cje=new h,Vje=new h,Lje=new h,Rje=new h,Wde=new we,Pde=new $;function _k(e,t,n,i,o){let r=h.angleBetween(h.subtract(t,e,_1),h.subtract(n,e,wde)),s=i===Ei.BEVELED?1:Math.ceil(r/W.toRadians(5))+1,a=s*3,c=new Array(a);c[a-3]=n.x,c[a-2]=n.y,c[a-1]=n.z;let d;o?d=$.fromQuaternion(we.fromAxisAngle(h.negate(e,_1),r/s,Wde),Pde):d=$.fromQuaternion(we.fromAxisAngle(e,r/s,Wde),Pde);let u=0;t=h.clone(t,_1);for(let m=0;m<s;m++)t=$.multiplyByVector(d,t,t),c[u++]=t.x,c[u++]=t.y,c[u++]=t.z;return c}function Zje(e){let t=Fde,n=Ade,i=Mde,o=e[1];n=h.fromArray(e[1],o.length-3,n),i=h.fromArray(e[0],0,i),t=h.midpoint(n,i,t);let r=_k(t,n,i,Ei.ROUNDED,!1),s=e.length-1,a=e[s-1];o=e[s],n=h.fromArray(a,a.length-3,n),i=h.fromArray(o,0,i),t=h.midpoint(n,i,t);let c=_k(t,n,i,Ei.ROUNDED,!1);return[r,c]}function vde(e,t,n,i){let o=_1;return i?o=h.add(e,t,o):(t=h.negate(t,t),o=h.add(e,t,o)),[o.x,o.y,o.z,n.x,n.y,n.z]}function vK(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=h.multiplyByScalar(t,n,_1),a=h.negate(s,wde),c=0,d=e.length-1;for(let u=0;u<e.length;u+=3){let m=h.fromArray(e,u,xje),p=h.add(m,a,Xde);o[c++]=p.x,o[c++]=p.y,o[c++]=p.z;let g=h.add(m,s,Xde);r[d--]=g.z,r[d--]=g.y,r[d--]=g.x}return i.push(o,r),i}wK.addAttribute=function(e,t,n,i){let o=t.x,r=t.y,s=t.z;l(n)&&(e[n]=o,e[n+1]=r,e[n+2]=s),l(i)&&(e[i]=s,e[i-1]=r,e[i-2]=o)};var Gje=new h,Eje=new h;wK.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=Fde,c=Ade,d=Mde,u=_je,m=Tje,p=Sje,g=Cje,f=Vje,x=Lje,_=Rje,C=[],V=s?[]:void 0,L=s?[]:void 0,Z=n[0],G=n[1];c=h.normalize(h.subtract(G,Z,c),c),a=i.geodeticSurfaceNormal(Z,a),u=h.normalize(h.cross(a,c,u),u),s&&(V.push(u.x,u.y,u.z),L.push(a.x,a.y,a.z)),g=h.clone(Z,g),Z=G,d=h.negate(c,d);let I,v=[],P,w=n.length;for(P=1;P<w-1;P++){a=i.geodeticSurfaceNormal(Z,a),G=n[P+1],c=h.normalize(h.subtract(G,Z,c),c);let b=h.multiplyByScalar(a,h.dot(c,a),Gje);h.subtract(c,b,b),h.normalize(b,b);let R=h.multiplyByScalar(a,h.dot(d,a),Eje);if(h.subtract(d,R,R),h.normalize(R,R),!W.equalsEpsilon(Math.abs(h.dot(b,R)),1,W.EPSILON7)){m=h.normalize(h.add(c,d,m),m),m=h.cross(m,a,m),m=h.cross(a,m,m),m=h.normalize(m,m);let X=o/Math.max(.25,h.magnitude(h.cross(m,d,_1))),A=eh.angleIsGreaterThanPi(c,d,Z,i);m=h.multiplyByScalar(m,X,m),A?(f=h.add(Z,m,f),_=h.add(f,h.multiplyByScalar(u,o,_),_),x=h.add(f,h.multiplyByScalar(u,o*2,x),x),Jc[0]=h.clone(g,Jc[0]),Jc[1]=h.clone(_,Jc[1]),I=Gi.generateArc({positions:Jc,granularity:t,ellipsoid:i}),C=vK(I,u,o,C),s&&(V.push(u.x,u.y,u.z),L.push(a.x,a.y,a.z)),p=h.clone(x,p),u=h.normalize(h.cross(a,c,u),u),x=h.add(f,h.multiplyByScalar(u,o*2,x),x),g=h.add(f,h.multiplyByScalar(u,o,g),g),r===Ei.ROUNDED||r===Ei.BEVELED?v.push({leftPositions:_k(f,p,x,r,A)}):v.push({leftPositions:vde(Z,h.negate(m,m),x,A)})):(x=h.add(Z,m,x),_=h.add(x,h.negate(h.multiplyByScalar(u,o,_),_),_),f=h.add(x,h.negate(h.multiplyByScalar(u,o*2,f),f),f),Jc[0]=h.clone(g,Jc[0]),Jc[1]=h.clone(_,Jc[1]),I=Gi.generateArc({positions:Jc,granularity:t,ellipsoid:i}),C=vK(I,u,o,C),s&&(V.push(u.x,u.y,u.z),L.push(a.x,a.y,a.z)),p=h.clone(f,p),u=h.normalize(h.cross(a,c,u),u),f=h.add(x,h.negate(h.multiplyByScalar(u,o*2,f),f),f),g=h.add(x,h.negate(h.multiplyByScalar(u,o,g),g),g),r===Ei.ROUNDED||r===Ei.BEVELED?v.push({rightPositions:_k(x,p,f,r,A)}):v.push({rightPositions:vde(Z,m,f,A)})),d=h.negate(c,d)}Z=G}a=i.geodeticSurfaceNormal(Z,a),Jc[0]=h.clone(g,Jc[0]),Jc[1]=h.clone(Z,Jc[1]),I=Gi.generateArc({positions:Jc,granularity:t,ellipsoid:i}),C=vK(I,u,o,C),s&&(V.push(u.x,u.y,u.z),L.push(a.x,a.y,a.z));let F;return r===Ei.ROUNDED&&(F=Zje(C)),{positions:C,corners:v,lefts:V,normals:L,endPositions:F}};var ki=wK;var Ude=new h,Dde=new h,Tk=new h,Sk=new h,Ije=new h,Bde=new h,Mg=new h,T1=new h;function Ode(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function th(e,t,n,i,o,r){let s=e.normals,a=e.tangents,c=e.bitangents,d=h.normalize(h.cross(n,t,Mg),Mg);r.normal&&ki.addAttribute(s,t,i,o),r.tangent&&ki.addAttribute(a,d,i,o),r.bitangent&&ki.addAttribute(c,n,i,o)}function Yde(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,s=e.lefts,a=e.normals,c=new mn,d,u=0,m=0,p,g=0,f;for(p=0;p<i.length;p+=2)f=i[p].length-3,u+=f,g+=f*2,m+=i[p+1].length-3;for(u+=3,m+=3,p=0;p<o.length;p++){d=o[p];let ee=o[p].leftPositions;l(ee)?(f=ee.length,u+=f,g+=f):(f=o[p].rightPositions.length,m+=f,g+=f)}let x=l(r),_;x&&(_=r[0].length-3,u+=_,m+=_,_/=3,g+=_*6);let C=u+m,V=new Float64Array(C),L=t.normal?new Float32Array(C):void 0,Z=t.tangent?new Float32Array(C):void 0,G=t.bitangent?new Float32Array(C):void 0,I={normals:L,tangents:Z,bitangents:G},v=0,P=C-1,w,F,b,R,E=Ude,X=Dde,A,N,O=_/2,U=Ae.createTypedArray(C/3,g),Y=0;if(x){N=Tk,A=Sk;let ee=r[0];for(E=h.fromArray(a,0,E),X=h.fromArray(s,0,X),p=0;p<O;p++)N=h.fromArray(ee,(O-1-p)*3,N),A=h.fromArray(ee,(O+p)*3,A),ki.addAttribute(V,A,v),ki.addAttribute(V,N,void 0,P),th(I,E,X,v,P,t),F=v/3,R=F+1,w=(P-2)/3,b=w-1,U[Y++]=w,U[Y++]=F,U[Y++]=b,U[Y++]=b,U[Y++]=F,U[Y++]=R,v+=3,P-=3}let k=0,H=0,J=i[k++],te=i[k++];V.set(J,v),V.set(te,P-te.length+1),X=h.fromArray(s,H,X);let z,q;for(f=te.length-3,p=0;p<f;p+=3)z=n.geodeticSurfaceNormal(h.fromArray(J,p,Mg),Mg),q=n.geodeticSurfaceNormal(h.fromArray(te,f-p,T1),T1),E=h.normalize(h.add(z,q,E),E),th(I,E,X,v,P,t),F=v/3,R=F+1,w=(P-2)/3,b=w-1,U[Y++]=w,U[Y++]=F,U[Y++]=b,U[Y++]=b,U[Y++]=F,U[Y++]=R,v+=3,P-=3;for(z=n.geodeticSurfaceNormal(h.fromArray(J,f,Mg),Mg),q=n.geodeticSurfaceNormal(h.fromArray(te,f,T1),T1),E=h.normalize(h.add(z,q,E),E),H+=3,p=0;p<o.length;p++){let ee;d=o[p];let fe=d.leftPositions,_e=d.rightPositions,le,ye,Te=Bde,Xe=Tk,Le=Sk;if(E=h.fromArray(a,H,E),l(fe)){for(th(I,E,X,void 0,P,t),P-=3,le=R,ye=b,ee=0;ee<fe.length/3;ee++)Te=h.fromArray(fe,ee*3,Te),U[Y++]=le,U[Y++]=ye-ee-1,U[Y++]=ye-ee,ki.addAttribute(V,Te,void 0,P),Xe=h.fromArray(V,(ye-ee-1)*3,Xe),Le=h.fromArray(V,le*3,Le),X=h.normalize(h.subtract(Xe,Le,X),X),th(I,E,X,void 0,P,t),P-=3;Te=h.fromArray(V,le*3,Te),Xe=h.subtract(h.fromArray(V,ye*3,Xe),Te,Xe),Le=h.subtract(h.fromArray(V,(ye-ee)*3,Le),Te,Le),X=h.normalize(h.add(Xe,Le,X),X),th(I,E,X,v,void 0,t),v+=3}else{for(th(I,E,X,v,void 0,t),v+=3,le=b,ye=R,ee=0;ee<_e.length/3;ee++)Te=h.fromArray(_e,ee*3,Te),U[Y++]=le,U[Y++]=ye+ee,U[Y++]=ye+ee+1,ki.addAttribute(V,Te,v),Xe=h.fromArray(V,le*3,Xe),Le=h.fromArray(V,(ye+ee)*3,Le),X=h.normalize(h.subtract(Xe,Le,X),X),th(I,E,X,v,void 0,t),v+=3;Te=h.fromArray(V,le*3,Te),Xe=h.subtract(h.fromArray(V,(ye+ee)*3,Xe),Te,Xe),Le=h.subtract(h.fromArray(V,ye*3,Le),Te,Le),X=h.normalize(h.negate(h.add(Le,Xe,X),X),X),th(I,E,X,void 0,P,t),P-=3}for(J=i[k++],te=i[k++],J.splice(0,3),te.splice(te.length-3,3),V.set(J,v),V.set(te,P-te.length+1),f=te.length-3,H+=3,X=h.fromArray(s,H,X),ee=0;ee<te.length;ee+=3)z=n.geodeticSurfaceNormal(h.fromArray(J,ee,Mg),Mg),q=n.geodeticSurfaceNormal(h.fromArray(te,f-ee,T1),T1),E=h.normalize(h.add(z,q,E),E),th(I,E,X,v,P,t),R=v/3,F=R-1,b=(P-2)/3,w=b+1,U[Y++]=w,U[Y++]=F,U[Y++]=b,U[Y++]=b,U[Y++]=F,U[Y++]=R,v+=3,P-=3;v-=3,P+=3}if(E=h.fromArray(a,a.length-3,E),th(I,E,X,v,P,t),x){v+=3,P-=3,N=Tk,A=Sk;let ee=r[1];for(p=0;p<O;p++)N=h.fromArray(ee,(_-p-1)*3,N),A=h.fromArray(ee,p*3,A),ki.addAttribute(V,N,void 0,P),ki.addAttribute(V,A,v),th(I,E,X,v,P,t),R=v/3,F=R-1,b=(P-2)/3,w=b+1,U[Y++]=w,U[Y++]=F,U[Y++]=b,U[Y++]=b,U[Y++]=F,U[Y++]=R,v+=3,P-=3}if(c.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:V}),t.st){let ee=new Float32Array(C/3*2),fe,_e,le=0;if(x){u/=3,m/=3;let ye=Math.PI/(_+1);_e=1/(u-_+1),fe=1/(m-_+1);let Te,Xe=_/2;for(p=Xe+1;p<_+1;p++)Te=W.PI_OVER_TWO+ye*p,ee[le++]=fe*(1+Math.cos(Te)),ee[le++]=.5*(1+Math.sin(Te));for(p=1;p<m-_+1;p++)ee[le++]=p*fe,ee[le++]=0;for(p=_;p>Xe;p--)Te=W.PI_OVER_TWO-p*ye,ee[le++]=1-fe*(1+Math.cos(Te)),ee[le++]=.5*(1+Math.sin(Te));for(p=Xe;p>0;p--)Te=W.PI_OVER_TWO-ye*p,ee[le++]=1-_e*(1+Math.cos(Te)),ee[le++]=.5*(1+Math.sin(Te));for(p=u-_;p>0;p--)ee[le++]=p*_e,ee[le++]=1;for(p=1;p<Xe+1;p++)Te=W.PI_OVER_TWO+ye*p,ee[le++]=_e*(1+Math.cos(Te)),ee[le++]=.5*(1+Math.sin(Te))}else{for(u/=3,m/=3,_e=1/(u-1),fe=1/(m-1),p=0;p<m;p++)ee[le++]=p*fe,ee[le++]=0;for(p=u;p>0;p--)ee[le++]=(p-1)*_e,ee[le++]=1}c.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:ee})}return t.normal&&(c.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:I.normals})),t.tangent&&(c.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:I.tangents})),t.bitangent&&(c.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:I.bitangents})),{attributes:c,indices:U}}function Xje(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,o;(t.normal||t.bitangent)&&(i=e.normal.values,o=e.bitangent.values);let r=e.position.values.length/18,s=r*3,a=r*2,c=s*2,d;if(t.normal||t.bitangent||t.tangent){let u=t.normal?new Float32Array(s*6):void 0,m=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,g=Ude,f=Dde,x=Tk,_=Sk,C=Ije,V=Bde,L=c;for(d=0;d<s;d+=3){let Z=L+c;g=h.fromArray(n,d,g),f=h.fromArray(n,d+s,f),x=h.fromArray(n,(d+3)%s,x),f=h.subtract(f,g,f),x=h.subtract(x,g,x),_=h.normalize(h.cross(f,x,_),_),t.normal&&(ki.addAttribute(u,_,Z),ki.addAttribute(u,_,Z+3),ki.addAttribute(u,_,L),ki.addAttribute(u,_,L+3)),(t.tangent||t.bitangent)&&(V=h.fromArray(i,d,V),t.bitangent&&(ki.addAttribute(p,V,Z),ki.addAttribute(p,V,Z+3),ki.addAttribute(p,V,L),ki.addAttribute(p,V,L+3)),t.tangent&&(C=h.normalize(h.cross(V,_,C),C),ki.addAttribute(m,C,Z),ki.addAttribute(m,C,Z+3),ki.addAttribute(m,C,L),ki.addAttribute(m,C,L+3))),L+=6}if(t.normal){for(u.set(i),d=0;d<s;d+=3)u[d+s]=-i[d],u[d+s+1]=-i[d+1],u[d+s+2]=-i[d+2];e.normal.values=u}else e.normal=void 0;if(t.bitangent?(p.set(o),p.set(o,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let Z=e.tangent.values;m.set(Z),m.set(Z,s),e.tangent.values=m}}if(t.st){let u=e.st.values,m=new Float32Array(a*6);m.set(u),m.set(u,a);let p=a*2;for(let g=0;g<2;g++){for(m[p++]=u[0],m[p++]=u[1],d=2;d<a;d+=2){let f=u[d],x=u[d+1];m[p++]=f,m[p++]=x,m[p++]=f,m[p++]=x}m[p++]=u[0],m[p++]=u[1]}e.st.values=m}return e}function FK(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(let i=3;i<e.length;i+=3){let o=e[i],r=e[i+1],s=e[i+2];n[t++]=o,n[t++]=r,n[t++]=s,n[t++]=o,n[t++]=r,n[t++]=s}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function Wje(e,t){let n=new We({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,o=ki.computePositions(e),r=Yde(o,n,i),s=e.height,a=e.extrudedHeight,c=r.attributes,d=r.indices,u=c.position.values,m=u.length,p=new Float64Array(m*6),g=new Float64Array(m);g.set(u);let f=new Float64Array(m*4);u=si.scaleToGeodeticHeight(u,s,i),f=FK(u,0,f),g=si.scaleToGeodeticHeight(g,a,i),f=FK(g,m*2,f),p.set(u),p.set(g,m),p.set(f,m*2),c.position.values=p,c=Xje(c,t);let x,_=m/3;if(e.shadowVolume){let w=c.normal.values;m=w.length;let F=new Float32Array(m*6);for(x=0;x<m;x++)w[x]=-w[x];F.set(w,m),F=FK(w,m*4,F),c.extrudeDirection=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:F}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let w=new Uint8Array(_*6);if(e.offsetAttribute===cn.TOP)w=w.fill(1,0,_).fill(1,_*2,_*4);else{let F=e.offsetAttribute===cn.NONE?0:1;w=w.fill(F)}c.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:w})}let C=d.length,V=_+_,L=Ae.createTypedArray(p.length/3,C*2+V*3);L.set(d);let Z=C;for(x=0;x<C;x+=3){let w=d[x],F=d[x+1],b=d[x+2];L[Z++]=b+_,L[Z++]=F+_,L[Z++]=w+_}let G,I,v,P;for(x=0;x<V;x+=2)G=x+V,I=G+V,v=G+1,P=I+1,L[Z++]=G,L[Z++]=I,L[Z++]=v,L[Z++]=v,L[Z++]=I,L[Z++]=P;return{attributes:c,indices:L}}var Nde=new h,xP=new h,Du=new he;function kde(e,t,n,i,o,r){let s=h.subtract(t,e,Nde);h.normalize(s,s);let a=n.geodeticSurfaceNormal(e,xP),c=h.cross(s,a,Nde);h.multiplyByScalar(c,i,c);let d=o.latitude,u=o.longitude,m=r.latitude,p=r.longitude;h.add(e,c,xP),n.cartesianToCartographic(xP,Du);let g=Du.latitude,f=Du.longitude;d=Math.min(d,g),u=Math.min(u,f),m=Math.max(m,g),p=Math.max(p,f),h.subtract(e,c,xP),n.cartesianToCartographic(xP,Du),g=Du.latitude,f=Du.longitude,d=Math.min(d,g),u=Math.min(u,f),m=Math.max(m,g),p=Math.max(p,f),o.latitude=d,o.longitude=u,r.latitude=m,r.longitude=p}var Uu=new h,_P=new h,Ml=new he,Nl=new he;function Hde(e,t,n,i,o){e=Ode(e,t);let r=xo(e,h.equalsEpsilon),s=r.length;if(s<2||n<=0)return new ae;let a=n*.5;Ml.latitude=Number.POSITIVE_INFINITY,Ml.longitude=Number.POSITIVE_INFINITY,Nl.latitude=Number.NEGATIVE_INFINITY,Nl.longitude=Number.NEGATIVE_INFINITY;let c,d;if(i===Ei.ROUNDED){let p=r[0];h.subtract(p,r[1],Uu),h.normalize(Uu,Uu),h.multiplyByScalar(Uu,a,Uu),h.add(p,Uu,_P),t.cartesianToCartographic(_P,Du),c=Du.latitude,d=Du.longitude,Ml.latitude=Math.min(Ml.latitude,c),Ml.longitude=Math.min(Ml.longitude,d),Nl.latitude=Math.max(Nl.latitude,c),Nl.longitude=Math.max(Nl.longitude,d)}for(let p=0;p<s-1;++p)kde(r[p],r[p+1],t,a,Ml,Nl);let u=r[s-1];h.subtract(u,r[s-2],Uu),h.normalize(Uu,Uu),h.multiplyByScalar(Uu,a,Uu),h.add(u,Uu,_P),kde(u,_P,t,a,Ml,Nl),i===Ei.ROUNDED&&(t.cartesianToCartographic(_P,Du),c=Du.latitude,d=Du.longitude,Ml.latitude=Math.min(Ml.latitude,c),Ml.longitude=Math.min(Ml.longitude,d),Nl.latitude=Math.max(Nl.latitude,c),Nl.longitude=Math.max(Nl.longitude,d));let m=l(o)?o:new ae;return m.north=Nl.latitude,m.south=Ml.latitude,m.east=Nl.longitude,m.west=Ml.longitude,m}function Ib(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),o=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=ne.clone(y(e.ellipsoid,ne.default)),this._vertexFormat=We.clone(y(e.vertexFormat,We.DEFAULT)),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=y(e.cornerType,Ei.ROUNDED),this._granularity=y(e.granularity,W.RADIANS_PER_DEGREE),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*h.packedLength+ne.packedLength+We.packedLength+7}Ib.pack=function(e,t,n){n=y(n,0);let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=h.packedLength)h.pack(i[r],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var zde=ne.clone(ne.UNIT_SPHERE),Kde=new We,Eb={positions:void 0,ellipsoid:zde,vertexFormat:Kde,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};Ib.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o=new Array(i);for(let f=0;f<i;++f,t+=h.packedLength)o[f]=h.unpack(e,t);let r=ne.unpack(e,t,zde);t+=ne.packedLength;let s=We.unpack(e,t,Kde);t+=We.packedLength;let a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++],p=e[t++]===1,g=e[t];return l(n)?(n._positions=o,n._ellipsoid=ne.clone(r,n._ellipsoid),n._vertexFormat=We.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=d,n._cornerType=u,n._granularity=m,n._shadowVolume=p,n._offsetAttribute=g===-1?void 0:g,n):(Eb.positions=o,Eb.width=a,Eb.height=c,Eb.extrudedHeight=d,Eb.cornerType=u,Eb.granularity=m,Eb.shadowVolume=p,Eb.offsetAttribute=g===-1?void 0:g,new Ib(Eb))};Ib.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.positions,i=e.width,o=y(e.ellipsoid,ne.default),r=y(e.cornerType,Ei.ROUNDED);return Hde(n,o,i,r,t)};Ib.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=Ode(t,i);let o=xo(t,h.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!W.equalsEpsilon(r,s,0,W.EPSILON2),c=e._vertexFormat,d={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},u;if(a)d.height=r,d.extrudedHeight=s,d.shadowVolume=e._shadowVolume,d.offsetAttribute=e._offsetAttribute,u=Wje(d,c);else{let g=ki.computePositions(d);if(u=Yde(g,c,i),u.attributes.position.values=si.scaleToGeodeticHeight(u.attributes.position.values,r,i),l(e._offsetAttribute)){let f=e._offsetAttribute===cn.NONE?0:1,x=u.attributes.position.values.length,_=new Uint8Array(x/3).fill(f);u.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}}let m=u.attributes,p=ce.fromVertices(m.position.values,void 0,3);return c.position||(u.attributes.position.values=void 0),new ht({attributes:m,indices:u.indices,primitiveType:Fe.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Ib.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Ib({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:s,vertexFormat:We.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(Ib.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=Hde(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var U_=Ib;var wzn=T(S(),1);var Jde=new h,Qde=new h,Pje=new h;function vje(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function jde(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,s=new mn,a,c=0,d=0,u,m=0,p;for(u=0;u<i.length;u+=2)p=i[u].length-3,c+=p,m+=p/3*4,d+=i[u+1].length-3;for(c+=3,d+=3,u=0;u<o.length;u++){a=o[u];let A=o[u].leftPositions;l(A)?(p=A.length,c+=p,m+=p/3*2):(p=o[u].rightPositions.length,d+=p,m+=p/3*2)}let g=l(r),f;g&&(f=r[0].length-3,c+=f,d+=f,f/=3,m+=f*4);let x=c+d,_=new Float64Array(x),C=0,V=x-1,L,Z,G,I,v,P,w=f/2,F=Ae.createTypedArray(x/3,m+4),b=0;if(F[b++]=C/3,F[b++]=(V-2)/3,g){n.push(C/3),P=Jde,v=Qde;let A=r[0];for(u=0;u<w;u++)P=h.fromArray(A,(w-1-u)*3,P),v=h.fromArray(A,(w+u)*3,v),ki.addAttribute(_,v,C),ki.addAttribute(_,P,void 0,V),Z=C/3,I=Z+1,L=(V-2)/3,G=L-1,F[b++]=L,F[b++]=G,F[b++]=Z,F[b++]=I,C+=3,V-=3}let R=0,E=i[R++],X=i[R++];for(_.set(E,C),_.set(X,V-X.length+1),p=X.length-3,n.push(C/3,(V-2)/3),u=0;u<p;u+=3)Z=C/3,I=Z+1,L=(V-2)/3,G=L-1,F[b++]=L,F[b++]=G,F[b++]=Z,F[b++]=I,C+=3,V-=3;for(u=0;u<o.length;u++){let A;a=o[u];let N=a.leftPositions,O=a.rightPositions,U,Y=Pje;if(l(N)){for(V-=3,U=G,n.push(I),A=0;A<N.length/3;A++)Y=h.fromArray(N,A*3,Y),F[b++]=U-A-1,F[b++]=U-A,ki.addAttribute(_,Y,void 0,V),V-=3;n.push(U-Math.floor(N.length/6)),t===Ei.BEVELED&&n.push((V-2)/3+1),C+=3}else{for(C+=3,U=I,n.push(G),A=0;A<O.length/3;A++)Y=h.fromArray(O,A*3,Y),F[b++]=U+A,F[b++]=U+A+1,ki.addAttribute(_,Y,C),C+=3;n.push(U+Math.floor(O.length/6)),t===Ei.BEVELED&&n.push(C/3-1),V-=3}for(E=i[R++],X=i[R++],E.splice(0,3),X.splice(X.length-3,3),_.set(E,C),_.set(X,V-X.length+1),p=X.length-3,A=0;A<X.length;A+=3)I=C/3,Z=I-1,G=(V-2)/3,L=G+1,F[b++]=L,F[b++]=G,F[b++]=Z,F[b++]=I,C+=3,V-=3;C-=3,V+=3,n.push(C/3,(V-2)/3)}if(g){C+=3,V-=3,P=Jde,v=Qde;let A=r[1];for(u=0;u<w;u++)P=h.fromArray(A,(f-u-1)*3,P),v=h.fromArray(A,u*3,v),ki.addAttribute(_,P,void 0,V),ki.addAttribute(_,v,C),I=C/3,Z=I-1,G=(V-2)/3,L=G+1,F[b++]=L,F[b++]=G,F[b++]=Z,F[b++]=I,C+=3,V-=3;n.push(C/3)}else n.push(C/3,(V-2)/3);return F[b++]=C/3,F[b++]=(V-2)/3,s.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:_}),{attributes:s,indices:F,wallIndices:n}}function wje(e){let t=e.ellipsoid,n=ki.computePositions(e),i=jde(n,e.cornerType),o=i.wallIndices,r=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,d=a.position.values,u=d.length,m=new Float64Array(u);m.set(d);let p=new Float64Array(u*2);if(d=si.scaleToGeodeticHeight(d,r,t),m=si.scaleToGeodeticHeight(m,s,t),p.set(d),p.set(m,u),a.position.values=p,u/=3,l(e.offsetAttribute)){let L=new Uint8Array(u*2);if(e.offsetAttribute===cn.TOP)L=L.fill(1,0,u);else{let Z=e.offsetAttribute===cn.NONE?0:1;L=L.fill(Z)}a.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:L})}let g,f=c.length,x=Ae.createTypedArray(p.length/3,(f+o.length)*2);x.set(c);let _=f;for(g=0;g<f;g+=2){let L=c[g],Z=c[g+1];x[_++]=L+u,x[_++]=Z+u}let C,V;for(g=0;g<o.length;g++)C=o[g],V=C+u,x[_++]=C,x[_++]=V;return{attributes:a,indices:x}}function TP(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.width,i=y(e.height,0),o=y(e.extrudedHeight,i);this._positions=t,this._ellipsoid=ne.clone(y(e.ellipsoid,ne.default)),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=y(e.cornerType,Ei.ROUNDED),this._granularity=y(e.granularity,W.RADIANS_PER_DEGREE),this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*h.packedLength+ne.packedLength+6}TP.pack=function(e,t,n){n=y(n,0);let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=h.packedLength)h.pack(i[r],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=y(e._offsetAttribute,-1),t};var qde=ne.clone(ne.UNIT_SPHERE),Ng={positions:void 0,ellipsoid:qde,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};TP.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o=new Array(i);for(let p=0;p<i;++p,t+=h.packedLength)o[p]=h.unpack(e,t);let r=ne.unpack(e,t,qde);t+=ne.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t];return l(n)?(n._positions=o,n._ellipsoid=ne.clone(r,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=d,n._granularity=u,n._offsetAttribute=m===-1?void 0:m,n):(Ng.positions=o,Ng.width=s,Ng.height=a,Ng.extrudedHeight=c,Ng.cornerType=d,Ng.granularity=u,Ng.offsetAttribute=m===-1?void 0:m,new TP(Ng))};TP.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=vje(t,i);let o=xo(t,h.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!W.equalsEpsilon(r,s,0,W.EPSILON2),c={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},d;if(a)c.height=r,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,d=wje(c);else{let p=ki.computePositions(c);if(d=jde(p,c.cornerType),d.attributes.position.values=si.scaleToGeodeticHeight(d.attributes.position.values,r,i),l(e._offsetAttribute)){let g=d.attributes.position.values.length,f=e._offsetAttribute===cn.NONE?0:1,x=new Uint8Array(g/3).fill(f);d.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}}let u=d.attributes,m=ce.fromVertices(u.position.values,void 0,3);return new ht({attributes:u,indices:d.indices,primitiveType:Fe.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var SP=TP;var Kzn=T(S(),1);var Fje=new Jn(0);function Qc(e){ii.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(Qc.prototype=Object.create(ii.prototype),Qc.prototype.constructor=Qc);Object.defineProperties(Qc.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Qc.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&Ac.isSupported(this._scene)};Qc.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};Qc.prototype._computeCenter=pe.throwInstantiationError;Qc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(ii.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(o.zIndex)&&(l(o.height)||l(o.extrudedHeight))&&St(St.geometryZIndex),this._zIndex=y(o.zIndex,Fje),l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference,s=o.extrudedHeightReference;if(l(r)||l(s)){let a=new Xm(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Mx(this._scene,a,r,s)}};Qc.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),ii.prototype.destroy.call(this)};Qc.getGeometryHeight=function(e,t){if(!l(e)){t!==Qe.NONE&&St(St.geometryHeightReference);return}return bu(t)?0:e};Qc.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==Qe.NONE&&St(St.geometryExtrudedHeightReference);return}return bu(t)?Qc.CLAMP_TO_GROUND:e};Qc.CLAMP_TO_GROUND="clamp";Qc.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=Qe.NONE),(!l(n)||!l(i))&&(i=Qe.NONE);let o=0;if(t!==Qe.NONE&&o++,i===Qe.RELATIVE_TO_GROUND&&o++,o===2)return cn.ALL;if(o===1)return cn.TOP};var Yn=Qc;var $de=new B,eue=h.ZERO,tue=new h,nue=new ae;function Aje(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.offsetAttribute=void 0}function nh(e,t){Yn.call(this,{entity:e,scene:t,geometryOptions:new Aje(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(nh.prototype=Object.create(Yn.prototype),nh.prototype.constructor=nh);nh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Yt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,$de)),l(o)||(o=B.WHITE),i.color=Kt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Qi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,eue,tue))),new Gt({id:t,geometry:new U_(this._options),attributes:i})};nh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,$de),o={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Qi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,eue,tue))),new Gt({id:t,geometry:new SP(this._options),attributes:o})};nh.prototype._computeCenter=function(e,t){let n=K.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return h.clone(n[Math.floor(n.length/2)],t)};nh.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||ii.prototype._isHidden.call(this,e,t)};nh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!K.isConstant(t.height)||!K.isConstant(t.extrudedHeight)||!K.isConstant(t.granularity)||!K.isConstant(t.width)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.cornerType)||!K.isConstant(t.zIndex)||this._onTerrain&&!K.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Yt)};nh.prototype._setStaticOptions=function(e,t){let n=K.getValueOrUndefined(t.height,Be.MINIMUM_VALUE),i=K.getValueOrDefault(t.heightReference,Be.MINIMUM_VALUE,Qe.NONE),o=K.getValueOrUndefined(t.extrudedHeight,Be.MINIMUM_VALUE),r=K.getValueOrDefault(t.extrudedHeightReference,Be.MINIMUM_VALUE,Qe.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Yt?dn.VERTEX_FORMAT:oo.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Be.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(Be.MINIMUM_VALUE),s.granularity=K.getValueOrUndefined(t.granularity,Be.MINIMUM_VALUE),s.cornerType=K.getValueOrUndefined(t.cornerType,Be.MINIMUM_VALUE),s.offsetAttribute=Yn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Yn.getGeometryHeight(n,i),o=Yn.getGeometryExtrudedHeight(o,r),o===Yn.CLAMP_TO_GROUND&&(o=li.getMinimumMaximumHeights(U_.computeRectangle(s,nue)).minimumTerrainHeight),s.extrudedHeight=o};nh.DynamicGeometryUpdater=S1;function S1(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(S1.prototype=Object.create(ni.prototype),S1.prototype.constructor=S1);S1.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||ni.prototype._isHidden.call(this,e,t,n)};S1.prototype._setOptions=function(e,t,n){let i=this._options,o=K.getValueOrUndefined(t.height,n),r=K.getValueOrDefault(t.heightReference,n,Qe.NONE),s=K.getValueOrUndefined(t.extrudedHeight,n),a=K.getValueOrDefault(t.extrudedHeightReference,n,Qe.NONE);l(s)&&!l(o)&&(o=0),i.positions=K.getValueOrUndefined(t.positions,n),i.width=K.getValueOrUndefined(t.width,n),i.granularity=K.getValueOrUndefined(t.granularity,n),i.cornerType=K.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=Yn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Yn.getGeometryHeight(o,r),s=Yn.getGeometryExtrudedHeight(s,a),s===Yn.CLAMP_TO_GROUND&&(s=li.getMinimumMaximumHeights(U_.computeRectangle(i,nue)).minimumTerrainHeight),i.extrudedHeight=s};var CP=nh;var HJn=T(S(),1);var _Kn=T(S(),1);function Ck(){pe.throwInstantiationError()}Object.defineProperties(Ck.prototype,{name:{get:pe.throwInstantiationError},clock:{get:pe.throwInstantiationError},entities:{get:pe.throwInstantiationError},isLoading:{get:pe.throwInstantiationError},changedEvent:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError},loadingEvent:{get:pe.throwInstantiationError},show:{get:pe.throwInstantiationError},clustering:{get:pe.throwInstantiationError}});Ck.prototype.update=function(e){pe.throwInstantiationError()};Ck.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Dr=Ck;var kJn=T(S(),1);var GKn=T(S(),1);function xf(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(xf.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=h.magnitudeSquared(n)-1;h.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var iue=new h;xf.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,iue);return MK(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};xf.prototype.isScaledSpacePointVisible=function(e){return MK(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var Mje=new h;xf.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=Mje,o.x=this._cameraPosition.x/(n.radii.x+t),o.y=this._cameraPosition.y/(n.radii.y+t),o.z=this._cameraPosition.z/(n.radii.z+t),i=o.x*o.x+o.y*o.y+o.z*o.z-1):(o=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),MK(e,o,i)};xf.prototype.computeHorizonCullingPoint=function(e,t,n){return sue(this._ellipsoid,e,t,n)};var oue=ne.clone(ne.UNIT_SPHERE);xf.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=rue(this._ellipsoid,n,oue);return sue(o,e,t,i)};xf.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return aue(this._ellipsoid,e,t,n,i,o)};xf.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=rue(this._ellipsoid,o,oue);return aue(s,e,t,n,i,r)};var Nje=[];xf.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ae.subsample(e,t,0,Nje),o=ce.fromPoints(i);if(!(h.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var kje=new h;function rue(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=h.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,kje);e=ne.fromCartesian3(i,n)}return e}function sue(e,t,n,i){l(i)||(i=new h);let o=due(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],d=cue(e,c,o);if(d<0)return;r=Math.max(r,d)}return lue(o,r,i)}var Vk=new h;function aue(e,t,n,i,o,r){l(r)||(r=new h),i=y(i,3),o=y(o,h.ZERO);let s=due(e,t),a=0;for(let c=0,d=n.length;c<d;c+=i){Vk.x=n[c]+o.x,Vk.y=n[c+1]+o.y,Vk.z=n[c+2]+o.z;let u=cue(e,Vk,s);if(u<0)return;a=Math.max(a,u)}return lue(s,a,r)}function MK(e,t,n){let i=t,o=n,r=h.subtract(e,i,iue),s=-h.dot(r,i);return!(o<0?s>0:s>o&&s*s/h.magnitudeSquared(r)>o)}var Uje=new h,Dje=new h;function cue(e,t,n){let i=e.transformPositionToScaledSpace(t,Uje),o=h.magnitudeSquared(i),r=Math.sqrt(o),s=h.divideByScalar(i,r,Dje);o=Math.max(1,o),r=Math.max(1,r);let a=h.dot(s,n),c=h.magnitude(h.cross(s,n,s)),d=1/r,u=Math.sqrt(o-1)*d;return 1/(a*d-c*u)}function lue(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var AK=new h;function due(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,AK),h.normalize(AK,AK))}var Xb=xf;var BKn=T(S(),1);function Vr(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=Ut.clone(n)),l(i)&&(i=Ut.clone(i)),l(o)&&(o=At.clone(o)),this._show=y(e.show,!0),this._position=h.clone(y(e.position,h.ZERO)),this._actualPosition=h.clone(this._position),this._color=B.clone(y(e.color,B.WHITE)),this._outlineColor=B.clone(y(e.outlineColor,B.TRANSPARENT)),this._outlineWidth=y(e.outlineWidth,0),this._pixelSize=y(e.pixelSize,10),this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=y(e.disableDepthTestDistance,0),this._id=e.id,this._collection=y(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=y(e.splitDirection,vr.NONE)}var uue=Vr.SHOW_INDEX=0,fue=Vr.POSITION_INDEX=1,Bje=Vr.COLOR_INDEX=2,Oje=Vr.OUTLINE_COLOR_INDEX=3,Yje=Vr.OUTLINE_WIDTH_INDEX=4,Hje=Vr.PIXEL_SIZE_INDEX=5,zje=Vr.SCALE_BY_DISTANCE_INDEX=6,Kje=Vr.TRANSLUCENCY_BY_DISTANCE_INDEX=7,Jje=Vr.DISTANCE_DISPLAY_CONDITION_INDEX=8,Qje=Vr.DISABLE_DEPTH_DISTANCE_INDEX=9,jje=Vr.SPLIT_DIRECTION_INDEX=10;Vr.NUMBER_OF_PROPERTIES=11;function Rd(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Vr.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Rd(this,uue))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),Rd(this,fue))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Ut.equals(t,e)||(this._scaleByDistance=Ut.clone(e,t),Rd(this,zje))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Ut.equals(t,e)||(this._translucencyByDistance=Ut.clone(e,t),Rd(this,Kje))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Rd(this,Hje))}},color:{get:function(){return this._color},set:function(e){let t=this._color;B.equals(t,e)||(B.clone(e,t),Rd(this,Bje))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;B.equals(t,e)||(B.clone(e,t),Rd(this,Oje))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Rd(this,Yje))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){At.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=At.clone(e,this._distanceDisplayCondition),Rd(this,Jje))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Rd(this,Qje))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Rd(this,uue))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Rd(this,jje))}}});Vr.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Vr.prototype._getActualPosition=function(){return this._actualPosition};Vr.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),Rd(this,fue)};var mue=new se;Vr._computeActualPosition=function(e,t,n){return t.mode===oe.SCENE3D?e:(M.multiplyByPoint(n,e,mue),Mi.computeActualEllipsoidPosition(t,mue))};var hue=new se;Vr._computeScreenSpacePosition=function(e,t,n,i){let o=M.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,hue),hue);return Mi.worldToWindowCoordinates(n,o,i)};Vr.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new D);let i=n.modelMatrix,o=Vr._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};Vr.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,c=i;return l(n)||(n=new Ke),n.x=r,n.y=s,n.width=a,n.height=c,n};Vr.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&B.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&B.equals(this._outlineColor,e._outlineColor)&&Ut.equals(this._scaleByDistance,e._scaleByDistance)&&Ut.equals(this._translucencyByDistance,e._translucencyByDistance)&&At.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Vr.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Rs=Vr;var _Jn=T(S(),1);var YKn=T(S(),1),kg=`in vec4 v_color;
  8362. in vec4 v_outlineColor;
  8363. in float v_innerPercent;
  8364. in float v_pixelDistance;
  8365. in vec4 v_pickColor;
  8366. in float v_splitDirection;
  8367. void main()
  8368. {
  8369. if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
  8370. if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
  8371. // The distance in UV space from this fragment to the center of the point, at most 0.5.
  8372. float distanceToCenter = length(gl_PointCoord - vec2(0.5));
  8373. // The max distance stops one pixel shy of the edge to leave space for anti-aliasing.
  8374. float maxDistance = max(0.0, 0.5 - v_pixelDistance);
  8375. float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);
  8376. float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);
  8377. vec4 color = mix(v_outlineColor, v_color, innerAlpha);
  8378. color.a *= wholeAlpha;
  8379. // Fully transparent parts of the billboard are not pickable.
  8380. #if !defined(OPAQUE) && !defined(TRANSLUCENT)
  8381. if (color.a < 0.005) // matches 0/255 and 1/255
  8382. {
  8383. discard;
  8384. }
  8385. #else
  8386. // The billboard is rendered twice. The opaque pass discards translucent fragments
  8387. // and the translucent pass discards opaque fragments.
  8388. #ifdef OPAQUE
  8389. if (color.a < 0.995) // matches < 254/255
  8390. {
  8391. discard;
  8392. }
  8393. #else
  8394. if (color.a >= 0.995) // matches 254/255 and 255/255
  8395. {
  8396. discard;
  8397. }
  8398. #endif
  8399. #endif
  8400. out_FragColor = czm_gammaCorrect(color);
  8401. czm_writeLogDepth();
  8402. }
  8403. `;var zKn=T(S(),1),VP=`uniform float u_maxTotalPointSize;
  8404. in vec4 positionHighAndSize;
  8405. in vec4 positionLowAndOutline;
  8406. in vec4 compressedAttribute0; // color, outlineColor, pick color
  8407. in vec4 compressedAttribute1; // show, translucency by distance, some free space
  8408. in vec4 scaleByDistance; // near, nearScale, far, farScale
  8409. in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection; // near, far, disableDepthTestDistance, splitDirection
  8410. out vec4 v_color;
  8411. out vec4 v_outlineColor;
  8412. out float v_innerPercent;
  8413. out float v_pixelDistance;
  8414. out vec4 v_pickColor;
  8415. out float v_splitDirection;
  8416. const float SHIFT_LEFT8 = 256.0;
  8417. const float SHIFT_RIGHT8 = 1.0 / 256.0;
  8418. void main()
  8419. {
  8420. // Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition
  8421. // unpack attributes
  8422. vec3 positionHigh = positionHighAndSize.xyz;
  8423. vec3 positionLow = positionLowAndOutline.xyz;
  8424. float outlineWidthBothSides = 2.0 * positionLowAndOutline.w;
  8425. float totalSize = positionHighAndSize.w + outlineWidthBothSides;
  8426. float outlinePercent = outlineWidthBothSides / totalSize;
  8427. // Scale in response to browser-zoom.
  8428. totalSize *= czm_pixelRatio;
  8429. float temp = compressedAttribute1.x * SHIFT_RIGHT8;
  8430. float show = floor(temp);
  8431. #ifdef EYE_DISTANCE_TRANSLUCENCY
  8432. vec4 translucencyByDistance;
  8433. translucencyByDistance.x = compressedAttribute1.z;
  8434. translucencyByDistance.z = compressedAttribute1.w;
  8435. translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
  8436. temp = compressedAttribute1.y * SHIFT_RIGHT8;
  8437. translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
  8438. #endif
  8439. ///////////////////////////////////////////////////////////////////////////
  8440. vec4 color;
  8441. vec4 outlineColor;
  8442. vec4 pickColor;
  8443. // compressedAttribute0.z => pickColor.rgb
  8444. temp = compressedAttribute0.z * SHIFT_RIGHT8;
  8445. pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
  8446. temp = floor(temp) * SHIFT_RIGHT8;
  8447. pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
  8448. pickColor.r = floor(temp);
  8449. // compressedAttribute0.x => color.rgb
  8450. temp = compressedAttribute0.x * SHIFT_RIGHT8;
  8451. color.b = (temp - floor(temp)) * SHIFT_LEFT8;
  8452. temp = floor(temp) * SHIFT_RIGHT8;
  8453. color.g = (temp - floor(temp)) * SHIFT_LEFT8;
  8454. color.r = floor(temp);
  8455. // compressedAttribute0.y => outlineColor.rgb
  8456. temp = compressedAttribute0.y * SHIFT_RIGHT8;
  8457. outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
  8458. temp = floor(temp) * SHIFT_RIGHT8;
  8459. outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
  8460. outlineColor.r = floor(temp);
  8461. // compressedAttribute0.w => color.a, outlineColor.a, pickColor.a
  8462. temp = compressedAttribute0.w * SHIFT_RIGHT8;
  8463. pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
  8464. pickColor = pickColor / 255.0;
  8465. temp = floor(temp) * SHIFT_RIGHT8;
  8466. outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
  8467. outlineColor /= 255.0;
  8468. color.a = floor(temp);
  8469. color /= 255.0;
  8470. ///////////////////////////////////////////////////////////////////////////
  8471. vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
  8472. vec4 positionEC = czm_modelViewRelativeToEye * p;
  8473. ///////////////////////////////////////////////////////////////////////////
  8474. #if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)
  8475. float lengthSq;
  8476. if (czm_sceneMode == czm_sceneMode2D)
  8477. {
  8478. // 2D camera distance is a special case
  8479. // treat all billboards as flattened to the z=0.0 plane
  8480. lengthSq = czm_eyeHeight2D.y;
  8481. }
  8482. else
  8483. {
  8484. lengthSq = dot(positionEC.xyz, positionEC.xyz);
  8485. }
  8486. #endif
  8487. #ifdef EYE_DISTANCE_SCALING
  8488. totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);
  8489. #endif
  8490. if (totalSize > 0.0) {
  8491. // Add padding for anti-aliasing on both sides.
  8492. totalSize += 3.0;
  8493. }
  8494. // Clamp to max point size.
  8495. totalSize = min(totalSize, u_maxTotalPointSize);
  8496. // If size is too small, push vertex behind near plane for clipping.
  8497. // Note that context.minimumAliasedPointSize "will be at most 1.0".
  8498. if (totalSize < 1.0)
  8499. {
  8500. positionEC.xyz = vec3(0.0);
  8501. totalSize = 1.0;
  8502. }
  8503. float translucency = 1.0;
  8504. #ifdef EYE_DISTANCE_TRANSLUCENCY
  8505. translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);
  8506. // push vertex behind near plane for clipping
  8507. if (translucency < 0.004)
  8508. {
  8509. positionEC.xyz = vec3(0.0);
  8510. }
  8511. #endif
  8512. #ifdef DISTANCE_DISPLAY_CONDITION
  8513. float nearSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.x;
  8514. float farSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.y;
  8515. if (lengthSq < nearSq || lengthSq > farSq) {
  8516. // push vertex behind camera to force it to be clipped
  8517. positionEC.xyz = vec3(0.0, 0.0, 1.0);
  8518. }
  8519. #endif
  8520. gl_Position = czm_projection * positionEC;
  8521. czm_vertexLogDepth();
  8522. #ifdef DISABLE_DEPTH_DISTANCE
  8523. float disableDepthTestDistance = distanceDisplayConditionAndDisableDepthAndSplitDirection.z;
  8524. if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
  8525. {
  8526. disableDepthTestDistance = czm_minimumDisableDepthTestDistance;
  8527. }
  8528. if (disableDepthTestDistance != 0.0)
  8529. {
  8530. // Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w.
  8531. float zclip = gl_Position.z / gl_Position.w;
  8532. bool clipped = (zclip < -1.0 || zclip > 1.0);
  8533. if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))
  8534. {
  8535. // Position z on the near plane.
  8536. gl_Position.z = -gl_Position.w;
  8537. #ifdef LOG_DEPTH
  8538. czm_vertexLogDepth(vec4(czm_currentFrustum.x));
  8539. #endif
  8540. }
  8541. }
  8542. #endif
  8543. v_color = color;
  8544. v_color.a *= translucency * show;
  8545. v_outlineColor = outlineColor;
  8546. v_outlineColor.a *= translucency * show;
  8547. v_innerPercent = 1.0 - outlinePercent;
  8548. v_pixelDistance = 2.0 / totalSize;
  8549. gl_PointSize = totalSize * show;
  8550. gl_Position *= show;
  8551. v_pickColor = pickColor;
  8552. v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w;
  8553. }
  8554. `;var qje=Rs.SHOW_INDEX,UK=Rs.POSITION_INDEX,pue=Rs.COLOR_INDEX,$je=Rs.OUTLINE_COLOR_INDEX,e8e=Rs.OUTLINE_WIDTH_INDEX,t8e=Rs.PIXEL_SIZE_INDEX,bue=Rs.SCALE_BY_DISTANCE_INDEX,gue=Rs.TRANSLUCENCY_BY_DISTANCE_INDEX,yue=Rs.DISTANCE_DISPLAY_CONDITION_INDEX,n8e=Rs.DISABLE_DEPTH_DISTANCE_INDEX,i8e=Rs.SPLIT_DIRECTION_INDEX,DK=Rs.NUMBER_OF_PROPERTIES,bc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function Bu(e){e=y(e,y.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(DK),this._maxPixelSize=1,this._baseVolume=new ce,this._baseVolumeWC=new ce,this._baseVolume2D=new ce,this._boundingVolume=new ce,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=y(e.show,!0),this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.blendOption=y(e.blendOption,Lo.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=oe.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(Bu.prototype,{length:{get:function(){return BK(this),this._pointPrimitives.length}}});function xue(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Bu.prototype.add=function(e){let t=new Rs(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};Bu.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Bu.prototype.removeAll=function(){xue(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function BK(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];s&&(s._index=r++,t.push(s))}e._pointPrimitives=t}}Bu.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};Bu.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};Bu.prototype.get=function(e){return BK(this),this._pointPrimitives[e]};Bu.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<DK;++i){let o=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function o8e(e,t,n){return new Sp(e,[{index:bc.positionHighAndSize,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[UK]},{index:bc.positionLowAndShow,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[UK]},{index:bc.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[pue]},{index:bc.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[gue]},{index:bc.scaleByDistance,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[bue]},{index:bc.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:n[yue]}],t)}var NK=new On;function _ue(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===oe.SCENE3D&&(ce.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),On.fromCartesian(r,NK);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[bc.positionHighAndSize],d=NK.high;c(o,d.x,d.y,d.z,s);let u=n[bc.positionLowAndOutline],m=NK.low;u(o,m.x,m.y,m.z,a)}var Lk=65536,LP=256;function Tue(e,t,n,i){let o=i._index,r=i.color,s=i.getPickId(t).color,a=i.outlineColor,c=B.floatToByte(r.red),d=B.floatToByte(r.green),u=B.floatToByte(r.blue),m=c*Lk+d*LP+u;c=B.floatToByte(a.red),d=B.floatToByte(a.green),u=B.floatToByte(a.blue);let p=c*Lk+d*LP+u;c=B.floatToByte(s.red),d=B.floatToByte(s.green),u=B.floatToByte(s.blue);let g=c*Lk+d*LP+u,f=B.floatToByte(r.alpha)*Lk+B.floatToByte(a.alpha)*LP+B.floatToByte(s.alpha),x=n[bc.compressedAttribute0];x(o,m,p,g,f)}function Sue(e,t,n,i){let o=i._index,r=0,s=1,a=1,c=1,d=i.translucencyByDistance;l(d)&&(r=d.near,s=d.nearValue,a=d.far,c=d.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let u=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(u=!1),s=W.clamp(s,0,1),s=s===1?255:s*255|0;let m=(u?1:0)*LP+s;c=W.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[bc.compressedAttribute1];g(o,m,p,r,a)}function Cue(e,t,n,i){let o=i._index,r=n[bc.scaleByDistance],s=0,a=1,c=1,d=1,u=i.scaleByDistance;l(u)&&(s=u.near,a=u.nearValue,c=u.far,d=u.farValue,(a!==1||d!==1)&&(e._shaderScaleByDistance=!0)),r(o,s,a,c,d)}function Vue(e,t,n,i){let o=i._index,r=n[bc.distanceDisplayConditionAndDisableDepthAndSplitDirection],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let d=i.disableDepthTestDistance;d*=d,d>0&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1));let u=0,m=i.splitDirection;l(m)&&(u=m),r(o,s,a,d,u)}function r8e(e,t,n,i){_ue(e,t,n,i),Tue(e,t,n,i),Sue(e,t,n,i),Cue(e,t,n,i),Vue(e,t,n,i)}function kK(e,t,n,i,o,r){let s;i.mode===oe.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let d=t[c],u=d.position,m=Rs._computeActualPosition(u,i,o);l(m)&&(d._setActualPosition(m),r?a.push(m):ce.expand(s,m,s))}r&&ce.fromPoints(a,s)}function s8e(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==oe.SCENE3D&&!M.equals(r,e.modelMatrix)?(e._mode=n,M.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===oe.SCENE3D||n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&kK(e,i,i.length,t,r,!0)):n===oe.MORPHING?kK(e,i,i.length,t,r,!0):(n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&kK(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function a8e(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var c8e=[];Bu.prototype.update=function(e){if(BK(this),!this.show)return;this._maxTotalPointSize=Bt.maximumAliasedPointSize,s8e(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,d=e.passes,u=d.pick;if(s||!u&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let G=0;G<DK;++G)r[G]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=o8e(c,n,this._buffersUsage),a=this._vaf.writers;for(let G=0;G<n;++G){let I=this._pointPrimitives[G];I._dirty=!1,r8e(this,c,a,I)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let G=c8e;G.length=0,(r[UK]||r[e8e]||r[t8e])&&G.push(_ue),(r[pue]||r[$je])&&G.push(Tue),(r[qje]||r[gue])&&G.push(Sue),r[bue]&&G.push(Cue),(r[yue]||r[n8e]||r[i8e])&&G.push(Vue);let I=G.length;if(a=this._vaf.writers,o/n>.1){for(let v=0;v<o;++v){let P=i[v];P._dirty=!1;for(let w=0;w<I;++w)G[w](this,c,a,P)}this._vaf.commit()}else{for(let v=0;v<o;++v){let P=i[v];P._dirty=!1;for(let w=0;w<I;++w)G[w](this,c,a,P);this._vaf.subCommit(P._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ce.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,p=M.IDENTITY;e.mode===oe.SCENE3D?(p=this.modelMatrix,m=ce.clone(this._baseVolumeWC,this._boundingVolume)):m=ce.clone(this._baseVolume2D,this._boundingVolume),a8e(this,e,m);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Lo.OPAQUE||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ue.fromCache({depthTest:{enabled:!0,func:ie.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Lo.TRANSLUCENT||this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ue.fromCache({depthTest:{enabled:!0,func:ie.LEQUAL},depthMask:!1,blending:un.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let f,x;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(f=new De({sources:[VP]}),this._shaderScaleByDistance&&f.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&f.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&f.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&f.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT&&(x=new De({defines:["OPAQUE"],sources:[kg]}),this._sp=tn.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:bc}),x=new De({defines:["TRANSLUCENT"],sources:[kg]}),this._spTranslucent=tn.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:bc})),this._blendOption===Lo.OPAQUE&&(x=new De({sources:[kg]}),this._sp=tn.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:bc})),this._blendOption===Lo.TRANSLUCENT&&(x=new De({sources:[kg]}),this._spTranslucent=tn.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:x,attributeLocations:bc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let _,C,V,L,Z=e.commandList;if(d.render||u){let G=this._colorCommands,I=this._blendOption===Lo.OPAQUE,v=this._blendOption===Lo.OPAQUE_AND_TRANSLUCENT;_=this._vaf.va,C=_.length,G.length=C;let P=v?C*2:C;for(L=0;L<P;++L){let w=I||v&&L%2===0;V=G[L],l(V)||(V=G[L]=new tt),V.primitiveType=Fe.POINTS,V.pass=w||!v?Ge.OPAQUE:Ge.TRANSLUCENT,V.owner=this;let F=v?Math.floor(L/2):L;V.boundingVolume=m,V.modelMatrix=p,V.shaderProgram=w?this._sp:this._spTranslucent,V.uniformMap=this._uniforms,V.vertexArray=_[F].va,V.renderState=w?this._rsOpaque:this._rsTranslucent,V.debugShowBoundingVolume=this.debugShowBoundingVolume,V.pickId="v_pickColor",Z.push(V)}}};Bu.prototype.isDestroyed=function(){return!1};Bu.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),xue(this._pointPrimitives),me(this)};var C1=Bu;var SJn=T(S(),1),Lue=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],OK=1,RP=8,GP=class e{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");let o=i>>4;if(o!==OK)throw new Error(`Got v${o} data when expected v${OK}.`);let r=Lue[i&15];if(!r)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new e(a,s,r,t)}constructor(t,n=64,i=Float64Array,o){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let r=Lue.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-a%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${i}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,RP,t),this.coords=new this.ArrayType(this.data,RP+a+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(RP+s+a+c),this.ids=new this.IndexArrayType(this.data,RP,t),this.coords=new this.ArrayType(this.data,RP+a+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(OK<<4)+r]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return HK(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:s,nodeSize:a}=this,c=[0,r.length-1,0],d=[];for(;c.length;){let u=c.pop()||0,m=c.pop()||0,p=c.pop()||0;if(m-p<=a){for(let _=p;_<=m;_++){let C=s[2*_],V=s[2*_+1];C>=t&&C<=i&&V>=n&&V<=o&&d.push(r[_])}continue}let g=p+m>>1,f=s[2*g],x=s[2*g+1];f>=t&&f<=i&&x>=n&&x<=o&&d.push(r[g]),(u===0?t<=f:n<=x)&&(c.push(p),c.push(g-1),c.push(1-u)),(u===0?i>=f:o>=x)&&(c.push(g+1),c.push(m),c.push(1-u))}return d}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:r,nodeSize:s}=this,a=[0,o.length-1,0],c=[],d=i*i;for(;a.length;){let u=a.pop()||0,m=a.pop()||0,p=a.pop()||0;if(m-p<=s){for(let _=p;_<=m;_++)Rue(r[2*_],r[2*_+1],t,n)<=d&&c.push(o[_]);continue}let g=p+m>>1,f=r[2*g],x=r[2*g+1];Rue(f,x,t,n)<=d&&c.push(o[g]),(u===0?t-i<=f:n-i<=x)&&(a.push(p),a.push(g-1),a.push(1-u)),(u===0?t+i>=f:n+i>=x)&&(a.push(g+1),a.push(m),a.push(1-u))}return c}};function HK(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;Zue(e,t,s,i,o,r),HK(e,t,n,i,s-1,1-r),HK(e,t,n,s+1,o,1-r)}function Zue(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let d=o-i+1,u=n-i+1,m=Math.log(d),p=.5*Math.exp(2*m/3),g=.5*Math.sqrt(m*p*(d-p)/d)*(u-d/2<0?-1:1),f=Math.max(i,Math.floor(n-u*p/d+g)),x=Math.min(o,Math.floor(n+(d-u)*p/d+g));Zue(e,t,n,f,x,r)}let s=t[2*n+r],a=i,c=o;for(ZP(e,t,i,n),t[2*o+r]>s&&ZP(e,t,i,o);a<c;){for(ZP(e,t,a,c),a++,c--;t[2*a+r]<s;)a++;for(;t[2*c+r]>s;)c--}t[2*i+r]===s?ZP(e,t,i,c):(c++,ZP(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function ZP(e,t,n,i){YK(e,n,i),YK(t,2*n,2*i),YK(t,2*n+1,2*i+1)}function YK(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function Rue(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function ih(e){e=y(e,y.EMPTY_OBJECT),this._enabled=y(e.enabled,!1),this._pixelRange=y(e.pixelRange,80),this._minimumClusterSize=y(e.minimumClusterSize,2),this._clusterBillboards=y(e.clusterBillboards,!0),this._clusterLabels=y(e.clusterLabels,!0),this._clusterPoints=y(e.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new be,this.show=y(e.show,!0)}function Gue(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var l8e=new Ke;function Eue(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=Zg.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=so.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Rs.getScreenSpaceBoundingBox(e,t,o)),Gue(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&Xue(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=Zg.getScreenSpaceBoundingBox(s,t,l8e);Gue(a,n),o=Ke.union(o,a,o)}return o}function d8e(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&Xue(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function Iue(e,t,n,i){let o={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};o.billboard.show=!1,o.point.show=!1,o.label.show=!0,o.label.text=t.toLocaleString(),o.label.id=n,o.billboard.position=o.label.position=o.point.position=e,i._clusterEvent.raiseEvent(n,o)}function Xue(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function zK(e,t,n,i,o){if(!l(e))return;let r=e.length;for(let s=0;s<r;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||o._scene.mode===oe.SCENE3D&&!i.isPointVisible(a.position))continue;let c=o._clusterLabels&&l(a._labelCollection),d=o._clusterBillboards&&l(a.id._billboard),u=o._clusterPoints&&l(a.id._point);if(c&&(u||d))continue;let m=a.computeScreenSpacePosition(n);l(m)&&t.push({index:s,collection:e,clustered:!1,coord:m})}}var u8e=new Ke,m8e=new Ke,h8e=new Ke;function f8e(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,o=e._billboardCollection,r=e._pointCollection;if(!l(i)&&!l(o)&&!l(r)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,c=e._clusterPointCollection;l(s)?s.removeAll():s=e._clusterLabelCollection=new ff({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new Sd({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new C1;let d=e._pixelRange,u=e._minimumClusterSize,m=e._previousClusters,p=[],g=e._previousHeight,f=n.camera.positionCartographic.height,x=n.ellipsoid,_=n.camera.positionWC,C=new Xb(x,_),V=[];e._clusterLabels&&zK(i,V,n,C,e),e._clusterBillboards&&zK(o,V,n,C,e),e._clusterPoints&&zK(r,V,n,C,e);let L,Z,G,I,v,P,w,F,b,R,E,X;if(V.length>0){let A=new GP(V.length,64,Uint32Array);for(let N=0;N<V.length;++N)A.add(V[N].coord.x,V[N].coord.y);if(A.finish(),f<g)for(G=m.length,L=0;L<G;++L){let N=m[L];if(!C.isPointVisible(N.position))continue;let O=so._computeScreenSpacePosition(M.IDENTITY,N.position,h.ZERO,D.ZERO,n);if(!l(O))continue;let U=1-f/g,Y=N.width=N.width*U,k=N.height=N.height*U;Y=Math.max(Y,N.minimumWidth),k=Math.max(k,N.minimumHeight);let H=O.x-Y*.5,J=O.y-k*.5,te=O.x+Y,z=O.y+k;for(v=A.range(H,J,te,z),P=v.length,R=0,b=[],Z=0;Z<P;++Z)w=v[Z],F=V[w],F.clustered||(++R,E=F.collection,X=F.index,b.push(E.get(X).id));if(R>=u)for(Iue(N.position,R,b,e),p.push(N),Z=0;Z<P;++Z)V[v[Z]].clustered=!0}for(G=V.length,L=0;L<G;++L){let N=V[L];if(N.clustered)continue;N.clustered=!0,E=N.collection,X=N.index;let O=E.get(X);I=Eue(O,N.coord,d,e,u8e);let U=Ke.clone(I,m8e);v=A.range(I.x,I.y,I.x+I.width,I.y+I.height),P=v.length;let Y=h.clone(O.position);for(R=1,b=[O.id],Z=0;Z<P;++Z)if(w=v[Z],F=V[w],!F.clustered){let k=F.collection.get(F.index),H=Eue(k,F.coord,d,e,h8e);h.add(k.position,Y,Y),Ke.union(U,H,U),++R,b.push(k.id)}if(R>=u){let k=h.multiplyByScalar(Y,1/R,Y);for(Iue(k,R,b,e),p.push({position:k,width:U.width,height:U.height,minimumWidth:I.width,minimumHeight:I.height}),Z=0;Z<P;++Z)V[v[Z]].clustered=!0}else d8e(O,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=f}}ih.prototype._initialize=function(e){this._scene=e;let t=f8e(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(ih.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}}});function JK(e,t,n,i){return function(o){let r=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[o.id];if(l(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(r)&&l(s[i]))return r.get(s[i]);l(r)||(r=this[e]=new t({scene:this._scene}));let a,c,d=this[n];d.length>0?(a=d.shift(),c=r.get(a)):(c=r.add(),a=r.length-1),s[i]=a;let u=this;return Promise.resolve().then(function(){u._clusterDirty=!0}),c}}function QK(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}ih.prototype.getLabel=JK("_labelCollection",ff,"_unusedLabelIndices","labelIndex");ih.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,QK(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};ih.prototype.getBillboard=JK("_billboardCollection",Sd,"_unusedBillboardIndices","billboardIndex");ih.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,QK(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};ih.prototype.getPoint=JK("_pointCollection",C1,"_unusedPointIndices","pointIndex");ih.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,QK(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function KK(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function p8e(e){e.enabled||(l(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),l(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),l(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,KK(e._labelCollection),KK(e._billboardCollection),KK(e._pointCollection))}ih.prototype.update=function(e){if(!this.show)return;let t;l(this._labelCollection)&&this._labelCollection.length>0&&this._labelCollection.get(0)._glyphs.length===0&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),l(this._billboardCollection)&&this._billboardCollection.length>0&&!l(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,p8e(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(this._labelCollection)&&this._labelCollection.update(e),l(this._billboardCollection)&&this._billboardCollection.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};ih.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var Zd=ih;function jK(e){this._name=e,this._clock=void 0,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new Hs(this),this._entityCluster=new Zd}Object.defineProperties(jK.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){Dr.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});jK.prototype.update=function(e){return!0};var EP=jK;var JQn=T(S(),1);var mQn=T(S(),1);var JJn=T(S(),1);var Wue={};Wue.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,c=o?2*a:a,d=new Float64Array(c*3),u,m=0,p=0,g=o?a*3:0,f=o?(a+i)*3:i*3;for(u=0;u<i;u++){let x=u/i*W.TWO_PI,_=Math.cos(x),C=Math.sin(x),V=_*n,L=C*n,Z=_*t,G=C*t;d[p+g]=V,d[p+g+1]=L,d[p+g+2]=s,d[p+f]=Z,d[p+f+1]=G,d[p+f+2]=r,p+=3,o&&(d[m++]=V,d[m++]=L,d[m++]=s,d[m++]=Z,d[m++]=G,d[m++]=r)}return d};var D_=Wue;var qK=new D,b8e=new h,g8e=new h,y8e=new h,x8e=new h;function Wb(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,o=y(e.vertexFormat,We.DEFAULT),r=y(e.slices,128);this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=We.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}Wb.packedLength=We.packedLength+5;Wb.pack=function(e,t,n){return n=y(n,0),We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=y(e._offsetAttribute,-1),t};var Pue=new We,V1={vertexFormat:Pue,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};Wb.unpack=function(e,t,n){t=y(t,0);let i=We.unpack(e,t,Pue);t+=We.packedLength;let o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=We.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(V1.length=o,V1.topRadius=r,V1.bottomRadius=s,V1.slices=a,V1.offsetAttribute=c===-1?void 0:c,new Wb(V1))};Wb.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._vertexFormat,r=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r+r,a=r+s,c=s+s,d=D_.computePositions(t,n,i,r,!0),u=o.st?new Float32Array(c*2):void 0,m=o.normal?new Float32Array(c*3):void 0,p=o.tangent?new Float32Array(c*3):void 0,g=o.bitangent?new Float32Array(c*3):void 0,f,x=o.normal||o.tangent||o.bitangent;if(x){let v=o.tangent||o.bitangent,P=0,w=0,F=0,b=Math.atan2(i-n,t),R=b8e;R.z=Math.sin(b);let E=Math.cos(b),X=y8e,A=g8e;for(f=0;f<r;f++){let N=f/r*W.TWO_PI,O=E*Math.cos(N),U=E*Math.sin(N);x&&(R.x=O,R.y=U,v&&(X=h.normalize(h.cross(h.UNIT_Z,R,X),X)),o.normal&&(m[P++]=R.x,m[P++]=R.y,m[P++]=R.z,m[P++]=R.x,m[P++]=R.y,m[P++]=R.z),o.tangent&&(p[w++]=X.x,p[w++]=X.y,p[w++]=X.z,p[w++]=X.x,p[w++]=X.y,p[w++]=X.z),o.bitangent&&(A=h.normalize(h.cross(R,X,A),A),g[F++]=A.x,g[F++]=A.y,g[F++]=A.z,g[F++]=A.x,g[F++]=A.y,g[F++]=A.z))}for(f=0;f<r;f++)o.normal&&(m[P++]=0,m[P++]=0,m[P++]=-1),o.tangent&&(p[w++]=1,p[w++]=0,p[w++]=0),o.bitangent&&(g[F++]=0,g[F++]=-1,g[F++]=0);for(f=0;f<r;f++)o.normal&&(m[P++]=0,m[P++]=0,m[P++]=1),o.tangent&&(p[w++]=1,p[w++]=0,p[w++]=0),o.bitangent&&(g[F++]=0,g[F++]=1,g[F++]=0)}let _=12*r-12,C=Ae.createTypedArray(c,_),V=0,L=0;for(f=0;f<r-1;f++)C[V++]=L,C[V++]=L+2,C[V++]=L+3,C[V++]=L,C[V++]=L+3,C[V++]=L+1,L+=2;for(C[V++]=s-2,C[V++]=0,C[V++]=1,C[V++]=s-2,C[V++]=1,C[V++]=s-1,f=1;f<r-1;f++)C[V++]=s+f+1,C[V++]=s+f,C[V++]=s;for(f=1;f<r-1;f++)C[V++]=a,C[V++]=a+f,C[V++]=a+f+1;let Z=0;if(o.st){let v=Math.max(n,i);for(f=0;f<c;f++){let P=h.fromArray(d,f*3,x8e);u[Z++]=(P.x+v)/(2*v),u[Z++]=(P.y+v)/(2*v)}}let G=new mn;o.position&&(G.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:d})),o.normal&&(G.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:m})),o.tangent&&(G.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(G.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g})),o.st&&(G.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:u})),qK.x=t*.5,qK.y=Math.max(i,n);let I=new ce(h.ZERO,D.magnitude(qK));if(l(e._offsetAttribute)){t=d.length;let v=e._offsetAttribute===cn.NONE?0:1,P=new Uint8Array(t/3).fill(v);G.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:P})}return new ht({attributes:G,indices:C,primitiveType:Fe.TRIANGLES,boundingSphere:I,offsetAttribute:e._offsetAttribute})};var $K;Wb.getUnitCylinder=function(){return l($K)||($K=Wb.createGeometry(new Wb({topRadius:1,bottomRadius:1,length:1,vertexFormat:We.POSITION_ONLY}))),$K};var IP=Wb;var ZQn=T(S(),1);var eJ=new D;function L1(e){e=y(e,y.EMPTY_OBJECT);let t=e.length,n=e.topRadius,i=e.bottomRadius,o=y(e.slices,128),r=Math.max(y(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=o,this._numberOfVerticalLines=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}L1.packedLength=6;L1.pack=function(e,t,n){return n=y(n,0),t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=y(e._offsetAttribute,-1),t};var B_={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};L1.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=o,n._bottomRadius=r,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=c===-1?void 0:c,n):(B_.length=i,B_.topRadius=o,B_.bottomRadius=r,B_.slices=s,B_.numberOfVerticalLines=a,B_.offsetAttribute=c===-1?void 0:c,new L1(B_))};L1.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._slices,r=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=o*2,a=D_.computePositions(t,n,i,o,!1),c=o*2,d;if(r>0){let x=Math.min(r,o);d=Math.round(o/x),c+=x}let u=Ae.createTypedArray(s,c*2),m=0,p;for(p=0;p<o-1;p++)u[m++]=p,u[m++]=p+1,u[m++]=p+o,u[m++]=p+1+o;if(u[m++]=o-1,u[m++]=0,u[m++]=o+o-1,u[m++]=o,r>0)for(p=0;p<o;p+=d)u[m++]=p,u[m++]=p+o;let g=new mn;g.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:a}),eJ.x=t*.5,eJ.y=Math.max(i,n);let f=new ce(h.ZERO,D.magnitude(eJ));if(l(e._offsetAttribute)){t=a.length;let x=e._offsetAttribute===cn.NONE?0:1,_=new Uint8Array(t/3).fill(x);g.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}return new ht({attributes:g,indices:u,primitiveType:Fe.LINES,boundingSphere:f,offsetAttribute:e._offsetAttribute})};var XP=L1;var vue=h.ZERO,wue=new h,_8e=new h,Fue=new B;function T8e(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function Gd(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new T8e(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(Gd.prototype=Object.create(ii.prototype),Gd.prototype.constructor=Gd);Object.defineProperties(Gd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Gd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Nn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Yt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Fue)),l(a)||(a=B.WHITE),s.color=Kt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Qi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,vue,wue))),new Gt({id:t,geometry:new IP(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};Gd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,Fue),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Qi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,vue,wue))),new Gt({id:t,geometry:new XP(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:r})};Gd.prototype._computeCenter=function(e,t){return K.getValueOrUndefined(this._entity.position,e,t)};Gd.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||ii.prototype._isHidden.call(this,e,t)};Gd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!K.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!K.isConstant(t.slices)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.numberOfVerticalLines)};Gd.prototype._setStaticOptions=function(e,t){let n=K.getValueOrDefault(t.heightReference,Be.MINIMUM_VALUE,Qe.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Yt?dn.VERTEX_FORMAT:oo.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(Be.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(Be.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(Be.MINIMUM_VALUE),i.slices=K.getValueOrUndefined(t.slices,Be.MINIMUM_VALUE),i.numberOfVerticalLines=K.getValueOrUndefined(t.numberOfVerticalLines,Be.MINIMUM_VALUE),i.offsetAttribute=n!==Qe.NONE?cn.ALL:void 0};Gd.prototype._onEntityPropertyChanged=vp;Gd.DynamicGeometryUpdater=R1;function R1(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(R1.prototype=Object.create(ni.prototype),R1.prototype.constructor=R1);R1.prototype._isHidden=function(e,t,n){let i=this._options,o=K.getValueOrUndefined(e.position,n,_8e);return!l(o)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||ni.prototype._isHidden.call(this,e,t,n)};R1.prototype._setOptions=function(e,t,n){let i=K.getValueOrDefault(t.heightReference,n,Qe.NONE),o=this._options;o.length=K.getValueOrUndefined(t.length,n),o.topRadius=K.getValueOrUndefined(t.topRadius,n),o.bottomRadius=K.getValueOrUndefined(t.bottomRadius,n),o.slices=K.getValueOrUndefined(t.slices,n),o.numberOfVerticalLines=K.getValueOrUndefined(t.numberOfVerticalLines,n),o.offsetAttribute=i!==Qe.NONE?cn.ALL:void 0};var WP=Gd;var rqn=T(S(),1);var jQn=T(S(),1),S8e={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},Br=Object.freeze(S8e);var $Qn=T(S(),1),C8e={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},mo=Object.freeze(C8e);var t4n=T(S(),1),V8e={NONE:0,HOLD:1,EXTRAPOLATE:2},Ed=Object.freeze(V8e);var i4n=T(S(),1),Aue=T(id(),1);function L8e(e){let t=new Aue.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var Pb=L8e;var c4n=T(S(),1);var R8e=W.factorial;function tJ(e,t,n,i,o,r){let s=0,a,c,d;if(i>0){for(c=0;c<o;c++){for(a=!1,d=0;d<r.length&&!a;d++)c===r[d]&&(a=!0);a||(r.push(c),s+=tJ(e,t,n,i-1,o,r),r.splice(r.length-1,1))}return s}for(s=1,c=0;c<o;c++){for(a=!1,d=0;d<r.length&&!a;d++)c===r[d]&&(a=!0);a||(s*=e-n[t[c]])}return s}var Rk={type:"Hermite"};Rk.getRequiredDataPoints=function(e,t){return t=y(t,0),Math.max(Math.floor((e+1)/(t+1)),2)};Rk.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c,d,u,m=t.length,p=new Array(i);for(r=0;r<i;r++){o[r]=0;let _=new Array(m);for(p[r]=_,s=0;s<m;s++)_[s]=[]}let g=m,f=new Array(g);for(r=0;r<g;r++)f[r]=r;let x=m-1;for(c=0;c<i;c++){for(s=0;s<g;s++)u=f[s]*i+c,p[c][0].push(n[u]);for(r=1;r<g;r++){let _=!1;for(s=0;s<g-r;s++){let C=t[f[s]],V=t[f[s+r]],L;V-C<=0?(u=f[s]*i+i*r+c,L=n[u],p[c][r].push(L/R8e(r))):(L=p[c][r-1][s+1]-p[c][r-1][s],p[c][r].push(L/(V-C))),_=_||L!==0}_||(x=r-1)}}for(a=0,d=0;a<=d;a++)for(r=a;r<=x;r++){let _=tJ(e,f,t,a,r,[]);for(c=0;c<i;c++){let C=p[c][r][0];o[c+a*i]+=C*_}}return o};var Z8e=[];Rk.interpolate=function(e,t,n,i,o,r,s){let a=i*(r+1);l(s)||(s=new Array(a));for(let C=0;C<a;C++)s[C]=0;let c=t.length,d=new Array(c*(o+1)),u;for(u=0;u<c;u++)for(let C=0;C<o+1;C++)d[u*(o+1)+C]=u;let m=d.length,p=Z8e,g=G8e(p,d,t,n,i,o),f=[],x=m*(m+1)/2,_=Math.min(g,r);for(let C=0;C<=_;C++)for(u=C;u<=g;u++){f.length=0;let V=tJ(e,d,t,C,u,f),L=Math.floor(u*(1-u)/2)+m*u;for(let Z=0;Z<i;Z++){let G=Math.floor(Z*x),I=p[G+L];s[Z+C*i]+=I*V}}return s};function G8e(e,t,n,i,o,r){let s,a,c=-1,d=t.length,u=d*(d+1)/2;for(let m=0;m<o;m++){let p=Math.floor(m*u);for(s=0;s<d;s++)a=t[s]*o*(r+1)+m,e[p+s]=i[a];for(let g=1;g<d;g++){let f=0,x=Math.floor(g*(1-g)/2)+d*g,_=!1;for(s=0;s<d-g;s++){let C=n[t[s]],V=n[t[s+g]],L,Z;if(V-C<=0)a=t[s]*o*(r+1)+o*g+m,L=i[a],Z=L/W.factorial(g),e[p+x+f]=Z,f++;else{let G=Math.floor((g-1)*(2-g)/2)+d*(g-1);L=e[p+G+s+1]-e[p+G+s],Z=L/(V-C),e[p+x+f]=Z,f++}_=_||L!==0}_&&(c=Math.max(c,g))}}return c}var PP=Rk;var u4n=T(S(),1);var nJ={type:"Lagrange"};nJ.getRequiredDataPoints=function(e){return Math.max(e+1,2)};nJ.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a=t.length;for(r=0;r<i;r++)o[r]=0;for(r=0;r<a;r++){let c=1;for(s=0;s<a;s++)if(s!==r){let d=t[r]-t[s];c*=(e-t[s])/d}for(s=0;s<i;s++)o[s]+=c*n[r*i+s]}return o};var vP=nJ;var f4n=T(S(),1);var iJ={type:"Linear"};iJ.getRequiredDataPoints=function(e){return 2};iJ.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,s,a,c=t[0],d=t[1];for(r=0;r<i;r++)s=n[r],a=n[r+i],o[r]=((a-s)*e+d*s-c*a)/(d-c);return o};var O_=iJ;var y4n=T(S(),1);function gc(e,t,n){this.clock=y(e,0),this.cone=y(t,0),this.magnitude=y(n,1)}gc.fromCartesian3=function(e,t){let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return l(t)||(t=new gc),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};gc.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new gc(e.clock,e.cone,e.magnitude)};gc.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new gc(e.clock,e.cone,1)};gc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};gc.equalsEpsilon=function(e,t,n){return n=y(n,0),e===t||l(e)&&l(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};gc.prototype.equals=function(e){return gc.equals(this,e)};gc.prototype.clone=function(e){return gc.clone(this,e)};gc.prototype.equalsEpsilon=function(e,t){return gc.equalsEpsilon(this,e,t)};gc.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var wP=gc;var kP=T(id(),1);var A4n=T(S(),1);var E4n=T(S(),1);var _4n=T(S(),1),oJ;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?oJ=function(){return performance.now()}:oJ=function(){return Date.now()};var _i=oJ;function rJ(e){e=y(e,y.EMPTY_OBJECT);let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=j.clone(t):l(n)?t=j.clone(n):l(i)?t=j.addDays(i,-1,new j):t=j.now(),l(n)?n=j.clone(n):n=j.clone(t),l(i)?i=j.clone(i):i=j.addDays(n,1,new j),this.startTime=n,this.stopTime=i,this.clockRange=y(e.clockRange,Br.UNBOUNDED),this.canAnimate=y(e.canAnimate,!0),this.onTick=new be,this.onStop=new be,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=_i(),this.currentTime=t,this.multiplier=y(e.multiplier,1),this.shouldAnimate=y(e.shouldAnimate,!1),this.clockStep=y(e.clockStep,mo.SYSTEM_CLOCK_MULTIPLIER)}Object.defineProperties(rJ.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){j.equals(this._currentTime,e)||(this._clockStep===mo.SYSTEM_CLOCK&&(this._clockStep=mo.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===mo.SYSTEM_CLOCK&&(this._clockStep=mo.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===mo.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=j.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===mo.SYSTEM_CLOCK&&(this._clockStep=mo.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});rJ.prototype.tick=function(){let e=_i(),t=j.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===mo.SYSTEM_CLOCK)t=j.now(t);else{let i=this._multiplier;if(n===mo.TICK_DEPENDENT)t=j.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=j.addSeconds(t,i*(a/1e3),t)}let o=this.clockRange,r=this.startTime,s=this.stopTime;if(o===Br.CLAMPED)j.lessThan(t,r)?t=j.clone(r,t):j.greaterThan(t,s)&&(t=j.clone(s,t),this.onStop.raiseEvent(this));else if(o===Br.LOOP_STOP)for(j.lessThan(t,r)&&(t=j.clone(r,t));j.greaterThan(t,s);)t=j.addSeconds(r,j.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var oh=rJ;function Y_(){this._definitionChanged=new be,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(Y_.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:Ll("startTime"),stopTime:Ll("stopTime"),currentTime:Ll("currentTime"),clockRange:Ll("clockRange"),clockStep:Ll("clockStep"),multiplier:Ll("multiplier")});Y_.prototype.clone=function(e){return l(e)||(e=new Y_),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e};Y_.prototype.equals=function(e){return this===e||l(e)&&j.equals(this.startTime,e.startTime)&&j.equals(this.stopTime,e.stopTime)&&j.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};Y_.prototype.merge=function(e){this.startTime=y(this.startTime,e.startTime),this.stopTime=y(this.stopTime,e.stopTime),this.currentTime=y(this.currentTime,e.currentTime),this.clockRange=y(this.clockRange,e.clockRange),this.clockStep=y(this.clockStep,e.clockStep),this.multiplier=y(this.multiplier,e.multiplier)};Y_.prototype.getValue=function(e){return l(e)||(e=new oh),e.startTime=y(this.startTime,e.startTime),e.stopTime=y(this.stopTime,e.stopTime),e.currentTime=y(this.currentTime,e.currentTime),e.clockRange=y(this.clockRange,e.clockRange),e.multiplier=y(this.multiplier,e.multiplier),e.clockStep=y(this.clockStep,e.clockStep),e};var rh=Y_;var z4n=T(S(),1);var E8e=B.WHITE,I8e=.1,X8e=new D(8,8),W8e=new D(0,0),P8e=new D(1,1);function Z1(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}Object.defineProperties(Z1.prototype,{isConstant:{get:function(){return K.isConstant(this._color)&&K.isConstant(this._cellAlpha)&&K.isConstant(this._lineCount)&&K.isConstant(this._lineThickness)&&K.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color"),cellAlpha:ue("cellAlpha"),lineCount:ue("lineCount"),lineThickness:ue("lineThickness"),lineOffset:ue("lineOffset")});Z1.prototype.getType=function(e){return"Grid"};var v8e=new j;Z1.prototype.getValue=function(e,t){return l(e)||(e=j.now(v8e)),l(t)||(t={}),t.color=K.getValueOrClonedDefault(this._color,e,E8e,t.color),t.cellAlpha=K.getValueOrDefault(this._cellAlpha,e,I8e),t.lineCount=K.getValueOrClonedDefault(this._lineCount,e,X8e,t.lineCount),t.lineThickness=K.getValueOrClonedDefault(this._lineThickness,e,P8e,t.lineThickness),t.lineOffset=K.getValueOrClonedDefault(this._lineOffset,e,W8e,t.lineOffset),t};Z1.prototype.equals=function(e){return this===e||e instanceof Z1&&K.equals(this._color,e._color)&&K.equals(this._cellAlpha,e._cellAlpha)&&K.equals(this._lineCount,e._lineCount)&&K.equals(this._lineThickness,e._lineThickness)&&K.equals(this._lineOffset,e._lineOffset)};var G1=Z1;var tjn=T(S(),1);function E1(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(E1.prototype,{isConstant:{get:function(){return K.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color")});E1.prototype.getType=function(e){return"PolylineArrow"};var w8e=new j;E1.prototype.getValue=function(e,t){return l(e)||(e=j.now(w8e)),l(t)||(t={}),t.color=K.getValueOrClonedDefault(this._color,e,B.WHITE,t.color),t};E1.prototype.equals=function(e){return this===e||e instanceof E1&&K.equals(this._color,e._color)};var I1=E1;var djn=T(S(),1);var F8e=B.WHITE,A8e=B.TRANSPARENT,M8e=16,N8e=255;function X1(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(X1.prototype,{isConstant:{get:function(){return K.isConstant(this._color)&&K.isConstant(this._gapColor)&&K.isConstant(this._dashLength)&&K.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color"),gapColor:ue("gapColor"),dashLength:ue("dashLength"),dashPattern:ue("dashPattern")});X1.prototype.getType=function(e){return"PolylineDash"};var k8e=new j;X1.prototype.getValue=function(e,t){return l(e)||(e=j.now(k8e)),l(t)||(t={}),t.color=K.getValueOrClonedDefault(this._color,e,F8e,t.color),t.gapColor=K.getValueOrClonedDefault(this._gapColor,e,A8e,t.gapColor),t.dashLength=K.getValueOrDefault(this._dashLength,e,M8e,t.dashLength),t.dashPattern=K.getValueOrDefault(this._dashPattern,e,N8e,t.dashPattern),t};X1.prototype.equals=function(e){return this===e||e instanceof X1&&K.equals(this._color,e._color)&&K.equals(this._gapColor,e._gapColor)&&K.equals(this._dashLength,e._dashLength)&&K.equals(this._dashPattern,e._dashPattern)};var W1=X1;var xjn=T(S(),1);var U8e=B.WHITE,D8e=.25,B8e=1;function P1(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}Object.defineProperties(P1.prototype,{isConstant:{get:function(){return K.isConstant(this._color)&&K.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color"),glowPower:ue("glowPower"),taperPower:ue("taperPower")});P1.prototype.getType=function(e){return"PolylineGlow"};var O8e=new j;P1.prototype.getValue=function(e,t){return l(e)||(e=j.now(O8e)),l(t)||(t={}),t.color=K.getValueOrClonedDefault(this._color,e,U8e,t.color),t.glowPower=K.getValueOrDefault(this._glowPower,e,D8e,t.glowPower),t.taperPower=K.getValueOrDefault(this._taperPower,e,B8e,t.taperPower),t};P1.prototype.equals=function(e){return this===e||e instanceof P1&&K.equals(this._color,e._color)&&K.equals(this._glowPower,e._glowPower)&&K.equals(this._taperPower,e._taperPower)};var v1=P1;var Gjn=T(S(),1);var Y8e=B.WHITE,H8e=B.BLACK,z8e=1;function w1(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}Object.defineProperties(w1.prototype,{isConstant:{get:function(){return K.isConstant(this._color)&&K.isConstant(this._outlineColor)&&K.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:ue("color"),outlineColor:ue("outlineColor"),outlineWidth:ue("outlineWidth")});w1.prototype.getType=function(e){return"PolylineOutline"};var K8e=new j;w1.prototype.getValue=function(e,t){return l(e)||(e=j.now(K8e)),l(t)||(t={}),t.color=K.getValueOrClonedDefault(this._color,e,Y8e,t.color),t.outlineColor=K.getValueOrClonedDefault(this._outlineColor,e,H8e,t.outlineColor),t.outlineWidth=K.getValueOrDefault(this._outlineWidth,e,z8e),t};w1.prototype.equals=function(e){return this===e||e instanceof w1&&K.equals(this._color,e._color)&&K.equals(this._outlineColor,e._outlineColor)&&K.equals(this._outlineWidth,e._outlineWidth)};var Ug=w1;var Ajn=T(S(),1);function vb(e,t){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new lr,this._referenceFrame=y(t,Ai.FIXED),this.setValue(e)}Object.defineProperties(vb.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!K.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var J8e=new j;vb.prototype.getValue=function(e,t){return l(e)||(e=j.now(J8e)),this.getValueInReferenceFrame(e,Ai.FIXED,t)};vb.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!l(i))return;let o=i.length;l(n)||(n=new Array(o));let r=0,s=0;for(;r<o;){let c=i[r].getValueInReferenceFrame(e,t,n[r]);l(c)&&(n[s]=c,s++),r++}return n.length=s,n};vb.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,vb.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};vb.prototype.equals=function(e){return this===e||e instanceof vb&&this._referenceFrame===e._referenceFrame&&K.arrayEquals(this._value,e._value)};vb.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var wb=vb;var Ojn=T(S(),1);function Dg(e){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new lr,this.setValue(e)}Object.defineProperties(Dg.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!K.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var Q8e=new j;Dg.prototype.getValue=function(e,t){l(e)||(e=j.now(Q8e));let n=this._value;if(!l(n))return;let i=n.length;l(t)||(t=new Array(i));let o=0,r=0;for(;o<i;){let a=this._value[o].getValue(e,t[o]);l(a)&&(t[r]=a,r++),o++}return t.length=r,t};Dg.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,Dg.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Dg.prototype.equals=function(e){return this===e||e instanceof Dg&&K.arrayEquals(this._value,e._value)};Dg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var F1=Dg;var Qjn=T(S(),1);function H_(e){let t=e._targetProperty;if(!l(t)){let n=e._targetEntity;if(!l(n)){if(n=e._targetCollection.getById(e._targetId),!l(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(Id.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let o=0,r=i.length;o<r&&l(t);++o)t=t[i[o]];e._targetProperty=t}return t}function Id(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new be,e.collectionChanged.addEventListener(Id.prototype._onCollectionChanged,this)}Object.defineProperties(Id.prototype,{isConstant:{get:function(){return K.isConstant(H_(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=H_(this);return l(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return H_(this)}}});Id.fromString=function(e,t){let n,i=[],o=!0,r=!1,s="";for(let a=0;a<t.length;++a){let c=t.charAt(a);r?(s+=c,r=!1):c==="\\"?r=!0:o&&c==="#"?(n=s,o=!1,s=""):!o&&c==="."?(i.push(s),s=""):s+=c}return i.push(s),new Id(e,n,i)};var j8e=new j;Id.prototype.getValue=function(e,t){let n=H_(this);return l(e)||(e=j.now(j8e)),l(n)?n.getValue(e,t):void 0};Id.prototype.getValueInReferenceFrame=function(e,t,n){let i=H_(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};Id.prototype.getType=function(e){let t=H_(this);return l(t)?t.getType(e):void 0};Id.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;let i=this._targetPropertyNames.length;for(let o=0;o<i;o++)if(t[o]!==n[o])return!1;return!0};Id.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};Id.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(Id.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=H_(this),l(i)&&this._definitionChanged.raiseEvent(this))};var Fb=Id;var t8n=T(S(),1);var q8e={packedLength:1,pack:function(e,t,n){return n=y(n,0),t[n]=e,t},unpack:function(e,t,n){return t=y(t,0),e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=y(t,0),n=y(n,e.length);let o;for(let r=0,s=n-t+1;r<s;r++){let a=e[t+r];r===0||Math.abs(o-a)<Math.PI?i[r]=a:i[r]=a-W.TWO_PI,o=a}},unpackInterpolationResult:function(e,t,n,i,o){return o=e[0],o<0?o+W.TWO_PI:o}},Ou=q8e;var T8n=T(S(),1);var d8n=T(S(),1);var Mue={packedLength:1,pack:function(e,t,n){n=y(n,0),t[n]=e},unpack:function(e,t,n){return t=y(t,0),e[t]}};function Nue(e,t,n){let i,o=e.length,r=n.length,s=o+r;if(e.length=s,o!==t){let a=o-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<r;i++)e[t++]=n[i]}function kue(e,t){return e instanceof j?e:typeof e=="string"?j.fromIso8601(e):j.addSeconds(t,e,new j)}var sJ=[],aJ=[];function Zk(e,t,n,i,o){let r=0,s,a,c,d,u,m;for(;r<i.length;){u=kue(i[r],e),c=Eo(t,u,j.compare);let p=0,g=0;if(c<0){for(c=~c,d=c*o,a=void 0,m=t[c];r<i.length&&(u=kue(i[r],e),!(l(a)&&j.compare(a,u)>=0||l(m)&&j.compare(u,m)>=0));){for(sJ[p++]=u,r=r+1,s=0;s<o;s++)aJ[g++]=i[r],r=r+1;a=u}p>0&&(aJ.length=g,Nue(n,d,aJ),sJ.length=p,Nue(t,c,sJ))}else{for(s=0;s<o;s++)r++,n[c*o+s]=i[r];r++}}}function sh(e,t){let n=e;n===Number&&(n=Mue);let i=n.packedLength,o=y(n.packedInterpolationLength,i),r=0,s;if(l(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let d=t[c];d===Number&&(d=Mue);let u=d.packedLength;i+=u,o+=y(d.packedInterpolationLength,u),s[c]=d}r=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=O_,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=o,this._updateTableLength=!0,this._interpolationResult=new Array(o),this._definitionChanged=new be,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=r,this._forwardExtrapolationType=Ed.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=Ed.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(sh.prototype,{isConstant:{get:function(){return this._values.length===0}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}});var $8e=new j;sh.prototype.getValue=function(e,t){l(e)||(e=j.now($8e));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=Eo(n,e,j.compare);if(a<0){if(a=~a,a===0){let Z=n[a];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===Ed.NONE||o!==0&&j.secondsDifference(Z,e)>o)return;if(this._backwardExtrapolationType===Ed.HOLD)return r.unpack(s,0,t)}if(a>=i){a=i-1;let Z=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===Ed.NONE||o!==0&&j.secondsDifference(e,Z)>o)return;if(this._forwardExtrapolationType===Ed.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t)}let c=this._xTable,d=this._yTable,u=this._interpolationAlgorithm,m=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let Z=Math.min(u.getRequiredDataPoints(this._interpolationDegree,p),i);Z!==this._numberOfPoints&&(this._numberOfPoints=Z,c.length=Z,d.length=Z*m)}let g=this._numberOfPoints-1;if(g<1)return;let f=0,x=i-1;if(x-f+1>=g+1){let Z=a-(g/2|0)-1;Z<f&&(Z=f);let G=Z+g;G>x&&(G=x,Z=G-g,Z<f&&(Z=f)),f=Z,x=G}let C=x-f+1;for(let Z=0;Z<C;++Z)c[Z]=j.secondsDifference(n[f+Z],n[x]);if(l(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(s,f,x,d);else{let Z=0,G=this._packedLength,I=f*G,v=(x+1)*G;for(;I<v;)d[Z]=s[I],I++,Z++}let V=j.secondsDifference(e,n[x]),L;if(p===0||!l(u.interpolate))L=u.interpolateOrderZero(V,c,d,m,this._interpolationResult);else{let Z=Math.floor(m/(p+1));L=u.interpolate(V,c,d,Z,p,p,this._interpolationResult)}return l(r.unpackInterpolationResult)?r.unpackInterpolationResult(L,s,f,x,t):r.unpack(L,0,t)}return r.unpack(s,a*this._packedLength,t)};sh.prototype.setInterpolationOptions=function(e){if(!l(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;l(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),l(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};sh.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=[];if(s.push(e),r.pack(t,s,s.length),o){let a=i.length;for(let c=0;c<a;c++)i[c].pack(n[c],s,s.length)}Zk(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};sh.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),r.pack(t[c],a,a.length),o){let d=n[c],u=i.length;for(let m=0;m<u;m++)i[m].pack(d[m],a,a.length)}Zk(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};sh.prototype.addSamplesPackedArray=function(e,t){Zk(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};sh.prototype.removeSample=function(e){let t=Eo(this._times,e,j.compare);return t<0?!1:(Uue(this,t,1),!0)};function Uue(e,t,n){let i=e._packedLength;e._times.splice(t,n),e._values.splice(t*i,n*i),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}sh.prototype.removeSamples=function(e){let t=this._times,n=Eo(t,e.start,j.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Eo(t,e.stop,j.compare);i<0?i=~i:e.isStopIncluded&&++i,Uue(this,n,i-n)};sh.prototype.equals=function(e){if(this===e)return!0;if(!l(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=l(t),i=e._derivativeTypes,o=l(i);if(n!==o)return!1;let r,s;if(n){if(s=t.length,s!==i.length)return!1;for(r=0;r<s;r++)if(t[r]!==i[r])return!1}let a=this._times,c=e._times;if(s=a.length,s!==c.length)return!1;for(r=0;r<s;r++)if(!j.equals(a[r],c[r]))return!1;let d=this._values,u=e._values;for(s=d.length,r=0;r<s;r++)if(d[r]!==u[r])return!1;return!0};sh._mergeNewSamples=Zk;var Xd=sh;function Yu(e,t){t=y(t,0);let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=h}this._numberOfDerivatives=t,this._property=new Xd(h,n),this._definitionChanged=new be,this._referenceFrame=y(e,Ai.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(Yu.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}});var e7e=new j;Yu.prototype.getValue=function(e,t){return l(e)||(e=j.now(e7e)),this.getValueInReferenceFrame(e,Ai.FIXED,t)};Yu.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return Zm.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};Yu.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};Yu.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};Yu.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};Yu.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};Yu.prototype.removeSample=function(e){return this._property.removeSample(e)};Yu.prototype.removeSamples=function(e){this._property.removeSamples(e)};Yu.prototype.equals=function(e){return this===e||e instanceof Yu&&K.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var fa=Yu;var P8n=T(S(),1);var C8n=T(S(),1),t7e={HORIZONTAL:0,VERTICAL:1},ah=Object.freeze(t7e);var n7e=ah.HORIZONTAL,i7e=B.WHITE,o7e=B.BLACK,r7e=0,s7e=1;function A1(e){e=y(e,y.EMPTY_OBJECT),this._definitionChanged=new be,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}Object.defineProperties(A1.prototype,{isConstant:{get:function(){return K.isConstant(this._orientation)&&K.isConstant(this._evenColor)&&K.isConstant(this._oddColor)&&K.isConstant(this._offset)&&K.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:ue("orientation"),evenColor:ue("evenColor"),oddColor:ue("oddColor"),offset:ue("offset"),repeat:ue("repeat")});A1.prototype.getType=function(e){return"Stripe"};var a7e=new j;A1.prototype.getValue=function(e,t){return l(e)||(e=j.now(a7e)),l(t)||(t={}),t.horizontal=K.getValueOrDefault(this._orientation,e,n7e)===ah.HORIZONTAL,t.evenColor=K.getValueOrClonedDefault(this._evenColor,e,i7e,t.evenColor),t.oddColor=K.getValueOrClonedDefault(this._oddColor,e,o7e,t.oddColor),t.offset=K.getValueOrDefault(this._offset,e,r7e),t.repeat=K.getValueOrDefault(this._repeat,e,s7e),t};A1.prototype.equals=function(e){return this===e||e instanceof A1&&K.equals(this._orientation,e._orientation)&&K.equals(this._evenColor,e._evenColor)&&K.equals(this._oddColor,e._oddColor)&&K.equals(this._offset,e._offset)&&K.equals(this._repeat,e._repeat)};var M1=A1;var B8n=T(S(),1);function Bg(e){this._definitionChanged=new be,this._intervals=new Ur,this._intervals.changedEvent.addEventListener(Bg.prototype._intervalsChanged,this),this._referenceFrame=y(e,Ai.FIXED)}Object.defineProperties(Bg.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}});var c7e=new j;Bg.prototype.getValue=function(e,t){return l(e)||(e=j.now(c7e)),this.getValueInReferenceFrame(e,Ai.FIXED,t)};Bg.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return Zm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Bg.prototype.equals=function(e){return this===e||e instanceof Bg&&this._intervals.equals(e._intervals,K.equals)&&this._referenceFrame===e._referenceFrame};Bg.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Ab=Bg;var Q8n=T(S(),1);function z_(){this._definitionChanged=new be,this._intervals=new Ur,this._intervals.changedEvent.addEventListener(z_.prototype._intervalsChanged,this)}Object.defineProperties(z_.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var l7e=new j;z_.prototype.getValue=function(e,t){l(e)||(e=j.now(l7e));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};z_.prototype.equals=function(e){return this===e||e instanceof z_&&this._intervals.equals(e._intervals,K.equals)};z_.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Mb=z_;var g7n=T(S(),1);var o7n=T(S(),1);function N1(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new be,this._normalize=y(t,!0),this.position=e}Object.defineProperties(N1.prototype,{isConstant:{get:function(){return K.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(l(t)&&this._subscription(),this._position=e,l(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var d7e=new h,Due=new h,Bue=new j,u7e=new j,cJ=1/60;N1.prototype.getValue=function(e,t){return this._getValue(e,t)};N1.prototype._getValue=function(e,t,n){l(e)||(e=j.now(u7e)),l(t)||(t=new h);let i=this._position;if(K.isConstant(i))return this._normalize?void 0:h.clone(h.ZERO,t);let o=i.getValue(e,d7e),r=i.getValue(j.addSeconds(e,cJ,Bue),Due);if(!l(o)||!l(r)&&(r=o,o=i.getValue(j.addSeconds(e,-cJ,Bue),Due),!l(o)))return;if(h.equals(o,r))return this._normalize?void 0:h.clone(h.ZERO,t);l(n)&&o.clone(n);let s=h.subtract(r,o,t);return this._normalize?h.normalize(s,t):h.divideByScalar(s,cJ,t)};N1.prototype.equals=function(e){return this===e||e instanceof N1&&K.equals(this._position,e._position)};var K_=N1;function FP(e,t){this._velocityVectorProperty=new K_(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new be,this.ellipsoid=y(t,ne.default);let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(FP.prototype,{isConstant:{get:function(){return K.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var Oue=new h,m7e=new h,Yue=new $,h7e=new j;FP.prototype.getValue=function(e,t){l(e)||(e=j.now(h7e));let n=this._velocityVectorProperty._getValue(e,m7e,Oue);if(l(n))return Ft.rotationMatrixFromPositionVelocity(Oue,n,this._ellipsoid,Yue),we.fromRotationMatrix(Yue,t)};FP.prototype.equals=function(e){return this===e||e instanceof FP&&K.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var AP=FP;var _7n=T(S(),1);var Nb={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};Nb.validate=function(e){return e===Nb.COMPLETE||e===Nb.BELOW_ELLIPSOID_HORIZON||e===Nb.ABOVE_ELLIPSOID_HORIZON};Nb.toString=function(e){switch(e){case Nb.COMPLETE:return"COMPLETE";case Nb.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case Nb.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new pe("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var k1=Nb;function Og(){}Og.packedLength=h.packedLength;Og.unpack=h.unpack;Og.pack=h.pack;var lJ;function MP(e,t){return t[0]==="#"&&(t=lJ+t),Fb.fromString(e,t)}function Hue(e,t,n){if(l(n.reference))return MP(t,n.reference);if(l(n.velocityReference)){let i=MP(t,n.velocityReference);switch(e){case h:case Og:return new K_(i,e===Og);case we:return new AP(i)}}throw new de(`${JSON.stringify(n)} is not valid CZML.`)}function f7e(e,t){return new Xm(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var Ui=new h,jc=new wP,yc=new he,J_=new Vn,Gk=new we;function p7e(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===B.packedLength)return[B.byteToFloat(n[0]),B.byteToFloat(n[1]),B.byteToFloat(n[2]),B.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=B.byteToFloat(n[o+1]),t[o+2]=B.byteToFloat(n[o+2]),t[o+3]=B.byteToFloat(n[o+3]),t[o+4]=B.byteToFloat(n[o+4]);return t}function zue(e,t){let n=y(e.uri,e);return l(t)?t.getDerivedResource({url:n}):Ee.createIfNeeded(n)}function b7e(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===ae.packedLength)return[W.toRadians(n[0]),W.toRadians(n[1]),W.toRadians(n[2]),W.toRadians(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=W.toRadians(n[o+1]),t[o+2]=W.toRadians(n[o+2]),t[o+3]=W.toRadians(n[o+3]),t[o+4]=W.toRadians(n[o+4]);return t}function g7e(e){let t=e.length;if(jc.magnitude=1,t===2)return jc.clock=e[0],jc.cone=e[1],h.fromSpherical(jc,Ui),[Ui.x,Ui.y,Ui.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],jc.clock=e[i+1],jc.cone=e[i+2],h.fromSpherical(jc,Ui),n[o+1]=Ui.x,n[o+2]=Ui.y,n[o+3]=Ui.z;return n}function y7e(e){let t=e.length;if(t===3)return jc.clock=e[0],jc.cone=e[1],jc.magnitude=e[2],h.fromSpherical(jc,Ui),[Ui.x,Ui.y,Ui.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],jc.clock=e[i+1],jc.cone=e[i+2],jc.magnitude=e[i+3],h.fromSpherical(jc,Ui),n[i+1]=Ui.x,n[i+2]=Ui.y,n[i+3]=Ui.z;return n}function x7e(e){let t=e.length;if(t===3)return yc.longitude=e[0],yc.latitude=e[1],yc.height=e[2],ne.default.cartographicToCartesian(yc,Ui),[Ui.x,Ui.y,Ui.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],yc.longitude=e[i+1],yc.latitude=e[i+2],yc.height=e[i+3],ne.default.cartographicToCartesian(yc,Ui),n[i+1]=Ui.x,n[i+2]=Ui.y,n[i+3]=Ui.z;return n}function _7e(e){let t=e.length;if(t===3)return yc.longitude=W.toRadians(e[0]),yc.latitude=W.toRadians(e[1]),yc.height=e[2],ne.default.cartographicToCartesian(yc,Ui),[Ui.x,Ui.y,Ui.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],yc.longitude=W.toRadians(e[i+1]),yc.latitude=W.toRadians(e[i+2]),yc.height=e[i+3],ne.default.cartographicToCartesian(yc,Ui),n[i+1]=Ui.x,n[i+2]=Ui.y,n[i+3]=Ui.z;return n}function dJ(e){let t=e.cartesian;if(l(t))return t;let n=e.cartesianVelocity;if(l(n))return n;let i=e.unitCartesian;if(l(i))return i;let o=e.unitSpherical;if(l(o))return g7e(o);let r=e.spherical;if(l(r))return y7e(r);let s=e.cartographicRadians;if(l(s))return x7e(s);let a=e.cartographicDegrees;if(l(a))return _7e(a);throw new de(`${JSON.stringify(e)} is not a valid CZML interval.`)}function Kue(e,t){h.unpack(e,t,Ui),h.normalize(Ui,Ui),h.pack(Ui,e,t)}function T7e(e){let t=dJ(e);if(t.length===3)return Kue(t,0),t;for(let n=1;n<t.length;n+=4)Kue(t,n);return t}function Jue(e,t){we.unpack(e,t,Gk),we.normalize(Gk,Gk),we.pack(Gk,e,t)}function S7e(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return Jue(t,0),t;for(let n=1;n<t.length;n+=5)Jue(t,n)}return t}function Que(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?Ke:e.hasOwnProperty("cartesian2")?D:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?h:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?Og:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?B:e.hasOwnProperty("arcType")?nn:e.hasOwnProperty("classificationType")?kn:e.hasOwnProperty("colorBlendMode")?lc:e.hasOwnProperty("cornerType")?Ei:e.hasOwnProperty("heightReference")?Qe:e.hasOwnProperty("horizontalOrigin")?gi:e.hasOwnProperty("date")?j:e.hasOwnProperty("labelStyle")?Uo:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Ut:e.hasOwnProperty("distanceDisplayCondition")?At:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?we:e.hasOwnProperty("shadowMode")?_n:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?ah:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ae:e.hasOwnProperty("uri")?kP.default:e.hasOwnProperty("verticalOrigin")?Pn:Object}function C7e(e,t,n){switch(e){case nn:return nn[y(t.arcType,t)];case Array:return t.array;case Boolean:return y(t.boolean,t);case Ke:return t.boundingRectangle;case D:return t.cartesian2;case h:return dJ(t);case Og:return T7e(t);case B:return p7e(t);case kn:return kn[y(t.classificationType,t)];case lc:return lc[y(t.colorBlendMode,t)];case Ei:return Ei[y(t.cornerType,t)];case Qe:return Qe[y(t.heightReference,t)];case gi:return gi[y(t.horizontalOrigin,t)];case Image:return zue(t,n);case j:return j.fromIso8601(y(t.date,t));case Uo:return Uo[y(t.labelStyle,t)];case Number:return y(t.number,t);case Ut:return t.nearFarScalar;case At:return t.distanceDisplayCondition;case Object:return y(y(t.object,t.value),t);case we:return S7e(t);case Ou:return y(t.number,t);case k1:return k1[y(t.portionToDisplay,t)];case _n:return _n[y(y(t.shadowMode,t.shadows),t)];case String:return y(t.string,t);case ah:return ah[y(t.stripeOrientation,t)];case ae:return b7e(t);case kP.default:return zue(t,n);case Pn:return Pn[y(t.verticalOrigin,t)];default:throw new de(`Unknown CzmlDataSource interval type: ${e}`)}}var V7e={HERMITE:PP,LAGRANGE:vP,LINEAR:O_};function Ek(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:V7e[n],interpolationDegree:i});let o=e.forwardExtrapolationType;l(o)&&(t.forwardExtrapolationType=Ed[o]);let r=e.forwardExtrapolationDuration;l(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=Ed[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var jue={iso8601:void 0};function dr(e){if(l(e))return jue.iso8601=e,Vn.fromIso8601(jue)}function uJ(e){let t=Be.MAXIMUM_INTERVAL.clone();return t.data=e,t}function que(e){let t=new pc;return t.intervals.addInterval(uJ(e)),t}function $ue(e){let t=new ma(e.referenceFrame);return t.intervals.addInterval(uJ(e)),t}function Ik(e,t,n,i,o,r,s){let a=dr(i.interval);l(o)&&(l(a)?a=Vn.intersect(a,o,J_):a=o);let c,d,u,m=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(Be.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return dme(t[n],a)}let g=!1;if(m){if(d=C7e(e,i,r),!l(d))return;c=y(e.packedLength,1),u=y(d.length,1),g=!l(i.array)&&typeof d!="string"&&u>c&&e!==Object}let f=typeof e.unpack=="function"&&e!==Ou;if(!g&&!p){m?t[n]=new Jn(f?e.unpack(d,0):d):t[n]=Hue(e,s,i);return}let x=t[n],_,C=i.epoch;if(l(C)&&(_=j.fromIso8601(C)),g&&!p){x instanceof Xd||(t[n]=x=new Xd(e)),x.addSamplesPackedArray(d,_),Ek(i,x);return}let V;if(!g&&p){a=a.clone(),m?a.data=f?e.unpack(d,0):d:a.data=Hue(e,s,i),l(x)||(t[n]=x=m?new Mb:new pc),m&&x instanceof Mb?x.intervals.addInterval(a):x instanceof pc?(m&&(a.data=new Jn(a.data)),x.intervals.addInterval(a)):(t[n]=x=que(x),m&&(a.data=new Jn(a.data)),x.intervals.addInterval(a));return}l(x)||(t[n]=x=new pc),x instanceof pc||(t[n]=x=que(x));let L=x.intervals;V=L.findInterval(a),(!l(V)||!(V.data instanceof Xd))&&(V=a.clone(),V.data=new Xd(e),L.addInterval(V)),V.data.addSamplesPackedArray(d,_),Ek(i,V.data)}function dme(e,t){if(e instanceof Xd){e.removeSamples(t);return}else if(e instanceof Mb){e.intervals.removeInterval(t);return}else if(e instanceof pc){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Vn.intersect(n.get(i),t,J_);o.isEmpty||dme(o.data,t)}n.removeInterval(t);return}}function xe(e,t,n,i,o,r,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)Ik(e,t,n,i[a],o,r,s);else Ik(e,t,n,i,o,r,s)}function eme(e,t,n,i,o,r){let s=dr(n.interval);l(i)&&(l(s)?s=Vn.intersect(s,i,J_):s=i);let a=l(n.cartesianVelocity)?1:0,c=h.packedLength*(a+1),d,u,m=!l(n.reference),p=l(s)&&!s.equals(Be.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return ume(e[t],s)}let g,f=!1;if(m&&(l(n.referenceFrame)&&(g=Ai[n.referenceFrame]),g=y(g,Ai.FIXED),d=dJ(n),u=y(d.length,1),f=u>c),!f&&!p){m?e[t]=new Nc(h.unpack(d),g):e[t]=MP(r,n.reference);return}let x=e[t],_,C=n.epoch;if(l(C)&&(_=j.fromIso8601(C)),f&&!p){(!(x instanceof fa)||l(g)&&x.referenceFrame!==g)&&(e[t]=x=new fa(g,a)),x.addSamplesPackedArray(d,_),Ek(n,x);return}let V;if(!f&&p){s=s.clone(),m?s.data=h.unpack(d):s.data=MP(r,n.reference),l(x)||(m?x=new Ab(g):x=new ma(g),e[t]=x),m&&x instanceof Ab&&l(g)&&x.referenceFrame===g?x.intervals.addInterval(s):x instanceof ma?(m&&(s.data=new Nc(s.data,g)),x.intervals.addInterval(s)):(e[t]=x=$ue(x),m&&(s.data=new Nc(s.data,g)),x.intervals.addInterval(s));return}l(x)?x instanceof ma||(e[t]=x=$ue(x)):e[t]=x=new ma(g);let L=x.intervals;V=L.findInterval(s),(!l(V)||!(V.data instanceof fa)||l(g)&&V.data.referenceFrame!==g)&&(V=s.clone(),V.data=new fa(g,a),L.addInterval(V)),V.data.addSamplesPackedArray(d,_),Ek(n,V.data)}function ume(e,t){if(e instanceof fa){e.removeSamples(t);return}else if(e instanceof Ab){e.intervals.removeInterval(t);return}else if(e instanceof ma){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Vn.intersect(n.get(i),t,J_);o.isEmpty||ume(o.data,t)}n.removeInterval(t);return}}function mme(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)eme(e,t,n[s],i,o,r);else eme(e,t,n,i,o,r)}function tme(e,t,n,i){l(n.references)?Xk(e,t,n.references,n.interval,i,F1,pc):(l(n.cartesian2)?n.array=D.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=D.unpackArray(n.cartesian)),l(n.array)&&xe(Array,e,t,n,void 0,void 0,i))}function nme(e,t,n,i,o,r){let s=dr(n.interval);l(i)&&(l(s)?s=Vn.intersect(s,i,J_):s=i);let a=e[t],c,d;if(l(s)){a instanceof y1||(a=new y1,e[t]=a);let m=a.intervals;d=m.findInterval({start:s.start,stop:s.stop}),l(d)?c=d.data:(d=s.clone(),m.addInterval(d))}else c=a;let u;l(n.solidColor)?(c instanceof Yt||(c=new Yt),u=n.solidColor,xe(B,c,"color",u.color,void 0,void 0,r)):l(n.grid)?(c instanceof G1||(c=new G1),u=n.grid,xe(B,c,"color",u.color,void 0,o,r),xe(Number,c,"cellAlpha",u.cellAlpha,void 0,o,r),xe(D,c,"lineCount",u.lineCount,void 0,o,r),xe(D,c,"lineThickness",u.lineThickness,void 0,o,r),xe(D,c,"lineOffset",u.lineOffset,void 0,o,r)):l(n.image)?(c instanceof D0||(c=new D0),u=n.image,xe(Image,c,"image",u.image,void 0,o,r),xe(D,c,"repeat",u.repeat,void 0,o,r),xe(B,c,"color",u.color,void 0,o,r),xe(Boolean,c,"transparent",u.transparent,void 0,o,r)):l(n.stripe)?(c instanceof M1||(c=new M1),u=n.stripe,xe(ah,c,"orientation",u.orientation,void 0,o,r),xe(B,c,"evenColor",u.evenColor,void 0,o,r),xe(B,c,"oddColor",u.oddColor,void 0,o,r),xe(Number,c,"offset",u.offset,void 0,o,r),xe(Number,c,"repeat",u.repeat,void 0,o,r)):l(n.polylineOutline)?(c instanceof Ug||(c=new Ug),u=n.polylineOutline,xe(B,c,"color",u.color,void 0,o,r),xe(B,c,"outlineColor",u.outlineColor,void 0,o,r),xe(Number,c,"outlineWidth",u.outlineWidth,void 0,o,r)):l(n.polylineGlow)?(c instanceof v1||(c=new v1),u=n.polylineGlow,xe(B,c,"color",u.color,void 0,o,r),xe(Number,c,"glowPower",u.glowPower,void 0,o,r),xe(Number,c,"taperPower",u.taperPower,void 0,o,r)):l(n.polylineArrow)?(c instanceof I1||(c=new I1),u=n.polylineArrow,xe(B,c,"color",u.color,void 0,void 0,r)):l(n.polylineDash)?(c instanceof W1||(c=new W1),u=n.polylineDash,xe(B,c,"color",u.color,void 0,void 0,r),xe(B,c,"gapColor",u.gapColor,void 0,void 0,r),xe(Number,c,"dashLength",u.dashLength,void 0,o,r),xe(Number,c,"dashPattern",u.dashPattern,void 0,o,r)):l(n.checkerboard)&&(c instanceof b1||(c=new b1),u=n.checkerboard,xe(B,c,"evenColor",u.evenColor,void 0,o,r),xe(B,c,"oddColor",u.oddColor,void 0,o,r),xe(D,c,"repeat",u.repeat,void 0,o,r)),l(d)?d.data=c:e[t]=c}function Wd(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)nme(e,t,n[s],i,o,r);else nme(e,t,n,i,o,r)}function L7e(e,t,n,i){let o=t.name;l(o)&&(e.name=t.name)}function R7e(e,t,n,i){let o=t.description;l(o)&&xe(String,e,"description",o,void 0,i,n)}function Z7e(e,t,n,i){let o=t.position;l(o)&&mme(e,"position",o,void 0,i,n)}function G7e(e,t,n,i){let o=t.viewFrom;l(o)&&xe(h,e,"viewFrom",o,void 0,i,n)}function E7e(e,t,n,i){let o=t.orientation;l(o)&&xe(we,e,"orientation",o,void 0,i,n)}function I7e(e,t,n,i){let o=t.properties;if(l(o)){l(e.properties)||(e.properties=new Rl);for(let r in o)if(o.hasOwnProperty(r)){e.properties.hasProperty(r)||e.properties.addProperty(r);let s=o[r];if(Array.isArray(s))for(let a=0,c=s.length;a<c;++a)Ik(Que(s[a]),e.properties,r,s[a],void 0,i,n);else Ik(Que(s),e.properties,r,s,void 0,i,n)}}}function Xk(e,t,n,i,o,r,s){let a=n.map(function(c){return MP(o,c)});if(l(i)){i=dr(i);let c=e[t];if(!(c instanceof s)){let d=new s;d.intervals.addInterval(uJ(c)),e[t]=c=d}i.data=new r(a),c.intervals.addInterval(i)}else e[t]=new r(a)}function ime(e,t,n,i){let o=n.references;l(o)?Xk(e,t,o,n.interval,i,F1,pc):xe(Array,e,t,n,void 0,void 0,i)}function ome(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)ime(e,t,n[o],i);else ime(e,t,n,i)}function rme(e,t,n,i){let o=n.references;l(o)?Xk(e,t,o,n.interval,i,wb,ma):(l(n.cartesian)?n.array=h.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=h.fromRadiansArrayHeights(n.cartographicRadians,ne.default):l(n.cartographicDegrees)&&(n.array=h.fromDegreesArrayHeights(n.cartographicDegrees,ne.default)),l(n.array)&&xe(Array,e,t,n,void 0,void 0,i))}function UP(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)rme(e,t,n[o],i);else rme(e,t,n,i)}function X7e(e){return h.unpackArray(e)}function W7e(e){return h.fromRadiansArrayHeights(e,ne.default)}function P7e(e){return h.fromDegreesArrayHeights(e,ne.default)}function sme(e,t,n,i){let o=n.references;if(l(o)){let r=o.map(function(s){let a={};return Xk(a,"positions",s,n.interval,i,wb,ma),a.positions});e[t]=new wb(r)}else l(n.cartesian)?n.array=n.cartesian.map(X7e):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(W7e):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(P7e)),l(n.array)&&xe(Array,e,t,n,void 0,void 0,i)}function v7e(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)sme(e,t,n[o],i);else sme(e,t,n,i)}function w7e(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)tme(e,t,n[o],i);else tme(e,t,n,i)}function F7e(e,t,n,i){let o=t.availability;if(!l(o))return;let r;if(Array.isArray(o))for(let s=0,a=o.length;s<a;++s)l(r)||(r=new Ur),r.addInterval(dr(o[s]));else r=new Ur,r.addInterval(dr(o));e.availability=r}function A7e(e,t,n,i,o){l(t)&&xe(Og,e,"alignedAxis",t,n,i,o)}function M7e(e,t,n,i){let o=t.billboard;if(!l(o))return;let r=dr(o.interval),s=e.billboard;l(s)||(e.billboard=s=new tc),xe(Boolean,s,"show",o.show,r,i,n),xe(Image,s,"image",o.image,r,i,n),xe(Number,s,"scale",o.scale,r,i,n),xe(D,s,"pixelOffset",o.pixelOffset,r,i,n),xe(h,s,"eyeOffset",o.eyeOffset,r,i,n),xe(gi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),xe(Pn,s,"verticalOrigin",o.verticalOrigin,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(B,s,"color",o.color,r,i,n),xe(Ou,s,"rotation",o.rotation,r,i,n),A7e(s,o.alignedAxis,r,i,n),xe(Boolean,s,"sizeInMeters",o.sizeInMeters,r,i,n),xe(Number,s,"width",o.width,r,i,n),xe(Number,s,"height",o.height,r,i,n),xe(Ut,s,"scaleByDistance",o.scaleByDistance,r,i,n),xe(Ut,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),xe(Ut,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),xe(Ke,s,"imageSubRegion",o.imageSubRegion,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function N7e(e,t,n,i){let o=t.box;if(!l(o))return;let r=dr(o.interval),s=e.box;l(s)||(e.box=s=new Gx),xe(Boolean,s,"show",o.show,r,i,n),xe(h,s,"dimensions",o.dimensions,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Wd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(B,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(_n,s,"shadows",o.shadows,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function k7e(e,t,n,i){let o=t.corridor;if(!l(o))return;let r=dr(o.interval),s=e.corridor;l(s)||(e.corridor=s=new Ix),xe(Boolean,s,"show",o.show,r,i,n),UP(s,"positions",o.positions,n),xe(Number,s,"width",o.width,r,i,n),xe(Number,s,"height",o.height,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),xe(Qe,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),xe(Ei,s,"cornerType",o.cornerType,r,i,n),xe(Number,s,"granularity",o.granularity,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Wd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(B,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(_n,s,"shadows",o.shadows,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(kn,s,"classificationType",o.classificationType,r,i,n),xe(Number,s,"zIndex",o.zIndex,r,i,n)}function U7e(e,t,n,i){let o=t.cylinder;if(!l(o))return;let r=dr(o.interval),s=e.cylinder;l(s)||(e.cylinder=s=new Xx),xe(Boolean,s,"show",o.show,r,i,n),xe(Number,s,"length",o.length,r,i,n),xe(Number,s,"topRadius",o.topRadius,r,i,n),xe(Number,s,"bottomRadius",o.bottomRadius,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Wd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(B,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),xe(Number,s,"slices",o.slices,r,i,n),xe(_n,s,"shadows",o.shadows,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function D7e(e,t){let n=e.version;if(l(n)&&typeof n=="string"){let r=n.split(".");if(r.length===2){if(r[0]!=="1")throw new de("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new de("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let o=e.clock;if(l(o)){let r=i.clock;l(r)?(r.interval=y(o.interval,r.interval),r.currentTime=y(o.currentTime,r.currentTime),r.range=y(o.range,r.range),r.step=y(o.step,r.step),r.multiplier=y(o.multiplier,r.multiplier)):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function B7e(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=dr(o.interval),s=e.ellipse;l(s)||(e.ellipse=s=new Wx),xe(Boolean,s,"show",o.show,r,i,n),xe(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),xe(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),xe(Number,s,"height",o.height,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),xe(Qe,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),xe(Ou,s,"rotation",o.rotation,r,i,n),xe(Ou,s,"stRotation",o.stRotation,r,i,n),xe(Number,s,"granularity",o.granularity,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Wd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(B,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),xe(_n,s,"shadows",o.shadows,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(kn,s,"classificationType",o.classificationType,r,i,n),xe(Number,s,"zIndex",o.zIndex,r,i,n)}function O7e(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=dr(o.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new Px),xe(Boolean,s,"show",o.show,r,i,n),xe(h,s,"radii",o.radii,r,i,n),xe(h,s,"innerRadii",o.innerRadii,r,i,n),xe(Number,s,"minimumClock",o.minimumClock,r,i,n),xe(Number,s,"maximumClock",o.maximumClock,r,i,n),xe(Number,s,"minimumCone",o.minimumCone,r,i,n),xe(Number,s,"maximumCone",o.maximumCone,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Wd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(B,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Number,s,"stackPartitions",o.stackPartitions,r,i,n),xe(Number,s,"slicePartitions",o.slicePartitions,r,i,n),xe(Number,s,"subdivisions",o.subdivisions,r,i,n),xe(_n,s,"shadows",o.shadows,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Y7e(e,t,n,i){let o=t.label;if(!l(o))return;let r=dr(o.interval),s=e.label;l(s)||(e.label=s=new Gm),xe(Boolean,s,"show",o.show,r,i,n),xe(String,s,"text",o.text,r,i,n),xe(String,s,"font",o.font,r,i,n),xe(Uo,s,"style",o.style,r,i,n),xe(Number,s,"scale",o.scale,r,i,n),xe(Boolean,s,"showBackground",o.showBackground,r,i,n),xe(B,s,"backgroundColor",o.backgroundColor,r,i,n),xe(D,s,"backgroundPadding",o.backgroundPadding,r,i,n),xe(D,s,"pixelOffset",o.pixelOffset,r,i,n),xe(h,s,"eyeOffset",o.eyeOffset,r,i,n),xe(gi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),xe(Pn,s,"verticalOrigin",o.verticalOrigin,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(B,s,"fillColor",o.fillColor,r,i,n),xe(B,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Ut,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),xe(Ut,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),xe(Ut,s,"scaleByDistance",o.scaleByDistance,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function H7e(e,t,n,i){let o=t.model;if(!l(o))return;let r=dr(o.interval),s=e.model;l(s)||(e.model=s=new Xp),xe(Boolean,s,"show",o.show,r,i,n),xe(kP.default,s,"uri",o.gltf,r,i,n),xe(Number,s,"scale",o.scale,r,i,n),xe(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),xe(Number,s,"maximumScale",o.maximumScale,r,i,n),xe(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),xe(Boolean,s,"runAnimations",o.runAnimations,r,i,n),xe(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),xe(_n,s,"shadows",o.shadows,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(B,s,"silhouetteColor",o.silhouetteColor,r,i,n),xe(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),xe(B,s,"color",o.color,r,i,n),xe(lc,s,"colorBlendMode",o.colorBlendMode,r,i,n),xe(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,c,d=o.nodeTransformations;if(l(d))if(Array.isArray(d))for(a=0,c=d.length;a<c;++a)ame(s,d[a],r,i,n);else ame(s,d,r,i,n);let u=o.articulations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)cme(s,u[a],r,i,n);else cme(s,u,r,i,n)}function ame(e,t,n,i,o){let r=dr(t.interval);l(n)&&(l(r)?r=Vn.intersect(r,n,J_):r=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,d=a.length;c<d;++c){let u=a[c];if(u==="interval")continue;let m=t[u];if(!l(m))continue;l(s)||(e.nodeTransformations=s=new Rl),s.hasProperty(u)||s.addProperty(u);let p=s[u];l(p)||(s[u]=p=new vx),xe(h,p,"translation",m.translation,r,i,o),xe(we,p,"rotation",m.rotation,r,i,o),xe(h,p,"scale",m.scale,r,i,o)}}function cme(e,t,n,i,o){let r=dr(t.interval);l(n)&&(l(r)?r=Vn.intersect(r,n,J_):r=n);let s=e.articulations,a=Object.keys(t);for(let c=0,d=a.length;c<d;++c){let u=a[c];if(u==="interval")continue;let m=t[u];l(m)&&(l(s)||(e.articulations=s=new Rl),s.hasProperty(u)||s.addProperty(u),xe(Number,s,u,m,r,i,o))}}function z7e(e,t,n,i){let o=t.path;if(!l(o))return;let r=dr(o.interval),s=e.path;l(s)||(e.path=s=new Wp),xe(Boolean,s,"show",o.show,r,i,n),xe(Number,s,"leadTime",o.leadTime,r,i,n),xe(Number,s,"trailTime",o.trailTime,r,i,n),xe(Number,s,"width",o.width,r,i,n),xe(Number,s,"resolution",o.resolution,r,i,n),Wd(s,"material",o.material,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function K7e(e,t,n,i){let o=t.point;if(!l(o))return;let r=dr(o.interval),s=e.point;l(s)||(e.point=s=new Fx),xe(Boolean,s,"show",o.show,r,i,n),xe(Number,s,"pixelSize",o.pixelSize,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(B,s,"color",o.color,r,i,n),xe(B,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Ut,s,"scaleByDistance",o.scaleByDistance,r,i,n),xe(Ut,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function NP(e){this.polygon=e,this._definitionChanged=new be}Object.defineProperties(NP.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!l(e)||e.isConstant)&&(!l(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});NP.prototype.getValue=function(e,t){let n;l(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return l(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),l(i)&&(i=i.map(function(o){return new Ia(o)}))),l(t)?(t.positions=n,t.holes=i,t):new Ia(n,i)};NP.prototype.equals=function(e){return this===e||e instanceof NP&&K.equals(this.polygon._positions,e.polygon._positions)&&K.equals(this.polygon._holes,e.polygon._holes)};function J7e(e,t,n,i){let o=t.polygon;if(!l(o))return;let r=dr(o.interval),s=e.polygon;l(s)||(e.polygon=s=new Em),xe(Boolean,s,"show",o.show,r,i,n),UP(s,"_positions",o.positions,n),v7e(s,"_holes",o.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new NP(s)),xe(Number,s,"height",o.height,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),xe(Qe,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),xe(Ou,s,"stRotation",o.stRotation,r,i,n),xe(Number,s,"granularity",o.granularity,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Wd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(B,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Boolean,s,"perPositionHeight",o.perPositionHeight,r,i,n),xe(Boolean,s,"closeTop",o.closeTop,r,i,n),xe(Boolean,s,"closeBottom",o.closeBottom,r,i,n),xe(nn,s,"arcType",o.arcType,r,i,n),xe(_n,s,"shadows",o.shadows,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(kn,s,"classificationType",o.classificationType,r,i,n),xe(Number,s,"zIndex",o.zIndex,r,i,n)}function Q7e(e){return e?nn.GEODESIC:nn.NONE}function j7e(e,t,n,i){let o=t.polyline;if(!l(o))return;let r=dr(o.interval),s=e.polyline;if(l(s)||(e.polyline=s=new oc),xe(Boolean,s,"show",o.show,r,i,n),UP(s,"positions",o.positions,n),xe(Number,s,"width",o.width,r,i,n),xe(Number,s,"granularity",o.granularity,r,i,n),Wd(s,"material",o.material,r,i,n),Wd(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),xe(nn,s,"arcType",o.arcType,r,i,n),xe(Boolean,s,"clampToGround",o.clampToGround,r,i,n),xe(_n,s,"shadows",o.shadows,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(kn,s,"classificationType",o.classificationType,r,i,n),xe(Number,s,"zIndex",o.zIndex,r,i,n),l(o.followSurface)&&!l(o.arcType)){let a={};xe(Boolean,a,"followSurface",o.followSurface,r,i,n),s.arcType=f7e(a.followSurface,Q7e)}}function q7e(e,t,n,i){let o=t.polylineVolume;if(!l(o))return;let r=dr(o.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new Ax),UP(s,"positions",o.positions,n),w7e(s,"shape",o.shape,n),xe(Boolean,s,"show",o.show,r,i,n),xe(Ei,s,"cornerType",o.cornerType,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Wd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(B,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(Number,s,"granularity",o.granularity,r,i,n),xe(_n,s,"shadows",o.shadows,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function $7e(e,t,n,i){let o=t.rectangle;if(!l(o))return;let r=dr(o.interval),s=e.rectangle;l(s)||(e.rectangle=s=new Im),xe(Boolean,s,"show",o.show,r,i,n),xe(ae,s,"coordinates",o.coordinates,r,i,n),xe(Number,s,"height",o.height,r,i,n),xe(Qe,s,"heightReference",o.heightReference,r,i,n),xe(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),xe(Qe,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),xe(Ou,s,"rotation",o.rotation,r,i,n),xe(Ou,s,"stRotation",o.stRotation,r,i,n),xe(Number,s,"granularity",o.granularity,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Wd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(B,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(_n,s,"shadows",o.shadows,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),xe(kn,s,"classificationType",o.classificationType,r,i,n),xe(Number,s,"zIndex",o.zIndex,r,i,n)}function e6e(e,t,n,i){let o=t.tileset;if(!l(o))return;let r=dr(o.interval),s=e.tileset;l(s)||(e.tileset=s=new wx),xe(Boolean,s,"show",o.show,r,i,n),xe(kP.default,s,"uri",o.uri,r,i,n),xe(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function t6e(e,t,n,i){let o=t.wall;if(!l(o))return;let r=dr(o.interval),s=e.wall;l(s)||(e.wall=s=new Pp),xe(Boolean,s,"show",o.show,r,i,n),UP(s,"positions",o.positions,n),ome(s,"minimumHeights",o.minimumHeights,n),ome(s,"maximumHeights",o.maximumHeights,n),xe(Number,s,"granularity",o.granularity,r,i,n),xe(Boolean,s,"fill",o.fill,r,i,n),Wd(s,"material",o.material,r,i,n),xe(Boolean,s,"outline",o.outline,r,i,n),xe(B,s,"outlineColor",o.outlineColor,r,i,n),xe(Number,s,"outlineWidth",o.outlineWidth,r,i,n),xe(_n,s,"shadows",o.shadows,r,i,n),xe(At,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function lme(e,t,n,i,o){let r=e.id;if(l(r)||(r=Bn()),lJ=r,!l(o._version)&&r!=="document")throw new de("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(r);else if(r==="document")D7e(e,o);else{let s=t.getOrCreateEntity(r),a=e.parent;l(a)&&(s.parent=t.getOrCreateEntity(a));for(let c=n.length-1;c>-1;c--)n[c](s,e,t,i)}lJ=void 0}function n6e(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(Be.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=j.secondsDifference(s,r),c=Math.round(a/120);return t=new rh,t.startTime=j.clone(r),t.stopTime=j.clone(s),t.clockRange=Br.LOOP_STOP,t.multiplier=c,t.currentTime=j.clone(r),t.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new rh,t.startTime=Be.MINIMUM_VALUE.clone(),t.stopTime=Be.MAXIMUM_VALUE.clone(),t.currentTime=Be.MINIMUM_VALUE.clone(),t.clockRange=Br.LOOP_STOP,t.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=dr(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=j.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=y(Br[n.range],Br.LOOP_STOP)),l(n.step)&&(t.clockStep=y(mo[n.step],mo.SYSTEM_CLOCK_MULTIPLIER)),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function hme(e,t,n,i){n=y(n,y.EMPTY_OBJECT);let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new Et(s)),e._credit=s,typeof t=="string"||t instanceof Ee){t=Ee.createIfNeeded(t),o=t.fetchJson(),r=y(r,t.clone());let a=e._resourceCredits,c=t.credits;if(l(c)){let d=c.length;for(let u=0;u<d;u++)a.push(c[u])}}return r=Ee.createIfNeeded(r),Dr.setLoading(e,!0),Promise.resolve(o).then(function(a){return i6e(e,a,r,i)}).catch(function(a){return Dr.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function i6e(e,t,n,i){Dr.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new fme,o.removeAll()),bs._processCzml(t,o,n,void 0,e);let r=n6e(e),s=e._documentPacket;return l(s.name)&&e._name!==s.name?(e._name=s.name,r=!0):!l(e._name)&&l(n)&&(e._name=Pb(n.getUrlComponent()),r=!0),Dr.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function fme(){this.name=void 0,this.clock=void 0}function bs(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._clock=void 0,this._documentPacket=new fme,this._version=void 0,this._entityCollection=new Hs(this),this._entityCluster=new Zd,this._credit=void 0,this._resourceCredits=[]}bs.load=function(e,t){return new bs().load(e,t)};Object.defineProperties(bs.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});bs.updaters=[M7e,N7e,k7e,U7e,B7e,O7e,Y7e,H7e,L7e,R7e,z7e,K7e,J7e,j7e,q7e,I7e,$7e,Z7e,e6e,G7e,t6e,E7e,F7e];bs.registerUpdater=function(e){bs.updaters.includes(e)||bs.updaters.push(e)};bs.unregisterUpdater=function(e){if(bs.updaters.includes(e)){let t=bs.updaters.indexOf(e);bs.updaters.splice(t,1)}};bs.prototype.process=function(e,t){return hme(this,e,t,!1)};bs.prototype.load=function(e,t){return hme(this,e,t,!0)};bs.prototype.update=function(e){return!0};bs.processPacketData=xe;bs.processPositionPacketData=mme;bs.processMaterialPacketData=Wd;bs._processCzml=function(e,t,n,i,o){if(i=y(i,bs.updaters),Array.isArray(e))for(let r=0,s=e.length;r<s;++r)lme(e[r],t,i,n,o);else lme(e,t,i,n,o)};var DP=bs;var uqn=T(S(),1);function qc(){this._dataSources=[],this._dataSourceAdded=new be,this._dataSourceRemoved=new be,this._dataSourceMoved=new be}Object.defineProperties(qc.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}});qc.prototype.add=function(e){let t=this,n=this._dataSources;return Promise.resolve(e).then(function(i){return n===t._dataSources&&(t._dataSources.push(i),t._dataSourceAdded.raiseEvent(t,i)),i})};qc.prototype.remove=function(e,t){t=y(t,!1);let n=this._dataSources.indexOf(e);return n!==-1?(this._dataSources.splice(n,1),this._dataSourceRemoved.raiseEvent(this,e),t&&typeof e.destroy=="function"&&e.destroy(),!0):!1};qc.prototype.removeAll=function(e){e=y(e,!1);let t=this._dataSources;for(let n=0,i=t.length;n<i;++n){let o=t[n];this._dataSourceRemoved.raiseEvent(this,o),e&&typeof o.destroy=="function"&&o.destroy()}this._dataSources=[]};qc.prototype.contains=function(e){return this.indexOf(e)!==-1};qc.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};qc.prototype.get=function(e){return this._dataSources[e]};qc.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function Wk(e,t){return e.indexOf(t)}function pme(e,t,n){let i=e._dataSources,o=i.length-1;if(t=W.clamp(t,0,o),n=W.clamp(n,0,o),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e.dataSourceMoved.raiseEvent(r,n,t)}qc.prototype.raise=function(e){let t=Wk(this._dataSources,e);pme(this,t,t+1)};qc.prototype.lower=function(e){let t=Wk(this._dataSources,e);pme(this,t,t-1)};qc.prototype.raiseToTop=function(e){let t=Wk(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))};qc.prototype.lowerToBottom=function(e){let t=Wk(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};qc.prototype.isDestroyed=function(){return!1};qc.prototype.destroy=function(){return this.removeAll(!0),me(this)};var BP=qc;var vui=T(S(),1);var Vqn=T(S(),1);var yqn=T(S(),1);function pa(e){e=y(e,y.EMPTY_OBJECT),this._primitives=[],this._guid=Bn(),this._primitiveAdded=new be,this._primitiveRemoved=new be,this._zIndex=void 0,this.show=y(e.show,!0),this.destroyPrimitives=y(e.destroyPrimitives,!0)}Object.defineProperties(pa.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});pa.prototype.add=function(e,t){let n=l(t),i=e._external=e._external||{},o=i._composites=i._composites||{};return o[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),this._primitiveAdded.raiseEvent(e),e};pa.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};pa.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};pa.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n)delete e[n]._external._composites[this._guid],this.destroyPrimitives&&e[n].destroy(),this._primitiveRemoved.raiseEvent(e[n]);this._primitives=[]};pa.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function Pk(e,t){return e._primitives.indexOf(t)}pa.prototype.raise=function(e){if(l(e)){let t=Pk(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};pa.prototype.raiseToTop=function(e){if(l(e)){let t=Pk(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};pa.prototype.lower=function(e){if(l(e)){let t=Pk(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};pa.prototype.lowerToBottom=function(e){if(l(e)){let t=Pk(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};pa.prototype.get=function(e){return this._primitives[e]};pa.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};pa.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.prePassesUpdate)&&i.prePassesUpdate(e)}};pa.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let o=n[i];l(o.updateForPass)&&o.updateForPass(e,t)}};pa.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.postPassesUpdate)&&i.postPassesUpdate(e)}};pa.prototype.isDestroyed=function(){return!1};pa.prototype.destroy=function(){return this.removeAll(),me(this)};var kl=pa;function _f(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(_f.prototype,{length:{get:function(){return this._length}}});_f.prototype.add=function(e,t){t=y(t,0);let n=this._collections[t];if(!l(n)){n=new kl({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,o=0;for(;o<i.length&&i[o]._zIndex<t;)o++;i.splice(o,0,n)}return n.add(e),this._length++,e._zIndex=t,e};_f.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};_f.prototype.remove=function(e,t){if(this.contains(e)){let n=e._zIndex,i=this._collections[n],o;return t?o=i.remove(e):o=i.removeAndDestroy(e),o&&this._length--,i.length===0&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),o}return!1};_f.prototype.removeAll=function(){let e=this._collectionsArray;for(let t=0;t<e.length;t++){let n=e[t];n.destroyPrimitives=!0,n.destroy()}this._collections={},this._collectionsArray=[],this._length=0};_f.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};_f.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};_f.prototype.isDestroyed=function(){return!1};_f.prototype.destroy=function(){return this.removeAll(),me(this)};var OP=_f;var rci=T(S(),1);var Eqn=T(S(),1);function U1(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Zt}U1.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};U1.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};U1.prototype.update=function(e){let t=this._dynamicUpdaters.values;for(let n=0,i=t.length;n<i;n++)t[n].update(e);return!0};U1.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};U1.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):ft.FAILED};var Q_=U1;var psi=T(S(),1);var Y$n=T(S(),1);var s$n=T(S(),1);var wqn=T(S(),1);var hJ={},vk=new h,bme=new h,gme=new we,yme=new $;function D1(e,t,n,i,o,r,s,a,c,d){let u=e+t;h.multiplyByScalar(i,Math.cos(u),vk),h.multiplyByScalar(n,Math.sin(u),bme),h.add(vk,bme,vk);let m=Math.cos(e);m=m*m;let p=Math.sin(e);p=p*p;let f=r/Math.sqrt(s*m+o*p)/a;return we.fromAxisAngle(vk,f,gme),$.fromQuaternion(gme,yme),$.multiplyByVector(yme,c,d),h.normalize(d,d),h.multiplyByScalar(d,a,d),d}var xme=new h,_me=new h,mJ=new h,o6e=new h;hJ.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,o=t.height,r=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,d=n?c:0;for(let u=0;u<c;u+=3){let m=u+1,p=u+2,g=h.fromArray(e,u,xme);i.scaleToGeodeticSurface(g,g);let f=h.clone(g,_me),x=i.geodeticSurfaceNormal(g,o6e),_=h.multiplyByScalar(x,o,mJ);h.add(g,_,g),n&&(h.multiplyByScalar(x,r,_),h.add(f,_,f),a[u+d]=f.x,a[m+d]=f.y,a[p+d]=f.z),a[u]=g.x,a[m]=g.y,a[p]=g.z}return a};var r6e=new h,s6e=new h,a6e=new h;hJ.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,o=e.semiMajorAxis,r=e.rotation,s=e.center,a=e.granularity*8,c=i*i,d=o*o,u=o*i,m=h.magnitude(s),p=h.normalize(s,r6e),g=h.cross(h.UNIT_Z,s,s6e);g=h.normalize(g,g);let f=h.cross(p,g,a6e),x=1+Math.ceil(W.PI_OVER_TWO/a),_=W.PI_OVER_TWO/(x-1),C=W.PI_OVER_TWO-x*_;C<0&&(x-=Math.ceil(Math.abs(C)/_));let V=2*(x*(x+2)),L=t?new Array(V*3):void 0,Z=0,G=xme,I=_me,v=x*4*3,P=v-1,w=0,F=n?new Array(v):void 0,b,R,E,X,A;for(C=W.PI_OVER_TWO,G=D1(C,r,f,g,c,u,d,m,p,G),t&&(L[Z++]=G.x,L[Z++]=G.y,L[Z++]=G.z),n&&(F[P--]=G.z,F[P--]=G.y,F[P--]=G.x),C=W.PI_OVER_TWO-_,b=1;b<x+1;++b){if(G=D1(C,r,f,g,c,u,d,m,p,G),I=D1(Math.PI-C,r,f,g,c,u,d,m,p,I),t){for(L[Z++]=G.x,L[Z++]=G.y,L[Z++]=G.z,E=2*b+2,R=1;R<E-1;++R)X=R/(E-1),A=h.lerp(G,I,X,mJ),L[Z++]=A.x,L[Z++]=A.y,L[Z++]=A.z;L[Z++]=I.x,L[Z++]=I.y,L[Z++]=I.z}n&&(F[P--]=G.z,F[P--]=G.y,F[P--]=G.x,F[w++]=I.x,F[w++]=I.y,F[w++]=I.z),C=W.PI_OVER_TWO-(b+1)*_}for(b=x;b>1;--b){if(C=W.PI_OVER_TWO-(b-1)*_,G=D1(-C,r,f,g,c,u,d,m,p,G),I=D1(C+Math.PI,r,f,g,c,u,d,m,p,I),t){for(L[Z++]=G.x,L[Z++]=G.y,L[Z++]=G.z,E=2*(b-1)+2,R=1;R<E-1;++R)X=R/(E-1),A=h.lerp(G,I,X,mJ),L[Z++]=A.x,L[Z++]=A.y,L[Z++]=A.z;L[Z++]=I.x,L[Z++]=I.y,L[Z++]=I.z}n&&(F[P--]=G.z,F[P--]=G.y,F[P--]=G.x,F[w++]=I.x,F[w++]=I.y,F[w++]=I.z)}C=W.PI_OVER_TWO,G=D1(-C,r,f,g,c,u,d,m,p,G);let N={};return t&&(L[Z++]=G.x,L[Z++]=G.y,L[Z++]=G.z,N.positions=L,N.numPts=x),n&&(F[P--]=G.z,F[P--]=G.y,F[P--]=G.x,N.outerPositions=F),N};var Ul=hJ;var B1=new h,fJ=new h,pJ=new h,Tme=new h,Zs=new D,Sme=new $,c6e=new $,bJ=new we,Cme=new h,Vme=new h,Lme=new h,Ak=new he,Rme=new h,Zme=new D,Gme=new D;function Eme(e,t,n){let i=t.vertexFormat,o=t.center,r=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,d=n?e.length/3*2:e.length/3,u=t.shadowVolume,m=i.st?new Float32Array(d*2):void 0,p=i.normal?new Float32Array(d*3):void 0,g=i.tangent?new Float32Array(d*3):void 0,f=i.bitangent?new Float32Array(d*3):void 0,x=u?new Float32Array(d*3):void 0,_=0,C=Cme,V=Vme,L=Lme,Z=new Ri(a),G=Z.project(a.cartesianToCartographic(o,Ak),Rme),I=a.scaleToGeodeticSurface(o,B1);a.geodeticSurfaceNormal(I,I);let v=Sme,P=c6e;if(c!==0){let A=we.fromAxisAngle(I,c,bJ);v=$.fromQuaternion(A,v),A=we.fromAxisAngle(I,-c,bJ),P=$.fromQuaternion(A,P)}else v=$.clone($.IDENTITY,v),P=$.clone($.IDENTITY,P);let w=D.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Zme),F=D.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Gme),b=e.length,R=n?b:0,E=R/3*2;for(let A=0;A<b;A+=3){let N=A+1,O=A+2,U=h.fromArray(e,A,B1);if(i.st){let Y=$.multiplyByVector(v,U,fJ),k=Z.project(a.cartesianToCartographic(Y,Ak),pJ);h.subtract(k,G,k),Zs.x=(k.x+r)/(2*r),Zs.y=(k.y+s)/(2*s),w.x=Math.min(Zs.x,w.x),w.y=Math.min(Zs.y,w.y),F.x=Math.max(Zs.x,F.x),F.y=Math.max(Zs.y,F.y),n&&(m[_+E]=Zs.x,m[_+1+E]=Zs.y),m[_++]=Zs.x,m[_++]=Zs.y}(i.normal||i.tangent||i.bitangent||u)&&(C=a.geodeticSurfaceNormal(U,C),u&&(x[A+R]=-C.x,x[N+R]=-C.y,x[O+R]=-C.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(V=h.normalize(h.cross(h.UNIT_Z,C,V),V),$.multiplyByVector(P,V,V)),i.normal&&(p[A]=C.x,p[N]=C.y,p[O]=C.z,n&&(p[A+R]=-C.x,p[N+R]=-C.y,p[O+R]=-C.z)),i.tangent&&(g[A]=V.x,g[N]=V.y,g[O]=V.z,n&&(g[A+R]=-V.x,g[N+R]=-V.y,g[O+R]=-V.z)),i.bitangent&&(L=h.normalize(h.cross(C,V,L),L),f[A]=L.x,f[N]=L.y,f[O]=L.z,n&&(f[A+R]=L.x,f[N+R]=L.y,f[O+R]=L.z))))}if(i.st){b=m.length;for(let A=0;A<b;A+=2)m[A]=(m[A]-w.x)/(F.x-w.x),m[A+1]=(m[A+1]-w.y)/(F.y-w.y)}let X=new mn;if(i.position){let A=Ul.raisePositionsToHeight(e,t,n);X.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:A})}if(i.st&&(X.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:m})),i.normal&&(X.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(X.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(X.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),u&&(X.extrudeDirection=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:x})),n&&l(t.offsetAttribute)){let A=new Uint8Array(d);if(t.offsetAttribute===cn.TOP)A=A.fill(1,0,d/2);else{let N=t.offsetAttribute===cn.NONE?0:1;A=A.fill(N)}X.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}return X}function Ime(e){let t=new Array(12*(e*(e+1))-6),n=0,i,o,r,s,a;for(i=0,r=1,s=0;s<3;s++)t[n++]=r++,t[n++]=i,t[n++]=r;for(s=2;s<e+1;++s){for(r=s*(s+1)-1,i=(s-1)*s-1,t[n++]=r++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=r++,t[n++]=i,t[n++]=r}for(o=e*2,++r,++i,s=0;s<o-1;++s)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;for(t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i++,t[n++]=i,++i,s=e-1;s>1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=i++,t[n++]=i++,t[n++]=r++}for(s=0;s<3;s++)t[n++]=i++,t[n++]=i,t[n++]=r;return t}var j_=new h;function l6e(e){let t=e.center;j_=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,j_),e.height,j_),j_=h.add(t,j_,j_);let n=new ce(j_,e.semiMajorAxis),i=Ul.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=Eme(o,e,!1),a=Ime(r);return a=Ae.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function d6e(e,t){let n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,r=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,d=t.stRotation,u=e.length/3*2,m=new Float64Array(u*3),p=n.st?new Float32Array(u*2):void 0,g=n.normal?new Float32Array(u*3):void 0,f=n.tangent?new Float32Array(u*3):void 0,x=n.bitangent?new Float32Array(u*3):void 0,_=t.shadowVolume,C=_?new Float32Array(u*3):void 0,V=0,L=Cme,Z=Vme,G=Lme,I=new Ri(s),v=I.project(s.cartesianToCartographic(i,Ak),Rme),P=s.scaleToGeodeticSurface(i,B1);s.geodeticSurfaceNormal(P,P);let w=we.fromAxisAngle(P,d,bJ),F=$.fromQuaternion(w,Sme),b=D.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Zme),R=D.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Gme),E=e.length,X=E/3*2;for(let N=0;N<E;N+=3){let O=N+1,U=N+2,Y=h.fromArray(e,N,B1),k;if(n.st){let J=$.multiplyByVector(F,Y,fJ),te=I.project(s.cartesianToCartographic(J,Ak),pJ);h.subtract(te,v,te),Zs.x=(te.x+o)/(2*o),Zs.y=(te.y+r)/(2*r),b.x=Math.min(Zs.x,b.x),b.y=Math.min(Zs.y,b.y),R.x=Math.max(Zs.x,R.x),R.y=Math.max(Zs.y,R.y),p[V+X]=Zs.x,p[V+1+X]=Zs.y,p[V++]=Zs.x,p[V++]=Zs.y}Y=s.scaleToGeodeticSurface(Y,Y),k=h.clone(Y,fJ),L=s.geodeticSurfaceNormal(Y,L),_&&(C[N+E]=-L.x,C[O+E]=-L.y,C[U+E]=-L.z);let H=h.multiplyByScalar(L,a,Tme);if(Y=h.add(Y,H,Y),H=h.multiplyByScalar(L,c,H),k=h.add(k,H,k),n.position&&(m[N+E]=k.x,m[O+E]=k.y,m[U+E]=k.z,m[N]=Y.x,m[O]=Y.y,m[U]=Y.z),n.normal||n.tangent||n.bitangent){G=h.clone(L,G);let J=h.fromArray(e,(N+3)%E,Tme);h.subtract(J,Y,J);let te=h.subtract(k,Y,pJ);L=h.normalize(h.cross(te,J,L),L),n.normal&&(g[N]=L.x,g[O]=L.y,g[U]=L.z,g[N+E]=L.x,g[O+E]=L.y,g[U+E]=L.z),n.tangent&&(Z=h.normalize(h.cross(G,L,Z),Z),f[N]=Z.x,f[O]=Z.y,f[U]=Z.z,f[N+E]=Z.x,f[N+1+E]=Z.y,f[N+2+E]=Z.z),n.bitangent&&(x[N]=G.x,x[O]=G.y,x[U]=G.z,x[N+E]=G.x,x[O+E]=G.y,x[U+E]=G.z)}}if(n.st){E=p.length;for(let N=0;N<E;N+=2)p[N]=(p[N]-b.x)/(R.x-b.x),p[N+1]=(p[N+1]-b.y)/(R.y-b.y)}let A=new mn;if(n.position&&(A.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:m})),n.st&&(A.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(A.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(A.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),n.bitangent&&(A.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:x})),_&&(A.extrudeDirection=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:C})),l(t.offsetAttribute)){let N=new Uint8Array(u);if(t.offsetAttribute===cn.TOP)N=N.fill(1,0,u/2);else{let O=t.offsetAttribute===cn.NONE?0:1;N=N.fill(O)}A.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}return A}function u6e(e){let t=e.length/3,n=Ae.createTypedArray(t,t*6),i=0;for(let o=0;o<t;o++){let r=o,s=o+t,a=(r+1)%t,c=a+t;n[i++]=r,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=c}return n}var wk=new ce,Fk=new ce;function m6e(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,B1),e.height,B1);wk.center=h.add(t,o,wk.center),wk.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),Fk.center=h.add(t,o,Fk.center),Fk.radius=i;let r=Ul.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,c=r.outerPositions,d=ce.union(wk,Fk),u=Eme(s,e,!0),m=Ime(a),p=m.length;m.length=p*2;let g=s.length/3;for(let Z=0;Z<p;Z+=3)m[Z+p]=m[Z+2]+g,m[Z+1+p]=m[Z+1]+g,m[Z+2+p]=m[Z]+g;let f=Ae.createTypedArray(g*2/3,m),x=new ht({attributes:u,indices:f,primitiveType:Fe.TRIANGLES}),_=d6e(c,e);m=u6e(c);let C=Ae.createTypedArray(c.length*2/3,m),V=new ht({attributes:_,indices:C,primitiveType:Fe.TRIANGLES}),L=Fn.combineInstances([new Gt({geometry:x}),new Gt({geometry:V})]);return{boundingSphere:d,attributes:L[0].attributes,indices:L[0].indices}}function Xme(e,t,n,i,o,r,s){let c=Ul.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:o},!1,!0).outerPositions,d=c.length/3,u=new Array(d);for(let p=0;p<d;++p)u[p]=h.fromArray(c,p*3);let m=ae.fromCartesianArray(u,r,s);return m.width>W.PI&&(m.north=m.north>0?W.PI_OVER_TWO-W.EPSILON7:m.north,m.south=m.south<0?W.EPSILON7-W.PI_OVER_TWO:m.south,m.east=W.PI,m.west=-W.PI),m}function Sf(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,ne.default),i=e.semiMajorAxis,o=e.semiMinorAxis,r=y(e.granularity,W.RADIANS_PER_DEGREE),s=y(e.vertexFormat,We.DEFAULT),a=y(e.height,0),c=y(e.extrudedHeight,a);this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ne.clone(n),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._height=Math.max(c,a),this._granularity=r,this._vertexFormat=We.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Sf.packedLength=h.packedLength+ne.packedLength+We.packedLength+9;Sf.pack=function(e,t,n){return n=y(n,0),h.pack(e._center,t,n),n+=h.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var Wme=new h,Pme=new ne,vme=new We,Tf={center:Wme,ellipsoid:Pme,vertexFormat:vme,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Sf.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,Wme);t+=h.packedLength;let o=ne.unpack(e,t,Pme);t+=ne.packedLength;let r=We.unpack(e,t,vme);t+=We.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++],p=e[t++],g=e[t++]===1,f=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=We.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=d,n._height=u,n._granularity=m,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=f===-1?void 0:f,n):(Tf.height=u,Tf.extrudedHeight=p,Tf.granularity=m,Tf.stRotation=d,Tf.rotation=c,Tf.semiMajorAxis=s,Tf.semiMinorAxis=a,Tf.shadowVolume=g,Tf.offsetAttribute=f===-1?void 0:f,new Sf(Tf))};Sf.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.center,i=y(e.ellipsoid,ne.default),o=e.semiMajorAxis,r=e.semiMinorAxis,s=y(e.granularity,W.RADIANS_PER_DEGREE),a=y(e.rotation,0);return Xme(n,o,r,a,s,i,t)};Sf.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!W.equalsEpsilon(t,n,0,W.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},r;if(i)o.extrudedHeight=n,o.shadowVolume=e._shadowVolume,o.offsetAttribute=e._offsetAttribute,r=m6e(o);else if(r=l6e(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===cn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new ht({attributes:r.attributes,indices:r.indices,primitiveType:Fe.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};Sf.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Sf({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:We.POSITION_ONLY,shadowVolume:!0})};function h6e(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Ul.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,o=i.length/3,r=new Array(o);for(let c=0;c<o;++c)r[c]=h.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return ht._textureCoordinateRotationPoints(r,t,s,a)}Object.defineProperties(Sf.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=Xme(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=h6e(this)),this._textureCoordinateRotationPoints}}});var $c=Sf;var S$n=T(S(),1);var wme=new h,q_=new h;function f6e(e){let t=e.center;q_=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,q_),e.height,q_),q_=h.add(t,q_,q_);let n=new ce(q_,e.semiMajorAxis),i=Ul.computeEllipsePositions(e,!1,!0).outerPositions,o=new mn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:Ul.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,s=Ae.createTypedArray(r,r*2),a=0;for(let c=0;c<r;++c)s[a++]=c,s[a++]=(c+1)%r;return{boundingSphere:n,attributes:o,indices:s}}var Mk=new ce,Nk=new ce;function p6e(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,wme),e.height,wme);Mk.center=h.add(t,o,Mk.center),Mk.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),Nk.center=h.add(t,o,Nk.center),Nk.radius=i;let r=Ul.computeEllipsePositions(e,!1,!0).outerPositions,s=new mn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:Ul.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=ce.union(Mk,Nk),c=r.length/3;if(l(e.offsetAttribute)){let f=new Uint8Array(c);if(e.offsetAttribute===cn.TOP)f=f.fill(1,0,c/2);else{let x=e.offsetAttribute===cn.NONE?0:1;f=f.fill(x)}s.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}let d=y(e.numberOfVerticalLines,16);d=W.clamp(d,0,c/2);let u=Ae.createTypedArray(c,c*2+d*2);c/=2;let m=0,p;for(p=0;p<c;++p)u[m++]=p,u[m++]=(p+1)%c,u[m++]=p+c,u[m++]=(p+1)%c+c;let g;if(d>0){let f=Math.min(d,c);g=Math.round(c/f);let x=Math.min(g*d,c);for(p=0;p<x;p+=g)u[m++]=p,u[m++]=p+c}return{boundingSphere:a,attributes:s,indices:u}}function O1(e){e=y(e,y.EMPTY_OBJECT);let t=e.center,n=y(e.ellipsoid,ne.default),i=e.semiMajorAxis,o=e.semiMinorAxis,r=y(e.granularity,W.RADIANS_PER_DEGREE),s=y(e.height,0),a=y(e.extrudedHeight,s);this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ne.clone(n),this._rotation=y(e.rotation,0),this._height=Math.max(a,s),this._granularity=r,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(y(e.numberOfVerticalLines,16),0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}O1.packedLength=h.packedLength+ne.packedLength+8;O1.pack=function(e,t,n){return n=y(n,0),h.pack(e._center,t,n),n+=h.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=y(e._offsetAttribute,-1),t};var Fme=new h,Ame=new ne,kb={center:Fme,ellipsoid:Ame,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};O1.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,Fme);t+=h.packedLength;let o=ne.unpack(e,t,Ame);t+=ne.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++],p=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=ne.clone(o,n._ellipsoid),n._semiMajorAxis=r,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=d,n._extrudedHeight=u,n._numberOfVerticalLines=m,n._offsetAttribute=p===-1?void 0:p,n):(kb.height=c,kb.extrudedHeight=u,kb.granularity=d,kb.rotation=a,kb.semiMajorAxis=r,kb.semiMinorAxis=s,kb.numberOfVerticalLines=m,kb.offsetAttribute=p===-1?void 0:p,new O1(kb))};O1.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!W.equalsEpsilon(t,n,0,W.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(i)o.extrudedHeight=n,o.offsetAttribute=e._offsetAttribute,r=p6e(o);else if(r=f6e(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===cn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new ht({attributes:r.attributes,indices:r.indices,primitiveType:Fe.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var Pd=O1;var Mme=new B,Nme=h.ZERO,kme=new h,Ume=new ae;function b6e(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function ch(e,t){Yn.call(this,{entity:e,scene:t,geometryOptions:new b6e(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(ch.prototype=Object.create(Yn.prototype),ch.prototype.constructor=ch);ch.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Yt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Mme)),l(o)||(o=B.WHITE),i.color=Kt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Qi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,Nme,kme))),new Gt({id:t,geometry:new $c(this._options),attributes:i})};ch.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,Mme),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Qi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,Nme,kme))),new Gt({id:t,geometry:new Pd(this._options),attributes:r})};ch.prototype._computeCenter=function(e,t){return K.getValueOrUndefined(this._entity.position,e,t)};ch.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||ii.prototype._isHidden.call(this,e,t)};ch.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!K.isConstant(t.rotation)||!K.isConstant(t.height)||!K.isConstant(t.extrudedHeight)||!K.isConstant(t.granularity)||!K.isConstant(t.stRotation)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.numberOfVerticalLines)||!K.isConstant(t.zIndex)||this._onTerrain&&!K.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Yt)};ch.prototype._setStaticOptions=function(e,t){let n=K.getValueOrUndefined(t.height,Be.MINIMUM_VALUE),i=K.getValueOrDefault(t.heightReference,Be.MINIMUM_VALUE,Qe.NONE),o=K.getValueOrUndefined(t.extrudedHeight,Be.MINIMUM_VALUE),r=K.getValueOrDefault(t.extrudedHeightReference,Be.MINIMUM_VALUE,Qe.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Yt?dn.VERTEX_FORMAT:oo.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(Be.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(Be.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(Be.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=K.getValueOrUndefined(t.rotation,Be.MINIMUM_VALUE),s.granularity=K.getValueOrUndefined(t.granularity,Be.MINIMUM_VALUE),s.stRotation=K.getValueOrUndefined(t.stRotation,Be.MINIMUM_VALUE),s.numberOfVerticalLines=K.getValueOrUndefined(t.numberOfVerticalLines,Be.MINIMUM_VALUE),s.offsetAttribute=Yn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Yn.getGeometryHeight(n,i),o=Yn.getGeometryExtrudedHeight(o,r),o===Yn.CLAMP_TO_GROUND&&(o=li.getMinimumMaximumHeights($c.computeRectangle(s,Ume)).minimumTerrainHeight),s.extrudedHeight=o};ch.DynamicGeometryUpdater=Y1;function Y1(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(Y1.prototype=Object.create(ni.prototype),Y1.prototype.constructor=Y1);Y1.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||ni.prototype._isHidden.call(this,e,t,n)};Y1.prototype._setOptions=function(e,t,n){let i=this._options,o=K.getValueOrUndefined(t.height,n),r=K.getValueOrDefault(t.heightReference,n,Qe.NONE),s=K.getValueOrUndefined(t.extrudedHeight,n),a=K.getValueOrDefault(t.extrudedHeightReference,n,Qe.NONE);l(s)&&!l(o)&&(o=0),i.center=K.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=K.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=K.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=K.getValueOrUndefined(t.rotation,n),i.granularity=K.getValueOrUndefined(t.granularity,n),i.stRotation=K.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=K.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=Yn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Yn.getGeometryHeight(o,r),s=Yn.getGeometryExtrudedHeight(s,a),s===Yn.CLAMP_TO_GROUND&&(s=li.getMinimumMaximumHeights($c.computeRectangle(i,Ume)).minimumTerrainHeight),i.extrudedHeight=s};var YP=ch;var Fei=T(S(),1);var cei=T(S(),1);var g6e=new h,y6e=new h,x6e=new h,_6e=new h,T6e=new h,S6e=new h(1,1,1),Dme=Math.cos,Bme=Math.sin;function Ub(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.radii,S6e),n=y(e.innerRadii,t),i=y(e.minimumClock,0),o=y(e.maximumClock,W.TWO_PI),r=y(e.minimumCone,0),s=y(e.maximumCone,W.PI),a=Math.round(y(e.stackPartitions,64)),c=Math.round(y(e.slicePartitions,64)),d=y(e.vertexFormat,We.DEFAULT);this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=We.clone(d),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}Ub.packedLength=2*h.packedLength+We.packedLength+7;Ub.pack=function(e,t,n){return n=y(n,0),h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n]=y(e._offsetAttribute,-1),t};var Ome=new h,Yme=new h,Hme=new We,Yg={radii:Ome,innerRadii:Yme,vertexFormat:Hme,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};Ub.unpack=function(e,t,n){t=y(t,0);let i=h.unpack(e,t,Ome);t+=h.packedLength;let o=h.unpack(e,t,Yme);t+=h.packedLength;let r=We.unpack(e,t,Hme);t+=We.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(o,n._innerRadii),n._vertexFormat=We.clone(r,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=d,n._stackPartitions=u,n._slicePartitions=m,n._offsetAttribute=p===-1?void 0:p,n):(Yg.minimumClock=s,Yg.maximumClock=a,Yg.minimumCone=c,Yg.maximumCone=d,Yg.stackPartitions=u,Yg.slicePartitions=m,Yg.offsetAttribute=p===-1?void 0:p,new Ub(Yg))};Ub.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,d=e._stackPartitions+1;c=Math.round(c*Math.abs(o-i)/W.TWO_PI),d=Math.round(d*Math.abs(s-r)/W.PI),c<2&&(c=2),d<2&&(d=2);let u,m,p=0,g=[r],f=[i];for(u=0;u<d;u++)g.push(r+u*(s-r)/(d-1));for(g.push(s),m=0;m<c;m++)f.push(i+m*(o-i)/(c-1));f.push(o);let x=g.length,_=f.length,C=0,V=1,L=n.x!==t.x||n.y!==t.y||n.z!==t.z,Z=!1,G=!1,I=!1;L&&(V=2,r>0&&(Z=!0,C+=c-1),s<Math.PI&&(G=!0,C+=c-1),(o-i)%W.TWO_PI?(I=!0,C+=(d-1)*2+1):C+=1);let v=_*x*V,P=new Float64Array(v*3),w=new Array(v).fill(!1),F=new Array(v).fill(!1),b=c*d*V,R=6*(b+C+1-(c+d)*V),E=Ae.createTypedArray(b,R),X=a.normal?new Float32Array(v*3):void 0,A=a.tangent?new Float32Array(v*3):void 0,N=a.bitangent?new Float32Array(v*3):void 0,O=a.st?new Float32Array(v*2):void 0,U=new Array(x),Y=new Array(x);for(u=0;u<x;u++)U[u]=Bme(g[u]),Y[u]=Dme(g[u]);let k=new Array(_),H=new Array(_);for(m=0;m<_;m++)H[m]=Dme(f[m]),k[m]=Bme(f[m]);for(u=0;u<x;u++)for(m=0;m<_;m++)P[p++]=t.x*U[u]*H[m],P[p++]=t.y*U[u]*k[m],P[p++]=t.z*Y[u];let J=v/2;if(L)for(u=0;u<x;u++)for(m=0;m<_;m++)P[p++]=n.x*U[u]*H[m],P[p++]=n.y*U[u]*k[m],P[p++]=n.z*Y[u],w[J]=!0,u>0&&u!==x-1&&m!==0&&m!==_-1&&(F[J]=!0),J++;p=0;let te,z;for(u=1;u<x-2;u++)for(te=u*_,z=(u+1)*_,m=1;m<_-2;m++)E[p++]=z+m,E[p++]=z+m+1,E[p++]=te+m+1,E[p++]=z+m,E[p++]=te+m+1,E[p++]=te+m;if(L){let at=x*_;for(u=1;u<x-2;u++)for(te=at+u*_,z=at+(u+1)*_,m=1;m<_-2;m++)E[p++]=z+m,E[p++]=te+m,E[p++]=te+m+1,E[p++]=z+m,E[p++]=te+m+1,E[p++]=z+m+1}let q,ee;if(L){if(Z)for(ee=x*_,u=1;u<_-2;u++)E[p++]=u,E[p++]=u+1,E[p++]=ee+u+1,E[p++]=u,E[p++]=ee+u+1,E[p++]=ee+u;if(G)for(q=x*_-_,ee=x*_*V-_,u=1;u<_-2;u++)E[p++]=q+u+1,E[p++]=q+u,E[p++]=ee+u,E[p++]=q+u+1,E[p++]=ee+u,E[p++]=ee+u+1}if(I){for(u=1;u<x-2;u++)ee=_*x+_*u,q=_*u,E[p++]=ee,E[p++]=q+_,E[p++]=q,E[p++]=ee,E[p++]=ee+_,E[p++]=q+_;for(u=1;u<x-2;u++)ee=_*x+_*(u+1)-1,q=_*(u+1)-1,E[p++]=q+_,E[p++]=ee,E[p++]=q,E[p++]=q+_,E[p++]=ee+_,E[p++]=ee}let fe=new mn;a.position&&(fe.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:P}));let _e=0,le=0,ye=0,Te=0,Xe=v/2,Le,ke=ne.fromCartesian3(t),Oe=ne.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(u=0;u<v;u++){Le=w[u]?Oe:ke;let at=h.fromArray(P,u*3,g6e),Mt=Le.geodeticSurfaceNormal(at,y6e);if(F[u]&&h.negate(Mt,Mt),a.st){let Lt=D.negate(Mt,T6e);O[_e++]=Math.atan2(Lt.y,Lt.x)/W.TWO_PI+.5,O[_e++]=Math.asin(Mt.z)/Math.PI+.5}if(a.normal&&(X[le++]=Mt.x,X[le++]=Mt.y,X[le++]=Mt.z),a.tangent||a.bitangent){let Lt=x6e,Ie=0,je;if(w[u]&&(Ie=Xe),!Z&&u>=Ie&&u<Ie+_*2?je=h.UNIT_X:je=h.UNIT_Z,h.cross(je,Mt,Lt),h.normalize(Lt,Lt),a.tangent&&(A[ye++]=Lt.x,A[ye++]=Lt.y,A[ye++]=Lt.z),a.bitangent){let et=h.cross(Mt,Lt,_6e);h.normalize(et,et),N[Te++]=et.x,N[Te++]=et.y,N[Te++]=et.z}}}a.st&&(fe.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:O})),a.normal&&(fe.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:X})),a.tangent&&(fe.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:A})),a.bitangent&&(fe.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:N}))}if(l(e._offsetAttribute)){let at=P.length,Mt=e._offsetAttribute===cn.NONE?0:1,Lt=new Uint8Array(at/3).fill(Mt);fe.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:Lt})}return new ht({attributes:fe,indices:E,primitiveType:Fe.TRIANGLES,boundingSphere:ce.fromEllipsoid(ke),offsetAttribute:e._offsetAttribute})};var gJ;Ub.getUnitEllipsoid=function(){return l(gJ)||(gJ=Ub.createGeometry(new Ub({radii:new h(1,1,1),vertexFormat:We.POSITION_ONLY}))),gJ};var zs=Ub;var C6e=new Yt(B.WHITE),yJ=h.ZERO,xJ=new h,V6e=new h,L6e=new h,_J=new B,R6e=new h(1,1,1);function Z6e(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function vd(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new Z6e(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(vd.prototype=Object.create(ii.prototype),vd.prototype.constructor=vd);Object.defineProperties(vd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});vd.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r,s=new xn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=Nn.fromDistanceDisplayCondition(a),d={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Yt){let u;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(u=this._materialProperty.color.getValue(e,_J)),l(u)||(u=B.WHITE),r=Kt.fromColor(u),d.color=r}return l(this._options.offsetAttribute)&&(d.offset=Qi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,yJ,xJ))),new Gt({id:i,geometry:new zs(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:d})};vd.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r=K.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,_J),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new xn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(r),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=Qi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,yJ,xJ))),new Gt({id:i,geometry:new Vd(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};vd.prototype._computeCenter=function(e,t){return K.getValueOrUndefined(this._entity.position,e,t)};vd.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||ii.prototype._isHidden.call(this,e,t)};vd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!K.isConstant(e.orientation)||!t.radii.isConstant||!K.isConstant(t.innerRadii)||!K.isConstant(t.stackPartitions)||!K.isConstant(t.slicePartitions)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.minimumClock)||!K.isConstant(t.maximumClock)||!K.isConstant(t.minimumCone)||!K.isConstant(t.maximumCone)||!K.isConstant(t.subdivisions)};vd.prototype._setStaticOptions=function(e,t){let n=K.getValueOrDefault(t.heightReference,Be.MINIMUM_VALUE,Qe.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Yt?dn.VERTEX_FORMAT:oo.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(Be.MINIMUM_VALUE,i.radii),i.innerRadii=K.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=K.getValueOrUndefined(t.minimumClock,Be.MINIMUM_VALUE),i.maximumClock=K.getValueOrUndefined(t.maximumClock,Be.MINIMUM_VALUE),i.minimumCone=K.getValueOrUndefined(t.minimumCone,Be.MINIMUM_VALUE),i.maximumCone=K.getValueOrUndefined(t.maximumCone,Be.MINIMUM_VALUE),i.stackPartitions=K.getValueOrUndefined(t.stackPartitions,Be.MINIMUM_VALUE),i.slicePartitions=K.getValueOrUndefined(t.slicePartitions,Be.MINIMUM_VALUE),i.subdivisions=K.getValueOrUndefined(t.subdivisions,Be.MINIMUM_VALUE),i.offsetAttribute=n!==Qe.NONE?cn.ALL:void 0};vd.prototype._onEntityPropertyChanged=vp;vd.DynamicGeometryUpdater=HP;function HP(e,t,n){ni.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new M,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new h,this._material={}}l(Object.create)&&(HP.prototype=Object.create(ni.prototype),HP.prototype.constructor=HP);HP.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!K.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=K.getValueOrUndefined(n.radii,e,V6e),o=l(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.ellipsoid,this._modelMatrix):void 0;if(!l(o)||!l(i)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let r=K.getValueOrDefault(n.fill,e,!0),s=K.getValueOrDefault(n.outline,e,!1),a=K.getValueOrClonedDefault(n.outlineColor,e,B.BLACK,_J),c=Qo.getValue(e,y(n.material,C6e),this._material),d=K.getValueOrUndefined(n.innerRadii,e,L6e),u=K.getValueOrUndefined(n.minimumClock,e),m=K.getValueOrUndefined(n.maximumClock,e),p=K.getValueOrUndefined(n.minimumCone,e),g=K.getValueOrUndefined(n.maximumCone,e),f=K.getValueOrUndefined(n.stackPartitions,e),x=K.getValueOrUndefined(n.slicePartitions,e),_=K.getValueOrUndefined(n.subdivisions,e),C=K.getValueOrDefault(n.outlineWidth,e,1),V=K.getValueOrDefault(n.heightReference,e,Qe.NONE),L=V!==Qe.NONE?cn.ALL:void 0,Z=this._scene.mode,G=Z===oe.SCENE3D&&V===Qe.NONE,I=this._options,v=this._geometryUpdater.shadowsProperty.getValue(e),w=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),F=K.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,yJ,xJ);if(!G||this._lastSceneMode!==Z||!l(this._primitive)||I.stackPartitions!==f||I.slicePartitions!==x||l(d)&&!h.equals(I.innerRadii!==d)||I.minimumClock!==u||I.maximumClock!==m||I.minimumCone!==p||I.maximumCone!==g||I.subdivisions!==_||this._lastOutlineWidth!==C||I.offsetAttribute!==L){let R=this._primitives;R.removeAndDestroy(this._primitive),R.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=Z,this._lastOutlineWidth=C,I.stackPartitions=f,I.slicePartitions=x,I.subdivisions=_,I.offsetAttribute=L,I.radii=h.clone(G?R6e:i,I.radii),l(d)?G?I.innerRadii=h.fromElements(d.x/i.x,d.y/i.y,d.z/i.z,I.innerRadii):I.innerRadii=h.clone(d,I.innerRadii):I.innerRadii=void 0,I.minimumClock=u,I.maximumClock=m,I.minimumCone=p,I.maximumCone=g;let E=new oo({material:c,translucent:c.isTranslucent(),closed:!0});I.vertexFormat=E.vertexFormat;let X=this._geometryUpdater.createFillGeometryInstance(e,G,this._modelMatrix);this._primitive=R.add(new In({geometryInstances:X,appearance:E,asynchronous:!1,shadows:v}));let A=this._geometryUpdater.createOutlineGeometryInstance(e,G,this._modelMatrix);this._outlinePrimitive=R.add(new In({geometryInstances:A,appearance:new dn({flat:!0,translucent:A.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(C)}}),asynchronous:!1,shadows:v})),this._lastShow=r,this._lastOutlineShow=s,this._lastOutlineColor=B.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=w,this._lastOffset=h.clone(F,this._lastOffset)}else if(this._primitive.ready){let R=this._primitive,E=this._outlinePrimitive;R.show=!0,E.show=!0,R.appearance.material=c;let X=this._attributes;l(X)||(X=R.getGeometryInstanceAttributes(t),this._attributes=X),r!==this._lastShow&&(X.show=xn.toValue(r,X.show),this._lastShow=r);let A=this._outlineAttributes;l(A)||(A=E.getGeometryInstanceAttributes(t),this._outlineAttributes=A),s!==this._lastOutlineShow&&(A.show=xn.toValue(s,A.show),this._lastOutlineShow=s),B.equals(a,this._lastOutlineColor)||(A.color=Kt.toValue(a,A.color),B.clone(a,this._lastOutlineColor)),At.equals(w,this._lastDistanceDisplayCondition)||(X.distanceDisplayCondition=Nn.toValue(w,X.distanceDisplayCondition),A.distanceDisplayCondition=Nn.toValue(w,A.distanceDisplayCondition),At.clone(w,this._lastDistanceDisplayCondition)),h.equals(F,this._lastOffset)||(X.offset=Qi.toValue(F,X.offset),A.offset=Qi.toValue(F,X.offset),h.clone(F,this._lastOffset))}G&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=M.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var zP=vd;var Lti=T(S(),1);var Kei=T(S(),1);function H1(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.vertexFormat,We.DEFAULT);this._vertexFormat=t,this._workerName="createPlaneGeometry"}H1.packedLength=We.packedLength;H1.pack=function(e,t,n){return n=y(n,0),We.pack(e._vertexFormat,t,n),t};var zme=new We,G6e={vertexFormat:zme};H1.unpack=function(e,t,n){t=y(t,0);let i=We.unpack(e,t,zme);return l(n)?(n._vertexFormat=We.clone(i,n._vertexFormat),n):new H1(G6e)};var kk=new h(-.5,-.5,0),Uk=new h(.5,.5,0);H1.createGeometry=function(e){let t=e._vertexFormat,n=new mn,i,o;if(t.position){if(o=new Float64Array(4*3),o[0]=kk.x,o[1]=kk.y,o[2]=0,o[3]=Uk.x,o[4]=kk.y,o[5]=0,o[6]=Uk.x,o[7]=Uk.y,o[8]=0,o[9]=kk.x,o[10]=Uk.y,o[11]=0,n.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:o}),t.normal){let r=new Float32Array(12);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=1,r[9]=0,r[10]=0,r[11]=1,n.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})}if(t.st){let r=new Float32Array(8);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=1,r[5]=1,r[6]=0,r[7]=1,n.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:r})}if(t.tangent){let r=new Float32Array(12);r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r[6]=1,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,n.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})}if(t.bitangent){let r=new Float32Array(12);r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=1,r[8]=0,r[9]=0,r[10]=1,r[11]=0,n.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})}i=new Uint16Array(2*3),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new ht({attributes:n,indices:i,primitiveType:Fe.TRIANGLES,boundingSphere:new ce(h.ZERO,Math.sqrt(2))})};var KP=H1;var oti=T(S(),1);function z1(){this._workerName="createPlaneOutlineGeometry"}z1.packedLength=0;z1.pack=function(e,t){return t};z1.unpack=function(e,t,n){return l(n)?n:new z1};var Hg=new h(-.5,-.5,0),Dk=new h(.5,.5,0);z1.createGeometry=function(){let e=new mn,t=new Uint16Array(4*2),n=new Float64Array(4*3);return n[0]=Hg.x,n[1]=Hg.y,n[2]=Hg.z,n[3]=Dk.x,n[4]=Hg.y,n[5]=Hg.z,n[6]=Dk.x,n[7]=Dk.y,n[8]=Hg.z,n[9]=Hg.x,n[10]=Dk.y,n[11]=Hg.z,e.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:n}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new ht({attributes:e,indices:t,primitiveType:Fe.LINES,boundingSphere:new ce(h.ZERO,Math.sqrt(2))})};var JP=z1;var E6e=new h,Kme=new B;function I6e(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function Hu(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new I6e(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(Hu.prototype=Object.create(ii.prototype),Hu.prototype.constructor=Hu);Hu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Nn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Yt){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,Kme)),l(g)||(g=B.WHITE),o=Kt.fromColor(g),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};let c=t.plane,d=this._options,u=t.computeModelMatrix(e),m=K.getValueOrDefault(c.plane,e,d.plane),p=K.getValueOrUndefined(c.dimensions,e,d.dimensions);return d.plane=m,d.dimensions=p,u=TJ(m,p,u,u),new Gt({id:t,geometry:new KP(this._options),modelMatrix:u,attributes:i})};Hu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,Kme),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,s=this._options,a=t.computeModelMatrix(e),c=K.getValueOrDefault(r.plane,e,s.plane),d=K.getValueOrUndefined(r.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=d,a=TJ(c,d,a,a),new Gt({id:t,geometry:new JP,modelMatrix:a,attributes:{show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(o)}})};Hu.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||ii.prototype._isHidden.call(this,e,t)};Hu.prototype._getIsClosed=function(e){return!1};Hu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!K.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!K.isConstant(t.outlineWidth)};Hu.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Yt,i=this._options;i.vertexFormat=n?dn.VERTEX_FORMAT:oo.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(Be.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(Be.MINIMUM_VALUE,i.dimensions)};Hu.DynamicGeometryUpdater=K1;function K1(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(K1.prototype=Object.create(ni.prototype),K1.prototype.constructor=K1);K1.prototype._isHidden=function(e,t,n){let i=this._options,o=K.getValueOrUndefined(e.position,n,E6e);return!l(o)||!l(i.plane)||!l(i.dimensions)||ni.prototype._isHidden.call(this,e,t,n)};K1.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=K.getValueOrDefault(t.plane,n,i.plane),i.dimensions=K.getValueOrUndefined(t.dimensions,n,i.dimensions)};var X6e=new h,W6e=new h,P6e=new h,v6e=new h,w6e=new $,F6e=new $,A6e=new M;function TJ(e,t,n,i){let o=e.normal,r=e.distance,s=h.multiplyByScalar(o,-r,P6e),a=h.clone(h.UNIT_Z,W6e);W.equalsEpsilon(Math.abs(h.dot(a,o)),1,W.EPSILON8)&&(a=h.clone(h.UNIT_Y,a));let c=h.cross(a,o,X6e);a=h.cross(o,c,a),h.normalize(c,c),h.normalize(a,a);let d=w6e;$.setColumn(d,0,c,d),$.setColumn(d,1,a,d),$.setColumn(d,2,o,d);let u=h.fromElements(t.x,t.y,1,v6e),m=$.multiplyByScale(d,u,F6e),p=M.fromRotationTranslation(m,s,A6e);return M.multiplyTransformation(n,p,i)}Hu.createPrimitiveMatrix=TJ;var QP=Hu;var zni=T(S(),1);var Qti=T(S(),1);var M6e=new h,N6e=new Ke,k6e=new D,U6e=new D,D6e=new h,B6e=new h,O6e=new h,jP=new h,Y6e=new h,H6e=new h,Jme=new we,z6e=new $,K6e=new $,J6e=new h;function Q6e(e,t,n,i,o,r,s,a,c){let d=e.positions,u=si.triangulate(e.positions2D,e.holes);u.length<3&&(u=[0,1,2]);let m=Ae.createTypedArray(d.length,u.length);m.set(u);let p=z6e;if(i!==0){let b=we.fromAxisAngle(s,i,Jme);if(p=$.fromQuaternion(b,p),t.tangent||t.bitangent){b=we.fromAxisAngle(s,-i,Jme);let R=$.fromQuaternion(b,K6e);a=h.normalize($.multiplyByVector(R,a,a),a),t.bitangent&&(c=h.normalize(h.cross(s,a,c),c))}}else p=$.clone($.IDENTITY,p);let g=U6e;t.st&&(g.x=n.x,g.y=n.y);let f=d.length,x=f*3,_=new Float64Array(x),C=t.normal?new Float32Array(x):void 0,V=t.tangent?new Float32Array(x):void 0,L=t.bitangent?new Float32Array(x):void 0,Z=t.st?new Float32Array(f*2):void 0,G=0,I=0,v=0,P=0,w=0;for(let b=0;b<f;b++){let R=d[b];if(_[G++]=R.x,_[G++]=R.y,_[G++]=R.z,t.st)if(l(o)&&o.positions.length===f)Z[w++]=o.positions[b].x,Z[w++]=o.positions[b].y;else{let E=$.multiplyByVector(p,R,M6e),X=r(E,k6e);D.subtract(X,g,X);let A=W.clamp(X.x/n.width,0,1),N=W.clamp(X.y/n.height,0,1);Z[w++]=A,Z[w++]=N}t.normal&&(C[I++]=s.x,C[I++]=s.y,C[I++]=s.z),t.tangent&&(V[P++]=a.x,V[P++]=a.y,V[P++]=a.z),t.bitangent&&(L[v++]=c.x,L[v++]=c.y,L[v++]=c.z)}let F=new mn;return t.position&&(F.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:_})),t.normal&&(F.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:C})),t.tangent&&(F.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:V})),t.bitangent&&(F.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:L})),t.st&&(F.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:Z})),new ht({attributes:F,indices:m,primitiveType:Fe.TRIANGLES})}function $_(e){e=y(e,y.EMPTY_OBJECT);let t=e.polygonHierarchy,n=e.textureCoordinates,i=y(e.vertexFormat,We.DEFAULT);this._vertexFormat=We.clone(i),this._polygonHierarchy=t,this._stRotation=y(e.stRotation,0),this._ellipsoid=ne.clone(y(e.ellipsoid,ne.default)),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=Dn.computeHierarchyPackedLength(t,h)+We.packedLength+ne.packedLength+(l(n)?Dn.computeHierarchyPackedLength(n,D):1)+2}$_.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new $_(t)};$_.pack=function(e,t,n){return n=y(n,0),n=Dn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=Dn.packPolygonHierarchy(e._textureCoordinates,t,n,D):t[n++]=-1,t[n++]=e.packedLength,t};var j6e=ne.clone(ne.UNIT_SPHERE),q6e=new We,$6e={polygonHierarchy:{}};$_.unpack=function(e,t,n){t=y(t,0);let i=Dn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=ne.unpack(e,t,j6e);t+=ne.packedLength;let r=We.unpack(e,t,q6e);t+=We.packedLength;let s=e[t++],a=e[t]===-1?void 0:Dn.unpackPolygonHierarchy(e,t,D);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t++];return l(n)||(n=new $_($6e)),n._polygonHierarchy=i,n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=We.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};$_.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=l(o),s=n.positions;if(s=xo(s,h.equalsEpsilon,!0),s.length<3)return;let a=D6e,c=B6e,d=O6e,u=Y6e,m=H6e;if(!xb.computeProjectTo2DArguments(s,jP,u,m))return;if(a=h.cross(u,m,a),a=h.normalize(a,a),!h.equalsEpsilon(jP,h.ZERO,W.EPSILON6)){let w=e._ellipsoid.geodeticSurfaceNormal(jP,J6e);h.dot(a,w)<0&&(a=h.negate(a,a),u=h.negate(u,u))}let g=xb.createProjectPointsTo2DFunction(jP,u,m),f=xb.createProjectPointTo2DFunction(jP,u,m);t.tangent&&(c=h.clone(u,c)),t.bitangent&&(d=h.clone(m,d));let x=Dn.polygonsFromHierarchy(n,r,g,!1),_=x.hierarchy,C=x.polygons,V=function(w){return w},L=r?Dn.polygonsFromHierarchy(o,!0,V,!1).polygons:void 0;if(_.length===0)return;s=_[0].outerRing;let Z=ce.fromPoints(s),G=Dn.computeBoundingRectangle(a,f,s,i,N6e),I=[];for(let w=0;w<C.length;w++){let F=new Gt({geometry:Q6e(C[w],t,G,i,r?L[w]:void 0,f,a,c,d)});I.push(F)}let v=Fn.combineInstances(I)[0];v.attributes.position.values=new Float64Array(v.attributes.position.values),v.indices=Ae.createTypedArray(v.attributes.position.values.length/3,v.indices);let P=v.attributes;return t.position||delete P.position,new ht({attributes:P,indices:v.indices,primitiveType:v.primitiveType,boundingSphere:Z})};var qP=$_;var yni=T(S(),1);var Qme=[],Bk=[];function eqe(e,t,n,i,o){let s=Kr.fromPoints(t,e).projectPointsOntoPlane(t,Qme);si.computeWindingOrder2D(s)===ds.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,d,u=t.length,m=0;if(i)for(c=new Float64Array(u*2*3),d=0;d<u;d++){let f=t[d],x=t[(d+1)%u];c[m++]=f.x,c[m++]=f.y,c[m++]=f.z,c[m++]=x.x,c[m++]=x.y,c[m++]=x.z}else{let f=0;if(o===nn.GEODESIC)for(d=0;d<u;d++)f+=Dn.subdivideLineCount(t[d],t[(d+1)%u],n);else if(o===nn.RHUMB)for(d=0;d<u;d++)f+=Dn.subdivideRhumbLineCount(e,t[d],t[(d+1)%u],n);for(c=new Float64Array(f*3),d=0;d<u;d++){let x;o===nn.GEODESIC?x=Dn.subdivideLine(t[d],t[(d+1)%u],n,Bk):o===nn.RHUMB&&(x=Dn.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,Bk));let _=x.length;for(let C=0;C<_;++C)c[m++]=x[C]}}u=c.length/3;let p=u*2,g=Ae.createTypedArray(u,p);for(m=0,d=0;d<u-1;d++)g[m++]=d,g[m++]=d+1;return g[m++]=u-1,g[m++]=0,new Gt({geometry:new ht({attributes:new mn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:Fe.LINES})})}function tqe(e,t,n,i,o){let s=Kr.fromPoints(t,e).projectPointsOntoPlane(t,Qme);si.computeWindingOrder2D(s)===ds.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,d,u=t.length,m=new Array(u),p=0;if(i)for(c=new Float64Array(u*2*3*2),d=0;d<u;++d){m[d]=p/3;let _=t[d],C=t[(d+1)%u];c[p++]=_.x,c[p++]=_.y,c[p++]=_.z,c[p++]=C.x,c[p++]=C.y,c[p++]=C.z}else{let _=0;if(o===nn.GEODESIC)for(d=0;d<u;d++)_+=Dn.subdivideLineCount(t[d],t[(d+1)%u],n);else if(o===nn.RHUMB)for(d=0;d<u;d++)_+=Dn.subdivideRhumbLineCount(e,t[d],t[(d+1)%u],n);for(c=new Float64Array(_*3*2),d=0;d<u;++d){m[d]=p/3;let C;o===nn.GEODESIC?C=Dn.subdivideLine(t[d],t[(d+1)%u],n,Bk):o===nn.RHUMB&&(C=Dn.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,Bk));let V=C.length;for(let L=0;L<V;++L)c[p++]=C[L]}}u=c.length/(3*2);let g=m.length,f=(u*2+g)*2,x=Ae.createTypedArray(u+g,f);for(p=0,d=0;d<u;++d)x[p++]=d,x[p++]=(d+1)%u,x[p++]=d+u,x[p++]=(d+1)%u+u;for(d=0;d<g;d++){let _=m[d];x[p++]=_,x[p++]=_+u}return new Gt({geometry:new ht({attributes:new mn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c})}),indices:x,primitiveType:Fe.LINES})})}function eT(e){let t=e.polygonHierarchy,n=y(e.ellipsoid,ne.default),i=y(e.granularity,W.RADIANS_PER_DEGREE),o=y(e.perPositionHeight,!1),r=o&&l(e.extrudedHeight),s=y(e.arcType,nn.GEODESIC),a=y(e.height,0),c=y(e.extrudedHeight,a);if(!r){let d=Math.max(a,c);c=Math.min(a,c),a=d}this._ellipsoid=ne.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=o,this._perPositionHeightExtrude=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=Dn.computeHierarchyPackedLength(t,h)+ne.packedLength+8}eT.pack=function(e,t,n){return n=y(n,0),n=Dn.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=y(e._offsetAttribute,-1),t[n]=e.packedLength,t};var nqe=ne.clone(ne.UNIT_SPHERE),iqe={polygonHierarchy:{}};eT.unpack=function(e,t,n){t=y(t,0);let i=Dn.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=ne.unpack(e,t,nqe);t+=ne.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,d=e[t++]===1,u=e[t++],m=e[t++],p=e[t];return l(n)||(n=new eT(iqe)),n._polygonHierarchy=i,n._ellipsoid=ne.clone(o,n._ellipsoid),n._height=r,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=d,n._perPositionHeightExtrude=c,n._arcType=u,n._offsetAttribute=m===-1?void 0:m,n.packedLength=p,n};eT.fromPositions=function(e){e=y(e,y.EMPTY_OBJECT);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};return new eT(t)};eT.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,s=Dn.polygonOutlinesFromHierarchy(i,!o,t);if(s.length===0)return;let a,c=[],d=W.chordLength(n,t.maximumRadius),u=e._height,m=e._extrudedHeight,p=e._perPositionHeightExtrude||!W.equalsEpsilon(u,m,0,W.EPSILON2),g,f;if(p)for(f=0;f<s.length;f++){if(a=tqe(t,s[f],d,o,r),a.geometry=Dn.scaleToGeodeticHeightExtruded(a.geometry,u,m,t,o),l(e._offsetAttribute)){let C=a.geometry.attributes.position.values.length/3,V=new Uint8Array(C);e._offsetAttribute===cn.TOP?V=V.fill(1,0,C/2):(g=e._offsetAttribute===cn.NONE?0:1,V=V.fill(g)),a.geometry.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}c.push(a)}else for(f=0;f<s.length;f++){if(a=eqe(t,s[f],d,o,r),a.geometry.attributes.position.values=si.scaleToGeodeticHeight(a.geometry.attributes.position.values,u,t,!o),l(e._offsetAttribute)){let C=a.geometry.attributes.position.values.length;g=e._offsetAttribute===cn.NONE?0:1;let V=new Uint8Array(C/3).fill(g);a.geometry.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}c.push(a)}let x=Fn.combineInstances(c)[0],_=ce.fromVertices(x.attributes.position.values);return new ht({attributes:x.attributes,indices:x.indices,primitiveType:x.primitiveType,boundingSphere:_,offsetAttribute:e._offsetAttribute})};var $P=eT;var jme="Entity polygons cannot have both height and perPositionHeight. height will be ignored",qme="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",$me=new B,ehe=h.ZERO,the=new h,nhe=new ae,oqe=[],rqe=new D;function sqe(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0,this.textureCoordinates=void 0}function wd(e,t){Yn.call(this,{entity:e,scene:t,geometryOptions:new sqe(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(wd.prototype=Object.create(Yn.prototype),wd.prototype.constructor=wd);wd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Yt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,$me)),l(s)||(s=B.WHITE),o.color=Kt.fromColor(s)}l(i.offsetAttribute)&&(o.offset=Qi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,ehe,the)));let r;return i.perPositionHeight&&!l(i.extrudedHeight)?r=new qP(i):r=new Kp(i),new Gt({id:t,geometry:r,attributes:o})};wd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o=K.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,$me),r=this._distanceDisplayConditionProperty.getValue(e),s={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(o),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(r),offset:void 0};l(i.offsetAttribute)&&(s.offset=Qi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,ehe,the)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new Nu(i):a=new $P(i),new Gt({id:t,geometry:a,attributes:s})};wd.prototype._computeCenter=function(e,t){let n=K.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!l(n))return;let i=n.positions;if(i.length===0)return;let o=this._scene.ellipsoid,r=Kr.fromPoints(i,o),s=r.projectPointsOntoPlane(i,oqe),a=s.length,c=0,d=a-1,u=new D;for(let p=0;p<a;d=p++){let g=s[p],f=s[d],x=g.x*f.y-f.x*g.y,_=D.add(g,f,rqe);_=D.multiplyByScalar(_,x,_),u=D.add(u,_,u),c+=x}let m=1/(c*3);return u=D.multiplyByScalar(u,m,u),r.projectPointOntoEllipsoid(u,t)};wd.prototype._isHidden=function(e,t){return!l(t.hierarchy)||ii.prototype._isHidden.call(this,e,t)};wd.prototype._isOnTerrain=function(e,t){let n=Yn.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=l(i)&&(i.isConstant?i.getValue(Be.MINIMUM_VALUE):!0);return n&&!o};wd.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!K.isConstant(t.height)||!K.isConstant(t.extrudedHeight)||!K.isConstant(t.granularity)||!K.isConstant(t.stRotation)||!K.isConstant(t.textureCoordinates)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.perPositionHeight)||!K.isConstant(t.closeTop)||!K.isConstant(t.closeBottom)||!K.isConstant(t.zIndex)||!K.isConstant(t.arcType)||this._onTerrain&&!K.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Yt)};wd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Yt,i=this._options;i.vertexFormat=n?dn.VERTEX_FORMAT:oo.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(Be.MINIMUM_VALUE),r=K.getValueOrUndefined(t.height,Be.MINIMUM_VALUE),s=K.getValueOrDefault(t.heightReference,Be.MINIMUM_VALUE,Qe.NONE),a=K.getValueOrUndefined(t.extrudedHeight,Be.MINIMUM_VALUE),c=K.getValueOrDefault(t.extrudedHeightReference,Be.MINIMUM_VALUE,Qe.NONE),d=K.getValueOrDefault(t.perPositionHeight,Be.MINIMUM_VALUE,!1);r=Yn.getGeometryHeight(r,s);let u;if(d?(l(r)&&(r=void 0,St(jme)),s!==Qe.NONE&&d&&(r=void 0,St(qme))):(l(a)&&!l(r)&&(r=0),u=Yn.computeGeometryOffsetAttribute(r,s,a,c)),i.polygonHierarchy=o,i.granularity=K.getValueOrUndefined(t.granularity,Be.MINIMUM_VALUE),i.stRotation=K.getValueOrUndefined(t.stRotation,Be.MINIMUM_VALUE),i.perPositionHeight=d,i.closeTop=K.getValueOrDefault(t.closeTop,Be.MINIMUM_VALUE,!0),i.closeBottom=K.getValueOrDefault(t.closeBottom,Be.MINIMUM_VALUE,!0),i.offsetAttribute=u,i.height=r,i.arcType=K.getValueOrDefault(t.arcType,Be.MINIMUM_VALUE,nn.GEODESIC),i.textureCoordinates=K.getValueOrUndefined(t.textureCoordinates,Be.MINIMUM_VALUE),a=Yn.getGeometryExtrudedHeight(a,c),a===Yn.CLAMP_TO_GROUND){let m=Kp.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,nhe);a=li.getMinimumMaximumHeights(m).minimumTerrainHeight}i.extrudedHeight=a};wd.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=l(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};wd.DynamicGeometryUpdater=J1;function J1(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(J1.prototype=Object.create(ni.prototype),J1.prototype.constructor=J1);J1.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||ni.prototype._isHidden.call(this,e,t,n)};J1.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=K.getValueOrUndefined(t.hierarchy,n);let o=K.getValueOrUndefined(t.height,n),r=K.getValueOrDefault(t.heightReference,n,Qe.NONE),s=K.getValueOrDefault(t.extrudedHeightReference,n,Qe.NONE),a=K.getValueOrUndefined(t.extrudedHeight,n),c=K.getValueOrUndefined(t.perPositionHeight,n);o=Yn.getGeometryHeight(o,s);let d;if(c?(l(o)&&(o=void 0,St(jme)),r!==Qe.NONE&&c&&(o=void 0,St(qme))):(l(a)&&!l(o)&&(o=0),d=Yn.computeGeometryOffsetAttribute(o,r,a,s)),i.granularity=K.getValueOrUndefined(t.granularity,n),i.stRotation=K.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=K.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=K.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=K.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=K.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=d,i.height=o,i.arcType=K.getValueOrDefault(t.arcType,n,nn.GEODESIC),a=Yn.getGeometryExtrudedHeight(a,s),a===Yn.CLAMP_TO_GROUND){let u=Kp.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,nhe);a=li.getMinimumMaximumHeights(u).minimumTerrainHeight}i.extrudedHeight=a};var ev=wd;var toi=T(S(),1);var gii=T(S(),1);function aqe(e,t,n,i){let o=new mn;i.position&&(o.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,s=e.length/3,a=(s-r*2)/(r*2),c=si.triangulate(t),d=(a-1)*r*6+c.length*2,u=Ae.createTypedArray(s,d),m,p,g,f,x,_,C=r*2,V=0;for(m=0;m<a-1;m++){for(p=0;p<r-1;p++)g=p*2+m*r*2,_=g+C,f=g+1,x=f+C,u[V++]=f,u[V++]=g,u[V++]=x,u[V++]=x,u[V++]=g,u[V++]=_;g=r*2-2+m*r*2,f=g+1,x=f+C,_=g+C,u[V++]=f,u[V++]=g,u[V++]=x,u[V++]=x,u[V++]=g,u[V++]=_}if(i.st||i.tangent||i.bitangent){let G=new Float32Array(s*2),I=1/(a-1),v=1/n.height,P=n.height/2,w,F,b=0;for(m=0;m<a;m++){for(w=m*I,F=v*(t[0].y+P),G[b++]=w,G[b++]=F,p=1;p<r;p++)F=v*(t[p].y+P),G[b++]=w,G[b++]=F,G[b++]=w,G[b++]=F;F=v*(t[0].y+P),G[b++]=w,G[b++]=F}for(p=0;p<r;p++)w=0,F=v*(t[p].y+P),G[b++]=w,G[b++]=F;for(p=0;p<r;p++)w=(a-1)*I,F=v*(t[p].y+P),G[b++]=w,G[b++]=F;o.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:new Float32Array(G)})}let L=s-r*2;for(m=0;m<c.length;m+=3){let G=c[m]+L,I=c[m+1]+L,v=c[m+2]+L;u[V++]=G,u[V++]=I,u[V++]=v,u[V++]=v+r,u[V++]=I+r,u[V++]=G+r}let Z=new ht({attributes:o,indices:u,boundingSphere:ce.fromVertices(e),primitiveType:Fe.TRIANGLES});if(i.normal&&(Z=Fn.computeNormal(Z)),i.tangent||i.bitangent){try{Z=Fn.computeTangentAndBitangent(Z)}catch{St("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(Z.attributes.tangent=void 0),i.bitangent||(Z.attributes.bitangent=void 0),i.st||(Z.attributes.st=void 0)}return Z}function nv(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ne.clone(y(e.ellipsoid,ne.default)),this._cornerType=y(e.cornerType,Ei.ROUNDED),this._vertexFormat=We.clone(y(e.vertexFormat,We.DEFAULT)),this._granularity=y(e.granularity,W.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*D.packedLength,this.packedLength=i+ne.packedLength+We.packedLength+2}nv.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=D.packedLength)D.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var ihe=ne.clone(ne.UNIT_SPHERE),ohe=new We,tv={polylinePositions:void 0,shapePositions:void 0,ellipsoid:ihe,vertexFormat:ohe,cornerType:void 0,granularity:void 0};nv.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=D.packedLength)s[i]=D.unpack(e,t);let a=ne.unpack(e,t,ihe);t+=ne.packedLength;let c=We.unpack(e,t,ohe);t+=We.packedLength;let d=e[t++],u=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=ne.clone(a,n._ellipsoid),n._vertexFormat=We.clone(c,n._vertexFormat),n._cornerType=d,n._granularity=u,n):(tv.polylinePositions=r,tv.shapePositions=s,tv.cornerType=d,tv.granularity=u,new nv(tv))};var cqe=new Ke;nv.createGeometry=function(e){let t=e._positions,n=xo(t,h.equalsEpsilon),i=e._shape;if(i=eh.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;si.computeWindingOrder2D(i)===ds.CLOCKWISE&&i.reverse();let o=Ke.fromPoints(i,cqe),r=eh.computePositions(n,i,o,e,!0);return aqe(r,i,o,e._vertexFormat)};var iv=nv;var Mii=T(S(),1);function lqe(e,t){let n=new mn;n.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,s=e.length/3/i,a=Ae.createTypedArray(o,2*i*(s+1)),c,d,u=0;c=0;let m=c*i;for(d=0;d<i-1;d++)a[u++]=d+m,a[u++]=d+m+1;for(a[u++]=i-1+m,a[u++]=m,c=s-1,m=c*i,d=0;d<i-1;d++)a[u++]=d+m,a[u++]=d+m+1;for(a[u++]=i-1+m,a[u++]=m,c=0;c<s-1;c++){let g=i*c,f=g+i;for(d=0;d<i;d++)a[u++]=d+g,a[u++]=d+f}return new ht({attributes:n,indices:Ae.createTypedArray(o,a),boundingSphere:ce.fromVertices(e),primitiveType:Fe.LINES})}function rv(e){e=y(e,y.EMPTY_OBJECT);let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ne.clone(y(e.ellipsoid,ne.default)),this._cornerType=y(e.cornerType,Ei.ROUNDED),this._granularity=y(e.granularity,W.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*D.packedLength,this.packedLength=i+ne.packedLength+2}rv.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=D.packedLength)D.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var rhe=ne.clone(ne.UNIT_SPHERE),ov={polylinePositions:void 0,shapePositions:void 0,ellipsoid:rhe,height:void 0,cornerType:void 0,granularity:void 0};rv.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=D.packedLength)s[i]=D.unpack(e,t);let a=ne.unpack(e,t,rhe);t+=ne.packedLength;let c=e[t++],d=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=ne.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=d,n):(ov.polylinePositions=r,ov.shapePositions=s,ov.cornerType=c,ov.granularity=d,new rv(ov))};var dqe=new Ke;rv.createGeometry=function(e){let t=e._positions,n=xo(t,h.equalsEpsilon),i=e._shape;if(i=eh.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;si.computeWindingOrder2D(i)===ds.CLOCKWISE&&i.reverse();let o=Ke.fromPoints(i,dqe),r=eh.computePositions(n,i,o,e,!1);return lqe(r,i)};var sv=rv;var she=new B;function uqe(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function Cf(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new uqe(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(Cf.prototype=Object.create(ii.prototype),Cf.prototype.constructor=Cf);Cf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Nn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Yt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,she)),l(c)||(c=B.WHITE),o=Kt.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Gt({id:t,geometry:new iv(this._options),attributes:i})};Cf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,she),o=this._distanceDisplayConditionProperty.getValue(e);return new Gt({id:t,geometry:new sv(this._options),attributes:{show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(o)}})};Cf.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||ii.prototype._isHidden.call(this,e,t)};Cf.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!K.isConstant(t.granularity)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.cornerType)};Cf.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof Yt;o.vertexFormat=r?dn.VERTEX_FORMAT:oo.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(Be.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(Be.MINIMUM_VALUE,o.shape),o.granularity=l(n)?n.getValue(Be.MINIMUM_VALUE):void 0,o.cornerType=l(i)?i.getValue(Be.MINIMUM_VALUE):void 0};Cf.DynamicGeometryUpdater=Q1;function Q1(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(Q1.prototype=Object.create(ni.prototype),Q1.prototype.constructor=Q1);Q1.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||ni.prototype._isHidden.call(this,e,t,n)};Q1.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=K.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=K.getValueOrUndefined(t.shape,n),i.granularity=K.getValueOrUndefined(t.granularity,n),i.cornerType=K.getValueOrUndefined(t.cornerType,n)};var av=Cf;var qoi=T(S(),1);var Zoi=T(S(),1);var SJ=new h,lhe=new h,dhe=new h,uhe=new h,mhe=new ae,mqe=new D,hqe=new ce,fqe=new ce;function hhe(e,t){let n=new ht({attributes:new mn,primitiveType:Fe.TRIANGLES});return n.attributes.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function pqe(e,t,n,i){let o=e.length,r=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,a=t.bitangent?new Float32Array(o):void 0,c=0,d=uhe,u=dhe,m=lhe;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let g=h.fromArray(e,p,SJ),f=c+1,x=c+2;m=n.geodeticSurfaceNormal(g,m),(t.tangent||t.bitangent)&&(h.cross(h.UNIT_Z,m,u),$.multiplyByVector(i,u,u),h.normalize(u,u),t.bitangent&&h.normalize(h.cross(m,u,d),d)),t.normal&&(r[c]=m.x,r[f]=m.y,r[x]=m.z),t.tangent&&(s[c]=u.x,s[f]=u.y,s[x]=u.z),t.bitangent&&(a[c]=d.x,a[f]=d.y,a[x]=d.z),c+=3}return hhe(t,{positions:e,normals:r,tangents:s,bitangents:a})}var CJ=new h,fhe=new h;function bqe(e,t,n){let i=e.length,o=t.normal?new Float32Array(i):void 0,r=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,d=0,u=!0,m=uhe,p=dhe,g=lhe;if(t.normal||t.tangent||t.bitangent)for(let f=0;f<i;f+=6){let x=h.fromArray(e,f,SJ),_=h.fromArray(e,(f+6)%i,CJ);if(u){let C=h.fromArray(e,(f+3)%i,fhe);h.subtract(_,x,_),h.subtract(C,x,C),g=h.normalize(h.cross(C,_,g),g),u=!1}h.equalsEpsilon(_,x,W.EPSILON10)&&(u=!0),(t.tangent||t.bitangent)&&(m=n.geodeticSurfaceNormal(x,m),t.tangent&&(p=h.normalize(h.cross(m,g,p),p))),t.normal&&(o[a++]=g.x,o[a++]=g.y,o[a++]=g.z,o[a++]=g.x,o[a++]=g.y,o[a++]=g.z),t.tangent&&(r[c++]=p.x,r[c++]=p.y,r[c++]=p.z,r[c++]=p.x,r[c++]=p.y,r[c++]=p.z),t.bitangent&&(s[d++]=m.x,s[d++]=m.y,s[d++]=m.z,s[d++]=m.x,s[d++]=m.y,s[d++]=m.z)}return hhe(t,{positions:e,normals:o,tangents:r,bitangents:s})}function phe(e,t){let n=e._vertexFormat,i=e._ellipsoid,o=t.height,r=t.width,s=t.northCap,a=t.southCap,c=0,d=o,u=o,m=0;s&&(c=1,u-=1,m+=1),a&&(d-=1,u-=1,m+=1),m+=r*u;let p=n.position?new Float64Array(m*3):void 0,g=n.st?new Float32Array(m*2):void 0,f=0,x=0,_=SJ,C=mqe,V=Number.MAX_VALUE,L=Number.MAX_VALUE,Z=-Number.MAX_VALUE,G=-Number.MAX_VALUE;for(let R=c;R<d;++R)for(let E=0;E<r;++E)Ls.computePosition(t,i,n.st,R,E,_,C),p[f++]=_.x,p[f++]=_.y,p[f++]=_.z,n.st&&(g[x++]=C.x,g[x++]=C.y,V=Math.min(V,C.x),L=Math.min(L,C.y),Z=Math.max(Z,C.x),G=Math.max(G,C.y));if(s&&(Ls.computePosition(t,i,n.st,0,0,_,C),p[f++]=_.x,p[f++]=_.y,p[f++]=_.z,n.st&&(g[x++]=C.x,g[x++]=C.y,V=C.x,L=C.y,Z=C.x,G=C.y)),a&&(Ls.computePosition(t,i,n.st,o-1,0,_,C),p[f++]=_.x,p[f++]=_.y,p[f]=_.z,n.st&&(g[x++]=C.x,g[x]=C.y,V=Math.min(V,C.x),L=Math.min(L,C.y),Z=Math.max(Z,C.x),G=Math.max(G,C.y))),n.st&&(V<0||L<0||Z>1||G>1))for(let R=0;R<g.length;R+=2)g[R]=(g[R]-V)/(Z-V),g[R+1]=(g[R+1]-L)/(G-L);let I=pqe(p,n,i,t.tangentRotationMatrix),v=6*(r-1)*(u-1);s&&(v+=3*(r-1)),a&&(v+=3*(r-1));let P=Ae.createTypedArray(m,v),w=0,F=0,b;for(b=0;b<u-1;++b){for(let R=0;R<r-1;++R){let E=w,X=E+r,A=X+1,N=E+1;P[F++]=E,P[F++]=X,P[F++]=N,P[F++]=N,P[F++]=X,P[F++]=A,++w}++w}if(s||a){let R=m-1,E=m-1;s&&a&&(R=m-2);let X,A;if(w=0,s)for(b=0;b<r-1;b++)X=w,A=X+1,P[F++]=R,P[F++]=X,P[F++]=A,++w;if(a)for(w=(u-1)*r,b=0;b<r-1;b++)X=w,A=X+1,P[F++]=X,P[F++]=E,P[F++]=A,++w}return I.indices=P,n.st&&(I.attributes.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:g})),I}function j1(e,t,n,i,o){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=o[n],e[t++]=o[n+1],e[t]=o[n+2],e}function q1(e,t,n,i){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n],e[t]=i[n+1],e}var VJ=new We;function gqe(e,t){let n=e._shadowVolume,i=e._offsetAttribute,o=e._vertexFormat,r=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,d=t.width,u;if(n){let Ie=We.clone(o,VJ);Ie.normal=!0,e._vertexFormat=Ie}let m=phe(e,t);n&&(e._vertexFormat=o);let p=si.scaleToGeodeticHeight(m.attributes.position.values,s,a,!1);p=new Float64Array(p);let g=p.length,f=g*2,x=new Float64Array(f);x.set(p);let _=si.scaleToGeodeticHeight(m.attributes.position.values,r,a);x.set(_,g),m.attributes.position.values=x;let C=o.normal?new Float32Array(f):void 0,V=o.tangent?new Float32Array(f):void 0,L=o.bitangent?new Float32Array(f):void 0,Z=o.st?new Float32Array(f/3*2):void 0,G,I;if(o.normal){for(I=m.attributes.normal.values,C.set(I),u=0;u<g;u++)I[u]=-I[u];C.set(I,g),m.attributes.normal.values=C}if(n){I=m.attributes.normal.values,o.normal||(m.attributes.normal=void 0);let Ie=new Float32Array(f);for(u=0;u<g;u++)I[u]=-I[u];Ie.set(I,g),m.attributes.extrudeDirection=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:Ie})}let v,P=l(i);if(P){let Ie=g/3*2,je=new Uint8Array(Ie);i===cn.TOP?je=je.fill(1,0,Ie/2):(v=i===cn.NONE?0:1,je=je.fill(v)),m.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:je})}if(o.tangent){let Ie=m.attributes.tangent.values;for(V.set(Ie),u=0;u<g;u++)Ie[u]=-Ie[u];V.set(Ie,g),m.attributes.tangent.values=V}if(o.bitangent){let Ie=m.attributes.bitangent.values;L.set(Ie),L.set(Ie,g),m.attributes.bitangent.values=L}o.st&&(G=m.attributes.st.values,Z.set(G),Z.set(G,g/3*2),m.attributes.st.values=Z);let w=m.indices,F=w.length,b=g/3,R=Ae.createTypedArray(f/3,F*2);for(R.set(w),u=0;u<F;u+=3)R[u+F]=w[u+2]+b,R[u+1+F]=w[u+1]+b,R[u+2+F]=w[u]+b;m.indices=R;let E=t.northCap,X=t.southCap,A=c,N=2,O=0,U=4,Y=4;E&&(N-=1,A-=1,O+=1,U-=2,Y-=1),X&&(N-=1,A-=1,O+=1,U-=2,Y-=1),O+=N*d+2*A-U;let k=(O+Y)*2,H=new Float64Array(k*3),J=n?new Float32Array(k*3):void 0,te=P?new Uint8Array(k):void 0,z=o.st?new Float32Array(k*2):void 0,q=i===cn.TOP;P&&!q&&(v=i===cn.ALL?1:0,te=te.fill(v));let ee=0,fe=0,_e=0,le=0,ye=d*A,Te;for(u=0;u<ye;u+=d)Te=u*3,H=j1(H,ee,Te,p,_),ee+=6,o.st&&(z=q1(z,fe,u*2,G),fe+=4),n&&(_e+=3,J[_e++]=I[Te],J[_e++]=I[Te+1],J[_e++]=I[Te+2]),q&&(te[le++]=1,le+=1);if(X){let Ie=E?ye+1:ye;for(Te=Ie*3,u=0;u<2;u++)H=j1(H,ee,Te,p,_),ee+=6,o.st&&(z=q1(z,fe,Ie*2,G),fe+=4),n&&(_e+=3,J[_e++]=I[Te],J[_e++]=I[Te+1],J[_e++]=I[Te+2]),q&&(te[le++]=1,le+=1)}else for(u=ye-d;u<ye;u++)Te=u*3,H=j1(H,ee,Te,p,_),ee+=6,o.st&&(z=q1(z,fe,u*2,G),fe+=4),n&&(_e+=3,J[_e++]=I[Te],J[_e++]=I[Te+1],J[_e++]=I[Te+2]),q&&(te[le++]=1,le+=1);for(u=ye-1;u>0;u-=d)Te=u*3,H=j1(H,ee,Te,p,_),ee+=6,o.st&&(z=q1(z,fe,u*2,G),fe+=4),n&&(_e+=3,J[_e++]=I[Te],J[_e++]=I[Te+1],J[_e++]=I[Te+2]),q&&(te[le++]=1,le+=1);if(E){let Ie=ye;for(Te=Ie*3,u=0;u<2;u++)H=j1(H,ee,Te,p,_),ee+=6,o.st&&(z=q1(z,fe,Ie*2,G),fe+=4),n&&(_e+=3,J[_e++]=I[Te],J[_e++]=I[Te+1],J[_e++]=I[Te+2]),q&&(te[le++]=1,le+=1)}else for(u=d-1;u>=0;u--)Te=u*3,H=j1(H,ee,Te,p,_),ee+=6,o.st&&(z=q1(z,fe,u*2,G),fe+=4),n&&(_e+=3,J[_e++]=I[Te],J[_e++]=I[Te+1],J[_e++]=I[Te+2]),q&&(te[le++]=1,le+=1);let Xe=bqe(H,o,a);o.st&&(Xe.attributes.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:z})),n&&(Xe.attributes.extrudeDirection=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:J})),P&&(Xe.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:te}));let Le=Ae.createTypedArray(k,O*6),ke,Oe,at,Mt;g=H.length/3;let Lt=0;for(u=0;u<g-1;u+=2){ke=u,Mt=(ke+2)%g;let Ie=h.fromArray(H,ke*3,CJ),je=h.fromArray(H,Mt*3,fhe);h.equalsEpsilon(Ie,je,W.EPSILON10)||(Oe=(ke+1)%g,at=(Oe+2)%g,Le[Lt++]=ke,Le[Lt++]=Oe,Le[Lt++]=Mt,Le[Lt++]=Mt,Le[Lt++]=Oe,Le[Lt++]=at)}return Xe.indices=Le,Xe=Fn.combineInstances([new Gt({geometry:m}),new Gt({geometry:Xe})]),Xe[0]}var yqe=[new h,new h,new h,new h],bhe=new he,xqe=new he;function LJ(e,t,n,i,o){if(n===0)return ae.clone(e,o);let r=Ls.computeOptions(e,t,n,0,mhe,bhe),s=r.height,a=r.width,c=yqe;return Ls.computePosition(r,i,!1,0,0,c[0]),Ls.computePosition(r,i,!1,0,a-1,c[1]),Ls.computePosition(r,i,!1,s-1,0,c[2]),Ls.computePosition(r,i,!1,s-1,a-1,c[3]),ae.fromCartesianArray(c,i,o)}function Vf(e){e=y(e,y.EMPTY_OBJECT);let t=e.rectangle,n=y(e.height,0),i=y(e.extrudedHeight,n);this._rectangle=ae.clone(t),this._granularity=y(e.granularity,W.RADIANS_PER_DEGREE),this._ellipsoid=ne.clone(y(e.ellipsoid,ne.default)),this._surfaceHeight=Math.max(n,i),this._rotation=y(e.rotation,0),this._stRotation=y(e.stRotation,0),this._vertexFormat=We.clone(y(e.vertexFormat,We.DEFAULT)),this._extrudedHeight=Math.min(n,i),this._shadowVolume=y(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}Vf.packedLength=ae.packedLength+ne.packedLength+We.packedLength+7;Vf.pack=function(e,t,n){return n=y(n,0),ae.pack(e._rectangle,t,n),n+=ae.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=y(e._offsetAttribute,-1),t};var ghe=new ae,yhe=ne.clone(ne.UNIT_SPHERE),zg={rectangle:ghe,ellipsoid:yhe,vertexFormat:VJ,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Vf.unpack=function(e,t,n){t=y(t,0);let i=ae.unpack(e,t,ghe);t+=ae.packedLength;let o=ne.unpack(e,t,yhe);t+=ne.packedLength;let r=We.unpack(e,t,VJ);t+=We.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++]===1,p=e[t];return l(n)?(n._rectangle=ae.clone(i,n._rectangle),n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=We.clone(r,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=d,n._extrudedHeight=u,n._shadowVolume=m,n._offsetAttribute=p===-1?void 0:p,n):(zg.granularity=s,zg.height=a,zg.rotation=c,zg.stRotation=d,zg.extrudedHeight=u,zg.shadowVolume=m,zg.offsetAttribute=p===-1?void 0:p,new Vf(zg))};Vf.computeRectangle=function(e,t){e=y(e,y.EMPTY_OBJECT);let n=e.rectangle,i=y(e.granularity,W.RADIANS_PER_DEGREE),o=y(e.ellipsoid,ne.default),r=y(e.rotation,0);return LJ(n,i,r,o,t)};var _qe=new $,ahe=new we,Tqe=new he;Vf.createGeometry=function(e){if(W.equalsEpsilon(e._rectangle.north,e._rectangle.south,W.EPSILON10)||W.equalsEpsilon(e._rectangle.east,e._rectangle.west,W.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,o=e._stRotation,r=e._vertexFormat,s=Ls.computeOptions(t,e._granularity,i,o,mhe,bhe,xqe),a=_qe;if(o!==0||i!==0){let g=ae.center(t,Tqe),f=n.geodeticSurfaceNormalCartographic(g,CJ);we.fromAxisAngle(f,-o,ahe),$.fromQuaternion(ahe,a)}else $.clone($.IDENTITY,a);let c=e._surfaceHeight,d=e._extrudedHeight,u=!W.equalsEpsilon(c,d,0,W.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let m,p;if(t=e._rectangle,u){m=gqe(e,s);let g=ce.fromRectangle3D(t,n,c,fqe),f=ce.fromRectangle3D(t,n,d,hqe);p=ce.union(g,f)}else{if(m=phe(e,s),m.attributes.position.values=si.scaleToGeodeticHeight(m.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let g=m.attributes.position.values.length,f=e._offsetAttribute===cn.NONE?0:1,x=new Uint8Array(g/3).fill(f);m.attributes.applyOffset=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}p=ce.fromRectangle3D(t,n,c)}return r.position||delete m.attributes.position,new ht({attributes:m.attributes,indices:m.indices,primitiveType:m.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Vf.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Vf({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:r,vertexFormat:We.POSITION_ONLY,shadowVolume:!0})};var che=new ae,Sqe=[new D,new D,new D],Cqe=new wi,Vqe=new he;function Lqe(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ae.clone(e._rectangle,che),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=LJ(t,n,o,i,che),s=Sqe;s[0].x=r.west,s[0].y=r.south,s[1].x=r.west,s[1].y=r.north,s[2].x=r.east,s[2].y=r.south;let a=e.rectangle,c=wi.fromRotation(e._stRotation,Cqe),d=ae.center(a,Vqe);for(let f=0;f<3;++f){let x=s[f];x.x-=d.longitude,x.y-=d.latitude,wi.multiplyByVector(c,x,x),x.x+=d.longitude,x.y+=d.latitude,x.x=(x.x-a.west)/a.width,x.y=(x.y-a.south)/a.height}let u=s[0],m=s[1],p=s[2],g=new Array(6);return D.pack(u,g),D.pack(m,g,2),D.pack(p,g,4),g}Object.defineProperties(Vf.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=LJ(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Lqe(this)),this._textureCoordinateRotationPoints}}});var tT=Vf;var xhe=new B,_he=h.ZERO,The=new h,She=new ae,Rqe=new ae,Zqe=new he;function Gqe(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function lh(e,t){Yn.call(this,{entity:e,scene:t,geometryOptions:new Gqe(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(lh.prototype=Object.create(Yn.prototype),lh.prototype.constructor=lh);lh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Yt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,xhe)),l(o)||(o=B.WHITE),i.color=Kt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Qi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,_he,The))),new Gt({id:t,geometry:new tT(this._options),attributes:i})};lh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,xhe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Qi.fromCartesian3(K.getValueOrDefault(this._terrainOffsetProperty,e,_he,The))),new Gt({id:t,geometry:new G_(this._options),attributes:r})};lh.prototype._computeCenter=function(e,t){let n=K.getValueOrUndefined(this._entity.rectangle.coordinates,e,Rqe);if(!l(n))return;let i=ae.center(n,Zqe);return he.toCartesian(i,ne.default,t)};lh.prototype._isHidden=function(e,t){return!l(t.coordinates)||ii.prototype._isHidden.call(this,e,t)};lh.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!K.isConstant(t.height)||!K.isConstant(t.extrudedHeight)||!K.isConstant(t.granularity)||!K.isConstant(t.stRotation)||!K.isConstant(t.rotation)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.zIndex)||this._onTerrain&&!K.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Yt)};lh.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Yt,i=K.getValueOrUndefined(t.height,Be.MINIMUM_VALUE),o=K.getValueOrDefault(t.heightReference,Be.MINIMUM_VALUE,Qe.NONE),r=K.getValueOrUndefined(t.extrudedHeight,Be.MINIMUM_VALUE),s=K.getValueOrDefault(t.extrudedHeightReference,Be.MINIMUM_VALUE,Qe.NONE);l(r)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?dn.VERTEX_FORMAT:oo.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(Be.MINIMUM_VALUE,a.rectangle),a.granularity=K.getValueOrUndefined(t.granularity,Be.MINIMUM_VALUE),a.stRotation=K.getValueOrUndefined(t.stRotation,Be.MINIMUM_VALUE),a.rotation=K.getValueOrUndefined(t.rotation,Be.MINIMUM_VALUE),a.offsetAttribute=Yn.computeGeometryOffsetAttribute(i,o,r,s),a.height=Yn.getGeometryHeight(i,o),r=Yn.getGeometryExtrudedHeight(r,s),r===Yn.CLAMP_TO_GROUND&&(r=li.getMinimumMaximumHeights(tT.computeRectangle(a,She)).minimumTerrainHeight),a.extrudedHeight=r};lh.DynamicGeometryUpdater=$1;function $1(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&($1.prototype=Object.create(ni.prototype),$1.prototype.constructor=$1);$1.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||ni.prototype._isHidden.call(this,e,t,n)};$1.prototype._setOptions=function(e,t,n){let i=this._options,o=K.getValueOrUndefined(t.height,n),r=K.getValueOrDefault(t.heightReference,n,Qe.NONE),s=K.getValueOrUndefined(t.extrudedHeight,n),a=K.getValueOrDefault(t.extrudedHeightReference,n,Qe.NONE);l(s)&&!l(o)&&(o=0),i.rectangle=K.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=K.getValueOrUndefined(t.granularity,n),i.stRotation=K.getValueOrUndefined(t.stRotation,n),i.rotation=K.getValueOrUndefined(t.rotation,n),i.offsetAttribute=Yn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Yn.getGeometryHeight(o,r),s=Yn.getGeometryExtrudedHeight(s,a),s===Yn.CLAMP_TO_GROUND&&(s=li.getMinimumMaximumHeights(tT.computeRectangle(i,She)).minimumTerrainHeight),i.extrudedHeight=s};var cv=lh;var esi=T(S(),1);var Sri=T(S(),1);var sri=T(S(),1);var Che={};function Eqe(e,t){return W.equalsEpsilon(e.latitude,t.latitude,W.EPSILON10)&&W.equalsEpsilon(e.longitude,t.longitude,W.EPSILON10)}var Iqe=new he,Xqe=new he;function Wqe(e,t,n,i){t=xo(t,h.equalsEpsilon);let o=t.length;if(o<2)return;let r=l(i),s=l(n),a=new Array(o),c=new Array(o),d=new Array(o),u=t[0];a[0]=u;let m=e.cartesianToCartographic(u,Iqe);s&&(m.height=n[0]),c[0]=m.height,r?d[0]=i[0]:d[0]=0;let p=c[0],g=d[0],f=p===g,x=1;for(let _=1;_<o;++_){let C=t[_],V=e.cartesianToCartographic(C,Xqe);s&&(V.height=n[_]),f=f&&V.height===0,Eqe(m,V)?m.height<V.height&&(c[x-1]=V.height):(a[x]=C,c[x]=V.height,r?d[x]=i[_]:d[x]=0,f=f&&c[x]===d[x],he.clone(V,m),++x)}if(!(f||x<2))return a.length=x,c.length=x,d.length=x,{positions:a,topHeights:c,bottomHeights:d}}var Pqe=new Array(2),vqe=new Array(2),wqe={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};Che.computePositions=function(e,t,n,i,o,r){let s=Wqe(e,t,n,i);if(!l(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,d,u,m=W.chordLength(o,e.maximumRadius),p=wqe;if(p.minDistance=m,p.ellipsoid=e,r){let g=0,f;for(f=0;f<a-1;f++)g+=Gi.numberOfPoints(t[f],t[f+1],m)+1;d=new Float64Array(g*3),u=new Float64Array(g*3);let x=Pqe,_=vqe;p.positions=x,p.height=_;let C=0;for(f=0;f<a-1;f++){x[0]=t[f],x[1]=t[f+1],_[0]=n[f],_[1]=n[f+1];let V=Gi.generateArc(p);d.set(V,C),_[0]=i[f],_[1]=i[f+1],u.set(Gi.generateArc(p),C),C+=V.length}}else p.positions=t,p.height=n,d=new Float64Array(Gi.generateArc(p)),p.height=i,u=new Float64Array(Gi.generateArc(p));return{bottomPositions:u,topPositions:d,numCorners:c}};var nT=Che;var RJ=new h,Ok=new h,Fqe=new h,Vhe=new h,Aqe=new h,Mqe=new h,Nqe=new h;function iT(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=y(e.vertexFormat,We.DEFAULT),r=y(e.granularity,W.RADIANS_PER_DEGREE),s=y(e.ellipsoid,ne.default);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=We.clone(o),this._granularity=r,this._ellipsoid=ne.clone(s),this._workerName="createWallGeometry";let a=1+t.length*h.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+ne.packedLength+We.packedLength+1}iT.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n]=e._granularity,t};var Lhe=ne.clone(ne.UNIT_SPHERE),Rhe=new We,lv={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Lhe,vertexFormat:Rhe,granularity:void 0};iT.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=ne.unpack(e,t,Lhe);t+=ne.packedLength;let d=We.unpack(e,t,Rhe);t+=We.packedLength;let u=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ne.clone(c,n._ellipsoid),n._vertexFormat=We.clone(d,n._vertexFormat),n._granularity=u,n):(lv.positions=r,lv.minimumHeights=s,lv.maximumHeights=a,lv.granularity=u,new iT(lv))};iT.fromConstantHeights=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let d=t.length;n=s?new Array(d):void 0,i=a?new Array(d):void 0;for(let u=0;u<d;++u)s&&(n[u]=o),a&&(i[u]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new iT(c)};iT.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,s=e._ellipsoid,a=nT.computePositions(s,t,i,n,r,!0);if(!l(a))return;let c=a.bottomPositions,d=a.topPositions,u=a.numCorners,m=d.length,p=m*2,g=o.position?new Float64Array(p):void 0,f=o.normal?new Float32Array(p):void 0,x=o.tangent?new Float32Array(p):void 0,_=o.bitangent?new Float32Array(p):void 0,C=o.st?new Float32Array(p/3*2):void 0,V=0,L=0,Z=0,G=0,I=0,v=Nqe,P=Mqe,w=Aqe,F=!0;m/=3;let b,R=0,E=1/(m-u-1);for(b=0;b<m;++b){let U=b*3,Y=h.fromArray(d,U,RJ),k=h.fromArray(c,U,Ok);if(o.position&&(g[V++]=k.x,g[V++]=k.y,g[V++]=k.z,g[V++]=Y.x,g[V++]=Y.y,g[V++]=Y.z),o.st&&(C[I++]=R,C[I++]=0,C[I++]=R,C[I++]=1),o.normal||o.tangent||o.bitangent){let H=h.clone(h.ZERO,Vhe),J=h.subtract(Y,s.geodeticSurfaceNormal(Y,Ok),Ok);if(b+1<m&&(H=h.fromArray(d,U+3,Vhe)),F){let te=h.subtract(H,Y,Fqe),z=h.subtract(J,Y,RJ);v=h.normalize(h.cross(z,te,v),v),F=!1}h.equalsEpsilon(Y,H,W.EPSILON10)?F=!0:(R+=E,o.tangent&&(P=h.normalize(h.subtract(H,Y,P),P)),o.bitangent&&(w=h.normalize(h.cross(v,P,w),w))),o.normal&&(f[L++]=v.x,f[L++]=v.y,f[L++]=v.z,f[L++]=v.x,f[L++]=v.y,f[L++]=v.z),o.tangent&&(x[G++]=P.x,x[G++]=P.y,x[G++]=P.z,x[G++]=P.x,x[G++]=P.y,x[G++]=P.z),o.bitangent&&(_[Z++]=w.x,_[Z++]=w.y,_[Z++]=w.z,_[Z++]=w.x,_[Z++]=w.y,_[Z++]=w.z)}}let X=new mn;o.position&&(X.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:g})),o.normal&&(X.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),o.tangent&&(X.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:x})),o.bitangent&&(X.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:_})),o.st&&(X.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:C}));let A=p/3;p-=6*(u+1);let N=Ae.createTypedArray(A,p),O=0;for(b=0;b<A-2;b+=2){let U=b,Y=b+2,k=h.fromArray(g,U*3,RJ),H=h.fromArray(g,Y*3,Ok);if(h.equalsEpsilon(k,H,W.EPSILON10))continue;let J=b+1,te=b+3;N[O++]=J,N[O++]=U,N[O++]=te,N[O++]=te,N[O++]=U,N[O++]=Y}return new ht({attributes:X,indices:N,primitiveType:Fe.TRIANGLES,boundingSphere:new ce.fromVertices(g)})};var dv=iT;var Ari=T(S(),1);var Zhe=new h,Ghe=new h;function oT(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=y(e.granularity,W.RADIANS_PER_DEGREE),r=y(e.ellipsoid,ne.default);this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=ne.clone(r),this._workerName="createWallOutlineGeometry";let s=1+t.length*h.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+ne.packedLength+1}oT.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n]=e._granularity,t};var Ehe=ne.clone(ne.UNIT_SPHERE),uv={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Ehe,granularity:void 0};oT.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=ne.unpack(e,t,Ehe);t+=ne.packedLength;let d=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ne.clone(c,n._ellipsoid),n._granularity=d,n):(uv.positions=r,uv.minimumHeights=s,uv.maximumHeights=a,uv.granularity=d,new oT(uv))};oT.fromConstantHeights=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let d=t.length;n=s?new Array(d):void 0,i=a?new Array(d):void 0;for(let u=0;u<d;++u)s&&(n[u]=o),a&&(i[u]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new oT(c)};oT.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,s=nT.computePositions(r,t,i,n,o,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,d=c.length,u=d*2,m=new Float64Array(u),p=0;d/=3;let g;for(g=0;g<d;++g){let V=g*3,L=h.fromArray(c,V,Zhe),Z=h.fromArray(a,V,Ghe);m[p++]=Z.x,m[p++]=Z.y,m[p++]=Z.z,m[p++]=L.x,m[p++]=L.y,m[p++]=L.z}let f=new mn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:m})}),x=u/3;u=2*x-4+x;let _=Ae.createTypedArray(x,u),C=0;for(g=0;g<x-2;g+=2){let V=g,L=g+2,Z=h.fromArray(m,V*3,Zhe),G=h.fromArray(m,L*3,Ghe);if(h.equalsEpsilon(Z,G,W.EPSILON10))continue;let I=g+1,v=g+3;_[C++]=I,_[C++]=V,_[C++]=I,_[C++]=v,_[C++]=V,_[C++]=L}return _[C++]=x-2,_[C++]=x-1,new ht({attributes:f,indices:_,primitiveType:Fe.LINES,boundingSphere:new ce.fromVertices(m)})};var mv=oT;var Ihe=new B;function kqe(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function dh(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new kqe(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(dh.prototype=Object.create(ii.prototype),dh.prototype.constructor=dh);dh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Nn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Yt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Ihe)),l(c)||(c=B.WHITE),o=Kt.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Gt({id:t,geometry:new dv(this._options),attributes:i})};dh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=K.getValueOrDefault(this._outlineColorProperty,e,B.BLACK,Ihe),o=this._distanceDisplayConditionProperty.getValue(e);return new Gt({id:t,geometry:new mv(this._options),attributes:{show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Kt.fromColor(i),distanceDisplayCondition:Nn.fromDistanceDisplayCondition(o)}})};dh.prototype._isHidden=function(e,t){return!l(t.positions)||ii.prototype._isHidden.call(this,e,t)};dh.prototype._getIsClosed=function(e){return!1};dh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!K.isConstant(t.minimumHeights)||!K.isConstant(t.maximumHeights)||!K.isConstant(t.outlineWidth)||!K.isConstant(t.granularity)};dh.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof Yt,s=this._options;s.vertexFormat=r?dn.VERTEX_FORMAT:oo.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Be.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(Be.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(Be.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(o)?o.getValue(Be.MINIMUM_VALUE):void 0};dh.DynamicGeometryUpdater=eV;function eV(e,t,n){ni.call(this,e,t,n)}l(Object.create)&&(eV.prototype=Object.create(ni.prototype),eV.prototype.constructor=eV);eV.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||ni.prototype._isHidden.call(this,e,t,n)};eV.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=K.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=K.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=K.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=K.getValueOrUndefined(t.granularity,n)};var hv=dh;var rT=[gI,WP,CP,YP,zP,QP,ev,av,cv,hv];function sT(e,t){this.entity=e,this.scene=t;let n=new Array(rT.length),i=new be,o=new lr;for(let r=0;r<n.length;r++){let s=new rT[r](e,t);o.add(s.geometryChanged,a=>{i.raiseEvent(a)}),n[r]=s}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(sT.prototype._onEntityPropertyChanged,this)}sT.prototype._onEntityPropertyChanged=function(e,t,n,i){let o=this.updaters;for(let r=0;r<o.length;r++)o[r]._onEntityPropertyChanged(e,t,n,i)};sT.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};sT.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),me(this)};sT.registerUpdater=function(e){rT.includes(e)||rT.push(e)};sT.unregisterUpdater=function(e){if(rT.includes(e)){let t=rT.indexOf(e);rT.splice(t,1)}};var aT=sT;var Xsi=T(S(),1);var Xhe=new B,Uqe=new At,Dqe=new At,Bqe=h.ZERO,Oqe=new h;function uh(e,t,n,i,o,r,s){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.depthFailMaterial=void 0,this.closed=r,this.shadows=s,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Zt,this.updaters=new Zt,this.updatersWithAttributes=new Zt,this.attributes=new Zt,this.subscriptions=new Zt,this.showsUpdated=new Zt,this.itemsToRemove=[],this.invalidated=!1;let a;l(o)&&(a=o.definitionChanged.addEventListener(uh.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}uh.prototype.onMaterialChanged=function(){this.invalidated=!0};uh.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};uh.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!K.isConstant(e.distanceDisplayConditionProperty)||!K.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};uh.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};uh.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0){l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let c;l(this.depthFailAppearanceType)&&(l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=Qo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),c=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),o.add(i),t=!1}else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Yt)&&(this.depthFailMaterial=Qo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),m=this.attributes.get(u.id.id);if(l(m)||(m=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),!d.fillMaterialProperty.isConstant||c){let _=d.fillMaterialProperty.color,C=K.getValueOrDefault(_,e,B.WHITE,Xhe);B.equals(m._lastColor,C)||(m._lastColor=B.clone(C,m._lastColor),m.color=Kt.toValue(C,m.color),(this.translucent&&m.color[3]===255||!this.translucent&&m.color[3]!==255)&&(this.itemsToRemove[n++]=d))}if(l(this.depthFailAppearanceType)&&d.depthFailMaterialProperty instanceof Yt&&(!d.depthFailMaterialProperty.isConstant||c)){let _=d.depthFailMaterialProperty.color,C=K.getValueOrDefault(_,e,B.WHITE,Xhe);B.equals(m._lastDepthFailColor,C)||(m._lastDepthFailColor=B.clone(C,m._lastDepthFailColor),m.depthFailColor=Kt.toValue(C,m.depthFailColor))}let p=d.entity.isShowing&&(d.hasConstantFill||d.isFilled(e)),g=m.show[0]===1;p!==g&&(m.show=xn.toValue(p,m.show));let f=d.distanceDisplayConditionProperty;if(!K.isConstant(f)){let _=K.getValueOrDefault(f,e,Dqe,Uqe);At.equals(_,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=At.clone(_,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Nn.toValue(_,m.distanceDisplayCondition))}let x=d.terrainOffsetProperty;if(!K.isConstant(x)){let _=K.getValueOrDefault(x,e,Bqe,Oqe);h.equals(_,m._lastOffset)||(m._lastOffset=h.clone(_,m._lastOffset),m.offset=Qi.toValue(_,m.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};uh.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=xn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};uh.prototype.contains=function(e){return this.updaters.contains(e.id)};uh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ft.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ft.FAILED:(i.boundingSphere.clone(t),ft.DONE)};uh.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),l(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function tV(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}tV.prototype.add=function(e,t){let n,i,o=t.createFillGeometryInstance(e);o.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let r=n.length;for(let a=0;a<r;a++){let c=n[a];if(c.isMaterial(t)){c.add(t,o);return}}let s=new uh(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,o),n.push(s)};function Whe(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let o=e[i];if(o.remove(t))return o.updaters.length===0&&(e.splice(i,1),o.destroy()),!0}return!1}tV.prototype.remove=function(e){Whe(this._solidItems,e)||Whe(this._translucentItems,e)};function Phe(e,t,n){let i=!1,o=t.length;for(let r=0;r<o;++r){let s=t[r],a=s.itemsToRemove,c=a.length;if(c>0)for(r=0;r<c;r++){let d=a[r];s.remove(d),e.add(n,d),i=!0}}return i}function Yk(e,t,n,i){let o=t.length,r;for(r=o-1;r>=0;r--){let s=t[r];if(s.invalidated){t.splice(r,1);let a=s.updaters.values,c=a.length;for(let d=0;d<c;d++)e.add(n,a[d]);s.destroy()}}for(o=t.length,r=0;r<o;++r)i=t[r].update(n)&&i;return i}tV.prototype.update=function(e){let t=Yk(this,this._solidItems,e,!0);t=Yk(this,this._translucentItems,e,t)&&t;let n=Phe(this,this._solidItems,e),i=Phe(this,this._translucentItems,e);return(n||i)&&(t=Yk(this,this._solidItems,e,t)&&t,t=Yk(this,this._translucentItems,e,t)&&t),t};function vhe(e,t,n){let i=e.length;for(let o=0;o<i;o++){let r=e[o];if(r.contains(t))return r.getBoundingSphere(t,n)}return ft.FAILED}tV.prototype.getBoundingSphere=function(e,t){let n=vhe(this._solidItems,e,t);return n===ft.FAILED?vhe(this._translucentItems,e,t):n};function whe(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}tV.prototype.removeAllPrimitives=function(){whe(this._solidItems),whe(this._translucentItems)};var zu=tV;var zsi=T(S(),1);var Yqe=new At,Hqe=new At,zqe=h.ZERO,Kqe=new h;function mh(e,t,n,i,o,r,s){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.closed=r,this.shadows=s,this.updaters=new Zt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Zt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Zt,this.attributes=new Zt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(mh.prototype.onMaterialChanged,this),this.subscriptions=new Zt,this.showsUpdated=new Zt}mh.prototype.onMaterialChanged=function(){this.invalidated=!0};mh.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,o=e.depthFailMaterialProperty;if(n===t&&o===i)return!0;let r=l(t)&&t.equals(n);return r=(!l(i)&&!l(o)||l(i)&&i.equals(o))&&r,r};mh.prototype.add=function(e,t){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,t.createFillGeometryInstance(e)),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!K.isConstant(t.distanceDisplayConditionProperty)||!K.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};mh.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var Jqe=new B;mh.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=Qo.getValue(e,this.materialProperty,this.material);let a;l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=Qo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new In({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=Qo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Yt)&&(this.depthFailMaterial=Qo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],d=c.entity,u=this.geometry.get(c.id),m=this.attributes.get(u.id.id);if(l(m)||(m=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Yt&&!c.depthFailMaterialProperty.isConstant){let _=c.depthFailMaterialProperty.color,C=K.getValueOrDefault(_,e,B.WHITE,Jqe);B.equals(m._lastDepthFailColor,C)||(m._lastDepthFailColor=B.clone(C,m._lastDepthFailColor),m.depthFailColor=Kt.toValue(C,m.depthFailColor))}let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=m.show[0]===1;p!==g&&(m.show=xn.toValue(p,m.show));let f=c.distanceDisplayConditionProperty;if(!K.isConstant(f)){let _=K.getValueOrDefault(f,e,Hqe,Yqe);At.equals(_,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=At.clone(_,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Nn.toValue(_,m.distanceDisplayCondition))}let x=c.terrainOffsetProperty;if(!K.isConstant(x)){let _=K.getValueOrDefault(x,e,zqe,Kqe);h.equals(_,m._lastOffset)||(m._lastOffset=h.clone(_,m._lastOffset),m.offset=Qi.toValue(_,m.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};mh.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,d=a.show[0]===1;c!==d&&(a.show=xn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};mh.prototype.contains=function(e){return this.updaters.contains(e.id)};mh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ft.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ft.FAILED:(i.boundingSphere.clone(t),ft.DONE)};mh.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function nV(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}nV.prototype.add=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let s=n[r];if(s.isMaterial(t)){s.add(e,t);return}}let o=new mh(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};nV.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};nV.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};nV.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ft.FAILED};nV.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var Ku=nV;var lai=T(S(),1);var Qsi=T(S(),1),Ahe=T(Fhe(),1);function Hk(){this._tree=new Ahe.default}function cT(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}cT.fromRectangleAndId=function(e,t,n){return n.minX=t.west,n.minY=t.south,n.maxX=t.east,n.maxY=t.north,n.id=e,n};Hk.prototype.insert=function(e,t){let n=cT.fromRectangleAndId(e,t,new cT);this._tree.insert(n)};function Qqe(e,t){return e.id===t.id}var jqe=new cT;Hk.prototype.remove=function(e,t){let n=cT.fromRectangleAndId(e,t,jqe);this._tree.remove(n,Qqe)};var qqe=new cT;Hk.prototype.collides=function(e){let t=cT.fromRectangleAndId("",e,qqe);return this._tree.collides(t)};var lT=Hk;var $qe=new B,e$e=new At,t$e=new At;function Db(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Zt,this.updaters=new Zt,this.updatersWithAttributes=new Zt,this.attributes=new Zt,this.subscriptions=new Zt,this.showsUpdated=new Zt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new lT}Db.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Db.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!K.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Db.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Db.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new Ac({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),m=this.attributes.get(u.id.id);if(l(m)||(m=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),!d.fillMaterialProperty.isConstant||c){let x=d.fillMaterialProperty.color,_=K.getValueOrDefault(x,e,B.WHITE,$qe);B.equals(m._lastColor,_)||(m._lastColor=B.clone(_,m._lastColor),m.color=Kt.toValue(_,m.color))}let p=d.entity.isShowing&&(d.hasConstantFill||d.isFilled(e)),g=m.show[0]===1;p!==g&&(m.show=xn.toValue(p,m.show));let f=d.distanceDisplayConditionProperty;if(!K.isConstant(f)){let x=K.getValueOrDefault(f,e,t$e,e$e);At.equals(x,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=At.clone(x,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Nn.toValue(x,m.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Db.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=xn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Db.prototype.contains=function(e){return this.updaters.contains(e.id)};Db.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ft.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),ft.DONE):ft.FAILED};Db.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function iV(e,t){this._batches=[],this._primitives=e,this._classificationType=t}iV.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,o=K.getValueOrDefault(t.zIndex,0),r,s=i.length;for(let a=0;a<s;++a){let c=i[a];if(c.zIndex===o&&!c.overlapping(n.geometry.rectangle)){r=c;break}}return l(r)||(r=new Db(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};iV.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};iV.prototype.update=function(e){let t,n,i=!0,o=this._batches,r=o.length;for(t=0;t<r;++t)i=o[t].update(e)&&i;for(t=0;t<r;++t){let s=o[t],a=s.itemsToRemove,c=a.length;for(let d=0;d<c;d++){n=a[d],s.remove(n);let u=this.add(e,n);s.isDirty=!0,u.isDirty=!0}}for(t=r-1;t>=0;--t){let s=o[t];s.isDirty&&(i=o[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&o.splice(t,1)}return i};iV.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ft.FAILED};iV.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var oV=iV;var Cai=T(S(),1);var n$e=new At,i$e=new At;function Ju(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Zt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Zt,this.material=void 0,this.updatersWithAttributes=new Zt,this.attributes=new Zt,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(Ju.prototype.onMaterialChanged,this),this.subscriptions=new Zt,this.showsUpdated=new Zt,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new lT}Ju.prototype.onMaterialChanged=function(){this.invalidated=!0};Ju.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Ju.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Yt&&t instanceof Yt?!0:l(t)&&t.equals(n)};Ju.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),this.rectangleCollisionCheck.insert(i,n.geometry.rectangle),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!K.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Ju.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t)),!0}return!1};Ju.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=Qo.getValue(e,this.materialProperty,this.material),n=new Ac({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=Qo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],d=c.entity,u=this.geometry.get(c.id),m=this.attributes.get(u.id.id);l(m)||(m=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m));let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=m.show[0]===1;p!==g&&(m.show=xn.toValue(p,m.show));let f=c.distanceDisplayConditionProperty;if(!K.isConstant(f)){let x=K.getValueOrDefault(f,e,i$e,n$e);At.equals(x,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=At.clone(x,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Nn.toValue(x,m.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Ju.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,d=a.show[0]===1;c!==d&&(a.show=xn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Ju.prototype.contains=function(e){return this.updaters.contains(e.id)};Ju.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ft.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ft.FAILED:(i.boundingSphere.clone(t),ft.DONE)};Ju.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function rV(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}rV.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=ud.shouldUseSphericalCoordinates(o.geometry.rectangle),s=K.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let d=n[c];if(d.isMaterial(t)&&d.usingSphericalTextureCoordinates===r&&d.zIndex===s&&!d.overlapping(o.geometry.rectangle)){d.add(e,t,o);return}}let a=new Ju(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,s);a.add(e,t,o),n.push(a)};rV.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};rV.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};rV.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ft.FAILED};rV.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var fv=rV;var Mai=T(S(),1);var o$e=new B,r$e=new At,s$e=new At,a$e=h.ZERO,c$e=new h;function Bb(e,t,n,i){this.translucent=t,this.width=n,this.shadows=i,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Zt,this.updaters=new Zt,this.updatersWithAttributes=new Zt,this.attributes=new Zt,this.itemsToRemove=[],this.subscriptions=new Zt,this.showsUpdated=new Zt}Bb.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantOutline||!e.outlineColorProperty.isConstant||!K.isConstant(e.distanceDisplayConditionProperty)||!K.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Bb.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Bb.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new dn({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),m=this.attributes.get(u.id.id);if(l(m)||(m=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),!d.outlineColorProperty.isConstant||c){let _=d.outlineColorProperty,C=K.getValueOrDefault(_,e,B.WHITE,o$e);B.equals(m._lastColor,C)||(m._lastColor=B.clone(C,m._lastColor),m.color=Kt.toValue(C,m.color),(this.translucent&&m.color[3]===255||!this.translucent&&m.color[3]!==255)&&(this.itemsToRemove[n++]=d))}let p=d.entity.isShowing&&(d.hasConstantOutline||d.isOutlineVisible(e)),g=m.show[0]===1;p!==g&&(m.show=xn.toValue(p,m.show));let f=d.distanceDisplayConditionProperty;if(!K.isConstant(f)){let _=K.getValueOrDefault(f,e,s$e,r$e);At.equals(_,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=At.clone(_,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Nn.toValue(_,m.distanceDisplayCondition))}let x=d.terrainOffsetProperty;if(!K.isConstant(x)){let _=K.getValueOrDefault(x,e,a$e,c$e);h.equals(_,m._lastOffset)||(m._lastOffset=h.clone(_,m._lastOffset),m.offset=Qi.toValue(_,m.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Bb.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=xn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Bb.prototype.contains=function(e){return this.updaters.contains(e.id)};Bb.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ft.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ft.FAILED:(i.boundingSphere.clone(t),ft.DONE)};Bb.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function sV(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Zt,this._translucentBatches=new Zt}sV.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),o,r;n.attributes.color.value[3]===255?(o=this._solidBatches,r=o.get(i),l(r)||(r=new Bb(this._primitives,!1,i,this._shadows),o.set(i,r)),r.add(t,n)):(o=this._translucentBatches,r=o.get(i),l(r)||(r=new Bb(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};sV.prototype.remove=function(e){let t,n=this._solidBatches.values,i=n.length;for(t=0;t<i;t++)if(n[t].remove(e))return;let o=this._translucentBatches.values,r=o.length;for(t=0;t<r;t++)if(o[t].remove(e))return};sV.prototype.update=function(e){let t,n,i,o,r=this._solidBatches.values,s=r.length,a=this._translucentBatches.values,c=a.length,d,u=!0,m=!1;do{for(m=!1,n=0;n<s;n++){o=r[n],u=o.update(e),d=o.itemsToRemove;let p=d.length;if(p>0)for(m=!0,t=0;t<p;t++)i=d[t],o.remove(i),this.add(e,i)}for(n=0;n<c;n++){o=a[n],u=o.update(e),d=o.itemsToRemove;let p=d.length;if(p>0)for(m=!0,t=0;t<p;t++)i=d[t],o.remove(i),this.add(e,i)}}while(m);return u};sV.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,o=i.length;for(n=0;n<o;n++){let a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}let r=this._translucentBatches.values,s=r.length;for(n=0;n<s;n++){let a=r[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return ft.FAILED};sV.prototype.removeAllPrimitives=function(){let e,t=this._solidBatches.values,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._translucentBatches.values,o=i.length;for(e=0;e<o;e++)i[e].removeAllPrimitives()};var aV=sV;var l$e=[];function Dl(e,t,n,i){n=y(n,e.primitives),i=y(i,e.groundPrimitives),this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new Zt,this._removedObjects=new Zt,this._changedObjects=new Zt;let o=_n.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(o*2),this._closedColorBatches=new Array(o*2),this._closedMaterialBatches=new Array(o*2),this._openColorBatches=new Array(o*2),this._openMaterialBatches=new Array(o*2);let r=jo.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=r;let s;for(s=0;s<o;++s)this._outlineBatches[s]=new aV(n,e,s,!1),this._outlineBatches[o+s]=new aV(n,e,s,!0),this._closedColorBatches[s]=new zu(n,dn,void 0,!0,s,!0),this._closedColorBatches[o+s]=new zu(n,dn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new Ku(n,oo,void 0,!0,s,!0),this._closedMaterialBatches[o+s]=new Ku(n,oo,void 0,!0,s,!1),this._openColorBatches[s]=new zu(n,dn,void 0,!1,s,!0),this._openColorBatches[o+s]=new zu(n,dn,void 0,!1,s,!1),this._openMaterialBatches[s]=new Ku(n,oo,void 0,!1,s,!0),this._openMaterialBatches[o+s]=new Ku(n,oo,void 0,!1,s,!1);let a=kn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),d=[];if(r)for(s=0;s<a;++s)d.push(new fv(i,s,oo)),c[s]=new oV(i,s);else for(s=0;s<a;++s)c[s]=new oV(i,s);this._groundColorBatches=c,this._groundMaterialBatches=d,this._dynamicBatch=new Q_(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new Zt,this._updaterSets=new Zt,this._entityCollection=t,t.collectionChanged.addEventListener(Dl.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,l$e)}Dl.registerUpdater=function(e){aT.registerUpdater(e)};Dl.unregisterUpdater=function(e){aT.unregisterUpdater(e)};Dl.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,d,u,m=this;for(a=s.length-1;a>-1;a--)c=s[a],d=c.id,u=this._updaterSets.get(d),u.entity===c?u.forEach(function(x){m._removeUpdater(x),m._insertUpdaterIntoBatch(e,x)}):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],d=c.id,u=this._updaterSets.get(d),u.forEach(this._removeUpdater.bind(this)),u.destroy(),this._updaterSets.remove(d),this._subscriptions.get(d)(),this._subscriptions.remove(d);for(a=n.length-1;a>-1;a--)c=n[a],d=c.id,u=new aT(c,this._scene),this._updaterSets.set(d,u),u.forEach(function(x){m._insertUpdaterIntoBatch(e,x)}),this._subscriptions.set(d,u.geometryChanged.addEventListener(Dl._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,g=this._batches,f=g.length;for(a=0;a<f;a++)p=g[a].update(e)&&p;return p};var d$e=[],u$e=new ce;Dl.prototype.getBoundingSphere=function(e,t){let n=d$e,i=u$e,o=0,r=ft.DONE,s=this._batches,a=s.length,c=e.id,d=this._updaterSets.get(c).updaters;for(let u=0;u<d.length;u++){let m=d[u];for(let p=0;p<a;p++){if(r=s[p].getBoundingSphere(m,i),r===ft.PENDING)return ft.PENDING;r===ft.DONE&&(n[o]=ce.clone(i,n[o]),o++)}}return o===0?ft.FAILED:(n.length=o,ce.fromBoundingSpheres(n,t),ft.DONE)};Dl.prototype.isDestroyed=function(){return!1};Dl.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Dl.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();let o=this._updaterSets.values;for(n=o.length,e=0;e<n;e++)o[e].destroy();return this._updaterSets.removeAll(),me(this)};Dl.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Dl.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic){this._dynamicBatch.add(e,t);return}let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));let i=_n.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(l(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){let o=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof Yt?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Yt?l(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof Yt?l(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};Dl._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!l(t.get(o))&&!l(n.get(o))&&n.set(o,i)};Dl.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var pv=Dl;var Sci=T(S(),1);var m$e=1,h$e="30px sans-serif",f$e=Uo.FILL,p$e=B.WHITE,b$e=B.BLACK,g$e=1,y$e=!1,x$e=new B(.165,.165,.165,.8),_$e=new D(7,5),T$e=D.ZERO,S$e=h.ZERO,C$e=Qe.NONE,V$e=gi.CENTER,L$e=Pn.CENTER,R$e=new h,Z$e=new B,G$e=new B,E$e=new B,I$e=new D,X$e=new h,W$e=new D,P$e=new Ut,v$e=new Ut,w$e=new Ut,F$e=new At;function Mhe(e){this.entity=e,this.label=void 0,this.index=void 0}function Kg(e,t){t.collectionChanged.addEventListener(Kg.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Zt,this._onCollectionChanged(t,t.values,[],[])}Kg.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._label,c,d=r.label,u=s.isShowing&&s.isAvailable(e)&&K.getValueOrDefault(a._show,e,!0),m;if(u&&(m=K.getValueOrUndefined(s._position,e,R$e),c=K.getValueOrUndefined(a._text,e),u=l(m)&&l(c)),!u){EJ(r,s,n);continue}K.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=K.getValueOrDefault(a._heightReference,e,C$e);l(d)||(d=n.getLabel(s),d.id=s,r.label=d,p=h.equals(d.position,m)&&d.heightReference===g),d.show=!0,d.position=m,d.text=c,d.scale=K.getValueOrDefault(a._scale,e,m$e),d.font=K.getValueOrDefault(a._font,e,h$e),d.style=K.getValueOrDefault(a._style,e,f$e),d.fillColor=K.getValueOrDefault(a._fillColor,e,p$e,Z$e),d.outlineColor=K.getValueOrDefault(a._outlineColor,e,b$e,G$e),d.outlineWidth=K.getValueOrDefault(a._outlineWidth,e,g$e),d.showBackground=K.getValueOrDefault(a._showBackground,e,y$e),d.backgroundColor=K.getValueOrDefault(a._backgroundColor,e,x$e,E$e),d.backgroundPadding=K.getValueOrDefault(a._backgroundPadding,e,_$e,I$e),d.pixelOffset=K.getValueOrDefault(a._pixelOffset,e,T$e,W$e),d.eyeOffset=K.getValueOrDefault(a._eyeOffset,e,S$e,X$e),d.heightReference=g,d.horizontalOrigin=K.getValueOrDefault(a._horizontalOrigin,e,V$e),d.verticalOrigin=K.getValueOrDefault(a._verticalOrigin,e,L$e),d.translucencyByDistance=K.getValueOrUndefined(a._translucencyByDistance,e,P$e),d.pixelOffsetScaleByDistance=K.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,v$e),d.scaleByDistance=K.getValueOrUndefined(a._scaleByDistance,e,w$e),d.distanceDisplayCondition=K.getValueOrUndefined(a._distanceDisplayCondition,e,F$e),d.disableDepthTestDistance=K.getValueOrUndefined(a._disableDepthTestDistance,e),p&&d._updateClamping()}return!0};Kg.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return ft.FAILED;let i=n.label;return t.center=h.clone(y(i._clampedPosition,i.position),t.center),t.radius=0,ft.DONE};Kg.prototype.isDestroyed=function(){return!1};Kg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Kg.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return me(this)};Kg.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._label)&&l(r._position)&&s.set(r.id,new Mhe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._label)&&l(r._position)?s.contains(r.id)||s.set(r.id,new Mhe(r)):(EJ(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],EJ(s.get(r.id),r,a),s.remove(r.id)};function EJ(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var bv=Kg;var Bci=T(S(),1);var A$e=1,M$e=!0,N$e=0,k$e=!0,U$e=!0,D$e=_n.ENABLED,B$e=Qe.NONE,O$e=B.RED,Y$e=0,H$e=B.WHITE,z$e=lc.HIGHLIGHT,K$e=.5,J$e=new D(1,1),Q$e=new M,j$e=new M,Nhe=new B,khe=new Array(4),q$e=new h;function Jg(e,t){t.collectionChanged.addEventListener(Jg.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Zt,this._onCollectionChanged(t,t.values,[],[])}async function $$e(e,t,n,i){let o=e._primitives,r=e._modelHash;try{let s=await zm.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene});if(e.isDestroyed()||!l(r[t.id]))return;s.id=t,o.add(s),r[t.id].modelPrimitive=s,s.errorEvent.addEventListener(a=>{l(r[t.id])&&(console.log(a),a.name!=="TextureError"&&s.incrementallyLoadTextures&&(r[t.id].loadFailed=!0))})}catch(s){if(e.isDestroyed()||!l(r[t.id]))return;console.log(s),r[t.id].loadFailed=!0}}Jg.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._model,c,d=n[s.id],u=s.isShowing&&s.isAvailable(e)&&K.getValueOrDefault(a._show,e,!0),m;if(u&&(m=s.computeModelMatrix(e,Q$e),c=Ee.createIfNeeded(K.getValueOrUndefined(a._uri,e)),u=l(m)&&l(c)),!u){l(d)&&d.modelPrimitive&&(d.modelPrimitive.show=!1);continue}if(!l(d)||c.url!==d.url){l(d?.modelPrimitive)&&(i.removeAndDestroy(d.modelPrimitive),delete n[s.id]),d={modelPrimitive:void 0,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1},n[s.id]=d;let f=K.getValueOrDefault(a._incrementallyLoadTextures,e,k$e);$$e(this,s,c,f)}let p=d.modelPrimitive;if(!l(p))continue;p.show=!0,p.scale=K.getValueOrDefault(a._scale,e,A$e),p.enableVerticalExaggeration=K.getValueOrDefault(a._enableVerticalExaggeration,e,M$e),p.minimumPixelSize=K.getValueOrDefault(a._minimumPixelSize,e,N$e),p.maximumScale=K.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=M.clone(m,p.modelMatrix),p.shadows=K.getValueOrDefault(a._shadows,e,D$e),p.heightReference=K.getValueOrDefault(a._heightReference,e,B$e),p.distanceDisplayCondition=K.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=K.getValueOrDefault(a._silhouetteColor,e,O$e,Nhe),p.silhouetteSize=K.getValueOrDefault(a._silhouetteSize,e,Y$e),p.color=K.getValueOrDefault(a._color,e,H$e,Nhe),p.colorBlendMode=K.getValueOrDefault(a._colorBlendMode,e,z$e),p.colorBlendAmount=K.getValueOrDefault(a._colorBlendAmount,e,K$e),p.clippingPlanes=K.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=K.getValueOrDefault(a._clampAnimations,e,U$e),p.imageBasedLighting.imageBasedLightingFactor=K.getValueOrDefault(a._imageBasedLightingFactor,e,J$e);let g=K.getValueOrUndefined(a._lightColor,e);if(l(g)&&(B.pack(g,khe,0),g=h.unpack(khe,0,q$e)),p.lightColor=g,p.customShader=K.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){let f=K.getValueOrDefault(a._runAnimations,e,!0);d.animationsRunning!==f&&(f?p.activeAnimations.addAll({loop:vl.REPEAT}):p.activeAnimations.removeAll(),d.animationsRunning=f);let x=K.getValueOrUndefined(a._nodeTransformations,e,d.nodeTransformationsScratch);if(l(x)){let V=Object.keys(x);for(let L=0,Z=V.length;L<Z;++L){let G=V[L],I=x[G];if(!l(I))continue;let v=p.getNode(G);if(!l(v))continue;let P=M.fromTranslationRotationScale(I,j$e);v.matrix=M.multiply(v.originalMatrix,P,P)}}let _=!1,C=K.getValueOrUndefined(a._articulations,e,d.articulationsScratch);if(l(C)){let V=Object.keys(C);for(let L=0,Z=V.length;L<Z;++L){let G=V[L],I=C[G];l(I)&&(_=!0,p.setArticulationStage(G,I))}}_&&p.applyArticulations()}}return!0};Jg.prototype.isDestroyed=function(){return!1};Jg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Jg.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)IJ(this,e[i],t,n);return me(this)};var zk=new h,eet=new he;Jg.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return ft.FAILED;if(n.loadFailed)return ft.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return ft.PENDING;if(!i.ready||!n.modelUpdated)return ft.PENDING;let o=this._scene,r=y(o.ellipsoid,ne.default);if(i.heightReference!==Qe.NONE){let a=i.modelMatrix;zk.x=a[12],zk.y=a[13],zk.z=a[14];let c=r.cartesianToCartographic(zk,eet),d=o.getHeight(c,i.heightReference);return l(d)&&(bu(i.heightReference)?c.height=d:c.height+=d),ce.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(c),ft.DONE}return ce.clone(i.boundingSphere,t),ft.DONE};Jg.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._model)&&l(r._position)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._model)&&l(r._position)?(tet(r,a),s.set(r.id,r)):(IJ(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],IJ(this,r,a,c),s.remove(r.id)};function IJ(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function tet(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var gv=Jg;var _li=T(S(),1);var jci=T(S(),1);function Qg(e){this._definitionChanged=new be,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(Qg.prototype,{isConstant:{get:function(){return K.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:Ai.FIXED}}});var net=new j;Qg.prototype.getValue=function(e,t){return l(e)||(e=j.now(net)),this.getValueInReferenceFrame(e,Ai.FIXED,t)};Qg.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};Qg.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?ne.default.scaleToGeodeticSurface(n,n):void 0};Qg.prototype.equals=function(e){return this===e||e instanceof Qg&&this._value===e._value};Qg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Lf=Qg;var iet=60,oet=1,Dhe=new Vn,XJ=new Vn,WJ=new Vn;function Uhe(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function ret(e,t,n,i,o,r,s,a,c){let d=a,u;u=e.getValueInReferenceFrame(t,r,c[d]),l(u)&&(c[d++]=u);let m=!l(o)||j.lessThanOrEquals(o,t)||j.greaterThanOrEquals(o,n),p=0,g=i.length,f=i[p],x=n,_=!1,C,V,L;for(;p<g;){if(!m&&j.greaterThanOrEquals(f,o)&&(u=e.getValueInReferenceFrame(o,r,c[d]),l(u)&&(c[d++]=u),m=!0),j.greaterThan(f,t)&&j.lessThan(f,x)&&!f.equals(o)&&(u=e.getValueInReferenceFrame(f,r,c[d]),l(u)&&(c[d++]=u)),p<g-1){if(s>0&&!_){let Z=i[p+1],G=j.secondsDifference(Z,f);_=G>s,_&&(C=Math.ceil(G/s),V=0,L=G/Math.max(C,2),C=Math.max(C-1,1))}if(_&&V<C){f=j.addSeconds(f,L,new j),V++;continue}}_=!1,p++,f=i[p]}return u=e.getValueInReferenceFrame(n,r,c[d]),l(u)&&(c[d++]=u),d}function set(e,t,n,i,o,r,s,a){let c,d=0,u=s,m=t,p=!l(i)||j.lessThanOrEquals(i,t)||j.greaterThanOrEquals(i,n);for(;j.lessThan(m,n);)!p&&j.greaterThanOrEquals(m,i)&&(p=!0,c=e.getValueInReferenceFrame(i,o,a[u]),l(c)&&(a[u]=c,u++)),c=e.getValueInReferenceFrame(m,o,a[u]),l(c)&&(a[u]=c,u++),d++,m=j.addSeconds(t,r*d,new j);return c=e.getValueInReferenceFrame(n,o,a[u]),l(c)&&(a[u]=c,u++),u}function aet(e,t,n,i,o,r,s,a){let c,d=0,u=s,m=t,p=Math.max(r,60),g=!l(i)||j.lessThanOrEquals(i,t)||j.greaterThanOrEquals(i,n);for(;j.lessThan(m,n);)!g&&j.greaterThanOrEquals(m,i)&&(g=!0,c=e.getValueInReferenceFrame(i,o,a[u]),l(c)&&(a[u]=c,u++)),c=e.getValueInReferenceFrame(m,o,a[u]),l(c)&&(a[u]=c,u++),d++,m=j.addSeconds(t,p*d,new j);return c=e.getValueInReferenceFrame(n,o,a[u]),l(c)&&(a[u]=c,u++),u}function cet(e,t,n,i,o,r,s,a){WJ.start=t,WJ.stop=n;let c=s,d=e.intervals;for(let u=0;u<d.length;u++){let m=d.get(u);if(!Vn.intersect(m,WJ,Dhe).isEmpty){let p=m.start;m.isStartIncluded||(m.isStopIncluded?p=m.stop:p=j.addSeconds(m.start,j.secondsDifference(m.stop,m.start)/2,new j));let g=e.getValueInReferenceFrame(p,o,a[c]);l(g)&&(a[c]=g,c++)}}return c}function det(e,t,n,i,o,r,s,a){let c=e.getValueInReferenceFrame(t,o,a[s]);return l(c)&&(a[s++]=c),s}function uet(e,t,n,i,o,r,s,a){XJ.start=t,XJ.stop=n;let c=s,d=e.intervals;for(let u=0;u<d.length;u++){let m=d.get(u);if(!Vn.intersect(m,XJ,Dhe).isEmpty){let p=m.start,g=m.stop,f=t;j.greaterThan(p,f)&&(f=p);let x=n;j.lessThan(g,x)&&(x=g),c=Bhe(m.data,f,x,i,o,r,c,a)}}return c}function Bhe(e,t,n,i,o,r,s,a){for(;e instanceof Fb;)e=e.resolvedProperty;if(e instanceof fa){let c=e._property._times;s=ret(e,t,n,c,i,o,r,s,a)}else e instanceof yI?s=set(e,t,n,i,o,r,s,a):e instanceof ma?s=uet(e,t,n,i,o,r,s,a):e instanceof Ab?s=cet(e,t,n,i,o,r,s,a):e instanceof Nc||e instanceof Lf&&K.isConstant(e)?s=det(e,t,n,i,o,r,s,a):s=aet(e,t,n,i,o,r,s,a);return s}function Ohe(e,t,n,i,o,r,s){l(s)||(s=[]);let a=Bhe(e,t,n,i,o,r,0,s);return s.length=a,s}var met=new $;function yv(e,t){this._unusedIndexes=[],this._polylineCollection=new Jm,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}yv.prototype.update=function(e){if(this._referenceFrame===Ai.INERTIAL){let t=Ft.computeIcrfToCentralBodyFixedMatrix(e,met);M.fromRotationTranslation(t,h.ZERO,this._polylineCollection.modelMatrix)}};yv.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,s,a=i._show,c=t.polyline,d=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(d){let m=K.getValueOrUndefined(i._leadTime,e),p=K.getValueOrUndefined(i._trailTime,e),g=n._availability,f=l(g),x=l(m),_=l(p);if(d=f||x&&_,d){if(_&&(r=j.addSeconds(e,-p,new j)),x&&(s=j.addSeconds(e,m,new j)),f){let C=g.start,V=g.stop;(!_||j.greaterThan(C,r))&&(r=C),(!x||j.lessThan(V,s))&&(s=V)}d=j.lessThan(r,s)}}if(!d){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);return}if(!l(c)){let m=this._unusedIndexes;if(m.length>0){let g=m.pop();c=this._polylineCollection.get(g),t.index=g}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let u=K.getValueOrDefault(i._resolution,e,iet);c.show=!0,c.positions=Ohe(o,r,s,e,this._referenceFrame,u,c.positions.slice()),c.material=Qo.getValue(e,i._material,c.material),c.width=K.getValueOrDefault(i._width,e,oet),c.distanceDisplayCondition=K.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};yv.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};yv.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),me(this)};function jg(e,t){t.collectionChanged.addEventListener(jg.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Zt,this._onCollectionChanged(t,t.values,[],[])}jg.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,o=n.length;i<o;i++){let r=n[i],a=r.entity._position,c=r.updater,d=Ai.FIXED;this._scene.mode===oe.SCENE3D&&(d=a.referenceFrame);let u=this._updaters[d];if(c===u&&l(u)){u.updateObject(e,r);continue}l(c)&&c.removeObject(r),l(u)||(u=new yv(this._scene,d),u.update(e),this._updaters[d]=u),r.updater=u,l(u)&&u.updateObject(e,r)}return!0};jg.prototype.isDestroyed=function(){return!1};jg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(jg.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return me(this)};jg.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s,a=this._items;for(o=t.length-1;o>-1;o--)r=t[o],l(r._path)&&l(r._position)&&a.set(r.id,new Uhe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._path)&&l(r._position)?a.contains(r.id)||a.set(r.id,new Uhe(r)):(s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id)));for(o=n.length-1;o>-1;o--)r=n[o],s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id))};jg._subSample=Ohe;var xv=jg;var vli=T(S(),1);var Yhe=B.WHITE,Hhe=B.BLACK,zhe=0,Khe=1,Jhe=0,Qhe=vr.NONE,jhe=new B,het=new h,qhe=new B,$he=new Ut,efe=new Ut,tfe=new At;function nfe(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function qg(e,t){t.collectionChanged.addEventListener(qg.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Zt,this._onCollectionChanged(t,t.values,[],[])}qg.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._point,c=r.pointPrimitive,d=r.billboard,u=K.getValueOrDefault(a._heightReference,e,Qe.NONE),m=s.isShowing&&s.isAvailable(e)&&K.getValueOrDefault(a._show,e,!0),p;if(m&&(p=K.getValueOrUndefined(s._position,e,het),m=l(p)),!m){_v(r,s,n);continue}K.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,f=!1;if(u!==Qe.NONE&&!l(d)?(l(c)&&(_v(r,s,n),c=void 0),d=n.getBillboard(s),d.id=s,d.image=void 0,r.billboard=d,g=!0,f=h.equals(d.position,p)&&d.heightReference===u):u===Qe.NONE&&!l(c)&&(l(d)&&(_v(r,s,n),d=void 0),c=n.getPoint(s),c.id=s,r.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=K.getValueOrUndefined(a._scaleByDistance,e,$he),c.translucencyByDistance=K.getValueOrUndefined(a._translucencyByDistance,e,efe),c.color=K.getValueOrDefault(a._color,e,Yhe,jhe),c.outlineColor=K.getValueOrDefault(a._outlineColor,e,Hhe,qhe),c.outlineWidth=K.getValueOrDefault(a._outlineWidth,e,zhe),c.pixelSize=K.getValueOrDefault(a._pixelSize,e,Khe),c.distanceDisplayCondition=K.getValueOrUndefined(a._distanceDisplayCondition,e,tfe),c.disableDepthTestDistance=K.getValueOrDefault(a._disableDepthTestDistance,e,Jhe),c.splitDirection=K.getValueOrDefault(a._splitDirection,e,Qhe);else if(l(d)){d.show=!0,d.position=p,d.scaleByDistance=K.getValueOrUndefined(a._scaleByDistance,e,$he),d.translucencyByDistance=K.getValueOrUndefined(a._translucencyByDistance,e,efe),d.distanceDisplayCondition=K.getValueOrUndefined(a._distanceDisplayCondition,e,tfe),d.disableDepthTestDistance=K.getValueOrDefault(a._disableDepthTestDistance,e,Jhe),d.splitDirection=K.getValueOrDefault(a._splitDirection,e,Qhe),d.heightReference=u;let x=K.getValueOrDefault(a._color,e,Yhe,jhe),_=K.getValueOrDefault(a._outlineColor,e,Hhe,qhe),C=Math.round(K.getValueOrDefault(a._outlineWidth,e,zhe)),V=Math.max(1,Math.round(K.getValueOrDefault(a._pixelSize,e,Khe)));if(C>0?(d.scale=1,g=g||C!==r.outlineWidth||V!==r.pixelSize||!B.equals(x,r.color)||!B.equals(_,r.outlineColor)):(d.scale=V/50,V=50,g=g||C!==r.outlineWidth||!B.equals(x,r.color)||!B.equals(_,r.outlineColor)),g){r.color=B.clone(x,r.color),r.outlineColor=B.clone(_,r.outlineColor),r.pixelSize=V,r.outlineWidth=C;let L=x.alpha,Z=x.toCssColorString(),G=_.toCssColorString(),I=JSON.stringify([Z,V,G,C]);d.setImage(I,__(L,Z,G,C,V))}f&&d._updateClamping()}}return!0};qg.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return ft.FAILED;if(l(n.pointPrimitive))t.center=h.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return ft.PENDING;t.center=h.clone(i._clampedPosition,t.center)}return t.radius=0,ft.DONE};qg.prototype.isDestroyed=function(){return!1};qg.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(qg.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return me(this)};qg.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._point)&&l(r._position)&&s.set(r.id,new nfe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._point)&&l(r._position)?s.contains(r.id)||s.set(r.id,new nfe(r)):(_v(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],_v(s.get(r.id),r,a),s.remove(r.id)};function _v(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let o=e.billboard;l(o)&&(e.billboard=void 0,n.removeBillboard(t))}}var Tv=qg;var mui=T(S(),1);var Xdi=T(S(),1);var edi=T(S(),1);var afe=[];function fet(e,t,n,i,o){let r=afe;r.length=o;let s,a=n.red,c=n.green,d=n.blue,u=n.alpha,m=i.red,p=i.green,g=i.blue,f=i.alpha;if(B.equals(n,i)){for(s=0;s<o;s++)r[s]=B.clone(n);return r}let x=(m-a)/o,_=(p-c)/o,C=(g-d)/o,V=(f-u)/o;for(s=0;s<o;s++)r[s]=new B(a+s*x,c+s*_,d+s*C,u+s*V);return r}function Sv(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.width,1),o=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=o,this._vertexFormat=We.clone(y(e.vertexFormat,We.DEFAULT)),this._arcType=y(e.arcType,nn.GEODESIC),this._granularity=y(e.granularity,W.RADIANS_PER_DEGREE),this._ellipsoid=ne.clone(y(e.ellipsoid,ne.default)),this._workerName="createPolylineGeometry";let r=1+t.length*h.packedLength;r+=l(n)?1+n.length*B.packedLength:1,this.packedLength=r+ne.packedLength+We.packedLength+4}Sv.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=B.packedLength)B.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var cfe=ne.clone(ne.UNIT_SPHERE),lfe=new We,dT={positions:void 0,colors:void 0,ellipsoid:cfe,vertexFormat:lfe,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};Sv.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=B.packedLength)s[i]=B.unpack(e,t);let a=ne.unpack(e,t,cfe);t+=ne.packedLength;let c=We.unpack(e,t,lfe);t+=We.packedLength;let d=e[t++],u=e[t++]===1,m=e[t++],p=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=ne.clone(a,n._ellipsoid),n._vertexFormat=We.clone(c,n._vertexFormat),n._width=d,n._colorsPerVertex=u,n._arcType=m,n._granularity=p,n):(dT.positions=r,dT.colors=s,dT.width=d,dT.colorsPerVertex=u,dT.arcType=m,dT.granularity=p,new Sv(dT))};var ife=new h,ofe=new h,rfe=new h,sfe=new h;Sv.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,o=e._colorsPerVertex,r=e._arcType,s=e._granularity,a=e._ellipsoid,c,d,u,m=[],p=xo(e._positions,h.equalsEpsilon,!1,m);if(l(i)&&m.length>0){let A=0,N=m[0];i=i.filter(function(O,U){let Y=!1;return o?Y=U===N||U===0&&N===1:Y=U+1===N,Y?(A++,N=m[A],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(r===nn.GEODESIC||r===nn.RHUMB){let A,N;r===nn.GEODESIC?(A=W.chordLength(s,a.maximumRadius),N=Gi.numberOfPoints):(A=s,N=Gi.numberOfPointsRhumbLine);let O=Gi.extractHeights(p,a);if(l(i)){let U=1;for(c=0;c<g-1;++c)U+=N(p[c],p[c+1],A);let Y=new Array(U),k=0;for(c=0;c<g-1;++c){let H=p[c],J=p[c+1],te=i[c],z=N(H,J,A);if(o&&c<U){let q=i[c+1],ee=fet(H,J,te,q,z),fe=ee.length;for(d=0;d<fe;++d)Y[k++]=ee[d]}else for(d=0;d<z;++d)Y[k++]=B.clone(te)}Y[k]=B.clone(i[i.length-1]),i=Y,afe.length=0}r===nn.GEODESIC?p=Gi.generateCartesianArc({positions:p,minDistance:A,ellipsoid:a,height:O}):p=Gi.generateCartesianRhumbArc({positions:p,granularity:A,ellipsoid:a,height:O})}g=p.length;let f=g*4-4,x=new Float64Array(f*3),_=new Float64Array(f*3),C=new Float64Array(f*3),V=new Float32Array(f*2),L=n.st?new Float32Array(f*2):void 0,Z=l(i)?new Uint8Array(f*4):void 0,G=0,I=0,v=0,P=0,w;for(d=0;d<g;++d){d===0?(w=ife,h.subtract(p[0],p[1],w),h.add(p[0],w,w)):w=p[d-1],h.clone(w,rfe),h.clone(p[d],ofe),d===g-1?(w=ife,h.subtract(p[g-1],p[g-2],w),h.add(p[g-1],w,w)):w=p[d+1],h.clone(w,sfe);let A,N;l(Z)&&(d!==0&&!o?A=i[d-1]:A=i[d],d!==g-1&&(N=i[d]));let O=d===0?2:0,U=d===g-1?2:4;for(u=O;u<U;++u){h.pack(ofe,x,G),h.pack(rfe,_,G),h.pack(sfe,C,G),G+=3;let Y=u-2<0?-1:1;if(V[I++]=2*(u%2)-1,V[I++]=Y*t,n.st&&(L[v++]=d/(g-1),L[v++]=Math.max(V[I-2],0)),l(Z)){let k=u<2?A:N;Z[P++]=B.floatToByte(k.red),Z[P++]=B.floatToByte(k.green),Z[P++]=B.floatToByte(k.blue),Z[P++]=B.floatToByte(k.alpha)}}}let F=new mn;F.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:x}),F.prevPosition=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:_}),F.nextPosition=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:C}),F.expandAndWidth=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:V}),n.st&&(F.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:L})),l(Z)&&(F.color=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,values:Z,normalize:!0}));let b=Ae.createTypedArray(f,g*6-6),R=0,E=0,X=g-1;for(d=0;d<X;++d)b[E++]=R,b[E++]=R+2,b[E++]=R+1,b[E++]=R+1,b[E++]=R+2,b[E++]=R+3,R+=4;return new ht({attributes:F,indices:b,primitiveType:Fe.TRIANGLES,boundingSphere:ce.fromPoints(p),geometryType:du.POLYLINES})};var Ob=Sv;var pet=new Jn(0),Kk={},dfe=new B,bet=new Yt(B.WHITE),get=new Jn(!0),yet=new Jn(_n.DISABLED),xet=new Jn(new At),_et=new Jn(kn.BOTH);function Tet(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Cet(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function hh(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(hh.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new be,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new Tet,this._groundGeometryOptions=new Cet,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=jo.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(hh.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&K.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}});hh.prototype.isOutlineVisible=function(e){return!1};hh.prototype.isFilled=function(e){let t=this._entity,n=this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e);return y(n,!1)};hh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new xn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=Nn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r},a;return this._materialProperty instanceof Yt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,dfe)),l(a)||(a=B.WHITE),s.color=Kt.fromColor(a)),this.clampToGround?new Gt({id:t,geometry:new Vx(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Yt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,dfe)),l(a)||(a=B.WHITE),s.depthFailColor=Kt.fromColor(a)),new Gt({id:t,geometry:new Ob(this._geometryOptions),attributes:s}))};hh.prototype.createOutlineGeometryInstance=function(e){};hh.prototype.isDestroyed=function(){return!1};hh.prototype.destroy=function(){this._entitySubscription(),me(this)};hh.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let o=this._entity.polyline;if(!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.positions,s=o.show;if(l(s)&&s.isConstant&&!s.getValue(Be.MINIMUM_VALUE)||!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=o.zIndex,c=y(o.material,bet),d=c instanceof Yt;this._materialProperty=c,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=y(s,get),this._shadowsProperty=y(o.shadows,yet),this._distanceDisplayConditionProperty=y(o.distanceDisplayCondition,xet),this._classificationTypeProperty=y(o.classificationType,_et),this._fillEnabled=!0,this._zIndex=y(a,pet);let u=o.width,m=o.arcType,p=o.clampToGround,g=o.granularity;if(!r.isConstant||!K.isConstant(u)||!K.isConstant(m)||!K.isConstant(g)||!K.isConstant(p)||!K.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let f=this._geometryOptions,x=r.getValue(Be.MINIMUM_VALUE,f.positions);if(!l(x)||x.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let _;d&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Yt)?_=Jr.VERTEX_FORMAT:_=sa.VERTEX_FORMAT,f.vertexFormat=_,f.positions=x,f.width=l(u)?u.getValue(Be.MINIMUM_VALUE):void 0,f.arcType=l(m)?m.getValue(Be.MINIMUM_VALUE):void 0,f.granularity=l(g)?g.getValue(Be.MINIMUM_VALUE):void 0;let C=this._groundGeometryOptions;C.positions=x,C.width=f.width,C.arcType=f.arcType,C.granularity=f.granularity,this._clampToGround=l(p)?p.getValue(Be.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&&St("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};hh.prototype.createDynamicUpdater=function(e,t){return new Cv(e,t,this)};var cV={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function Cv(e,t,n){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=n,this._positions=[]}function ufe(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=Kk[n];!l(i)||i.isDestroyed()?(i=new Jm,Kk[n]=i,t.add(i)):t.contains(i)||t.add(i);let o=i.add();return o.id=e._geometryUpdater._entity,e._line=o,o}Cv.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,o=i.positions,r=K.getValueOrUndefined(o,e,this._positions);t._clampToGround=K.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=r,t._groundGeometryOptions.width=K.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=K.getValueOrDefault(i._arcType,e,nn.GEODESIC),t._groundGeometryOptions.granularity=K.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(l(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!K.getValueOrDefault(i._show,e,!0)||!l(r)||r.length<2)return;let m=t.fillMaterialProperty,p;if(m instanceof Yt)p=new Jr;else{let g=Qo.getValue(e,m,this._material);p=new sa({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=s.add(new Rm({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),K.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=ufe(this);if(!n.isShowing||!n.isAvailable(e)||!K.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(r)||r.length<2){a.show=!1;return}let c=nn.GEODESIC;c=K.getValueOrDefault(i._arcType,e,c);let d=t._scene.globe,u=t._scene.ellipsoid;c!==nn.NONE&&l(d)&&(cV.ellipsoid=u,cV.positions=r,cV.granularity=K.getValueOrUndefined(i._granularity,e),cV.height=Gi.extractHeights(r,u),c===nn.GEODESIC?r=Gi.generateCartesianArc(cV):r=Gi.generateCartesianRhumbArc(cV)),a.show=!0,a.positions=r.slice(),a.material=Qo.getValue(e,t.fillMaterialProperty,a.material),a.width=K.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=K.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};Cv.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(l(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(l(n)&&l(n.boundingSphere))return ce.clone(n.boundingSphere,e),ft.DONE}return l(t)&&!t.ready?ft.PENDING:ft.DONE}else{let t=ufe(this);if(t.show&&t.positions.length>0)return ce.fromPoints(t.positions,e),ft.DONE}return ft.FAILED};Cv.prototype.isDestroyed=function(){return!1};Cv.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=Kk[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete Kk[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),me(this)};var Vv=hh;var Kdi=T(S(),1);var Vet=new B,Let=new At,Ret=new At;function fh(e,t,n,i,o){let r;n instanceof Yt?r=Jr:r=sa,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new Zt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Zt,this.material=void 0,this.updatersWithAttributes=new Zt,this.attributes=new Zt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(fh.prototype.onMaterialChanged,this),this.subscriptions=new Zt,this.showsUpdated=new Zt,this.zIndex=i,this._asynchronous=o}fh.prototype.onMaterialChanged=function(){this.invalidated=!0};fh.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Yt&&t instanceof Yt?!0:l(t)&&t.equals(n)};fh.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!K.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};fh.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};fh.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new Rm({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===sa&&(this.material=Qo.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===sa&&(this.material=Qo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],d=c.entity,u=this.geometry.get(c.id),m=this.attributes.get(u.id.id);if(l(m)||(m=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),!c.fillMaterialProperty.isConstant){let x=c.fillMaterialProperty.color,_=K.getValueOrDefault(x,e,B.WHITE,Vet);B.equals(m._lastColor,_)||(m._lastColor=B.clone(_,m._lastColor),m.color=Kt.toValue(_,m.color))}let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=m.show[0]===1;p!==g&&(m.show=xn.toValue(p,m.show));let f=c.distanceDisplayConditionProperty;if(!K.isConstant(f)){let x=K.getValueOrDefault(f,e,Ret,Let);At.equals(x,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=At.clone(x,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=Nn.toValue(x,m.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};fh.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,d=a.show[0]===1;c!==d&&(a.show=xn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};fh.prototype.contains=function(e){return this.updaters.contains(e.id)};fh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return ft.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?ft.FAILED:(i.boundingSphere.clone(t),ft.DONE)};fh.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function lV(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=y(n,!0)}lV.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=K.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let c=n[a];if(c.isMaterial(t)&&c.zIndex===r){c.add(e,t,o);return}}let s=new fh(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};lV.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};lV.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};lV.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return ft.FAILED};lV.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var Lv=lV;var Zet=[];function mfe(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function hfe(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let s=n.classificationTypeProperty.getValue(t);e._groundBatches[s].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let o=0;l(n.depthFailMaterialProperty)&&(o=n.depthFailMaterialProperty instanceof Yt?1:2);let r;l(i)&&(r=i+o*_n.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Yt?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function Rf(e,t,n,i){i=y(i,e.groundPrimitives),n=y(n,e.primitives),this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new Zt,this._removedObjects=new Zt,this._changedObjects=new Zt;let o,r=_n.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(r*3),this._materialBatches=new Array(r*3),o=0;o<r;++o)this._colorBatches[o]=new zu(n,Jr,void 0,!1,o),this._materialBatches[o]=new Ku(n,sa,void 0,!1,o),this._colorBatches[o+r]=new zu(n,Jr,Jr,!1,o),this._materialBatches[o+r]=new Ku(n,sa,Jr,!1,o),this._colorBatches[o+r*2]=new zu(n,Jr,sa,!1,o),this._materialBatches[o+r*2]=new Ku(n,sa,sa,!1,o);this._dynamicBatch=new Q_(n,i);let s=kn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new Lv(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Zt,this._updaters=new Zt,this._entityCollection=t,t.collectionChanged.addEventListener(Rf.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Zet)}Rf.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,d,u;for(a=s.length-1;a>-1;a--)c=s[a],d=c.id,u=this._updaters.get(d),u.entity===c?(mfe(this,u),hfe(this,e,u)):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],d=c.id,u=this._updaters.get(d),mfe(this,u),u.destroy(),this._updaters.remove(d),this._subscriptions.get(d)(),this._subscriptions.remove(d);for(a=n.length-1;a>-1;a--)c=n[a],d=c.id,u=new Vv(c,this._scene),this._updaters.set(d,u),hfe(this,e,u),this._subscriptions.set(d,u.geometryChanged.addEventListener(Rf._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let m=!0,p=this._batches,g=p.length;for(a=0;a<g;a++)m=p[a].update(e)&&m;return m};var Get=[],Eet=new ce;Rf.prototype.getBoundingSphere=function(e,t){let n=Get,i=Eet,o=0,r=ft.DONE,s=this._batches,a=s.length,c=this._updaters.get(e.id);for(let d=0;d<a;d++){if(r=s[d].getBoundingSphere(c,i),r===ft.PENDING)return ft.PENDING;r===ft.DONE&&(n[o]=ce.clone(i,n[o]),o++)}return o===0?ft.FAILED:(n.length=o,ce.fromBoundingSpheres(n,t),ft.DONE)};Rf.prototype.isDestroyed=function(){return!1};Rf.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Rf.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),me(this)};Rf._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!l(t.get(o))&&!l(n.get(o))&&n.set(o,i)};Rf.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var Rv=Rf;function Bl(e){Ac.initializeTerrainHeights(),Rm.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new lr,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=y(e.visualizersCallback,Bl.defaultVisualizersCallback);let i=!1,o=new kl,r=new kl;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let d=0,u=n.length;d<u;d++)this._onDataSourceAdded(n,n.get(d));let s=new EP;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let d=this,u=function(){t.primitives.add(o),t.groundPrimitives.add(r),a(),c(),d._removeDefaultDataSourceListener=void 0,d._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(u),c=n.dataSourceAdded.addEventListener(u)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}var dV=[];Bl.registerVisualizer=function(e){dV.includes(e)||dV.push(e)};Bl.unregisterVisualizer=function(e){if(dV.includes(e)){let t=dV.indexOf(e);dV.splice(t,1)}};Bl.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new sE(t,i),new pv(e,i,n._primitives,n._groundPrimitives),new bv(t,i),new gv(e,i),new fP(e,i),new Tv(t,i),new xv(e,i),new Rv(e,i,n._primitives,n._groundPrimitives),...dV.map(o=>new o(e,i))]};Object.defineProperties(Bl.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}});Bl.prototype.isDestroyed=function(){return!1};Bl.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),l(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),me(this)};Bl.prototype.update=function(e){if(!li.initialized)return this._ready=!1,!1;let t=!0,n,i,o,r,s=this._dataSourceCollection,a=s.length;for(n=0;n<a;n++){let c=s.get(n);for(l(c.update)&&(t=c.update(e)&&t),o=c._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t}for(o=this._defaultDataSource._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t;return!this._ready&&t&&this._scene.requestRender(),this._ready=t,t};Bl.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let o=t.get(i),r=o.credit;l(r)&&e.creditDisplay.addCreditToNextFrame(r);let s=o._resourceCredits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)e.creditDisplay.addCreditToNextFrame(s[c])}}};var Iet=[],Xet=new ce;Bl.prototype.getBoundingSphere=function(e,t,n){if(!this._ready&&!t)return ft.PENDING;let i,o,r=this._defaultDataSource;if(!r.entities.contains(e)){r=void 0;let p=this._dataSourceCollection;for(o=p.length,i=0;i<o;i++){let g=p.get(i);if(g.entities.contains(e)){r=g;break}}}if(!l(r))return ft.FAILED;let s=Iet,a=Xet,c=0,d=ft.DONE,u=r._visualizers,m=u.length;for(i=0;i<m;i++){let p=u[i];if(l(p.getBoundingSphere)){if(d=u[i].getBoundingSphere(e,a),!t&&d===ft.PENDING)return ft.PENDING;d===ft.DONE&&(s[c]=ce.clone(a,s[c]),c++)}}return c===0?ft.FAILED:(s.length=c,ce.fromBoundingSpheres(s,n),ft.DONE)};Bl.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new kl),s=o.add(new OP);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};Bl.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,o=t._primitives,r=t._groundPrimitives,s=t.clustering;o.remove(s);let a=t._visualizers,c=a.length;for(let d=0;d<c;d++)a[d].destroy();n.remove(o),i.remove(r),t._visualizers=void 0};Bl.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,o=this._groundPrimitives,r=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(r),o.raise(s)):t===n-1?(i.lower(r),o.lower(s)):t===0?(i.lowerToBottom(r),o.lowerToBottom(s),i.raise(r),o.raise(s)):(i.raiseToTop(r),o.raiseToTop(s))};var Zv=Bl;var jui=T(S(),1);var Mui=T(S(),1);function PJ(e,t,n){this.heading=y(e,0),this.pitch=y(t,0),this.range=y(n,0)}PJ.clone=function(e,t){if(l(e))return l(t)||(t=new PJ),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var Qu=PJ;var ffe=new $,pfe=new $,bfe=new $,Wet=new M,Jk=new h,gfe=new h,vJ=new h,wJ=new h,yfe=new h,xfe=new h,uV=new j,Pet=1.25;function vet(e,t,n,i,o,r,s){let a=e.scene.mode,c=o.getValue(r,e._lastCartesian);if(l(c)){let d=!1,u=!1,m,p,g;if(a===oe.SCENE3D){j.addSeconds(r,.001,uV);let V=o.getValue(uV,Jk);if(l(V)||(j.addSeconds(r,-.001,uV),V=o.getValue(uV,Jk),u=!0),l(V)){let L=Ft.computeFixedToIcrfMatrix(r,ffe),Z=Ft.computeFixedToIcrfMatrix(uV,pfe),G;!l(L)||!l(Z)?(G=Ft.computeTemeToPseudoFixedMatrix(r,bfe),L=$.transpose(G,ffe),Z=Ft.computeTemeToPseudoFixedMatrix(uV,pfe),$.transpose(Z,Z)):G=$.transpose(L,bfe);let I=$.multiplyByVector(L,c,yfe),v=$.multiplyByVector(Z,V,xfe);h.subtract(I,v,wJ);let P=h.magnitude(wJ)*1e3,w=W.GRAVITATIONALPARAMETER,F=-w/(P*P-2*w/h.magnitude(I));F<0||F>Pet*s.maximumRadius?(m=gfe,h.normalize(c,m),h.negate(m,m),g=h.clone(h.UNIT_Z,vJ),p=h.cross(g,m,Jk),h.magnitude(p)>W.EPSILON7&&(h.normalize(m,m),h.normalize(p,p),g=h.cross(m,p,vJ),h.normalize(g,g),d=!0)):h.equalsEpsilon(c,V,W.EPSILON7)||(g=gfe,h.normalize(I,g),h.normalize(v,v),p=h.cross(g,v,vJ),u&&(p=h.multiplyByScalar(p,-1,p)),h.equalsEpsilon(p,h.ZERO,W.EPSILON7)||(m=h.cross(p,g,Jk),$.multiplyByVector(G,m,m),$.multiplyByVector(G,p,p),$.multiplyByVector(G,g,g),h.normalize(m,m),h.normalize(p,p),h.normalize(g,g),d=!0))}}l(e.boundingSphere)&&(c=e.boundingSphere.center);let f,x,_;i&&(f=h.clone(t.position,wJ),x=h.clone(t.direction,yfe),_=h.clone(t.up,xfe));let C=Wet;d?(C[0]=m.x,C[1]=m.y,C[2]=m.z,C[3]=0,C[4]=p.x,C[5]=p.y,C[6]=p.z,C[7]=0,C[8]=g.x,C[9]=g.y,C[10]=g.z,C[11]=0,C[12]=c.x,C[13]=c.y,C[14]=c.z,C[15]=0):Ft.eastNorthUpToFixedFrame(c,s,C),t._setTransform(C),i&&(h.clone(f,t.position),h.clone(x,t.direction),h.clone(_,t.up),h.cross(x,_,t.right))}if(n){let d=a===oe.SCENE2D||h.equals(e._offset3D,h.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,d)}}function Gv(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=y(n,ne.default),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new h,this._defaultOffset3D=void 0,this._offset3D=new h}Object.defineProperties(Gv,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});Gv.defaultOffset3D=new h(-14e3,3500,3500);var Qk=new Qu,wet=new h;Gv.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===oe.MORPHING)return;let r=this.entity,s=r.position;if(!l(s))return;let a=r!==this._lastEntity,c=o!==this._mode,d=n.camera,u=a||c,m=!0;if(a){let p=r.viewFrom,g=l(p);if(!g&&l(t)){Qk.pitch=-W.PI_OVER_FOUR,Qk.range=0;let f=s.getValue(e,wet);if(l(f)){let x=2-1/Math.max(1,h.magnitude(f)/i.maximumRadius);Qk.pitch*=x}d.viewBoundingSphere(t,Qk),this.boundingSphere=t,u=!1,m=!1}else(!g||!l(p.getValue(e,this._offset3D)))&&h.clone(Gv._defaultOffset3D,this._offset3D)}else!c&&this._mode!==oe.SCENE2D&&h.clone(d.position,this._offset3D);this._lastEntity=r,this._mode=o,vet(this,d,u,m,s,e,i)};var Ev=Gv;var Ehi=T(S(),1);var omi=T(S(),1);function Xv(){this._cache={}}Xv.prototype.fromColor=function(e,t){return jk(void 0,void 0,e,t,this._cache)};Xv.prototype.fromUrl=function(e,t,n){return jk(e,void 0,t,n,this._cache)};Xv.prototype.fromMakiIconId=function(e,t,n){return jk(rn(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};Xv.prototype.fromText=function(e,t,n){return jk(void 0,e,t,n,this._cache)};var Fet=new B;function Aet(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,Fet).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function _fe(e,t,n){let i=n/2.5,o=i,r=i;t.width>t.height?r=i*(t.height/t.width):t.width<t.height&&(o=i*(t.width/t.height));let s=Math.round((n-o)/2),a=Math.round(7/24*n-r/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,o,r),e.drawImage(t,s,a-1,o,r),e.drawImage(t,s+1,a,o,r),e.drawImage(t,s,a+1,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=B.BLACK.toCssColorString(),e.fillRect(s-1,a-1,o+2,r+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=B.WHITE.toCssColorString(),e.fillRect(s-1,a-2,o+2,r+2)}var Iv=new Array(4);function jk(e,t,n,i,o){Iv[0]=e,Iv[1]=t,Iv[2]=n,Iv[3]=i;let r=JSON.stringify(Iv),s=o[r];if(l(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let c=a.getContext("2d");if(Aet(c,n,i),l(e)){let u=Ee.createIfNeeded(e).fetchImage().then(function(m){return _fe(c,m,i),o[r]=a,a});return o[r]=u,u}else if(l(t)){let d=S_(t,{font:`bold ${i}px sans-serif`});_fe(c,d,i)}return o[r]=a,a}var Yb=Xv;var Kmi=T(S());var mmi=T(S());var lmi=T(S());var smi=T(S());function FJ(e){return e}function qk(e){if(e==null)return FJ;var t,n,i=e.scale[0],o=e.scale[1],r=e.translate[0],s=e.translate[1];return function(a,c){c||(t=n=0);var d=2,u=a.length,m=new Array(u);for(m[0]=(t+=a[0])*i+r,m[1]=(n+=a[1])*o+s;d<u;)m[d]=a[d],++d;return m}}var ymi=T(S());var fmi=T(S());function Tfe(e,t){for(var n,i=e.length,o=i-t;o<--i;)n=e[o],e[o++]=e[i],e[i]=n}function AJ(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return Sfe(e,n)})}:Sfe(e,t)}function Sfe(e,t){var n=t.id,i=t.bbox,o=t.properties==null?{}:t.properties,r=MJ(e,t);return n==null&&i==null?{type:"Feature",properties:o,geometry:r}:i==null?{type:"Feature",id:n,properties:o,geometry:r}:{type:"Feature",id:n,bbox:i,properties:o,geometry:r}}function MJ(e,t){var n=qk(e.transform),i=e.arcs;function o(u,m){m.length&&m.pop();for(var p=i[u<0?~u:u],g=0,f=p.length;g<f;++g)m.push(n(p[g],g));u<0&&Tfe(m,f)}function r(u){return n(u)}function s(u){for(var m=[],p=0,g=u.length;p<g;++p)o(u[p],m);return m.length<2&&m.push(m[0]),m}function a(u){for(var m=s(u);m.length<4;)m.push(m[0]);return m}function c(u){return u.map(a)}function d(u){var m=u.type,p;switch(m){case"GeometryCollection":return{type:m,geometries:u.geometries.map(d)};case"Point":p=r(u.coordinates);break;case"MultiPoint":p=u.coordinates.map(r);break;case"LineString":p=s(u.arcs);break;case"MultiLineString":p=u.arcs.map(s);break;case"Polygon":p=c(u.arcs);break;case"MultiPolygon":p=u.arcs.map(c);break;default:return null}return{type:m,coordinates:p}}return d(t)}var Vmi=T(S());var _mi=T(S());var Gmi=T(S());var vmi=T(S());var Imi=T(S());var Umi=T(S());var Ami=T(S());function $k(e){return h.fromDegrees(e[0],e[1],e[2])}var NJ={"urn:ogc:def:crs:OGC:1.3:CRS84":$k,"EPSG:4326":$k,"urn:ogc:def:crs:EPSG::4326":$k},Cfe={},Vfe={},kJ=48,UJ,DJ=B.ROYALBLUE,BJ=B.YELLOW,OJ=2,YJ=B.fromBytes(255,255,0,100),HJ=!1,Det={small:24,medium:48,large:64},Bet=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function Lfe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||Bet.indexOf(i)!==-1)continue;let o=e[i];l(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${Lfe(o)}</td></tr>`:n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function Oet(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function Yet(e,t){return new Xm(Oet(Lfe,e,t),!0)}function eU(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Bn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(l(r)){o.properties=r;let s,a=r.title;if(l(a))o.name=a,s="title";else{let d=Number.MAX_VALUE;for(let u in r)if(r.hasOwnProperty(u)&&r[u]){let m=u.toLowerCase();if(d>1&&m==="title"){d=1,s=u;break}else d>2&&m==="name"?(d=2,s=u):d>3&&/title/i.test(u)?(d=3,s=u):d>4&&/name/i.test(u)&&(d=4,s=u)}l(s)&&(o.name=r[s])}let c=r.description;c!==null&&(o.description=l(c)?new Jn(c):n(r,s))}return o}function zJ(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var Rfe={Feature:Gfe,FeatureCollection:Het,GeometryCollection:Efe,LineString:vfe,MultiLineString:wfe,MultiPoint:Wfe,MultiPolygon:Mfe,Point:Xfe,Polygon:Afe,Topology:Nfe},Zfe={GeometryCollection:Efe,LineString:vfe,MultiLineString:wfe,MultiPoint:Wfe,MultiPolygon:Mfe,Point:Xfe,Polygon:Afe,Topology:Nfe};function Gfe(e,t,n,i,o){if(t.geometry===null){eU(t,e._entityCollection,o.describe);return}if(!l(t.geometry))throw new de("feature.geometry is required.");let r=t.geometry.type,s=Zfe[r];if(!l(s))throw new de(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function Het(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)Gfe(e,r[s],void 0,i,o)}function Efe(e,t,n,i,o){let r=n.geometries;for(let s=0,a=r.length;s<a;s++){let c=r[s],d=c.type,u=Zfe[d];if(!l(u))throw new de(`Unknown geometry type: ${d}`);u(e,t,c,i,o)}}function Ife(e,t,n,i,o){let r=o.markerSymbol,s=o.markerColor,a=o.markerSize,c=t.properties;if(l(c)){let g=c["marker-color"];l(g)&&(s=B.fromCssColorString(g)),a=y(Det[c["marker-size"]],a);let f=c["marker-symbol"];l(f)&&(r=f)}let d;l(r)?r.length===1?d=e._pinBuilder.fromText(r.toUpperCase(),s,a):d=e._pinBuilder.fromMakiIconId(r,s,a):d=e._pinBuilder.fromColor(s,a);let u=new tc;u.verticalOrigin=new Jn(Pn.BOTTOM),i.length===2&&o.clampToGround&&(u.heightReference=Qe.CLAMP_TO_GROUND);let m=eU(t,e._entityCollection,o.describe);m.billboard=u,m.position=new Nc(n(i));let p=Promise.resolve(d).then(function(g){u.image=new Jn(g)}).catch(function(){u.image=new Jn(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function Xfe(e,t,n,i,o){Ife(e,t,i,n.coordinates,o)}function Wfe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)Ife(e,t,i,r[s],o)}function Pfe(e,t,n,i,o){let r=o.strokeMaterialProperty,s=o.strokeWidthProperty,a=t.properties;if(l(a)){let u=a["stroke-width"];l(u)&&(s=new Jn(u));let m,p=a.stroke;l(p)&&(m=B.fromCssColorString(p));let g=a["stroke-opacity"];l(g)&&g!==1&&(l(m)||(m=r.color.getValue().clone()),m.alpha=g),l(m)&&(r=new Yt(m))}let c=eU(t,e._entityCollection,o.describe),d=new oc;c.polyline=d,d.clampToGround=o.clampToGround,d.material=r,d.width=s,d.positions=new Jn(zJ(i,n)),d.arcType=nn.RHUMB}function vfe(e,t,n,i,o){Pfe(e,t,i,n.coordinates,o)}function wfe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)Pfe(e,t,i,r[s],o)}function Ffe(e,t,n,i,o){if(i.length===0||i[0].length===0)return;let r=o.strokeMaterialProperty.color,s=o.fillMaterialProperty,a=o.strokeWidthProperty,c=t.properties;if(l(c)){let g=c["stroke-width"];l(g)&&(a=new Jn(g));let f,x=c.stroke;l(x)&&(f=B.fromCssColorString(x));let _=c["stroke-opacity"];l(_)&&_!==1&&(l(f)||(f=r.getValue().clone()),f.alpha=_),l(f)&&(r=new Jn(f));let C,V=c.fill,L=s.color.getValue();l(V)&&(C=B.fromCssColorString(V),C.alpha=L.alpha),_=c["fill-opacity"],l(_)&&_!==L.alpha&&(l(C)||(C=L.clone()),C.alpha=_),l(C)&&(s=new Yt(C))}let d=new Em;d.outline=new Jn(!0),d.outlineColor=r,d.outlineWidth=a,d.material=s,d.arcType=nn.RHUMB;let u=[];for(let g=1,f=i.length;g<f;g++)u.push(new Ia(zJ(i[g],n)));let m=i[0];d.hierarchy=new Jn(new Ia(zJ(m,n),u)),m[0].length>2?d.perPositionHeight=new Jn(!0):o.clampToGround||(d.height=0);let p=eU(t,e._entityCollection,o.describe);p.polygon=d}function Afe(e,t,n,i,o){Ffe(e,t,i,n.coordinates,o)}function Mfe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)Ffe(e,t,i,r[s],o)}function Nfe(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=AJ(n,n.objects[r]),a=Rfe[s.type];a(e,s,s,i,o)}}function $g(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new Hs(this),this._promises=[],this._pinBuilder=new Yb,this._entityCluster=new Zd,this._credit=void 0,this._resourceCredits=[]}$g.load=function(e,t){return new $g().load(e,t)};Object.defineProperties($g,{markerSize:{get:function(){return kJ},set:function(e){kJ=e}},markerSymbol:{get:function(){return UJ},set:function(e){UJ=e}},markerColor:{get:function(){return DJ},set:function(e){DJ=e}},stroke:{get:function(){return BJ},set:function(e){BJ=e}},strokeWidth:{get:function(){return OJ},set:function(e){OJ=e}},fill:{get:function(){return YJ},set:function(e){YJ=e}},clampToGround:{get:function(){return HJ},set:function(e){HJ=e}},crsNames:{get:function(){return NJ}},crsLinkHrefs:{get:function(){return Cfe}},crsLinkTypes:{get:function(){return Vfe}}});Object.defineProperties($g.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});$g.prototype.load=function(e,t){return kfe(this,e,t,!0)};$g.prototype.process=function(e,t){return kfe(this,e,t,!1)};function kfe(e,t,n,i){Dr.setLoading(e,!0),n=y(n,y.EMPTY_OBJECT);let o=n.credit;typeof o=="string"&&(o=new Et(o)),e._credit=o;let r=t,s=n.sourceUri;if(typeof t=="string"||t instanceof Ee){t=Ee.createIfNeeded(t),r=t.fetchJson(),s=y(s,t.getUrlComponent());let a=e._resourceCredits,c=t.credits;if(l(c)){let d=c.length;for(let u=0;u<d;u++)a.push(c[u])}}return n={describe:y(n.describe,Yet),markerSize:y(n.markerSize,kJ),markerSymbol:y(n.markerSymbol,UJ),markerColor:y(n.markerColor,DJ),strokeWidthProperty:new Jn(y(n.strokeWidth,OJ)),strokeMaterialProperty:new Yt(y(n.stroke,BJ)),fillMaterialProperty:new Yt(y(n.fill,YJ)),clampToGround:y(n.clampToGround,HJ)},Promise.resolve(r).then(function(a){return zet(e,a,n,s,i)}).catch(function(a){throw Dr.setLoading(e,!1),e._error.raiseEvent(e,a),a})}$g.prototype.update=function(e){return!0};function zet(e,t,n,i,o){let r;l(i)&&(r=Pb(i)),l(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=Rfe[t.type];if(!l(s))throw new de(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?$k:null;if(l(a)){if(!l(a.properties))throw new de("crs.properties is undefined.");let d=a.properties;if(a.type==="name"){if(c=NJ[d.name],!l(c))throw new de(`Unknown crs name: ${d.name}`)}else if(a.type==="link"){let u=Cfe[d.href];if(l(u)||(u=Vfe[d.type]),!l(u))throw new de(`Unable to resolve crs link: ${JSON.stringify(d)}`);c=u(d)}else if(a.type==="EPSG"){if(c=NJ[`EPSG:${d.code}`],!l(c))throw new de(`Unknown crs EPSG code: ${d.code}`)}else throw new de(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(d){return o&&e._entityCollection.removeAll(),d!==null&&s(e,t,t,d,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Dr.setLoading(e,!1),e})})}var Wv=$g;var ybi=T(S(),1);var Wpi=T(S());var bpi=T(S());var Xhi=T(S()),Ufe="4.0.0";var Phi=T(S());function Ket(e){return e===void 0}function Fd(e){return typeof e=="boolean"}function Dfe(e,t){for(var n in t)t.hasOwnProperty(n)&&Ket(e[n])&&(e[n]=t[n]);return e}function Bfe(e,t,n){var i;return e.length>t&&(n==null?(n="&hellip;",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function Oo(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}function ey(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function ty(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var qhi=T(S());var Nhi=T(S());var Fhi=T(S()),ny=/[A-Za-z]/,Ks=/[\d]/;var Ad=/\s/,tU=/['"]/,Ofe=/[\x00-\x1F\x7F]/,Yfe=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,Jet=/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source,Qet=/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,jet=Yfe+Jet+Qet,Hfe=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,vhi=new RegExp("[".concat(Yfe+Hfe,"]")),KJ=jet+Hfe,ph=new RegExp("[".concat(KJ,"]"));var nU=function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(Ad):[],o=t.split(Ad),r;r=o.shift();)i.indexOf(r)===-1&&i.push(r);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(Ad):[],o=t.split(Ad),r;i.length&&(r=o.shift());){var s=i.indexOf(r);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var t=this.getAttrs(),n=[];for(var i in t)t.hasOwnProperty(i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e}();var Uhi=T(S());function zfe(e,t,n){var i,o;n==null?(n="&hellip;",o=3,i=8):(o=n.length,i=n.length);var r=function(V){var L={},Z=V,G=Z.match(/^([a-z]+):\/\//i);return G&&(L.scheme=G[1],Z=Z.substr(G[0].length)),G=Z.match(/^(.*?)(?=(\?|#|\/|$))/i),G&&(L.host=G[1],Z=Z.substr(G[0].length)),G=Z.match(/^\/(.*?)(?=(\?|#|$))/i),G&&(L.path=G[1],Z=Z.substr(G[0].length)),G=Z.match(/^\?(.*?)(?=(#|$))/i),G&&(L.query=G[1],Z=Z.substr(G[0].length)),G=Z.match(/^#(.*?)$/i),G&&(L.fragment=G[1]),L},s=function(V){var L="";return V.scheme&&V.host&&(L+=V.scheme+"://"),V.host&&(L+=V.host),V.path&&(L+="/"+V.path),V.query&&(L+="?"+V.query),V.fragment&&(L+="#"+V.fragment),L},a=function(V,L){var Z=L/2,G=Math.ceil(Z),I=-1*Math.floor(Z),v="";return I<0&&(v=V.substr(I)),V.substr(0,G)+n+v};if(e.length<=t)return e;var c=t-o,d=r(e);if(d.query){var u=d.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);u&&(d.query=d.query.substr(0,u[1].length),e=s(d))}if(e.length<=t||(d.host&&(d.host=d.host.replace(/^www\./,""),e=s(d)),e.length<=t))return e;var m="";if(d.host&&(m+=d.host),m.length>=c)return d.host.length==t?(d.host.substr(0,t-o)+n).substr(0,c+i):a(m,c).substr(0,c+i);var p="";if(d.path&&(p+="/"+d.path),d.query&&(p+="?"+d.query),p)if((m+p).length>=c){if((m+p).length==t)return(m+p).substr(0,t);var g=c-m.length;return(m+a(p,g)).substr(0,c+i)}else m+=p;if(d.fragment){var f="#"+d.fragment;if((m+f).length>=c){if((m+f).length==t)return(m+f).substr(0,t);var x=c-m.length;return(m+a(f,x)).substr(0,c+i)}else m+=f}if(d.scheme&&d.host){var _=d.scheme+"://";if((m+_).length<c)return(_+m).substr(0,t)}if(m.length<=t)return m;var C="";return c>0&&(C=m.substr(-1*Math.floor(c/2))),(m.substr(0,Math.ceil(c/2))+n+C).substr(0,c+i)}var Bhi=T(S());function Kfe(e,t,n){if(e.length<=t)return e;var i,o;n==null?(n="&hellip;",i=8,o=3):(i=n.length,o=n.length);var r=t-o,s="";return r>0&&(s=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+s).substr(0,r+i)}var Hhi=T(S());function Jfe(e,t,n){return Bfe(e,t,n)}var Qfe=function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new nU({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],o=t.getCssClassSuffixes(),r=0,s=o.length;r<s;r++)i.push(n+"-"+o[r]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n||!n.length)return t;var i=n.length,o=n.location;return o==="smart"?zfe(t,i):o==="middle"?Kfe(t,i):Jfe(t,i)},e}();var tpi=T(S());var hfi=T(S());var efi=T(S(),1),JJ=function(e,t){return JJ=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},JJ(e,t)};function Zf(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");JJ(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Js=function(){return Js=Object.assign||function(t){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Js.apply(this,arguments)};var nfi=T(S()),Gf=function(){function e(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.type]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}();var cfi=T(S());var ofi=T(S()),qet="(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|verm\xF6gensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|verm\xF6gensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|travelchannel|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|\u0645\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u0627|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|etisalat|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|\u043A\u0430\u0442\u043E\u043B\u0438\u043A|\u0627\u062A\u0635\u0627\u0644\u0627\u062A|\u0627\u0644\u0628\u062D\u0631\u064A\u0646|\u0627\u0644\u062C\u0632\u0627\u0626\u0631|\u0627\u0644\u0639\u0644\u064A\u0627\u0646|\u067E\u0627\u06A9\u0633\u062A\u0627\u0646|\u0643\u0627\u062B\u0648\u0644\u064A\u0643|\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE|abarth|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|webcam|xihuan|yachts|yandex|zappos|\u043C\u043E\u0441\u043A\u0432\u0430|\u043E\u043D\u043B\u0430\u0439\u043D|\u0627\u0628\u0648\u0638\u0628\u064A|\u0627\u0631\u0627\u0645\u0643\u0648|\u0627\u0644\u0627\u0631\u062F\u0646|\u0627\u0644\u0645\u063A\u0631\u0628|\u0627\u0645\u0627\u0631\u0627\u062A|\u0641\u0644\u0633\u0637\u064A\u0646|\u0645\u0644\u064A\u0633\u064A\u0627|\u092D\u093E\u0930\u0924\u092E\u094D|\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8|\u30D5\u30A1\u30C3\u30B7\u30E7\u30F3|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|loans|locus|lotte|lotto|macys|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|\u05D9\u05E9\u05E8\u05D0\u05DC|\u0627\u06CC\u0631\u0627\u0646|\u0628\u0627\u0632\u0627\u0631|\u0628\u06BE\u0627\u0631\u062A|\u0633\u0648\u062F\u0627\u0646|\u0633\u0648\u0631\u064A\u0629|\u0647\u0645\u0631\u0627\u0647|\u092D\u093E\u0930\u094B\u0924|\u0938\u0902\u0917\u0920\u0928|\u09AC\u09BE\u0982\u09B2\u09BE|\u0C2D\u0C3E\u0C30\u0C24\u0C4D|\u0D2D\u0D3E\u0D30\u0D24\u0D02|\u5609\u91CC\u5927\u9152\u5E97|aarp|able|adac|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|\u0434\u0435\u0442\u0438|\u0441\u0430\u0439\u0442|\u0628\u0627\u0631\u062A|\u0628\u064A\u062A\u0643|\u0680\u0627\u0631\u062A|\u062A\u0648\u0646\u0633|\u0634\u0628\u0643\u0629|\u0639\u0631\u0627\u0642|\u0639\u0645\u0627\u0646|\u0645\u0648\u0642\u0639|\u092D\u093E\u0930\u0924|\u09AD\u09BE\u09B0\u09A4|\u09AD\u09BE\u09F0\u09A4|\u0A2D\u0A3E\u0A30\u0A24|\u0AAD\u0ABE\u0AB0\u0AA4|\u0B2D\u0B3E\u0B30\u0B24|\u0CAD\u0CBE\u0CB0\u0CA4|\u0DBD\u0D82\u0D9A\u0DCF|\u30A2\u30DE\u30BE\u30F3|\u30B0\u30FC\u30B0\u30EB|\u30AF\u30E9\u30A6\u30C9|\u30DD\u30A4\u30F3\u30C8|\u7EC4\u7EC7\u673A\u6784|\u96FB\u8A0A\u76C8\u79D1|\u9999\u683C\u91CC\u62C9|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|\u0431\u0435\u043B|\u043A\u043E\u043C|\u049B\u0430\u0437|\u043C\u043A\u0434|\u043C\u043E\u043D|\u043E\u0440\u0433|\u0440\u0443\u0441|\u0441\u0440\u0431|\u0443\u043A\u0440|\u0570\u0561\u0575|\u05E7\u05D5\u05DD|\u0639\u0631\u0628|\u0642\u0637\u0631|\u0643\u0648\u0645|\u0645\u0635\u0631|\u0915\u0949\u092E|\u0928\u0947\u091F|\u0E04\u0E2D\u0E21|\u0E44\u0E17\u0E22|\u0EA5\u0EB2\u0EA7|\u30B9\u30C8\u30A2|\u30BB\u30FC\u30EB|\u307F\u3093\u306A|\u4E2D\u6587\u7F51|\u4E9A\u9A6C\u900A|\u5929\u4E3B\u6559|\u6211\u7231\u4F60|\u65B0\u52A0\u5761|\u6DE1\u9A6C\u9521|\u8BFA\u57FA\u4E9A|\u98DE\u5229\u6D66|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|\u03B5\u03BB|\u03B5\u03C5|\u0431\u0433|\u0435\u044E|\u0440\u0444|\u10D2\u10D4|\uB2F7\uB137|\uB2F7\uCEF4|\uC0BC\uC131|\uD55C\uAD6D|\u30B3\u30E0|\u4E16\u754C|\u4E2D\u4FE1|\u4E2D\u56FD|\u4E2D\u570B|\u4F01\u4E1A|\u4F5B\u5C71|\u4FE1\u606F|\u5065\u5EB7|\u516B\u5366|\u516C\u53F8|\u516C\u76CA|\u53F0\u6E7E|\u53F0\u7063|\u5546\u57CE|\u5546\u5E97|\u5546\u6807|\u5609\u91CC|\u5728\u7EBF|\u5927\u62FF|\u5A31\u4E50|\u5BB6\u96FB|\u5E7F\u4E1C|\u5FAE\u535A|\u6148\u5584|\u624B\u673A|\u62DB\u8058|\u653F\u52A1|\u653F\u5E9C|\u65B0\u95FB|\u65F6\u5C1A|\u66F8\u7C4D|\u673A\u6784|\u6E38\u620F|\u6FB3\u9580|\u70B9\u770B|\u79FB\u52A8|\u7F51\u5740|\u7F51\u5E97|\u7F51\u7AD9|\u7F51\u7EDC|\u8054\u901A|\u8C37\u6B4C|\u8D2D\u7269|\u901A\u8CA9|\u96C6\u56E2|\u98DF\u54C1|\u9910\u5385|\u9999\u6E2F)",jfe=new RegExp("^"+qet+"$");var $et=/[\/?#]/,ett=/[-+&@#/%=~_()|'$*\[\]{}\u2713]/,qfe=/[?!:,.;^]/,QJ=/https?:\/\//i,$fe=new RegExp("^"+QJ.source,"i"),epe=new RegExp(qfe.source+"$"),ttt=/^(javascript|vbscript):/i,ntt=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,itt=/^(?:\/\/)?([^/#?:]+)/;function iU(e){return ny.test(e)}function jJ(e){return ny.test(e)||Ks.test(e)||e==="+"||e==="-"||e==="."}function Hb(e){return ph.test(e)}function oU(e){return e==="_"||Hb(e)}function qJ(e){return ph.test(e)||ett.test(e)||qfe.test(e)}function rU(e){return $et.test(e)}function $J(e){return jfe.test(e.toLowerCase())}function tpe(e){if(ttt.test(e))return!1;var t=e.match(ntt);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!ny.test(i))}function npe(e){var t=e.match(itt);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!$J(o)}var ott=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,rtt=/[:/?#]/;function ipe(e){var t=e.split(rtt,1)[0];return ott.test(t)}var stt=/^(https?:\/\/)?(www\.)?/i,att=/^\/\//,ope=function(e){Zf(t,e);function t(n){var i=e.call(this,n)||this;return i.type="url",i.url="",i.urlMatchType="scheme",i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&amp;/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=dtt(n)),this.stripPrefix.scheme&&(n=ctt(n)),this.stripPrefix.www&&(n=ltt(n)),this.stripTrailingSlash&&(n=utt(n)),this.decodePercentEncoding&&(n=mtt(n)),n},t}(Gf);function ctt(e){return e.replace($fe,"")}function ltt(e){return e.replace(stt,"$1")}function dtt(e){return e.replace(att,"")}function utt(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function mtt(e){var t=e.replace(/%22/gi,"&quot;").replace(/%26/gi,"&amp;").replace(/%27/gi,"&#39;").replace(/%3C/gi,"&lt;").replace(/%3E/gi,"&gt;");try{return decodeURIComponent(t)}catch{return t}}var gfi=T(S());var rpe=/^mailto:/i,htt=new RegExp("[".concat(KJ,"!#$%&'*+/=?^_`{|}~-]"));function spe(e){return ph.test(e)}function sU(e){return htt.test(e)}function ape(e){var t=e.split(".").pop()||"";return $J(t)}var Tfi=T(S());var cpe=function(e){Zf(t,e);function t(n){var i=e.call(this,n)||this;return i.type="email",i.email="",i.email=n.email,i}return t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(Gf);var Vfi=T(S());function eQ(e){return e==="_"||ph.test(e)}function lpe(e){return e.length<=140}var dpe=["twitter","facebook","instagram","tiktok"];var Efi=T(S());var upe=function(e){Zf(t,e);function t(n){var i=e.call(this,n)||this;return i.type="hashtag",i.serviceName="twitter",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;case"tiktok":return"https://www.tiktok.com/tag/"+i;default:throw ty(n),new Error("Invalid hashtag service: ".concat(n))}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(Gf);var Xfi=T(S()),ftt={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/},ptt=/[-\w.]/;function tQ(e){return ptt.test(e)}function mpe(e,t){var n=ftt[t];return n.test(e)}var hpe=["twitter","instagram","soundcloud","tiktok"];var wfi=T(S());var fpe=function(e){Zf(t,e);function t(n){var i=e.call(this,n)||this;return i.type="mention",i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(Gf);var Afi=T(S()),btt=/[-. ]/,gtt=/[-. ()]/,ytt=/[,;]/,xtt=/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/,_tt=/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,Ttt=new RegExp("^".concat(xtt.source,"|").concat(_tt.source,"$"));function nQ(e){return btt.test(e)}function aU(e){return ytt.test(e)}function ppe(e){var t=e.charAt(0)==="+"||gtt.test(e);return t&&Ttt.test(e)}var Ufi=T(S());var bpe=function(e){Zf(t,e);function t(n){var i=e.call(this,n)||this;return i.type="phone",i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(Gf);function xpe(e,t){for(var n=t.tagBuilder,i=t.stripPrefix,o=t.stripTrailingSlash,r=t.decodePercentEncoding,s=t.hashtagServiceName,a=t.mentionServiceName,c=[],d=e.length,u=[],m=0;m<d;m++){var p=e.charAt(m);if(u.length===0)_(p);else for(var g=u.length-1;g>=0;g--){var f=u[g];switch(f.state){case 11:I(f,p);break;case 12:v(f,p);break;case 0:C(f,p);break;case 1:V(f,p);break;case 2:L(f,p);break;case 3:Z(f,p);break;case 4:G(f,p);break;case 5:P(f,p);break;case 6:w(f,p);break;case 7:F(f,p);break;case 13:b(f,p);break;case 14:R(f,p);break;case 8:E(f,p);break;case 9:X(f,p);break;case 10:A(f,p);break;case 15:N(f,p);break;case 16:O(f,p);break;case 17:U(f,p);break;case 18:Y(f,p);break;case 19:k(f,p);break;case 20:H(f,p);break;case 21:J(f,p);break;case 22:te(f,p);break;case 23:z(f,p);break;case 24:q(f,p);break;case 25:ee(f,p);break;case 26:fe(f,p);break;case 27:_e(f,p);break;case 28:le(f,p);break;case 29:ye(f,p);break;case 30:Te(f,p);break;case 31:Xe(f,p);break;case 32:ke(f,p);break;case 33:Oe(f,p);break;case 34:at(f,p);break;case 35:Mt(f,p);break;case 36:Lt(f,p);break;case 37:Le(f,p);break;case 38:Ie(f,p);break;case 39:je(f,p);break;case 40:et(f,p);break;case 41:He(f,p);break;default:ty(f.state)}}}for(var x=u.length-1;x>=0;x--)u.forEach(function(Ce){return Dt(Ce)});return c;function _(Ce){if(Ce==="#")u.push(Rtt(m,28));else if(Ce==="@")u.push(Ztt(m,30));else if(Ce==="/")u.push(oQ(m,11));else if(Ce==="+")u.push(rQ(m,37));else if(Ce==="(")u.push(rQ(m,32));else{if(Ks.test(Ce)&&(u.push(rQ(m,38)),u.push(Vtt(m,13))),spe(Ce)){var Ve=Ce.toLowerCase()==="m"?15:22;u.push(Ltt(m,Ve))}iU(Ce)&&u.push(iQ(m,0)),ph.test(Ce)&&u.push(oQ(m,5))}}function C(Ce,Ve){Ve===":"?Ce.state=2:Ve==="-"?Ce.state=1:jJ(Ve)||Oo(u,Ce)}function V(Ce,Ve){Ve==="-"||(Ve==="/"?(Oo(u,Ce),u.push(oQ(m,11))):jJ(Ve)?Ce.state=0:Oo(u,Ce))}function L(Ce,Ve){Ve==="/"?Ce.state=3:Ve==="."?Oo(u,Ce):Hb(Ve)?(Ce.state=5,iU(Ve)&&u.push(iQ(m,0))):Oo(u,Ce)}function Z(Ce,Ve){Ve==="/"?Ce.state=4:qJ(Ve)?(Ce.state=10,Ce.acceptStateReached=!0):Dt(Ce)}function G(Ce,Ve){Ve==="/"?Ce.state=10:Hb(Ve)?(Ce.state=5,Ce.acceptStateReached=!0):Oo(u,Ce)}function I(Ce,Ve){Ve==="/"?Ce.state=12:Oo(u,Ce)}function v(Ce,Ve){Hb(Ve)?Ce.state=5:Oo(u,Ce)}function P(Ce,Ve){Ve==="."?Ce.state=7:Ve==="-"?Ce.state=6:Ve===":"?Ce.state=8:rU(Ve)?Ce.state=10:oU(Ve)||Dt(Ce)}function w(Ce,Ve){Ve==="-"||(Ve==="."?Dt(Ce):Hb(Ve)?Ce.state=5:Dt(Ce))}function F(Ce,Ve){Ve==="."?Dt(Ce):Hb(Ve)?(Ce.state=5,Ce.acceptStateReached=!0):Dt(Ce)}function b(Ce,Ve){Ve==="."?Ce.state=14:Ve===":"?Ce.state=8:Ks.test(Ve)||(rU(Ve)?Ce.state=10:ph.test(Ve)?Oo(u,Ce):Dt(Ce))}function R(Ce,Ve){Ks.test(Ve)?(Ce.octetsEncountered++,Ce.octetsEncountered===4&&(Ce.acceptStateReached=!0),Ce.state=13):Dt(Ce)}function E(Ce,Ve){Ks.test(Ve)?Ce.state=9:Dt(Ce)}function X(Ce,Ve){Ks.test(Ve)||(rU(Ve)?Ce.state=10:Dt(Ce))}function A(Ce,Ve){qJ(Ve)||Dt(Ce)}function N(Ce,Ve){Ve.toLowerCase()==="a"?Ce.state=16:te(Ce,Ve)}function O(Ce,Ve){Ve.toLowerCase()==="i"?Ce.state=17:te(Ce,Ve)}function U(Ce,Ve){Ve.toLowerCase()==="l"?Ce.state=18:te(Ce,Ve)}function Y(Ce,Ve){Ve.toLowerCase()==="t"?Ce.state=19:te(Ce,Ve)}function k(Ce,Ve){Ve.toLowerCase()==="o"?Ce.state=20:te(Ce,Ve)}function H(Ce,Ve){Ve.toLowerCase()===":"?Ce.state=21:te(Ce,Ve)}function J(Ce,Ve){sU(Ve)?Ce.state=22:Oo(u,Ce)}function te(Ce,Ve){Ve==="."?Ce.state=23:Ve==="@"?Ce.state=24:sU(Ve)?Ce.state=22:Oo(u,Ce)}function z(Ce,Ve){Ve==="."?Oo(u,Ce):Ve==="@"?Oo(u,Ce):sU(Ve)?Ce.state=22:Oo(u,Ce)}function q(Ce,Ve){Hb(Ve)?Ce.state=25:Oo(u,Ce)}function ee(Ce,Ve){Ve==="."?Ce.state=27:Ve==="-"?Ce.state=26:oU(Ve)||Dt(Ce)}function fe(Ce,Ve){Ve==="-"||Ve==="."?Dt(Ce):oU(Ve)?Ce.state=25:Dt(Ce)}function _e(Ce,Ve){Ve==="."||Ve==="-"?Dt(Ce):Hb(Ve)?(Ce.state=25,Ce.acceptStateReached=!0):Dt(Ce)}function le(Ce,Ve){eQ(Ve)?(Ce.state=29,Ce.acceptStateReached=!0):Oo(u,Ce)}function ye(Ce,Ve){eQ(Ve)||Dt(Ce)}function Te(Ce,Ve){tQ(Ve)?(Ce.state=31,Ce.acceptStateReached=!0):Oo(u,Ce)}function Xe(Ce,Ve){tQ(Ve)||(ph.test(Ve)?Oo(u,Ce):Dt(Ce))}function Le(Ce,Ve){Ks.test(Ve)?Ce.state=38:(Oo(u,Ce),_(Ve))}function ke(Ce,Ve){Ks.test(Ve)?Ce.state=33:Oo(u,Ce),_(Ve)}function Oe(Ce,Ve){Ks.test(Ve)?Ce.state=34:Oo(u,Ce)}function at(Ce,Ve){Ks.test(Ve)?Ce.state=35:Oo(u,Ce)}function Mt(Ce,Ve){Ve===")"?Ce.state=36:Oo(u,Ce)}function Lt(Ce,Ve){Ks.test(Ve)?Ce.state=38:nQ(Ve)?Ce.state=39:Oo(u,Ce)}function Ie(Ce,Ve){Ce.acceptStateReached=!0,aU(Ve)?Ce.state=40:Ve==="#"?Ce.state=41:Ks.test(Ve)||(Ve==="("?Ce.state=32:nQ(Ve)?Ce.state=39:(Dt(Ce),iU(Ve)&&u.push(iQ(m,0))))}function je(Ce,Ve){Ks.test(Ve)?Ce.state=38:Ve==="("?Ce.state=32:(Dt(Ce),_(Ve))}function et(Ce,Ve){aU(Ve)||(Ve==="#"?Ce.state=41:Ks.test(Ve)?Ce.state=38:Dt(Ce))}function He(Ce,Ve){aU(Ve)?Ce.state=40:Ks.test(Ve)?Oo(u,Ce):Dt(Ce)}function Dt(Ce){if(Oo(u,Ce),!!Ce.acceptStateReached){var Ve=Ce.startIdx,ct=e.slice(Ce.startIdx,m);if(ct=Ctt(ct),Ce.type==="url"){var Di=e.charAt(Ce.startIdx-1);if(Di==="@")return;var mt=Ce.matchType;if(mt==="scheme"){var _o=QJ.exec(ct);if(_o&&(Ve=Ve+_o.index,ct=ct.slice(_o.index)),!tpe(ct))return}else if(mt==="tld"){if(!npe(ct))return}else if(mt==="ipV4"){if(!ipe(ct))return}else ty(mt);c.push(new ope({tagBuilder:n,matchedText:ct,offset:Ve,urlMatchType:mt,url:ct,protocolRelativeMatch:ct.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:r}))}else if(Ce.type==="email")ape(ct)&&c.push(new cpe({tagBuilder:n,matchedText:ct,offset:Ve,email:ct.replace(rpe,"")}));else if(Ce.type==="hashtag")lpe(ct)&&c.push(new upe({tagBuilder:n,matchedText:ct,offset:Ve,serviceName:s,hashtag:ct.slice(1)}));else if(Ce.type==="mention")mpe(ct,a)&&c.push(new fpe({tagBuilder:n,matchedText:ct,offset:Ve,serviceName:a,mention:ct.slice(1)}));else if(Ce.type==="phone"){if(ct=ct.replace(/ +$/g,""),ppe(ct)){var fr=ct.replace(/[^0-9,;#]/g,"");c.push(new bpe({tagBuilder:n,matchedText:ct,offset:Ve,number:fr,plusSign:ct.charAt(0)==="+"}))}}else ty(Ce)}}}var Stt=/[\(\{\[]/,gpe=/[\)\}\]]/,ype={")":"(","}":"{","]":"["};function Ctt(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n);Stt.test(i)?t[i]++:gpe.test(i)&&t[ype[i]]--}for(var o=e.length-1,r;o>=0;)if(r=e.charAt(o),gpe.test(r)){var s=ype[r];if(t[s]<0)t[s]++,o--;else break}else if(epe.test(r))o--;else break;return e.slice(0,o+1)}function iQ(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function oQ(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function Vtt(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function Ltt(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function Rtt(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function Ztt(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function rQ(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}var spi=T(S());function _pe(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,o=t.onText,r=t.onComment,s=t.onDoctype,a=new Ef,c=0,d=e.length,u=0,m=0,p=a;c<d;){var g=e.charAt(c);switch(u){case 0:f(g);break;case 1:x(g);break;case 2:C(g);break;case 3:_(g);break;case 4:V(g);break;case 5:L(g);break;case 6:Z(g);break;case 7:G(g);break;case 8:I(g);break;case 9:v(g);break;case 10:P(g);break;case 11:w(g);break;case 12:F(g);break;case 13:b(g);break;case 14:R(g);break;case 15:E(g);break;case 16:X(g);break;case 17:A(g);break;case 18:N(g);break;case 19:O(g);break;case 20:U(g);break;default:ty(u)}c++}m<c&&J();function f(q){q==="<"&&k()}function x(q){q==="!"?u=13:q==="/"?(u=2,p=new Ef(Js(Js({},p),{isClosing:!0}))):q==="<"?k():ny.test(q)?(u=3,p=new Ef(Js(Js({},p),{isOpening:!0}))):(u=0,p=a)}function _(q){Ad.test(q)?(p=new Ef(Js(Js({},p),{name:te()})),u=4):q==="<"?k():q==="/"?(p=new Ef(Js(Js({},p),{name:te()})),u=12):q===">"?(p=new Ef(Js(Js({},p),{name:te()})),H()):!ny.test(q)&&!Ks.test(q)&&q!==":"&&Y()}function C(q){q===">"?Y():ny.test(q)?u=3:Y()}function V(q){Ad.test(q)||(q==="/"?u=12:q===">"?H():q==="<"?k():q==="="||tU.test(q)||Ofe.test(q)?Y():u=5)}function L(q){Ad.test(q)?u=6:q==="/"?u=12:q==="="?u=7:q===">"?H():q==="<"?k():tU.test(q)&&Y()}function Z(q){Ad.test(q)||(q==="/"?u=12:q==="="?u=7:q===">"?H():q==="<"?k():tU.test(q)?Y():u=5)}function G(q){Ad.test(q)||(q==='"'?u=8:q==="'"?u=9:/[>=`]/.test(q)?Y():q==="<"?k():u=10)}function I(q){q==='"'&&(u=11)}function v(q){q==="'"&&(u=11)}function P(q){Ad.test(q)?u=4:q===">"?H():q==="<"&&k()}function w(q){Ad.test(q)?u=4:q==="/"?u=12:q===">"?H():q==="<"?k():(u=4,z())}function F(q){q===">"?(p=new Ef(Js(Js({},p),{isClosing:!0})),H()):u=4}function b(q){e.substr(c,2)==="--"?(c+=2,p=new Ef(Js(Js({},p),{type:"comment"})),u=14):e.substr(c,7).toUpperCase()==="DOCTYPE"?(c+=7,p=new Ef(Js(Js({},p),{type:"doctype"})),u=20):Y()}function R(q){q==="-"?u=15:q===">"?Y():u=16}function E(q){q==="-"?u=18:q===">"?Y():u=16}function X(q){q==="-"&&(u=17)}function A(q){q==="-"?u=18:u=16}function N(q){q===">"?H():q==="!"?u=19:q==="-"||(u=16)}function O(q){q==="-"?u=17:q===">"?H():u=16}function U(q){q===">"?H():q==="<"&&k()}function Y(){u=0,p=a}function k(){u=1,p=new Ef({idx:c})}function H(){var q=e.slice(m,p.idx);q&&o(q,m),p.type==="comment"?r(p.idx):p.type==="doctype"?s(p.idx):(p.isOpening&&n(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),Y(),m=c+1}function J(){var q=e.slice(m,c);o(q,m),m=c+1}function te(){var q=p.idx+(p.isClosing?2:1);return e.slice(q,c).toLowerCase()}function z(){c--}}var Ef=function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e}();var Gtt=function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=Ett(t.urls),this.email=Fd(t.email)?t.email:this.email,this.phone=Fd(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=Fd(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=Itt(t.stripPrefix),this.stripTrailingSlash=Fd(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=Fd(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&hpe.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&dpe.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=Xtt(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],o=0,r=[];return _pe(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var c=/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi,d=s.split(c),u=a;d.forEach(function(m,p){if(p%2===0){var g=n.parseText(m,u);r.push.apply(r,g)}u+=m.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(o=Math.max(o-1,0))},onComment:function(s){},onDoctype:function(s){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(function(c,d){return c.getOffset()-d.getOffset()});for(var n=0;n<t.length-1;){var i=t[n],o=i.getOffset(),r=i.getMatchedText().length,s=o+r;if(n+1<t.length){if(t[n+1].getOffset()===o){var a=t[n+1].getMatchedText().length>r?n:n+1;t.splice(a,1);continue}if(t[n+1].getOffset()<s){t.splice(n+1,1);continue}}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||ey(t,function(n){return n.getType()==="hashtag"}),this.email||ey(t,function(n){return n.getType()==="email"}),this.phone||ey(t,function(n){return n.getType()==="phone"}),this.mention||ey(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||ey(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||ey(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||ey(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n===void 0&&(n=0),n=n||0;for(var i=xpe(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),o=0,r=i.length;o<r;o++)i[o].setOffset(n+i[o].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"&lt;").replace(/>/g,"&gt;"));for(var n=this.parse(t),i=[],o=0,r=0,s=n.length;r<s;r++){var a=n[r];i.push(t.substring(o,a.getOffset())),i.push(this.createMatchReturnVal(a)),o=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(o)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof nU)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new Qfe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=Ufe,e}(),Tpe=Gtt;function Ett(e){return e==null&&(e=!0),Fd(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:Fd(e.schemeMatches)?e.schemeMatches:!0,tldMatches:Fd(e.tldMatches)?e.tldMatches:!0,ipV4Matches:Fd(e.ipV4Matches)?e.ipV4Matches:!0}}function Itt(e){return e==null&&(e=!0),Fd(e)?{scheme:e,www:e}:{scheme:Fd(e.scheme)?e.scheme:!0,www:Fd(e.www)?e.www:!0}}function Xtt(e){return typeof e=="number"?{length:e,location:"end"}:Dfe(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})}var xpi=T(S());var gpi=T(S());var Gpi=T(S());var cU=Tpe;var Ipe;typeof DOMParser<"u"&&(Ipe=new DOMParser);var Wtt=new cU({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),lU=32,Spe=2414016,Cpe=1,Vpe=16093e3,Lpe=.1,Ptt=[null,void 0,"http://www.topografix.com/GPX/1/1"],Ro={gpx:Ptt};function vtt(e){return new Promise((t,n)=>{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function sQ(e,t){let n=wv(e,"id");return n=l(n)?n:Bn(),t.getOrCreateEntity(n)}function aQ(e){let t=Rpe(e,"lon"),n=Rpe(e,"lat"),i=Pv(e,"ele",Ro.gpx);return h.fromDegrees(t,n,i)}function Rpe(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function wv(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function iy(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function cQ(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagName(t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function Pv(e,t,n){let i=iy(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Ol(e,t,n){let i=iy(e,t,n);if(l(i))return i.textContent.trim()}function Xpe(e){let t=new tc;return t.width=lU,t.height=lU,t.scaleByDistance=new Ut(Spe,Cpe,Vpe,Lpe),t.pixelOffsetScaleByDistance=new Ut(Spe,Cpe,Vpe,Lpe),t.verticalOrigin=new Jn(Pn.BOTTOM),t.image=e,t}function wtt(){let e=new Gm;return e.translucencyByDistance=new Ut(3e6,1,5e6,0),e.pixelOffset=new D(17,0),e.horizontalOrigin=gi.LEFT,e.font="16px sans-serif",e.style=Uo.FILL_AND_OUTLINE,e}function Wpe(e){let t=new oc;return t.width=4,t.material=new Ug,t.material.color=l(e)?e:B.RED,t.material.outlineWidth=2,t.material.outlineColor=B.BLACK,t}var Zpe={time:{text:"Time",tag:"time"},comment:{text:"Comment",tag:"cmt"},description:{text:"Description",tag:"desc"},source:{text:"Source",tag:"src"},number:{text:"GPS track/route number",tag:"number"},type:{text:"Type",tag:"type"}},vv;typeof document<"u"&&(vv=document.createElement("div"));function lQ(e,t){let n,i="",o=Object.keys(Zpe),r=o.length;for(n=0;n<r;n++){let u=o[n],m=Zpe[u];m.value=y(Ol(e,m.tag,Ro.gpx),""),l(m.value)&&m.value!==""&&(i=`${i}<p>${m.text}: ${m.value}</p>`)}if(!l(i)||i==="")return;i=Wtt.link(i),vv.innerHTML=i;let s=vv.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=B.WHITE,c=B.BLACK,d='<div class="cesium-infoBox-description-lighter" style="';return d+="overflow:auto;",d+="word-wrap:break-word;",d+=`background-color:${a.toCssColorString()};`,d+=`color:${c.toCssColorString()};`,d+='">',d+=`${vv.innerHTML}</div>`,vv.innerHTML="",d}function Ppe(e,t,n,i){let o=aQ(t),r=sQ(t,n);r.position=o;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",B.RED,lU);r.billboard=Xpe(s);let a=Ol(t,"name",Ro.gpx);r.name=a,r.label=wtt(),r.label.text=a,r.description=lQ(t,r),i.clampToGround&&(r.billboard.heightReference=Qe.CLAMP_TO_GROUND,r.label.heightReference=Qe.CLAMP_TO_GROUND)}function Ftt(e,t,n,i){let o=sQ(t,n);o.description=lQ(t,o);let r=cQ(t,"rtept",Ro.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)Ppe(e,r[a],n,i),s[a]=aQ(r[a]);o.polyline=Wpe(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function Att(e,t,n,i){let o=sQ(t,n);o.description=lQ(t,o);let r=cQ(t,"trkseg",Ro.gpx),s=[],a=[],c,d=!0,u=new fa;for(let m=0;m<r.length;m++)c=Mtt(r[m]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),u.addSamples(a,s),d=d&&!0):d=!1;if(d){let m=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",B.RED,lU);o.billboard=Xpe(m),o.position=u,i.clampToGround&&(o.billboard.heightReference=Qe.CLAMP_TO_GROUND),o.availability=new Ur,o.availability.addInterval(new Vn({start:a[0],stop:a[a.length-1]}))}o.polyline=Wpe(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function Mtt(e){let t={positions:[],times:[]},n=cQ(e,"trkpt",Ro.gpx),i;for(let o=0;o<n.length;o++){let r=aQ(n[o]);t.positions.push(r),i=Ol(n[o],"time",Ro.gpx),l(i)&&t.times.push(j.fromIso8601(i))}return t}function Ntt(e){let t=iy(e,"metadata",Ro.gpx);if(l(t)){let n={name:Ol(t,"name",Ro.gpx),desc:Ol(t,"desc",Ro.gpx),author:ktt(t),copyright:Dtt(t),link:vpe(t),time:Ol(t,"time",Ro.gpx),keywords:Ol(t,"keywords",Ro.gpx),bounds:Btt(t)};if(l(n.name)||l(n.desc)||l(n.author)||l(n.copyright)||l(n.link)||l(n.time)||l(n.keywords)||l(n.bounds))return n}}function ktt(e){let t=iy(e,"author",Ro.gpx);if(l(t)){let n={name:Ol(t,"name",Ro.gpx),email:Utt(t),link:vpe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function Utt(e){let t=iy(e,"email",Ro.gpx);if(l(t)){let n=Ol(t,"id",Ro.gpx),i=Ol(t,"domain",Ro.gpx);return`${n}@${i}`}}function vpe(e){let t=iy(e,"link",Ro.gpx);if(l(t)){let n={href:wv(t,"href"),text:Ol(t,"text",Ro.gpx),mimeType:Ol(t,"type",Ro.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function Dtt(e){let t=iy(e,"copyright",Ro.gpx);if(l(t)){let n={author:wv(t,"author"),year:Ol(t,"year",Ro.gpx),license:Ol(t,"license",Ro.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function Btt(e){let t=iy(e,"bounds",Ro.gpx);if(l(t)){let n={minLat:Pv(t,"minlat",Ro.gpx),maxLat:Pv(t,"maxlat",Ro.gpx),minLon:Pv(t,"minlon",Ro.gpx),maxLon:Pv(t,"maxlon",Ro.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var Gpe={wpt:Ppe,rte:Ftt,trk:Att};function Ott(e,t,n,i){let o=Object.keys(Gpe),r=o.length;for(let s=0;s<r;s++){let a=o[s],c=Gpe[a],d=t.childNodes,u=d.length;for(let m=0;m<u;m++){let p=d[m];p.localName===a&&Ro.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function Epe(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=wv(o,"version"),s=wv(o,"creator"),a,c=Ntt(o);l(c)&&(a=c.name),o.localName==="gpx"?Ott(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let d,u=i.computeAvailability(),m=u.start,p=u.stop,g=j.equals(m,Be.MINIMUM_VALUE),f=j.equals(p,Be.MAXIMUM_VALUE);if(!g||!f){let _;g&&(_=new Date,_.setHours(0,0,0,0),m=j.fromDate(_)),f&&(_=new Date,_.setHours(24,0,0,0),p=j.fromDate(_)),d=new rh,d.startTime=m,d.stopTime=p,d.currentTime=j.clone(m),d.clockRange=Br.LOOP_STOP,d.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,d.multiplier=Math.round(Math.min(Math.max(j.secondsDifference(p,m)/60,1),31556900))}let x=!1;return e._name!==a&&(e._name=a,x=!0),e._creator!==s&&(e._creator=s,x=!0),Ytt(e._metadata,c)&&(e._metadata=c,x=!0),e._version!==r&&(e._version=r,x=!0),d!==e._clock&&(x=!0,e._clock=d),x&&e._changed.raiseEvent(e),Dr.setLoading(e,!1),e}function Ytt(e,t){return!l(e)&&!l(t)?!1:l(e)&&l(t)?e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds:!0}function Htt(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let o=n;if(typeof n=="string"||n instanceof Ee){n=Ee.createIfNeeded(n),o=n.fetchBlob();let r=e._resourceCredits,s=n.credits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)r.push(s[c])}}return Promise.resolve(o).then(function(r){return r instanceof Blob?vtt(r).then(function(s){let a,c;try{a=Ipe.parseFromString(s,"application/xml")}catch(d){c=d.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let d=l(c)?c:a.documentElement.firstChild.nodeValue;throw d||(d=a.body.innerText),new de(d)}return Epe(e,a,i)}):Epe(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function mV(){this._changed=new be,this._error=new be,this._loading=new be,this._clock=void 0,this._entityCollection=new Hs(this),this._entityCluster=new Zd,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new Yb}mV.load=function(e,t){return new mV().load(e,t)};Object.defineProperties(mV.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});mV.prototype.update=function(e){return!0};mV.prototype.load=function(e,t){if(!l(e))throw new pe("data is required.");t=y(t,y.EMPTY_OBJECT),Dr.setLoading(this,!0);let n=this._name,i=this;return Htt(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=j.equals(s,Be.MINIMUM_VALUE),d=j.equals(a,Be.MAXIMUM_VALUE);if(!c||!d){let m;c&&(m=new Date,m.setHours(0,0,0,0),s=j.fromDate(m)),d&&(m=new Date,m.setHours(24,0,0,0),a=j.fromDate(m)),o=new rh,o.startTime=s,o.stopTime=a,o.currentTime=j.clone(s),o.clockRange=Br.LOOP_STOP,o.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(j.secondsDifference(a,s)/60,1),31556900))}let u=!1;return o!==i._clock&&(i._clock=o,u=!0),n!==i._name&&(u=!0),u&&i._changed.raiseEvent(i),Dr.setLoading(i,!1),i}).catch(function(o){return Dr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var Fv=mV;var _bi=T(S(),1);function ztt(e,t){this.position=e,this.headingPitchRoll=t}var Av=ztt;var exi=T(S(),1);var aw=T(id(),1);var lgi=T(S(),1);var Sbi=T(S(),1);function bU(e){return gU(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function gU(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?gU(n):n),[])}var wpe=[0,1,2,3].concat(...bU([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function ur(){let e=this;function t(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,d=e.stat_desc.max_length,u,m,p,g,f,x,_=0;for(g=0;g<=15;g++)o.bl_count[g]=0;for(r[o.heap[o.heap_max]*2+1]=0,u=o.heap_max+1;u<573;u++)m=o.heap[u],g=r[r[m*2+1]*2+1]+1,g>d&&(g=d,_++),r[m*2+1]=g,!(m>e.max_code)&&(o.bl_count[g]++,f=0,m>=c&&(f=a[m-c]),x=r[m*2],o.opt_len+=x*(g+f),s&&(o.static_len+=x*(s[m*2+1]+f)));if(_!==0){do{for(g=d-1;o.bl_count[g]===0;)g--;o.bl_count[g]--,o.bl_count[g+1]+=2,o.bl_count[d]--,_-=2}while(_>0);for(g=d;g!==0;g--)for(m=o.bl_count[g];m!==0;)p=o.heap[--u],!(p>e.max_code)&&(r[p*2+1]!=g&&(o.opt_len+=(g-r[p*2+1])*r[p*2],r[p*2+1]=g),m--)}}function n(o,r){let s=0;do s|=o&1,o>>>=1,s<<=1;while(--r>0);return s>>>1}function i(o,r,s){let a=[],c=0,d,u,m;for(d=1;d<=15;d++)a[d]=c=c+s[d-1]<<1;for(u=0;u<=r;u++)m=o[u*2+1],m!==0&&(o[u*2]=n(a[m]++,m))}e.build_tree=function(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,c,d,u=-1,m;for(o.heap_len=0,o.heap_max=573,c=0;c<a;c++)r[c*2]!==0?(o.heap[++o.heap_len]=u=c,o.depth[c]=0):r[c*2+1]=0;for(;o.heap_len<2;)m=o.heap[++o.heap_len]=u<2?++u:0,r[m*2]=1,o.depth[m]=0,o.opt_len--,s&&(o.static_len-=s[m*2+1]);for(e.max_code=u,c=Math.floor(o.heap_len/2);c>=1;c--)o.pqdownheap(r,c);m=a;do c=o.heap[1],o.heap[1]=o.heap[o.heap_len--],o.pqdownheap(r,1),d=o.heap[1],o.heap[--o.heap_max]=c,o.heap[--o.heap_max]=d,r[m*2]=r[c*2]+r[d*2],o.depth[m]=Math.max(o.depth[c],o.depth[d])+1,r[c*2+1]=r[d*2+1]=m,o.heap[1]=m++,o.pqdownheap(r,1);while(o.heap_len>=2);o.heap[--o.heap_max]=o.heap[1],t(o),i(r,e.max_code,o.bl_count)}}ur._length_code=[0,1,2,3,4,5,6,7].concat(...bU([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));ur.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];ur.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];ur.d_code=function(e){return e<256?wpe[e]:wpe[256+(e>>>7)]};ur.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];ur.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];ur.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];ur.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function wa(e,t,n,i,o){let r=this;r.static_tree=e,r.extra_bits=t,r.extra_base=n,r.elems=i,r.max_length=o}var Ktt=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],Jtt=bU([[144,8],[112,9],[24,7],[8,8]]);wa.static_ltree=gU(Ktt.map((e,t)=>[e,Jtt[t]]));var Qtt=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],jtt=bU([[30,5]]);wa.static_dtree=gU(Qtt.map((e,t)=>[e,jtt[t]]));wa.static_l_desc=new wa(wa.static_ltree,ur.extra_lbits,257,286,15);wa.static_d_desc=new wa(wa.static_dtree,ur.extra_dbits,0,30,15);wa.static_bl_desc=new wa(null,ur.extra_blbits,0,19,7);var qtt=9,$tt=8;function If(e,t,n,i,o){let r=this;r.good_length=e,r.max_lazy=t,r.nice_length=n,r.max_chain=i,r.func=o}var Ape=0,fU=1,uT=2,bh=[new If(0,0,0,0,Ape),new If(4,4,8,4,fU),new If(4,5,16,8,fU),new If(4,6,32,32,fU),new If(4,4,16,16,uT),new If(8,16,32,32,uT),new If(8,16,128,128,uT),new If(8,32,128,256,uT),new If(32,128,258,1024,uT),new If(32,258,258,4096,uT)],dU=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],ju=0,uU=1,Mv=2,mU=3,ent=32,dQ=42,hU=113,Nv=666,uQ=8,tnt=0,mQ=1,nnt=2,Lr=3,pU=258,Md=pU+Lr+1;function Fpe(e,t,n,i){let o=e[t*2],r=e[n*2];return o<r||o==r&&i[t]<=i[n]}function int(){let e=this,t,n,i,o,r,s,a,c,d,u,m,p,g,f,x,_,C,V,L,Z,G,I,v,P,w,F,b,R,E,X,A,N,O,U=new ur,Y=new ur,k=new ur;e.depth=[];let H,J,te,z,q,ee;e.bl_count=[],e.heap=[],A=[],N=[],O=[];function fe(){d=2*r,m[g-1]=0;for(let Ne=0;Ne<g-1;Ne++)m[Ne]=0;F=bh[b].max_lazy,E=bh[b].good_length,X=bh[b].nice_length,w=bh[b].max_chain,G=0,C=0,v=0,V=P=Lr-1,Z=0,p=0}function _e(){let Ne;for(Ne=0;Ne<286;Ne++)A[Ne*2]=0;for(Ne=0;Ne<30;Ne++)N[Ne*2]=0;for(Ne=0;Ne<19;Ne++)O[Ne*2]=0;A[256*2]=1,e.opt_len=e.static_len=0,J=te=0}function le(){U.dyn_tree=A,U.stat_desc=wa.static_l_desc,Y.dyn_tree=N,Y.stat_desc=wa.static_d_desc,k.dyn_tree=O,k.stat_desc=wa.static_bl_desc,q=0,ee=0,z=8,_e()}e.pqdownheap=function(Ne,ut){let Je=e.heap,$e=Je[ut],pt=ut<<1;for(;pt<=e.heap_len&&(pt<e.heap_len&&Fpe(Ne,Je[pt+1],Je[pt],e.depth)&&pt++,!Fpe(Ne,$e,Je[pt],e.depth));)Je[ut]=Je[pt],ut=pt,pt<<=1;Je[ut]=$e};function ye(Ne,ut){let Je=-1,$e,pt=Ne[0*2+1],It=0,yn=7,po=4;pt===0&&(yn=138,po=3),Ne[(ut+1)*2+1]=65535;for(let rr=0;rr<=ut;rr++)$e=pt,pt=Ne[(rr+1)*2+1],!(++It<yn&&$e==pt)&&(It<po?O[$e*2]+=It:$e!==0?($e!=Je&&O[$e*2]++,O[16*2]++):It<=10?O[17*2]++:O[18*2]++,It=0,Je=$e,pt===0?(yn=138,po=3):$e==pt?(yn=6,po=3):(yn=7,po=4))}function Te(){let Ne;for(ye(A,U.max_code),ye(N,Y.max_code),k.build_tree(e),Ne=18;Ne>=3&&O[ur.bl_order[Ne]*2+1]===0;Ne--);return e.opt_len+=3*(Ne+1)+5+5+4,Ne}function Xe(Ne){e.pending_buf[e.pending++]=Ne}function Le(Ne){Xe(Ne&255),Xe(Ne>>>8&255)}function ke(Ne){Xe(Ne>>8&255),Xe(Ne&255&255)}function Oe(Ne,ut){let Je,$e=ut;ee>16-$e?(Je=Ne,q|=Je<<ee&65535,Le(q),q=Je>>>16-ee,ee+=$e-16):(q|=Ne<<ee&65535,ee+=$e)}function at(Ne,ut){let Je=Ne*2;Oe(ut[Je]&65535,ut[Je+1]&65535)}function Mt(Ne,ut){let Je,$e=-1,pt,It=Ne[0*2+1],yn=0,po=7,rr=4;for(It===0&&(po=138,rr=3),Je=0;Je<=ut;Je++)if(pt=It,It=Ne[(Je+1)*2+1],!(++yn<po&&pt==It)){if(yn<rr)do at(pt,O);while(--yn!==0);else pt!==0?(pt!=$e&&(at(pt,O),yn--),at(16,O),Oe(yn-3,2)):yn<=10?(at(17,O),Oe(yn-3,3)):(at(18,O),Oe(yn-11,7));yn=0,$e=pt,It===0?(po=138,rr=3):pt==It?(po=6,rr=3):(po=7,rr=4)}}function Lt(Ne,ut,Je){let $e;for(Oe(Ne-257,5),Oe(ut-1,5),Oe(Je-4,4),$e=0;$e<Je;$e++)Oe(O[ur.bl_order[$e]*2+1],3);Mt(A,Ne-1),Mt(N,ut-1)}function Ie(){ee==16?(Le(q),q=0,ee=0):ee>=8&&(Xe(q&255),q>>>=8,ee-=8)}function je(){Oe(mQ<<1,3),at(256,wa.static_ltree),Ie(),1+z+10-ee<9&&(Oe(mQ<<1,3),at(256,wa.static_ltree),Ie()),z=7}function et(Ne,ut){let Je,$e,pt;if(e.dist_buf[J]=Ne,e.lc_buf[J]=ut&255,J++,Ne===0?A[ut*2]++:(te++,Ne--,A[(ur._length_code[ut]+256+1)*2]++,N[ur.d_code(Ne)*2]++),!(J&8191)&&b>2){for(Je=J*8,$e=G-C,pt=0;pt<30;pt++)Je+=N[pt*2]*(5+ur.extra_dbits[pt]);if(Je>>>=3,te<Math.floor(J/2)&&Je<Math.floor($e/2))return!0}return J==H-1}function He(Ne,ut){let Je,$e,pt=0,It,yn;if(J!==0)do Je=e.dist_buf[pt],$e=e.lc_buf[pt],pt++,Je===0?at($e,Ne):(It=ur._length_code[$e],at(It+256+1,Ne),yn=ur.extra_lbits[It],yn!==0&&($e-=ur.base_length[It],Oe($e,yn)),Je--,It=ur.d_code(Je),at(It,ut),yn=ur.extra_dbits[It],yn!==0&&(Je-=ur.base_dist[It],Oe(Je,yn)));while(pt<J);at(256,Ne),z=Ne[256*2+1]}function Dt(){ee>8?Le(q):ee>0&&Xe(q&255),q=0,ee=0}function Ce(Ne,ut,Je){Dt(),z=8,Je&&(Le(ut),Le(~ut)),e.pending_buf.set(c.subarray(Ne,Ne+ut),e.pending),e.pending+=ut}function Ve(Ne,ut,Je){Oe((tnt<<1)+(Je?1:0),3),Ce(Ne,ut,!0)}function ct(Ne,ut,Je){let $e,pt,It=0;b>0?(U.build_tree(e),Y.build_tree(e),It=Te(),$e=e.opt_len+3+7>>>3,pt=e.static_len+3+7>>>3,pt<=$e&&($e=pt)):$e=pt=ut+5,ut+4<=$e&&Ne!=-1?Ve(Ne,ut,Je):pt==$e?(Oe((mQ<<1)+(Je?1:0),3),He(wa.static_ltree,wa.static_dtree)):(Oe((nnt<<1)+(Je?1:0),3),Lt(U.max_code+1,Y.max_code+1,It+1),He(A,N)),_e(),Je&&Dt()}function Di(Ne){ct(C>=0?C:-1,G-C,Ne),C=G,t.flush_pending()}function mt(){let Ne,ut,Je,$e;do{if($e=d-v-G,$e===0&&G===0&&v===0)$e=r;else if($e==-1)$e--;else if(G>=r+r-Md){c.set(c.subarray(r,r+r),0),I-=r,G-=r,C-=r,Ne=g,Je=Ne;do ut=m[--Je]&65535,m[Je]=ut>=r?ut-r:0;while(--Ne!==0);Ne=r,Je=Ne;do ut=u[--Je]&65535,u[Je]=ut>=r?ut-r:0;while(--Ne!==0);$e+=r}if(t.avail_in===0)return;Ne=t.read_buf(c,G+v,$e),v+=Ne,v>=Lr&&(p=c[G]&255,p=(p<<_^c[G+1]&255)&x)}while(v<Md&&t.avail_in!==0)}function _o(Ne){let ut=65535,Je;for(ut>i-5&&(ut=i-5);;){if(v<=1){if(mt(),v===0&&Ne==0)return ju;if(v===0)break}if(G+=v,v=0,Je=C+ut,(G===0||G>=Je)&&(v=G-Je,G=Je,Di(!1),t.avail_out===0)||G-C>=r-Md&&(Di(!1),t.avail_out===0))return ju}return Di(Ne==4),t.avail_out===0?Ne==4?Mv:ju:Ne==4?mU:uU}function fr(Ne){let ut=w,Je=G,$e,pt,It=P,yn=G>r-Md?G-(r-Md):0,po=X,rr=a,Oa=G+pU,Ya=c[Je+It-1],as=c[Je+It];P>=E&&(ut>>=2),po>v&&(po=v);do if($e=Ne,!(c[$e+It]!=as||c[$e+It-1]!=Ya||c[$e]!=c[Je]||c[++$e]!=c[Je+1])){Je+=2,$e++;do;while(c[++Je]==c[++$e]&&c[++Je]==c[++$e]&&c[++Je]==c[++$e]&&c[++Je]==c[++$e]&&c[++Je]==c[++$e]&&c[++Je]==c[++$e]&&c[++Je]==c[++$e]&&c[++Je]==c[++$e]&&Je<Oa);if(pt=pU-(Oa-Je),Je=Oa-pU,pt>It){if(I=Ne,It=pt,pt>=po)break;Ya=c[Je+It-1],as=c[Je+It]}}while((Ne=u[Ne&rr]&65535)>yn&&--ut!==0);return It<=v?It:v}function Zc(Ne){let ut=0,Je;for(;;){if(v<Md){if(mt(),v<Md&&Ne==0)return ju;if(v===0)break}if(v>=Lr&&(p=(p<<_^c[G+(Lr-1)]&255)&x,ut=m[p]&65535,u[G&a]=m[p],m[p]=G),ut!==0&&(G-ut&65535)<=r-Md&&R!=2&&(V=fr(ut)),V>=Lr)if(Je=et(G-I,V-Lr),v-=V,V<=F&&v>=Lr){V--;do G++,p=(p<<_^c[G+(Lr-1)]&255)&x,ut=m[p]&65535,u[G&a]=m[p],m[p]=G;while(--V!==0);G++}else G+=V,V=0,p=c[G]&255,p=(p<<_^c[G+1]&255)&x;else Je=et(0,c[G]&255),v--,G++;if(Je&&(Di(!1),t.avail_out===0))return ju}return Di(Ne==4),t.avail_out===0?Ne==4?Mv:ju:Ne==4?mU:uU}function Zr(Ne){let ut=0,Je,$e;for(;;){if(v<Md){if(mt(),v<Md&&Ne==0)return ju;if(v===0)break}if(v>=Lr&&(p=(p<<_^c[G+(Lr-1)]&255)&x,ut=m[p]&65535,u[G&a]=m[p],m[p]=G),P=V,L=I,V=Lr-1,ut!==0&&P<F&&(G-ut&65535)<=r-Md&&(R!=2&&(V=fr(ut)),V<=5&&(R==1||V==Lr&&G-I>4096)&&(V=Lr-1)),P>=Lr&&V<=P){$e=G+v-Lr,Je=et(G-1-L,P-Lr),v-=P-1,P-=2;do++G<=$e&&(p=(p<<_^c[G+(Lr-1)]&255)&x,ut=m[p]&65535,u[G&a]=m[p],m[p]=G);while(--P!==0);if(Z=0,V=Lr-1,G++,Je&&(Di(!1),t.avail_out===0))return ju}else if(Z!==0){if(Je=et(0,c[G-1]&255),Je&&Di(!1),G++,v--,t.avail_out===0)return ju}else Z=1,G++,v--}return Z!==0&&(Je=et(0,c[G-1]&255),Z=0),Di(Ne==4),t.avail_out===0?Ne==4?Mv:ju:Ne==4?mU:uU}function ss(Ne){return Ne.total_in=Ne.total_out=0,Ne.msg=null,e.pending=0,e.pending_out=0,n=hU,o=0,le(),fe(),0}e.deflateInit=function(Ne,ut,Je,$e,pt,It){return $e||($e=uQ),pt||(pt=$tt),It||(It=0),Ne.msg=null,ut==-1&&(ut=6),pt<1||pt>qtt||$e!=uQ||Je<9||Je>15||ut<0||ut>9||It<0||It>2?-2:(Ne.dstate=e,s=Je,r=1<<s,a=r-1,f=pt+7,g=1<<f,x=g-1,_=Math.floor((f+Lr-1)/Lr),c=new Uint8Array(r*2),u=[],m=[],H=1<<pt+6,e.pending_buf=new Uint8Array(H*4),i=H*4,e.dist_buf=new Uint16Array(H),e.lc_buf=new Uint8Array(H),b=ut,R=It,ss(Ne))},e.deflateEnd=function(){return n!=dQ&&n!=hU&&n!=Nv?-2:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,m=null,u=null,c=null,e.dstate=null,n==hU?-3:0)},e.deflateParams=function(Ne,ut,Je){let $e=0;return ut==-1&&(ut=6),ut<0||ut>9||Je<0||Je>2?-2:(bh[b].func!=bh[ut].func&&Ne.total_in!==0&&($e=Ne.deflate(1)),b!=ut&&(b=ut,F=bh[b].max_lazy,E=bh[b].good_length,X=bh[b].nice_length,w=bh[b].max_chain),R=Je,$e)},e.deflateSetDictionary=function(Ne,ut,Je){let $e=Je,pt,It=0;if(!ut||n!=dQ)return-2;if($e<Lr)return 0;for($e>r-Md&&($e=r-Md,It=Je-$e),c.set(ut.subarray(It,It+$e),0),G=$e,C=$e,p=c[0]&255,p=(p<<_^c[1]&255)&x,pt=0;pt<=$e-Lr;pt++)p=(p<<_^c[pt+(Lr-1)]&255)&x,u[pt&a]=m[p],m[p]=pt;return 0},e.deflate=function(Ne,ut){let Je,$e,pt,It,yn;if(ut>4||ut<0)return-2;if(!Ne.next_out||!Ne.next_in&&Ne.avail_in!==0||n==Nv&&ut!=4)return Ne.msg=dU[4],-2;if(Ne.avail_out===0)return Ne.msg=dU[7],-5;if(t=Ne,It=o,o=ut,n==dQ&&($e=uQ+(s-8<<4)<<8,pt=(b-1&255)>>1,pt>3&&(pt=3),$e|=pt<<6,G!==0&&($e|=ent),$e+=31-$e%31,n=hU,ke($e)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return o=-1,0}else if(t.avail_in===0&&ut<=It&&ut!=4)return t.msg=dU[7],-5;if(n==Nv&&t.avail_in!==0)return Ne.msg=dU[7],-5;if(t.avail_in!==0||v!==0||ut!=0&&n!=Nv){switch(yn=-1,bh[b].func){case Ape:yn=_o(ut);break;case fU:yn=Zc(ut);break;case uT:yn=Zr(ut);break;default:}if((yn==Mv||yn==mU)&&(n=Nv),yn==ju||yn==Mv)return t.avail_out===0&&(o=-1),0;if(yn==uU){if(ut==1)je();else if(Ve(0,0,!1),ut==3)for(Je=0;Je<g;Je++)m[Je]=0;if(t.flush_pending(),t.avail_out===0)return o=-1,0}}return ut!=4?0:1}}function Mpe(){let e=this;e.next_in_index=0,e.next_out_index=0,e.avail_in=0,e.total_in=0,e.avail_out=0,e.total_out=0}Mpe.prototype={deflateInit(e,t){let n=this;return n.dstate=new int,t||(t=15),n.dstate.deflateInit(n,e,t)},deflate(e){let t=this;return t.dstate?t.dstate.deflate(t,e):-2},deflateEnd(){let e=this;if(!e.dstate)return-2;let t=e.dstate.deflateEnd();return e.dstate=null,t},deflateParams(e,t){let n=this;return n.dstate?n.dstate.deflateParams(n,e,t):-2},deflateSetDictionary(e,t){let n=this;return n.dstate?n.dstate.deflateSetDictionary(n,e,t):-2},read_buf(e,t,n){let i=this,o=i.avail_in;return o>n&&(o=n),o===0?0:(i.avail_in-=o,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+o),t),i.next_in_index+=o,i.total_in+=o,o)},flush_pending(){let e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,e.dstate.pending===0&&(e.dstate.pending_out=0))}};function Npe(e){let t=this,n=new Mpe,i=ont(e&&e.chunkSize?e.chunkSize:64*1024),o=0,r=new Uint8Array(i),s=e?e.level:-1;typeof s>"u"&&(s=-1),n.deflateInit(s),n.next_out=r,t.append=function(a,c){let d,u,m=0,p=0,g=0,f=[];if(a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,d=n.deflate(o),d!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?f.push(new Uint8Array(r)):f.push(r.subarray(0,n.next_out_index))),g+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=m&&(c(n.next_in_index),m=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return f.length>1?(u=new Uint8Array(g),f.forEach(function(x){u.set(x,p),p+=x.length})):u=f[0]?new Uint8Array(f[0]):new Uint8Array,u}},t.flush=function(){let a,c,d=0,u=0,m=[];do{if(n.next_out_index=0,n.avail_out=i,a=n.deflate(4),a!=1&&a!=0)throw new Error("deflating: "+n.msg);i-n.avail_out>0&&m.push(r.slice(0,n.next_out_index)),u+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),c=new Uint8Array(u),m.forEach(function(p){c.set(p,d),d+=p.length}),c}}function ont(e){return e+5*(Math.floor(e/16383)+1)}var Vbi=T(S(),1);var Nd=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],rbe=1440,rnt=0,snt=4,ant=9,cnt=5,lnt=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],dnt=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],unt=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],mnt=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],hnt=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],fnt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],oy=15;function bQ(){let e=this,t,n,i,o,r,s;function a(d,u,m,p,g,f,x,_,C,V,L){let Z,G,I,v,P,w,F,b,R,E,X,A,N,O,U;E=0,P=m;do i[d[u+E]]++,E++,P--;while(P!==0);if(i[0]==m)return x[0]=-1,_[0]=0,0;for(b=_[0],w=1;w<=oy&&i[w]===0;w++);for(F=w,b<w&&(b=w),P=oy;P!==0&&i[P]===0;P--);for(I=P,b>P&&(b=P),_[0]=b,O=1<<w;w<P;w++,O<<=1)if((O-=i[w])<0)return-3;if((O-=i[P])<0)return-3;for(i[P]+=O,s[1]=w=0,E=1,N=2;--P!==0;)s[N]=w+=i[E],N++,E++;P=0,E=0;do(w=d[u+E])!==0&&(L[s[w]++]=P),E++;while(++P<m);for(m=s[I],s[0]=P=0,E=0,v=-1,A=-b,r[0]=0,X=0,U=0;F<=I;F++)for(Z=i[F];Z--!==0;){for(;F>A+b;){if(v++,A+=b,U=I-A,U=U>b?b:U,(G=1<<(w=F-A))>Z+1&&(G-=Z+1,N=F,w<U))for(;++w<U&&!((G<<=1)<=i[++N]);)G-=i[N];if(U=1<<w,V[0]+U>rbe)return-3;r[v]=X=V[0],V[0]+=U,v!==0?(s[v]=P,o[0]=w,o[1]=b,w=P>>>A-b,o[2]=X-r[v-1]-w,C.set(o,(r[v-1]+w)*3)):x[0]=X}for(o[1]=F-A,E>=m?o[0]=192:L[E]<p?(o[0]=L[E]<256?0:96,o[2]=L[E++]):(o[0]=f[L[E]-p]+16+64,o[2]=g[L[E++]-p]),G=1<<F-A,w=P>>>A;w<U;w+=G)C.set(o,(X+w)*3);for(w=1<<F-1;P&w;w>>>=1)P^=w;for(P^=w,R=(1<<A)-1;(P&R)!=s[v];)v--,A-=b,R=(1<<A)-1}return O!==0&&I!=1?-5:0}function c(d){let u;for(t||(t=[],n=[],i=new Int32Array(oy+1),o=[],r=new Int32Array(oy),s=new Int32Array(oy+1)),n.length<d&&(n=[]),u=0;u<d;u++)n[u]=0;for(u=0;u<oy+1;u++)i[u]=0;for(u=0;u<3;u++)o[u]=0;r.set(i.subarray(0,oy),0),s.set(i.subarray(0,oy+1),0)}e.inflate_trees_bits=function(d,u,m,p,g){let f;return c(19),t[0]=0,f=a(d,0,19,19,null,null,m,u,p,t,n),f==-3?g.msg="oversubscribed dynamic bit lengths tree":(f==-5||u[0]===0)&&(g.msg="incomplete dynamic bit lengths tree",f=-3),f},e.inflate_trees_dynamic=function(d,u,m,p,g,f,x,_,C){let V;return c(288),t[0]=0,V=a(m,0,d,257,unt,mnt,f,p,_,t,n),V!=0||p[0]===0?(V==-3?C.msg="oversubscribed literal/length tree":V!=-4&&(C.msg="incomplete literal/length tree",V=-3),V):(c(288),V=a(m,d,u,0,hnt,fnt,x,g,_,t,n),V!=0||g[0]===0&&d>257?(V==-3?C.msg="oversubscribed distance tree":V==-5?(C.msg="incomplete distance tree",V=-3):V!=-4&&(C.msg="empty distance tree with lengths",V=-3),V):0)}}bQ.inflate_trees_fixed=function(e,t,n,i){return e[0]=ant,t[0]=cnt,n[0]=lnt,i[0]=dnt,0};var yU=0,kpe=1,Upe=2,Dpe=3,Bpe=4,Ope=5,Ype=6,hQ=7,Hpe=8,xU=9;function pnt(){let e=this,t,n=0,i,o=0,r=0,s=0,a=0,c=0,d=0,u=0,m,p=0,g,f=0;function x(_,C,V,L,Z,G,I,v){let P,w,F,b,R,E,X,A,N,O,U,Y,k,H,J,te;X=v.next_in_index,A=v.avail_in,R=I.bitb,E=I.bitk,N=I.write,O=N<I.read?I.read-N-1:I.end-N,U=Nd[_],Y=Nd[C];do{for(;E<20;)A--,R|=(v.read_byte(X++)&255)<<E,E+=8;if(P=R&U,w=V,F=L,te=(F+P)*3,(b=w[te])===0){R>>=w[te+1],E-=w[te+1],I.win[N++]=w[te+2],O--;continue}do{if(R>>=w[te+1],E-=w[te+1],b&16){for(b&=15,k=w[te+2]+(R&Nd[b]),R>>=b,E-=b;E<15;)A--,R|=(v.read_byte(X++)&255)<<E,E+=8;P=R&Y,w=Z,F=G,te=(F+P)*3,b=w[te];do if(R>>=w[te+1],E-=w[te+1],b&16){for(b&=15;E<b;)A--,R|=(v.read_byte(X++)&255)<<E,E+=8;if(H=w[te+2]+(R&Nd[b]),R>>=b,E-=b,O-=k,N>=H)J=N-H,N-J>0&&2>N-J?(I.win[N++]=I.win[J++],I.win[N++]=I.win[J++],k-=2):(I.win.set(I.win.subarray(J,J+2),N),N+=2,J+=2,k-=2);else{J=N-H;do J+=I.end;while(J<0);if(b=I.end-J,k>b){if(k-=b,N-J>0&&b>N-J)do I.win[N++]=I.win[J++];while(--b!==0);else I.win.set(I.win.subarray(J,J+b),N),N+=b,J+=b,b=0;J=0}}if(N-J>0&&k>N-J)do I.win[N++]=I.win[J++];while(--k!==0);else I.win.set(I.win.subarray(J,J+k),N),N+=k,J+=k,k=0;break}else if(!(b&64))P+=w[te+2],P+=R&Nd[b],te=(F+P)*3,b=w[te];else return v.msg="invalid distance code",k=v.avail_in-A,k=E>>3<k?E>>3:k,A+=k,X-=k,E-=k<<3,I.bitb=R,I.bitk=E,v.avail_in=A,v.total_in+=X-v.next_in_index,v.next_in_index=X,I.write=N,-3;while(!0);break}if(b&64)return b&32?(k=v.avail_in-A,k=E>>3<k?E>>3:k,A+=k,X-=k,E-=k<<3,I.bitb=R,I.bitk=E,v.avail_in=A,v.total_in+=X-v.next_in_index,v.next_in_index=X,I.write=N,1):(v.msg="invalid literal/length code",k=v.avail_in-A,k=E>>3<k?E>>3:k,A+=k,X-=k,E-=k<<3,I.bitb=R,I.bitk=E,v.avail_in=A,v.total_in+=X-v.next_in_index,v.next_in_index=X,I.write=N,-3);if(P+=w[te+2],P+=R&Nd[b],te=(F+P)*3,(b=w[te])===0){R>>=w[te+1],E-=w[te+1],I.win[N++]=w[te+2],O--;break}}while(!0)}while(O>=258&&A>=10);return k=v.avail_in-A,k=E>>3<k?E>>3:k,A+=k,X-=k,E-=k<<3,I.bitb=R,I.bitk=E,v.avail_in=A,v.total_in+=X-v.next_in_index,v.next_in_index=X,I.write=N,0}e.init=function(_,C,V,L,Z,G){t=yU,d=_,u=C,m=V,p=L,g=Z,f=G,i=null},e.proc=function(_,C,V){let L,Z,G,I=0,v=0,P=0,w,F,b,R;for(P=C.next_in_index,w=C.avail_in,I=_.bitb,v=_.bitk,F=_.write,b=F<_.read?_.read-F-1:_.end-F;;)switch(t){case yU:if(b>=258&&w>=10&&(_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,V=x(d,u,m,p,g,f,_,C),P=C.next_in_index,w=C.avail_in,I=_.bitb,v=_.bitk,F=_.write,b=F<_.read?_.read-F-1:_.end-F,V!=0)){t=V==1?hQ:xU;break}r=d,i=m,o=p,t=kpe;case kpe:for(L=r;v<L;){if(w!==0)V=0;else return _.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);w--,I|=(C.read_byte(P++)&255)<<v,v+=8}if(Z=(o+(I&Nd[L]))*3,I>>>=i[Z+1],v-=i[Z+1],G=i[Z],G===0){s=i[Z+2],t=Ype;break}if(G&16){a=G&15,n=i[Z+2],t=Upe;break}if(!(G&64)){r=G,o=Z/3+i[Z+2];break}if(G&32){t=hQ;break}return t=xU,C.msg="invalid literal/length code",V=-3,_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);case Upe:for(L=a;v<L;){if(w!==0)V=0;else return _.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);w--,I|=(C.read_byte(P++)&255)<<v,v+=8}n+=I&Nd[L],I>>=L,v-=L,r=u,i=g,o=f,t=Dpe;case Dpe:for(L=r;v<L;){if(w!==0)V=0;else return _.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);w--,I|=(C.read_byte(P++)&255)<<v,v+=8}if(Z=(o+(I&Nd[L]))*3,I>>=i[Z+1],v-=i[Z+1],G=i[Z],G&16){a=G&15,c=i[Z+2],t=Bpe;break}if(!(G&64)){r=G,o=Z/3+i[Z+2];break}return t=xU,C.msg="invalid distance code",V=-3,_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);case Bpe:for(L=a;v<L;){if(w!==0)V=0;else return _.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);w--,I|=(C.read_byte(P++)&255)<<v,v+=8}c+=I&Nd[L],I>>=L,v-=L,t=Ope;case Ope:for(R=F-c;R<0;)R+=_.end;for(;n!==0;){if(b===0&&(F==_.end&&_.read!==0&&(F=0,b=F<_.read?_.read-F-1:_.end-F),b===0&&(_.write=F,V=_.inflate_flush(C,V),F=_.write,b=F<_.read?_.read-F-1:_.end-F,F==_.end&&_.read!==0&&(F=0,b=F<_.read?_.read-F-1:_.end-F),b===0)))return _.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);_.win[F++]=_.win[R++],b--,R==_.end&&(R=0),n--}t=yU;break;case Ype:if(b===0&&(F==_.end&&_.read!==0&&(F=0,b=F<_.read?_.read-F-1:_.end-F),b===0&&(_.write=F,V=_.inflate_flush(C,V),F=_.write,b=F<_.read?_.read-F-1:_.end-F,F==_.end&&_.read!==0&&(F=0,b=F<_.read?_.read-F-1:_.end-F),b===0)))return _.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);V=0,_.win[F++]=s,b--,t=yU;break;case hQ:if(v>7&&(v-=8,w++,P--),_.write=F,V=_.inflate_flush(C,V),F=_.write,b=F<_.read?_.read-F-1:_.end-F,_.read!=_.write)return _.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);t=Hpe;case Hpe:return V=1,_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);case xU:return V=-3,_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V);default:return V=-2,_.bitb=I,_.bitk=v,C.avail_in=w,C.total_in+=P-C.next_in_index,C.next_in_index=P,_.write=F,_.inflate_flush(C,V)}},e.free=function(){}}var zpe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],hV=0,fQ=1,Kpe=2,Jpe=3,Qpe=4,jpe=5,_U=6,TU=7,qpe=8,mT=9;function bnt(e,t){let n=this,i=hV,o=0,r=0,s=0,a,c=[0],d=[0],u=new pnt,m=0,p=new Int32Array(rbe*3),g=0,f=new bQ;n.bitk=0,n.bitb=0,n.win=new Uint8Array(t),n.end=t,n.read=0,n.write=0,n.reset=function(x,_){_&&(_[0]=g),i==_U&&u.free(x),i=hV,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(x,_){let C,V,L;return V=x.next_out_index,L=n.read,C=(L<=n.write?n.write:n.end)-L,C>x.avail_out&&(C=x.avail_out),C!==0&&_==-5&&(_=0),x.avail_out-=C,x.total_out+=C,x.next_out.set(n.win.subarray(L,L+C),V),V+=C,L+=C,L==n.end&&(L=0,n.write==n.end&&(n.write=0),C=n.write-L,C>x.avail_out&&(C=x.avail_out),C!==0&&_==-5&&(_=0),x.avail_out-=C,x.total_out+=C,x.next_out.set(n.win.subarray(L,L+C),V),V+=C,L+=C),x.next_out_index=V,n.read=L,_},n.proc=function(x,_){let C,V,L,Z,G,I,v,P;for(Z=x.next_in_index,G=x.avail_in,V=n.bitb,L=n.bitk,I=n.write,v=I<n.read?n.read-I-1:n.end-I;;){let w,F,b,R,E,X,A,N;switch(i){case hV:for(;L<3;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<<L,L+=8}switch(C=V&7,m=C&1,C>>>1){case 0:V>>>=3,L-=3,C=L&7,V>>>=C,L-=C,i=fQ;break;case 1:w=[],F=[],b=[[]],R=[[]],bQ.inflate_trees_fixed(w,F,b,R),u.init(w[0],F[0],b[0],0,R[0],0),V>>>=3,L-=3,i=_U;break;case 2:V>>>=3,L-=3,i=Jpe;break;case 3:return V>>>=3,L-=3,i=mT,x.msg="invalid block type",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_)}break;case fQ:for(;L<32;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<<L,L+=8}if((~V>>>16&65535)!=(V&65535))return i=mT,x.msg="invalid stored block lengths",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);o=V&65535,V=L=0,i=o!==0?Kpe:m!==0?TU:hV;break;case Kpe:if(G===0||v===0&&(I==n.end&&n.read!==0&&(I=0,v=I<n.read?n.read-I-1:n.end-I),v===0&&(n.write=I,_=n.inflate_flush(x,_),I=n.write,v=I<n.read?n.read-I-1:n.end-I,I==n.end&&n.read!==0&&(I=0,v=I<n.read?n.read-I-1:n.end-I),v===0)))return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);if(_=0,C=o,C>G&&(C=G),C>v&&(C=v),n.win.set(x.read_buf(Z,C),I),Z+=C,G-=C,I+=C,v-=C,(o-=C)!==0)break;i=m!==0?TU:hV;break;case Jpe:for(;L<14;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<<L,L+=8}if(r=C=V&16383,(C&31)>29||(C>>5&31)>29)return i=mT,x.msg="too many length or distance symbols",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);if(C=258+(C&31)+(C>>5&31),!a||a.length<C)a=[];else for(P=0;P<C;P++)a[P]=0;V>>>=14,L-=14,s=0,i=Qpe;case Qpe:for(;s<4+(r>>>10);){for(;L<3;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<<L,L+=8}a[zpe[s++]]=V&7,V>>>=3,L-=3}for(;s<19;)a[zpe[s++]]=0;if(c[0]=7,C=f.inflate_trees_bits(a,c,d,p,x),C!=0)return _=C,_==-3&&(a=null,i=mT),n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);s=0,i=jpe;case jpe:for(;C=r,!(s>=258+(C&31)+(C>>5&31));){let O,U;for(C=c[0];L<C;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<<L,L+=8}if(C=p[(d[0]+(V&Nd[C]))*3+1],U=p[(d[0]+(V&Nd[C]))*3+2],U<16)V>>>=C,L-=C,a[s++]=U;else{for(P=U==18?7:U-14,O=U==18?11:3;L<C+P;){if(G!==0)_=0;else return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);G--,V|=(x.read_byte(Z++)&255)<<L,L+=8}if(V>>>=C,L-=C,O+=V&Nd[P],V>>>=P,L-=P,P=s,C=r,P+O>258+(C&31)+(C>>5&31)||U==16&&P<1)return a=null,i=mT,x.msg="invalid bit length repeat",_=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);U=U==16?a[P-1]:0;do a[P++]=U;while(--O!==0);s=P}}if(d[0]=-1,E=[],X=[],A=[],N=[],E[0]=9,X[0]=6,C=r,C=f.inflate_trees_dynamic(257+(C&31),1+(C>>5&31),a,E,X,A,N,p,x),C!=0)return C==-3&&(a=null,i=mT),_=C,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);u.init(E[0],X[0],p,A[0],p,N[0]),i=_U;case _U:if(n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,(_=u.proc(n,x,_))!=1)return n.inflate_flush(x,_);if(_=0,u.free(x),Z=x.next_in_index,G=x.avail_in,V=n.bitb,L=n.bitk,I=n.write,v=I<n.read?n.read-I-1:n.end-I,m===0){i=hV;break}i=TU;case TU:if(n.write=I,_=n.inflate_flush(x,_),I=n.write,v=I<n.read?n.read-I-1:n.end-I,n.read!=n.write)return n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);i=qpe;case qpe:return _=1,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);case mT:return _=-3,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_);default:return _=-2,n.bitb=V,n.bitk=L,x.avail_in=G,x.total_in+=Z-x.next_in_index,x.next_in_index=Z,n.write=I,n.inflate_flush(x,_)}}},n.free=function(x){n.reset(x,null),n.win=null,p=null},n.set_dictionary=function(x,_,C){n.win.set(x.subarray(_,_+C),0),n.read=n.write=C},n.sync_point=function(){return i==fQ?1:0}}var gnt=32,ynt=8,xnt=0,$pe=1,ebe=2,tbe=3,nbe=4,ibe=5,pQ=6,kv=7,obe=12,ry=13,_nt=[0,0,255,255];function Tnt(){let e=this;e.mode=0,e.method=0,e.was=[0],e.need=0,e.marker=0,e.wbits=0;function t(n){return!n||!n.istate?-2:(n.total_in=n.total_out=0,n.msg=null,n.istate.mode=kv,n.istate.blocks.reset(n,null),0)}e.inflateEnd=function(n){return e.blocks&&e.blocks.free(n),e.blocks=null,0},e.inflateInit=function(n,i){return n.msg=null,e.blocks=null,i<8||i>15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new bnt(n,1<<i),t(n),0)},e.inflate=function(n,i){let o,r;if(!n||!n.istate||!n.next_in)return-2;let s=n.istate;for(i=i==snt?-5:0,o=-5;;)switch(s.mode){case xnt:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,((s.method=n.read_byte(n.next_in_index++))&15)!=ynt){s.mode=ry,n.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=ry,n.msg="invalid win size",s.marker=5;break}s.mode=$pe;case $pe:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,r=n.read_byte(n.next_in_index++)&255,((s.method<<8)+r)%31!==0){s.mode=ry,n.msg="incorrect header check",s.marker=5;break}if(!(r&gnt)){s.mode=kv;break}s.mode=ebe;case ebe:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need=(n.read_byte(n.next_in_index++)&255)<<24&4278190080,s.mode=tbe;case tbe:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<16&16711680,s.mode=nbe;case nbe:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<8&65280,s.mode=ibe;case ibe:return n.avail_in===0?o:(o=i,n.avail_in--,n.total_in++,s.need+=n.read_byte(n.next_in_index++)&255,s.mode=pQ,2);case pQ:return s.mode=ry,n.msg="need dictionary",s.marker=0,-2;case kv:if(o=s.blocks.proc(n,o),o==-3){s.mode=ry,s.marker=0;break}if(o==0&&(o=i),o!=1)return o;o=i,s.blocks.reset(n,s.was),s.mode=obe;case obe:return n.avail_in=0,1;case ry:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,o){let r=0,s=o;if(!n||!n.istate||n.istate.mode!=pQ)return-2;let a=n.istate;return s>=1<<a.wbits&&(s=(1<<a.wbits)-1,r=o-s),a.blocks.set_dictionary(i,r,s),a.mode=kv,0},e.inflateSync=function(n){let i,o,r,s,a;if(!n||!n.istate)return-2;let c=n.istate;if(c.mode!=ry&&(c.mode=ry,c.marker=0),(i=n.avail_in)===0)return-5;for(o=n.next_in_index,r=c.marker;i!==0&&r<4;)n.read_byte(o)==_nt[r]?r++:n.read_byte(o)!==0?r=0:r=4-r,o++,i--;return n.total_in+=o-n.next_in_index,n.next_in_index=o,n.avail_in=i,c.marker=r,r!=4?-3:(s=n.total_in,a=n.total_out,t(n),n.total_in=s,n.total_out=a,c.mode=kv,0)},e.inflateSyncPoint=function(n){return!n||!n.istate||!n.istate.blocks?-2:n.istate.blocks.sync_point()}}function sbe(){}sbe.prototype={inflateInit(e){let t=this;return t.istate=new Tnt,e||(e=15),t.istate.inflateInit(t,e)},inflate(e){let t=this;return t.istate?t.istate.inflate(t,e):-2},inflateEnd(){let e=this;if(!e.istate)return-2;let t=e.istate.inflateEnd(e);return e.istate=null,t},inflateSync(){let e=this;return e.istate?e.istate.inflateSync(e):-2},inflateSetDictionary(e,t){let n=this;return n.istate?n.istate.inflateSetDictionary(n,e,t):-2},read_byte(e){return this.next_in[e]},read_buf(e,t){return this.next_in.subarray(e,e+t)}};function abe(e){let t=this,n=new sbe,i=e&&e.chunkSize?Math.floor(e.chunkSize*2):128*1024,o=rnt,r=new Uint8Array(i),s=!1;n.inflateInit(),n.next_out=r,t.append=function(a,c){let d=[],u,m,p=0,g=0,f=0;if(a.length!==0){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,n.avail_in===0&&!s&&(n.next_in_index=0,s=!0),u=n.inflate(o),s&&u===-5){if(n.avail_in!==0)throw new Error("inflating: bad input")}else if(u!==0&&u!==1)throw new Error("inflating: "+n.msg);if((s||u===1)&&n.avail_in===a.length)throw new Error("inflating: bad input");n.next_out_index&&(n.next_out_index===i?d.push(new Uint8Array(r)):d.push(r.subarray(0,n.next_out_index))),f+=n.next_out_index,c&&n.next_in_index>0&&n.next_in_index!=p&&(c(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return d.length>1?(m=new Uint8Array(f),d.forEach(function(x){m.set(x,g),g+=x.length})):m=d[0]?new Uint8Array(d[0]):new Uint8Array,m}},t.flush=function(){n.inflateEnd()}}var Pbi=T(S(),1);var Rbi=T(S(),1);var fV="/",gQ=new Date(2107,11,31),yQ=new Date(1980,0,1),Ii=void 0,kd="undefined",zb="function";var Gbi=T(S(),1);var Uv=class{constructor(t){return class extends TransformStream{constructor(n,i){let o=new t(i);super({transform(r,s){s.enqueue(o.append(r))},flush(r){let s=o.flush();s&&r.enqueue(s)}})}}}};var Snt=64,cbe=2;try{typeof navigator!=kd&&navigator.hardwareConcurrency&&(cbe=navigator.hardwareConcurrency)}catch{}var Cnt={chunkSize:512*1024,maxWorkers:cbe,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:Ii,CompressionStreamNative:typeof CompressionStream!=kd&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=kd&&DecompressionStream},ay=Object.assign({},Cnt);function Dv(){return ay}function SU(e){return Math.max(e.chunkSize,Snt)}function pV(e){let{baseURL:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:s,Deflate:a,Inflate:c,CompressionStream:d,DecompressionStream:u,workerScripts:m}=e;if(sy("baseURL",t),sy("chunkSize",n),sy("maxWorkers",i),sy("terminateWorkerTimeout",o),sy("useCompressionStream",r),sy("useWebWorkers",s),a&&(ay.CompressionStream=new Uv(a)),c&&(ay.DecompressionStream=new Uv(c)),sy("CompressionStream",d),sy("DecompressionStream",u),m!==Ii){let{deflate:p,inflate:g}=m;if((p||g)&&(ay.workerScripts||(ay.workerScripts={})),p){if(!Array.isArray(p))throw new Error("workerScripts.deflate must be an array");ay.workerScripts.deflate=p}if(g){if(!Array.isArray(g))throw new Error("workerScripts.inflate must be an array");ay.workerScripts.inflate=g}}}function sy(e,t){t!==Ii&&(ay[e]=t)}var wbi=T(S(),1);var Z0i=T(S(),1);var y0i=T(S(),1);var p0i=T(S(),1);var kbi=T(S(),1);var Abi=T(S(),1),lbe=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=t>>>1^3988292384:t=t>>>1;lbe[e]=t}var Kb=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0;for(let i=0,o=t.length|0;i<o;i++)n=n>>>8^lbe[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var Bv=class extends TransformStream{constructor(){let t,n=new Kb;super({transform(i,o){n.append(i),o.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}};var r0i=T(S(),1);var Bbi=T(S(),1);function bV(e){if(typeof TextEncoder==kd){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}else return new TextEncoder().encode(e)}var Ybi=T(S(),1),el={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=el.getPartial(n);return i===32?e.concat(t):el._shiftRight(t,i,n|0,e.slice(0,e.length-1))},bitLength(e){let t=e.length;if(t===0)return 0;let n=e[t-1];return(t-1)*32+el.getPartial(n)},clamp(e,t){if(e.length*32<t)return e;e=e.slice(0,Math.ceil(t/32));let n=e.length;return t=t&31,n>0&&t&&(e[n-1]=el.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s<e.length;s++)i.push(n|e[s]>>>t),n=e[s]<<32-t;let o=e.length?e[e.length-1]:0,r=el.getPartial(o);return i.push(el.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},Ov={bytes:{fromBits(e){let n=el.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r<n;r++)r&3||(o=e[r/4]),i[r]=o>>>24,o<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],(n&3)===3&&(t.push(i),i=0);return n&3&&t.push(el.partial(8*(n&3),i)),t}}},dbe={};dbe.sha1=class{constructor(e){let t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],e?(t._h=e._h.slice(0),t._buffer=e._buffer.slice(0),t._length=e._length):t.reset()}reset(){let e=this;return e._h=e._init.slice(0),e._buffer=[],e._length=0,e}update(e){let t=this;typeof e=="string"&&(e=Ov.utf8String.toBits(e));let n=t._buffer=el.concat(t._buffer,e),i=t._length,o=t._length=i+el.bitLength(e);if(o>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let r=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=o;a+=t.blockSize)t._block(r.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t}finalize(){let e=this,t=e._buffer,n=e._h;t=el.concat(t,[el.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i}_S(e,t){return t<<e|t>>>32-e}_block(e){let t=this,n=t._h,i=Array(80);for(let d=0;d<16;d++)i[d]=e[d];let o=n[0],r=n[1],s=n[2],a=n[3],c=n[4];for(let d=0;d<=79;d++){d>=16&&(i[d]=t._S(1,i[d-3]^i[d-8]^i[d-14]^i[d-16]));let u=t._S(5,o)+t._f(d,r,s,a)+c+i[d]+t._key[Math.floor(d/20)]|0;c=a,a=s,s=t._S(30,r),r=o,o=u}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};var xQ={};xQ.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],o=e.length,r,s,a,c=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],r=o;r<4*o+28;r++){let d=s[r-1];(r%o===0||o===8&&r%o===4)&&(d=n[d>>>24]<<24^n[d>>16&255]<<16^n[d>>8&255]<<8^n[d&255],r%o===0&&(d=d<<8^d>>>24^c<<24,c=c<<1^(c>>7)*283)),s[r]=s[r-o]^d}for(let d=0;r;d++,r--){let u=s[d&3?r:r-4];r<=4||d<4?a[d]=u:a[d]=i[0][n[u>>>24]]^i[1][n[u>>16&255]]^i[2][n[u>>8&255]]^i[3][n[u&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],o=[],r=[],s,a,c,d;for(let u=0;u<256;u++)r[(o[u]=u<<1^(u>>7)*283)^u]=u;for(let u=s=0;!n[u];u^=a||1,s=r[s]||1){let m=s^s<<1^s<<2^s<<3^s<<4;m=m>>8^m&255^99,n[u]=m,i[m]=u,d=o[c=o[a=o[u]]];let p=d*16843009^c*65537^a*257^u*16843008,g=o[m]*257^m*16843008;for(let f=0;f<4;f++)e[f][u]=g=g<<24^g>>>8,t[f][m]=p=p<<24^p>>>8}for(let u=0;u<5;u++)e[u]=e[u].slice(0),t[u]=t[u].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,o=[0,0,0,0],r=this._tables[t],s=r[0],a=r[1],c=r[2],d=r[3],u=r[4],m=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],f=e[t?1:3]^n[3],x=4,_,C,V;for(let L=0;L<i;L++)_=s[m>>>24]^a[p>>16&255]^c[g>>8&255]^d[f&255]^n[x],C=s[p>>>24]^a[g>>16&255]^c[f>>8&255]^d[m&255]^n[x+1],V=s[g>>>24]^a[f>>16&255]^c[m>>8&255]^d[p&255]^n[x+2],f=s[f>>>24]^a[m>>16&255]^c[p>>8&255]^d[g&255]^n[x+3],x+=4,m=_,p=C,g=V;for(let L=0;L<4;L++)o[t?3&-L:L]=u[m>>>24]<<24^u[p>>16&255]<<16^u[g>>8&255]<<8^u[f&255]^n[x++],_=m,m=p,p=g,g=f,f=_;return o}};var ube={getRandomValues(e){let t=new Uint32Array(e.buffer),n=i=>{let o=987654321,r=4294967295;return function(){return o=36969*(o&65535)+(o>>16)&r,i=18e3*(i&65535)+(i>>16)&r,(((o<<16)+i&r)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let i=0,o;i<e.length;i+=4){let r=n((o||Math.random())*4294967296);o=r()*987654071,t[i/4]=r()*4294967296|0}return e}},_Q={};_Q.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let o=el.bitLength(t);for(let r=0;r<i;r+=4){this.incCounter(n);let s=e.encrypt(n);t[r]^=s[0],t[r+1]^=s[1],t[r+2]^=s[2],t[r+3]^=s[3]}return el.clamp(t,o)}};var cy={importKey(e){return new cy.hmacSha1(Ov.bytes.toBits(e))},pbkdf2(e,t,n,i){if(n=n||1e4,i<0||n<0)throw new Error("invalid params to pbkdf2");let o=(i>>5)+1<<2,r,s,a,c,d,u=new ArrayBuffer(o),m=new DataView(u),p=0,g=el;for(t=Ov.bytes.toBits(t),d=1;p<(o||1);d++){for(r=s=e.encrypt(g.concat(t,[d])),a=1;a<n;a++)for(s=e.encrypt(s),c=0;c<s.length;c++)r[c]^=s[c];for(a=0;p<(o||1)&&a<r.length;a++)m.setInt32(p,r[a]),p+=4}return u.slice(0,i/8)}};cy.hmacSha1=class{constructor(e){let t=this,n=t._hash=dbe.sha1,i=[[],[]];t._baseHash=[new n,new n];let o=t._baseHash[0].blockSize/32;e.length>o&&(e=new n().update(e).finalize());for(let r=0;r<o;r++)i[0][r]=e[r]^909522486,i[1][r]=e[r]^1549556828;t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){let e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){let t=this;t._updated=!0,t._resultHash.update(e)}digest(){let e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}};var $bi=T(S(),1);var Vnt=typeof crypto!=kd&&typeof crypto.getRandomValues==zb,ly="Invalid password",hT="Invalid signature",Jb="zipjs-abort-check-password";function CU(e){return Vnt?crypto.getRandomValues(e):ube.getRandomValues(e)}var gV=16,Lnt="raw",fbe={name:"PBKDF2"},Rnt={name:"HMAC"},Znt="SHA-1",Gnt=Object.assign({hash:Rnt},fbe),TQ=Object.assign({iterations:1e3,hash:{name:Znt}},fbe),Ent=["deriveBits"],Hv=[8,12,16],Yv=[16,24,32],dy=10,Int=[0,0,0,0],RU=typeof crypto!=kd,Jv=RU&&crypto.subtle,pbe=RU&&typeof Jv!=kd,Xf=Ov.bytes,Xnt=xQ.aes,Wnt=_Q.ctrGladman,Pnt=cy.hmacSha1,mbe=RU&&pbe&&typeof Jv.importKey==zb,hbe=RU&&pbe&&typeof Jv.deriveBits==zb,VU=class extends TransformStream{constructor({password:t,rawPassword:n,signed:i,encryptionStrength:o,checkPasswordOnly:r}){super({start(){Object.assign(this,{ready:new Promise(s=>this.resolveReady=s),password:ybe(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(s,a){let c=this,{password:d,strength:u,resolveReady:m,ready:p}=c;d?(await vnt(c,u,d,qu(s,0,Hv[u]+2)),s=qu(s,Hv[u]+2),r?a.error(new Error(Jb)):m()):await p;let g=new Uint8Array(s.length-dy-(s.length-dy)%gV);a.enqueue(bbe(c,s,g,0,dy,!0))},async flush(s){let{signed:a,ctr:c,hmac:d,pending:u,ready:m}=this;if(d&&c){await m;let p=qu(u,0,u.length-dy),g=qu(u,u.length-dy),f=new Uint8Array;if(p.length){let x=Kv(Xf,p);d.update(x);let _=c.update(x);f=zv(Xf,_)}if(a){let x=qu(zv(Xf,d.digest()),0,dy);for(let _=0;_<dy;_++)if(x[_]!=g[_])throw new Error(hT)}s.enqueue(f)}}})}},LU=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i}){let o;super({start(){Object.assign(this,{ready:new Promise(r=>this.resolveReady=r),password:ybe(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,s){let a=this,{password:c,strength:d,resolveReady:u,ready:m}=a,p=new Uint8Array;c?(p=await wnt(a,d,c),u()):await m;let g=new Uint8Array(p.length+r.length-r.length%gV);g.set(p,0),s.enqueue(bbe(a,r,g,p.length,0))},async flush(r){let{ctr:s,hmac:a,pending:c,ready:d}=this;if(a&&s){await d;let u=new Uint8Array;if(c.length){let m=s.update(Kv(Xf,c));a.update(m),u=zv(Xf,m)}o.signature=zv(Xf,a.digest()).slice(0,dy),r.enqueue(SQ(u,o.signature))}}}),o=this}};function bbe(e,t,n,i,o,r){let{ctr:s,hmac:a,pending:c}=e,d=t.length-o;c.length&&(t=SQ(c,t),n=Mnt(n,d-d%gV));let u;for(u=0;u<=d-gV;u+=gV){let m=Kv(Xf,qu(t,u,u+gV));r&&a.update(m);let p=s.update(m);r||a.update(p),n.set(zv(Xf,p),u+i)}return e.pending=qu(t,u),n}async function vnt(e,t,n,i){let o=await gbe(e,t,n,qu(i,0,Hv[t])),r=qu(i,Hv[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(ly)}async function wnt(e,t,n){let i=CU(new Uint8Array(Hv[t])),o=await gbe(e,t,n,i);return SQ(i,o)}async function gbe(e,t,n,i){e.password=null;let o=await Fnt(Lnt,n,Gnt,!1,Ent),r=await Ant(Object.assign({salt:i},TQ),o,8*(Yv[t]*2+2)),s=new Uint8Array(r),a=Kv(Xf,qu(s,0,Yv[t])),c=Kv(Xf,qu(s,Yv[t],Yv[t]*2)),d=qu(s,Yv[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:d},ctr:new Wnt(new Xnt(a),Array.from(Int)),hmac:new Pnt(c)}),d}async function Fnt(e,t,n,i,o){if(mbe)try{return await Jv.importKey(e,t,n,i,o)}catch{return mbe=!1,cy.importKey(t)}else return cy.importKey(t)}async function Ant(e,t,n){if(hbe)try{return await Jv.deriveBits(e,t,n)}catch{return hbe=!1,cy.pbkdf2(t,e.salt,TQ.iterations,n)}else return cy.pbkdf2(t,e.salt,TQ.iterations,n)}function ybe(e,t){return t===Ii?bV(e):t}function SQ(e,t){let n=e;return e.length+t.length&&(n=new Uint8Array(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function Mnt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function qu(e,t,n){return e.subarray(t,n)}function zv(e,t){return e.fromBits(t)}function Kv(e,t){return e.toBits(t)}var l0i=T(S(),1);var yV=12,ZU=class extends TransformStream{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),Sbe(this,t)},transform(o,r){let s=this;if(s.password){let a=xbe(s,o.subarray(0,yV));if(s.password=null,a[yV-1]!=s.passwordVerification)throw new Error(ly);o=o.subarray(yV)}i?r.error(new Error(Jb)):r.enqueue(xbe(s,o))}})}},GU=class extends TransformStream{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),Sbe(this,t)},transform(i,o){let r=this,s,a;if(r.password){r.password=null;let c=CU(new Uint8Array(yV));c[yV-1]=r.passwordVerification,s=new Uint8Array(i.length+c.length),s.set(_be(r,c),0),a=yV}else s=new Uint8Array(i.length),a=0;s.set(_be(r,i),a),o.enqueue(s)}})}};function xbe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=Cbe(e)^t[i],CQ(e,n[i]);return n}function _be(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=Cbe(e)^t[i],CQ(e,t[i]);return n}function Sbe(e,t){let n=[305419896,591751049,878082192];Object.assign(e,{keys:n,crcKey0:new Kb(n[0]),crcKey2:new Kb(n[2])});for(let i=0;i<t.length;i++)CQ(e,t.charCodeAt(i))}function CQ(e,t){let[n,i,o]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),i=Tbe(Math.imul(Tbe(i+Vbe(n)),134775813)+1),e.crcKey2.append([i>>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function Cbe(e){let t=e.keys[2]|2;return Vbe(Math.imul(t,t^1)>>>8)}function Vbe(e){return e&255}function Tbe(e){return e&4294967295}var Lbe="deflate-raw",EU=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStream:i,CompressionStreamNative:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:c,signed:d,level:u}=t,m=this,p,g,f=Rbe(super.readable);(!s||c)&&d&&(p=new Bv,f=Wf(f,p)),r&&(f=Gbe(f,a,{level:u,chunkSize:n},o,i)),s&&(c?f=Wf(f,new GU(t)):(g=new LU(t),f=Wf(f,g))),Zbe(m,f,()=>{let x;s&&!c&&(x=g.signature),(!s||c)&&d&&(x=new DataView(p.value.buffer).getUint32(0)),m.signature=x})}},IU=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStream:i,DecompressionStreamNative:o}){super({});let{zipCrypto:r,encrypted:s,signed:a,signature:c,compressed:d,useCompressionStream:u}=t,m,p,g=Rbe(super.readable);s&&(r?g=Wf(g,new ZU(t)):(p=new VU(t),g=Wf(g,p))),d&&(g=Gbe(g,u,{chunkSize:n},o,i)),(!s||r)&&a&&(m=new Bv,g=Wf(g,m)),Zbe(this,g,()=>{if((!s||r)&&a){let f=new DataView(m.value.buffer);if(c!=f.getUint32(0,!1))throw new Error(hT)}})}};function Rbe(e){return Wf(e,new TransformStream({transform(t,n){t&&t.length&&n.enqueue(t)}}))}function Zbe(e,t,n){t=Wf(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function Gbe(e,t,n,i,o){try{let r=t&&i?i:o;e=Wf(e,new r(Lbe,n))}catch{if(t)try{e=Wf(e,new o(Lbe,n))}catch{return e}else return e}return e}function Wf(e,t){return e.pipeThrough(t)}var Ebe="message",Ibe="start",Xbe="pull",VQ="data",Wbe="ack",LQ="close",PU="deflate",vU="inflate";var XU=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(PU)?r=EU:o.startsWith(vU)&&(r=IU);let s=0,a=0,c=new r(t,n),d=super.readable,u=new TransformStream({transform(p,g){p&&p.length&&(a+=p.length,g.enqueue(p))},flush(){Object.assign(i,{inputSize:a})}}),m=new TransformStream({transform(p,g){p&&p.length&&(s+=p.length,g.enqueue(p))},flush(){let{signature:p}=c;Object.assign(i,{signature:p,outputSize:s,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return d.pipeThrough(u).pipeThrough(c).pipeThrough(m)}})}},WU=class extends TransformStream{constructor(t){let n;super({transform:i,flush(o){n&&n.length&&o.enqueue(n)}});function i(o,r){if(n){let s=new Uint8Array(n.length+o.length);s.set(n),s.set(o,n.length),o=s,n=null}o.length>t?(r.enqueue(o.slice(0,t)),i(o.slice(t),r)):n=o}}};var S0i=T(S(),1);var wbe=typeof Worker!=kd;var xV=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:c,scripts:d},u){let{signal:m}=s;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new WU(r.chunkSize)).pipeThrough(new ZQ(n,s),{signal:m}),writable:i,options:Object.assign({},o),scripts:d,transferStreams:c,terminate(){return new Promise(p=>{let{worker:g,busy:f}=t;g?(f?t.resolveTerminated=p:(g.terminate(),p()),t.interface=null):p()})},onTaskFinished(){let{resolveTerminated:p}=t;p&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),p()),t.busy=!1,u(t)}}),(a&&wbe?Nnt:Fbe)(t,r)}},ZQ=class extends TransformStream{constructor(t,{onstart:n,onprogress:i,size:o,onend:r}){let s=0;super({async start(){n&&await RQ(n,o)},async transform(a,c){s+=a.length,i&&await RQ(i,s,o),c.enqueue(a)},async flush(){t.size=s,r&&await RQ(r,s)}})}};async function RQ(e,...t){try{await e(...t)}catch{}}function Fbe(e,t){return{run:()=>knt(e,t)}}function Nnt(e,t){let{baseURL:n,chunkSize:i}=t;if(!e.interface){let o;try{o=Bnt(e.scripts[0],n,e)}catch{return wbe=!1,Fbe(e,t)}Object.assign(e,{worker:o,interface:{run:()=>Unt(e,{chunkSize:i})}})}return e.interface}async function knt({options:e,readable:t,writable:n,onTaskFinished:i},o){try{let r=new XU(e,o);await t.pipeThrough(r).pipeTo(n,{preventClose:!0,preventAbort:!0});let{signature:s,inputSize:a,outputSize:c}=r;return{signature:s,inputSize:a,outputSize:c}}finally{i()}}async function Unt(e,t){let n,i,o=new Promise((p,g)=>{n=p,i=g});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:s,scripts:a}=e,{writable:c,closed:d}=Dnt(e.writable),u=wU({type:Ibe,scripts:a.slice(1),options:s,config:t,readable:r,writable:c},e);u||Object.assign(e,{reader:r.getReader(),writer:c.getWriter()});let m=await o;return u||await c.getWriter().close(),await d,m}function Dnt(e){let t,n=new Promise(o=>t=o);return{writable:new WritableStream({async write(o){let r=e.getWriter();await r.ready,await r.write(o),r.releaseLock()},close(){t()},abort(o){return e.getWriter().abort(o)}}),closed:n}}var Pbe=!0,vbe=!0;function Bnt(e,t,n){let i={type:"module"},o,r;typeof e==zb&&(e=e());try{o=new URL(e,t)}catch{o=e}if(Pbe)try{r=new Worker(o)}catch{Pbe=!1,r=new Worker(o,i)}else r=new Worker(o,i);return r.addEventListener(Ebe,s=>Ont(s,n)),r}function wU(e,{worker:t,writer:n,onTaskFinished:i,transferStreams:o}){try{let{value:r,readable:s,writable:a}=e,c=[];if(r&&(r.byteLength<r.buffer.byteLength?e.value=r.buffer.slice(0,r.byteLength):e.value=r.buffer,c.push(e.value)),o&&vbe?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{vbe=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),i(),r}}async function Ont({data:e},t){let{type:n,value:i,messageId:o,result:r,error:s}=e,{reader:a,writer:c,resolveResult:d,rejectResult:u,onTaskFinished:m}=t;try{if(s){let{message:g,stack:f,code:x,name:_}=s,C=new Error(g);Object.assign(C,{stack:f,code:x,name:_}),p(C)}else{if(n==Xbe){let{value:g,done:f}=await a.read();wU({type:VQ,value:g,done:f,messageId:o},t)}n==VQ&&(await c.ready,await c.write(new Uint8Array(i)),wU({type:Wbe,messageId:o},t)),n==LQ&&p(null,r)}}catch(g){wU({type:LQ,messageId:o},t),p(g)}function p(g,f){g?u(g):d(f),c&&c.releaseLock(),m()}}var fT=[],GQ=[];var Abe=0;async function FU(e,t){let{options:n,config:i}=t,{transferStreams:o,useWebWorkers:r,useCompressionStream:s,codecType:a,compressed:c,signed:d,encrypted:u}=n,{workerScripts:m,maxWorkers:p}=i;t.transferStreams=o||o===Ii;let g=!c&&!d&&!u&&!t.transferStreams;return t.useWebWorkers=!g&&(r||r===Ii&&i.useWebWorkers),t.scripts=t.useWebWorkers&&m?m[a]:[],n.useCompressionStream=s||s===Ii&&i.useCompressionStream,(await f()).run();async function f(){let _=fT.find(C=>!C.busy);if(_)return Mbe(_),new xV(_,e,t,x);if(fT.length<p){let C={indexWorker:Abe};return Abe++,fT.push(C),new xV(C,e,t,x)}else return new Promise(C=>GQ.push({resolve:C,stream:e,workerOptions:t}))}function x(_){if(GQ.length){let[{resolve:C,stream:V,workerOptions:L}]=GQ.splice(0,1);C(new xV(_,V,L,x))}else _.worker?(Mbe(_),Ynt(_,t)):fT=fT.filter(C=>C!=_)}}function Ynt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{fT=fT.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function Mbe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var X0i=T(S(),1);var Hnt="Writer iterator completed too soon",znt="text/plain";var Knt="Content-Type";var Jnt=64*1024,XQ="writable",_V=class{constructor(){this.size=0}init(){this.initialized=!0}},AU=class extends _V{get readable(){let t=this,{chunkSize:n=Jnt}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(o){let{offset:r=0,size:s,diskNumberStart:a}=i,{chunkOffset:c}=this;o.enqueue(await Fa(t,r+c,Math.min(n,s-c),a)),c+n>s?o.close():this.chunkOffset+=n}});return i}},EQ=class extends _V{constructor(){super();let t=this,n=new WritableStream({write(i){return t.writeUint8Array(i)}});Object.defineProperty(t,XQ,{get(){return n}})}writeUint8Array(){}};var MU=class extends EQ{constructor(t){super(),Object.assign(this,{data:"data:"+(t||"")+";base64,",pending:[]})}writeUint8Array(t){let n=this,i=0,o=n.pending,r=n.pending.length;for(n.pending="",i=0;i<Math.floor((r+t.length)/3)*3-r;i++)o+=String.fromCharCode(t[i]);for(;i<t.length;i++)n.pending+=String.fromCharCode(t[i]);o.length>2?n.data+=btoa(o):n.pending=o}getData(){return this.data+btoa(this.pending)}},Qb=class extends AU{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,n){let i=this,o=t+n,s=await(t||o<i.size?i.blob.slice(t,o):i.blob).arrayBuffer();return s.byteLength>n&&(s=s.slice(t,o)),new Uint8Array(s)}},Qv=class extends _V{constructor(t){super();let n=this,i=new TransformStream,o=[];t&&o.push([Knt,t]),Object.defineProperty(n,XQ,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},NU=class extends Qb{constructor(t){super(new Blob([t],{type:znt}))}},kU=class extends Qv{constructor(t){super(t),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){let{encoding:t,utf8:n}=this,i=await super.getData();if(i.text&&n)return i.text();{let o=new FileReader;return new Promise((r,s)=>{Object.assign(o,{onload:({target:a})=>r(a.result),onerror:()=>s(o.error)}),o.readAsText(i,t)})}}};var IQ=class extends AU{constructor(t){super(),this.readers=t}async init(){let t=this,{readers:n}=t;t.lastDiskNumber=0,t.lastDiskOffset=0,await Promise.all(n.map(async(i,o)=>{await i.init(),o!=n.length-1&&(t.lastDiskOffset+=i.size),t.size+=i.size})),super.init()}async readUint8Array(t,n,i=0){let o=this,{readers:r}=this,s,a=i;a==-1&&(a=r.length-1);let c=t;for(;c>=r[a].size;)c-=r[a].size,a++;let d=r[a],u=d.size;if(c+n<=u)s=await Fa(d,c,n);else{let m=u-c;s=new Uint8Array(n),s.set(await Fa(d,c,m)),s.set(await o.readUint8Array(t+m,n-m,i),m)}return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}},UU=class extends _V{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let o,r,s,a=new WritableStream({async write(u){let{availableSize:m}=i;if(s)u.length>=m?(await c(u.slice(0,m)),await d(),i.diskOffset+=o.size,i.diskNumber++,s=null,await this.write(u.slice(m))):await c(u);else{let{value:p,done:g}=await t.next();if(g&&!p)throw new Error(Hnt);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await vf(o),r=p.writable,s=r.getWriter(),await this.write(u)}},async close(){await s.ready,await d()}});Object.defineProperty(i,XQ,{get(){return a}});async function c(u){let m=u.length;m&&(await s.ready,await s.write(u),o.size+=m,i.size+=m,i.availableSize-=m)}async function d(){r.size=o.size,await s.close()}}};async function vf(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function DU(e){return Array.isArray(e)&&(e=new IQ(e)),e instanceof ReadableStream&&(e={readable:e}),e}function BU(e){e.writable===Ii&&typeof e.next==zb&&(e=new UU(e)),e instanceof WritableStream&&(e={writable:e});let{writable:t}=e;return t.size===Ii&&(t.size=0),e instanceof UU||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}function Fa(e,t,n,i){return e.readUint8Array(t,n,i)}var z0i=T(S(),1);var F0i=T(S(),1);var P0i=T(S(),1),Nbe="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),Qnt=Nbe.length==256;function kbe(e){if(Qnt){let t="";for(let n=0;n<e.length;n++)t+=Nbe[e[n]];return t}else return new TextDecoder().decode(e)}function jv(e,t){return t&&t.trim().toLowerCase()=="cp437"?kbe(e):new TextDecoder(t).decode(e)}var M0i=T(S(),1),WQ="filename",PQ="rawFilename",vQ="comment",wQ="rawComment",FQ="uncompressedSize",AQ="compressedSize",MQ="offset",OU="diskNumberStart",TV="lastModDate",YU="rawLastModDate",qv="lastAccessDate",Ube="rawLastAccessDate",$v="creationDate",Dbe="rawCreationDate",NQ="internalFileAttribute",kQ="externalFileAttribute",UQ="msDosCompatible",HU="zip64",DQ="encrypted",BQ="version",OQ="versionMadeBy",YQ="zipCrypto",jnt=[WQ,PQ,AQ,FQ,TV,YU,vQ,wQ,qv,$v,MQ,OU,OU,NQ,kQ,UQ,HU,DQ,BQ,OQ,YQ,"directory","bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"],uy=class{constructor(t){jnt.forEach(n=>this[n]=t[n])}};var HQ="File format is not recognized",tit="End of central directory not found",nit="End of Zip64 central directory locator not found",iit="Central directory header not found",oit="Local file header not found",rit="Zip64 extra field not found",sit="File contains encrypted entry",ait="Encryption method not supported",Bbe="Compression method not supported",Obe="Split zip file",Ybe="utf-8",Hbe="cp437",cit=[[FQ,4294967295],[AQ,4294967295],[MQ,4294967295],[OU,65535]],lit={[65535]:{getValue:gs,bytes:4},[4294967295]:{getValue:zU,bytes:8}},eD=class{constructor(t,n={}){Object.assign(this,{reader:DU(t),options:n,config:Dv()})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await vf(i),(i.size===Ii||!i.readUint8Array)&&(i=new Qb(await new Response(i.readable).blob()),await vf(i)),i.size<22)throw new Error(HQ);i.chunkSize=SU(o);let r=await fit(i,101010256,i.size,22,65535*16);if(!r){let F=await Fa(i,0,4),b=ga(F);throw gs(b)==134695760?new Error(Obe):new Error(tit)}let s=ga(r),a=gs(s,12),c=gs(s,16),d=r.offset,u=ba(s,20),m=d+22+u,p=ba(s,4),g=i.lastDiskNumber||0,f=ba(s,6),x=ba(s,8),_=0,C=0;if(c==4294967295||a==4294967295||x==65535||f==65535){let F=await Fa(i,r.offset-20,20),b=ga(F);if(gs(b,0)==117853008){c=zU(b,8);let R=await Fa(i,c,56,-1),E=ga(R),X=r.offset-20-56;if(gs(E,0)!=101075792&&c!=X){let A=c;c=X,_=c-A,R=await Fa(i,c,56,-1),E=ga(R)}if(gs(E,0)!=101075792)throw new Error(nit);p==65535&&(p=gs(E,16)),f==65535&&(f=gs(E,20)),x==65535&&(x=zU(E,32)),a==4294967295&&(a=zU(E,40)),c-=a}}if(c>=i.size&&(_=i.size-c-a-22,c=i.size-a-22),g!=p)throw new Error(Obe);if(c<0)throw new Error(HQ);let V=0,L=await Fa(i,c,a,f),Z=ga(L);if(a){let F=r.offset-a;if(gs(Z,V)!=33639248&&c!=F){let b=c;c=F,_+=c-b,L=await Fa(i,c,a,f),Z=ga(L)}}let G=r.offset-c-(i.lastDiskOffset||0);if(a!=G&&G>=0&&(a=G,L=await Fa(i,c,a,f),Z=ga(L)),c<0||c>=i.size)throw new Error(HQ);let I=tl(n,t,"filenameEncoding"),v=tl(n,t,"commentEncoding");for(let F=0;F<x;F++){let b=new KQ(i,o,n.options);if(gs(Z,V)!=33639248)throw new Error(iit);Kbe(b,Z,V+6);let R=!!b.bitFlag.languageEncodingFlag,E=V+46,X=E+b.filenameLength,A=X+b.extraFieldLength,N=ba(Z,V+4),O=(N&0)==0,U=L.subarray(E,X),Y=ba(Z,V+32),k=A+Y,H=L.subarray(A,k),J=R,te=R,z=O&&(SV(Z,V+38)&16)==16,q=gs(Z,V+42)+_;Object.assign(b,{versionMadeBy:N,msDosCompatible:O,compressedSize:0,uncompressedSize:0,commentLength:Y,directory:z,offset:q,diskNumberStart:ba(Z,V+34),internalFileAttribute:ba(Z,V+36),externalFileAttribute:gs(Z,V+38),rawFilename:U,filenameUTF8:J,commentUTF8:te,rawExtraField:L.subarray(X,A)});let ee=tl(n,t,"decodeText")||jv,fe=J?Ybe:I||Hbe,_e=te?Ybe:v||Hbe,le=ee(U,fe);le===Ii&&(le=jv(U,fe));let ye=ee(H,_e);ye===Ii&&(ye=jv(H,_e)),Object.assign(b,{rawComment:H,filename:le,comment:ye,directory:z||le.endsWith(fV)}),C=Math.max(q,C),await Jbe(b,b,Z,V+6),b.zipCrypto=b.encrypted&&!b.extraFieldAES;let Te=new uy(b);Te.getData=(Le,ke)=>b.getData(Le,Te,ke),V=k;let{onprogress:Xe}=t;if(Xe)try{await Xe(F+1,x,new uy(b))}catch{}yield Te}let P=tl(n,t,"extractPrependedData"),w=tl(n,t,"extractAppendedData");return P&&(n.prependedData=C>0?await Fa(i,0,C):new Uint8Array),n.comment=u?await Fa(i,d+22,u):new Uint8Array,w&&(n.appendedData=m<i.size?await Fa(i,m,i.size-m):new Uint8Array),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){}};var KQ=class{constructor(t,n,i){Object.assign(this,{reader:t,config:n,options:i})}async getData(t,n,i={}){let o=this,{reader:r,offset:s,diskNumberStart:a,extraFieldAES:c,compressionMethod:d,config:u,bitFlag:m,signature:p,rawLastModDate:g,uncompressedSize:f,compressedSize:x}=o,_=n.localDirectory={},C=await Fa(r,s,30,a),V=ga(C),L=tl(o,i,"password"),Z=tl(o,i,"rawPassword"),G=tl(o,i,"passThrough");if(L=L&&L.length&&L,Z=Z&&Z.length&&Z,c&&c.originalCompressionMethod!=99)throw new Error(Bbe);if(d!=0&&d!=8&&!G)throw new Error(Bbe);if(gs(V,0)!=67324752)throw new Error(oit);Kbe(_,V,4),_.rawExtraField=_.extraFieldLength?await Fa(r,s+30+_.filenameLength,_.extraFieldLength,a):new Uint8Array,await Jbe(o,_,V,4,!0),Object.assign(n,{lastAccessDate:_.lastAccessDate,creationDate:_.creationDate});let I=o.encrypted&&_.encrypted&&!G,v=I&&!c;if(G||(n.zipCrypto=v),I){if(!v&&c.strength===Ii)throw new Error(ait);if(!L&&!Z)throw new Error(sit)}let P=s+30+_.filenameLength+_.extraFieldLength,w=x,F=r.readable;Object.assign(F,{diskNumberStart:a,offset:P,size:w});let b=tl(o,i,"signal"),R=tl(o,i,"checkPasswordOnly");R&&(t=new WritableStream),t=BU(t),await vf(t,G?x:f);let{writable:E}=t,{onstart:X,onprogress:A,onend:N}=i,O={options:{codecType:vU,password:L,rawPassword:Z,zipCrypto:v,encryptionStrength:c&&c.strength,signed:tl(o,i,"checkSignature")&&!G,passwordVerification:v&&(m.dataDescriptor?g>>>8&255:p>>>24&255),signature:p,compressed:d!=0&&!G,encrypted:o.encrypted&&!G,useWebWorkers:tl(o,i,"useWebWorkers"),useCompressionStream:tl(o,i,"useCompressionStream"),transferStreams:tl(o,i,"transferStreams"),checkPasswordOnly:R},config:u,streamOptions:{signal:b,size:w,onstart:X,onprogress:A,onend:N}},U=0;try{({outputSize:U}=await FU({readable:F,writable:E},O))}catch(Y){if(!R||Y.message!=Jb)throw Y}finally{let Y=tl(o,i,"preventClose");E.size+=U,!Y&&!E.locked&&await E.getWriter().close()}return R?Ii:t.getData?t.getData():E}};function Kbe(e,t,n){let i=e.rawBitFlag=ba(t,n+2),o=(i&1)==1,r=gs(t,n+6);Object.assign(e,{encrypted:o,version:ba(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:pit(r),filenameLength:ba(t,n+22),extraFieldLength:ba(t,n+24)})}async function Jbe(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=ga(new Uint8Array(r)),c=0;try{for(;c<r.length;){let C=ba(a,c),V=ba(a,c+2);s.set(C,{type:C,data:r.slice(c+4,c+4+V)}),c+=4+V}}catch{}let d=ba(n,i+4);Object.assign(t,{signature:gs(n,i+10),uncompressedSize:gs(n,i+18),compressedSize:gs(n,i+14)});let u=s.get(1);u&&(dit(u,t),t.extraFieldZip64=u);let m=s.get(28789);m&&(await zbe(m,WQ,PQ,t,e),t.extraFieldUnicodePath=m);let p=s.get(25461);p&&(await zbe(p,vQ,wQ,t,e),t.extraFieldUnicodeComment=p);let g=s.get(39169);g?(uit(g,t,d),t.extraFieldAES=g):t.compressionMethod=d;let f=s.get(10);f&&(mit(f,t),t.extraFieldNTFS=f);let x=s.get(21589);x&&(hit(x,t,o),t.extraFieldExtendedTimestamp=x);let _=s.get(6534);_&&(t.extraFieldUSDZ=_)}function dit(e,t){t.zip64=!0;let n=ga(e.data),i=cit.filter(([o,r])=>t[o]==r);for(let o=0,r=0;o<i.length;o++){let[s,a]=i[o];if(t[s]==a){let c=lit[a];t[s]=e[s]=c.getValue(n,r),r+=c.bytes}else if(e[s])throw new Error(rit)}}async function zbe(e,t,n,i,o){let r=ga(e.data),s=new Kb;s.append(o[n]);let a=ga(new Uint8Array(4));a.setUint32(0,s.get(),!0);let c=gs(r,1);Object.assign(e,{version:SV(r,0),[t]:jv(e.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&c==gs(a,0)}),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function uit(e,t,n){let i=ga(e.data),o=SV(i,4);Object.assign(e,{vendorVersion:SV(i,0),vendorId:SV(i,2),strength:o,originalCompressionMethod:n,compressionMethod:ba(i,5)}),t.compressionMethod=e.compressionMethod}function mit(e,t){let n=ga(e.data),i=4,o;try{for(;i<e.data.length&&!o;){let r=ba(n,i),s=ba(n,i+2);r==1&&(o=e.data.slice(i+4,i+4+s)),i+=4+s}}catch{}try{if(o&&o.length==24){let r=ga(o),s=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),c=r.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:c});let d=zQ(s),u=zQ(a),m=zQ(c),p={lastModDate:d,lastAccessDate:u,creationDate:m};Object.assign(e,p),Object.assign(t,p)}}catch{}}function hit(e,t,n){let i=ga(e.data),o=SV(i,0),r=[],s=[];n?((o&1)==1&&(r.push(TV),s.push(YU)),(o&2)==2&&(r.push(qv),s.push(Ube)),(o&4)==4&&(r.push($v),s.push(Dbe))):e.data.length>=5&&(r.push(TV),s.push(YU));let a=1;r.forEach((c,d)=>{if(e.data.length>=a+4){let u=gs(i,a);t[c]=e[c]=new Date(u*1e3);let m=s[d];e[m]=u}a+=4})}async function fit(e,t,n,i,o){let r=new Uint8Array(4),s=ga(r);bit(s,0,t);let a=i+o;return await c(i)||await c(Math.min(a,n));async function c(d){let u=n-d,m=await Fa(e,u,d);for(let p=m.length-i;p>=0;p--)if(m[p]==r[0]&&m[p+1]==r[1]&&m[p+2]==r[2]&&m[p+3]==r[3])return{offset:u+p,buffer:m.slice(p,p+i).buffer}}}function tl(e,t,n){return t[n]===Ii?e.options[n]:t[n]}function pit(e){let t=(e&4294901760)>>16,n=e&65535;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0)}catch{}}function zQ(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function SV(e,t){return e.getUint8(t)}function ba(e,t){return e.getUint16(t,!0)}function gs(e,t){return e.getUint32(t,!0)}function zU(e,t){return Number(e.getBigUint64(t,!0))}function bit(e,t,n){e.setUint32(t,n,!0)}function ga(e){return new DataView(e.buffer)}var tgi=T(S(),1);var _it="File already exists",Tit="Zip file comment exceeds 64KB",Sit="File entry comment exceeds 64KB",Cit="File entry name exceeds 64KB",qbe="Version exceeds 65535",Vit="The strength must equal 1, 2, or 3",Lit="Extra field type exceeds 65535",Rit="Extra field data exceeds 64KB",c4="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",Zit="Undefined uncompressed size",$be=new Uint8Array([7,0,2,0,65,69,3,0,0]),s4=0,e0e=[],iD=class{constructor(t,n={}){t=BU(t);let i=t.availableSize!==Ii&&t.availableSize>0&&t.availableSize!==1/0&&t.maxSize!==Ii&&t.maxSize>0&&t.maxSize!==1/0;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:Dv(),files:new Map,filenames:new Set,offset:n.offset===Ii?t.writable.size:n.offset,pendingEntriesSize:0,pendingAddFileCalls:new Set,bufferedWrites:0})}async add(t="",n,i={}){let o=this,{pendingAddFileCalls:r,config:s}=o;s4<s.maxWorkers?s4++:await new Promise(c=>e0e.push(c));let a;try{if(t=t.trim(),o.filenames.has(t))throw new Error(_it);return o.filenames.add(t),a=Git(o,t,n,i),r.add(a),await a}catch(c){throw o.filenames.delete(t),c}finally{r.delete(a);let c=e0e.shift();c?c():s4--}}async close(t=new Uint8Array,n={}){let i=this,{pendingAddFileCalls:o,writer:r}=this,{writable:s}=r;for(;o.size;)await Promise.allSettled(Array.from(o));return await Ait(this,t,n),ho(i,n,"preventClose")||await s.getWriter().close(),r.getData?r.getData():s}};async function Git(e,t,n,i){t=t.trim(),i.directory&&!t.endsWith(fV)?t+=fV:i.directory=t.endsWith(fV);let o=ho(e,i,"encodeText",bV),r=o(t);if(r===Ii&&(r=bV(t)),Ki(r)>65535)throw new Error(Cit);let s=i.comment||"",a=o(s);if(a===Ii&&(a=bV(s)),Ki(a)>65535)throw new Error(Sit);let c=ho(e,i,BQ,20);if(c>65535)throw new Error(qbe);let d=ho(e,i,OQ,20);if(d>65535)throw new Error(qbe);let u=ho(e,i,TV,new Date),m=ho(e,i,qv),p=ho(e,i,$v),g=ho(e,i,UQ,!0),f=ho(e,i,NQ,0),x=ho(e,i,kQ,0),_=ho(e,i,"passThrough"),C,V;_||(C=ho(e,i,"password"),V=ho(e,i,"rawPassword"));let L=ho(e,i,"encryptionStrength",3),Z=ho(e,i,YQ),G=ho(e,i,"extendedTimestamp",!0),I=ho(e,i,"keepOrder",!0),v=ho(e,i,"level"),P=ho(e,i,"useWebWorkers"),w=ho(e,i,"bufferedWrite"),F=ho(e,i,"dataDescriptorSignature",!1),b=ho(e,i,"signal"),R=ho(e,i,"useUnicodeFileNames",!0),E=ho(e,i,"useCompressionStream"),X=ho(e,i,"compressionMethod"),A=ho(e,i,"dataDescriptor",!0),N=ho(e,i,HU);if(!Z&&(C!==Ii||V!==Ii)&&!(L>=1&&L<=3))throw new Error(Vit);let O=new Uint8Array,{extraField:U}=i;if(U){let Mt=0,Lt=0;U.forEach(Ie=>Mt+=4+Ki(Ie)),O=new Uint8Array(Mt),U.forEach((Ie,je)=>{if(je>65535)throw new Error(Lit);if(Ki(Ie)>65535)throw new Error(Rit);Gs(O,new Uint16Array([je]),Lt),Gs(O,new Uint16Array([Ki(Ie)]),Lt+2),Gs(O,Ie,Lt+4),Lt+=4+Ki(Ie)})}let Y=0,k=0,H=0;if(_&&({uncompressedSize:H}=i,H===Ii))throw new Error(Zit);let J=N===!0;n&&(n=DU(n),await vf(n),_?Y=t0e(H):n.size===Ii?(A=!0,(N||N===Ii)&&(N=!0,H=Y=4294967296)):(H=n.size,Y=t0e(H)));let{diskOffset:te,diskNumber:z,maxSize:q}=e.writer,ee=J||H>4294967295,fe=J||Y>4294967295,_e=J||e.offset+e.pendingEntriesSize-te>4294967295,ye=ho(e,i,"supportZip64SplitFile",!0)&&J||z+Math.ceil(e.pendingEntriesSize/q)>65535;if(_e||ee||fe||ye){if(N===!1||!I)throw new Error(c4);N=!0}N=N||!1;let Te=ho(e,i,DQ),{signature:Xe}=i;i=Object.assign({},i,{rawFilename:r,rawComment:a,version:c,versionMadeBy:d,lastModDate:u,lastAccessDate:m,creationDate:p,rawExtraField:O,zip64:N,zip64UncompressedSize:ee,zip64CompressedSize:fe,zip64Offset:_e,zip64DiskNumberStart:ye,password:C,rawPassword:V,level:!E&&e.config.CompressionStream===Ii&&e.config.CompressionStreamNative===Ii?0:v,useWebWorkers:P,encryptionStrength:L,extendedTimestamp:G,zipCrypto:Z,bufferedWrite:w,keepOrder:I,useUnicodeFileNames:R,dataDescriptor:A,dataDescriptorSignature:F,signal:b,msDosCompatible:g,internalFileAttribute:f,externalFileAttribute:x,useCompressionStream:E,passThrough:_,encrypted:!!(C&&Ki(C)||V&&Ki(V))||_&&Te,signature:Xe,compressionMethod:X});let Le=Xit(i),ke=Pit(i),Oe=Ki(Le.localHeaderArray,ke.dataDescriptorArray);k=Oe+Y,e.options.usdz&&(k+=k+64),e.pendingEntriesSize+=k;let at;try{at=await Eit(e,t,n,{headerInfo:Le,dataDescriptorInfo:ke,metadataSize:Oe},i)}finally{e.pendingEntriesSize-=k}return Object.assign(at,{name:t,comment:s,extraField:U}),new uy(at)}async function Eit(e,t,n,i,o){let{files:r,writer:s}=e,{keepOrder:a,dataDescriptor:c,signal:d}=o,{headerInfo:u}=i,{usdz:m}=e.options,p=Array.from(r.values()).pop(),g={},f,x,_,C,V,L,Z;r.set(t,g);try{let P;a&&(P=p&&p.lock,G()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&a||!c)&&!m?(L=new TransformStream,Z=new Response(L.readable).blob(),L.writable.size=0,f=!0,e.bufferedWrites++,await vf(s)):(L=s,await I()),await vf(L);let{writable:w}=s,{diskOffset:F}=s;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let R=new Uint8Array(4),E=Aa(R);zi(E,0,134695760),await wf(w,R),e.offset+=4}m&&Wit(i,e.offset-F),f||(await P,await v(w));let{diskNumber:b}=s;if(V=!0,g.diskNumberStart=b,g=await Iit(n,L,g,i,e.config,o),V=!1,r.set(t,g),g.filename=t,f){await L.writable.getWriter().close();let R=await Z;await P,await I(),C=!0,c||(R=await wit(g,R,w,o)),await v(w),g.diskNumberStart=s.diskNumber,F=s.diskOffset,await R.stream().pipeTo(w,{preventClose:!0,preventAbort:!0,signal:d}),w.size+=R.size,C=!1}if(g.offset=e.offset-F,g.zip64)Fit(g,o);else if(g.offset>4294967295)throw new Error(c4);return e.offset+=g.size,g}catch(P){if(f&&C||!f&&V){if(e.hasCorruptedEntries=!0,P)try{P.corruptedEntry=!0}catch{}f?e.offset+=L.writable.size:e.offset=L.writable.size}throw r.delete(t),P}finally{f&&e.bufferedWrites--,_&&_(),x&&x()}function G(){g.lock=new Promise(P=>_=P)}async function I(){e.writerLocked=!0;let{lockWriter:P}=e;e.lockWriter=new Promise(w=>x=()=>{e.writerLocked=!1,w()}),await P}async function v(P){Ki(u.localHeaderArray)>s.availableSize&&(s.availableSize=0,await wf(P,new Uint8Array))}}async function Iit(e,t,{diskNumberStart:n,lock:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:d}=o,{localHeaderArray:u,headerArray:m,lastModDate:p,rawLastModDate:g,encrypted:f,compressed:x,version:_,compressionMethod:C,rawExtraFieldExtendedTimestamp:V,extraFieldExtendedTimestampFlag:L,rawExtraFieldNTFS:Z,rawExtraFieldAES:G}=a,{dataDescriptorArray:I}=c,{rawFilename:v,lastAccessDate:P,creationDate:w,password:F,rawPassword:b,level:R,zip64:E,zip64UncompressedSize:X,zip64CompressedSize:A,zip64Offset:N,zip64DiskNumberStart:O,zipCrypto:U,dataDescriptor:Y,directory:k,versionMadeBy:H,rawComment:J,rawExtraField:te,useWebWorkers:z,onstart:q,onprogress:ee,onend:fe,signal:_e,encryptionStrength:le,extendedTimestamp:ye,msDosCompatible:Te,internalFileAttribute:Xe,externalFileAttribute:Le,useCompressionStream:ke,passThrough:Oe}=s,at={lock:i,versionMadeBy:H,zip64:E,directory:!!k,filenameUTF8:!0,rawFilename:v,commentUTF8:!0,rawComment:J,rawExtraFieldExtendedTimestamp:V,rawExtraFieldNTFS:Z,rawExtraFieldAES:G,rawExtraField:te,extendedTimestamp:ye,msDosCompatible:Te,internalFileAttribute:Xe,externalFileAttribute:Le,diskNumberStart:n},{signature:Mt,uncompressedSize:Lt}=s,Ie=0;Oe||(Lt=0);let{writable:je}=t;if(e){e.chunkSize=SU(r),await wf(je,u);let He=e.readable,Dt=He.size=e.size,Ce={options:{codecType:PU,level:R,rawPassword:b,password:F,encryptionStrength:le,zipCrypto:f&&U,passwordVerification:f&&U&&g>>8&255,signed:!Oe,compressed:x&&!Oe,encrypted:f&&!Oe,useWebWorkers:z,useCompressionStream:ke,transferStreams:!1},config:r,streamOptions:{signal:_e,size:Dt,onstart:q,onprogress:ee,onend:fe}},Ve=await FU({readable:He,writable:je},Ce);Ie=Ve.outputSize,Oe||(Lt=Ve.inputSize,Mt=Ve.signature),je.size+=Lt}else await wf(je,u);let et;if(E){let He=4;X&&(He+=8),A&&(He+=8),N&&(He+=8),O&&(He+=4),et=new Uint8Array(He)}else et=new Uint8Array;return vit({signature:Mt,rawExtraFieldZip64:et,compressedSize:Ie,uncompressedSize:Lt,headerInfo:a,dataDescriptorInfo:c},s),Y&&await wf(je,I),Object.assign(at,{uncompressedSize:Lt,compressedSize:Ie,lastModDate:p,rawLastModDate:g,creationDate:w,lastAccessDate:P,encrypted:f,zipCrypto:U,size:d+Ie,compressionMethod:C,version:_,headerArray:m,signature:Mt,rawExtraFieldZip64:et,extraFieldExtendedTimestampFlag:L,zip64UncompressedSize:X,zip64CompressedSize:A,zip64Offset:N,zip64DiskNumberStart:O}),at}function Xit(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,level:r,zip64:s,zipCrypto:a,useUnicodeFileNames:c,dataDescriptor:d,directory:u,rawExtraField:m,encryptionStrength:p,extendedTimestamp:g,encrypted:f}=e,x=r!==0&&!u,{version:_,compressionMethod:C}=e,V;if(f&&!a){V=new Uint8Array(Ki($be)+2);let N=Aa(V);no(N,0,39169),Gs(V,$be,2),oD(N,8,p)}else V=new Uint8Array;let L,Z,G;if(g){Z=new Uint8Array(9+(i?4:0)+(o?4:0));let N=Aa(Z);no(N,0,21589),no(N,2,Ki(Z)-4),G=1+(i?2:0)+(o?4:0),oD(N,4,G);let O=5;zi(N,O,Math.floor(n.getTime()/1e3)),O+=4,i&&(zi(N,O,Math.floor(i.getTime()/1e3)),O+=4),o&&zi(N,O,Math.floor(o.getTime()/1e3));try{L=new Uint8Array(36);let U=Aa(L),Y=a4(n);no(U,0,10),no(U,2,32),no(U,8,1),no(U,10,24),Yl(U,12,Y),Yl(U,20,a4(i)||Y),Yl(U,28,a4(o)||Y)}catch{L=new Uint8Array}}else L=Z=new Uint8Array;let I=0;c&&(I=I|2048),d&&(I=I|8),C===Ii&&(C=x?8:0),C==8&&(r>=1&&r<3&&(I=I|6),r>=3&&r<5&&(I=I|1),r===9&&(I=I|2)),s&&(_=_>45?_:45),f&&(I=I|1,a||(_=_>51?_:51,V[9]=C,C=99));let v=new Uint8Array(26),P=Aa(v);no(P,0,_),no(P,2,I),no(P,4,C);let w=new Uint32Array(1),F=Aa(w),b;n<yQ?b=yQ:n>gQ?b=gQ:b=n,no(F,0,(b.getHours()<<6|b.getMinutes())<<5|b.getSeconds()/2),no(F,2,(b.getFullYear()-1980<<4|b.getMonth()+1)<<5|b.getDate());let R=w[0];zi(P,6,R),no(P,22,Ki(t));let E=Ki(V,Z,L,m);no(P,24,E);let X=new Uint8Array(30+Ki(t)+E),A=Aa(X);return zi(A,0,67324752),Gs(X,v,4),Gs(X,t,30),Gs(X,V,30+Ki(t)),Gs(X,Z,30+Ki(t,V)),Gs(X,L,30+Ki(t,V,Z)),Gs(X,m,30+Ki(t,V,Z,L)),{localHeaderArray:X,headerArray:v,headerView:P,lastModDate:n,rawLastModDate:R,encrypted:f,compressed:x,version:_,compressionMethod:C,extraFieldExtendedTimestampFlag:G,rawExtraFieldExtendedTimestamp:Z,rawExtraFieldNTFS:L,rawExtraFieldAES:V,extraFieldLength:E}}function Wit(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=Aa(i),s=64-(t+Ki(i))%64;s<4&&(s+=64);let a=new Uint8Array(s),c=Aa(a);no(c,0,6534),no(c,2,s-2);let d=i;n.localHeaderArray=i=new Uint8Array(Ki(d)+s),Gs(i,d),Gs(i,a,Ki(d)),r=Aa(i),no(r,28,o+s),e.metadataSize+=s}function Pit(e){let{zip64:t,dataDescriptor:n,dataDescriptorSignature:i}=e,o=new Uint8Array,r,s=0;return n&&(o=new Uint8Array(t?i?24:20:i?16:12),r=Aa(o),i&&(s=4,zi(r,0,134695760))),{dataDescriptorArray:o,dataDescriptorView:r,dataDescriptorOffset:s}}function vit(e,t){let{signature:n,rawExtraFieldZip64:i,compressedSize:o,uncompressedSize:r,headerInfo:s,dataDescriptorInfo:a}=e,{headerView:c,encrypted:d}=s,{dataDescriptorView:u,dataDescriptorOffset:m}=a,{zip64:p,zip64UncompressedSize:g,zip64CompressedSize:f,zipCrypto:x,dataDescriptor:_}=t;if((!d||x)&&n!==Ii&&(zi(c,10,n),_&&zi(u,m,n)),p){let C=Aa(i);no(C,0,1),no(C,2,Ki(i)-4);let V=4;g&&(zi(c,18,4294967295),Yl(C,V,BigInt(r)),V+=8),f&&(zi(c,14,4294967295),Yl(C,V,BigInt(o))),_&&(Yl(u,m+4,BigInt(o)),Yl(u,m+12,BigInt(r)))}else zi(c,14,o),zi(c,18,r),_&&(zi(u,m+4,o),zi(u,m+8,r))}async function wit(e,t,n,{zipCrypto:i}){let o;o=await t.slice(0,26).arrayBuffer(),o.byteLength!=26&&(o=o.slice(0,26));let r=new DataView(o);return(!e.encrypted||i)&&zi(r,14,e.signature),e.zip64?(zi(r,18,4294967295),zi(r,22,4294967295)):(zi(r,18,e.compressedSize),zi(r,22,e.uncompressedSize)),await wf(n,new Uint8Array(o)),t.slice(o.byteLength)}function Fit(e,t){let{rawExtraFieldZip64:n,offset:i,diskNumberStart:o}=e,{zip64UncompressedSize:r,zip64CompressedSize:s,zip64Offset:a,zip64DiskNumberStart:c}=t,d=Aa(n),u=4;r&&(u+=8),s&&(u+=8),a&&(Yl(d,u,BigInt(i)),u+=8),c&&zi(d,u,o)}async function Ait(e,t,n){let{files:i,writer:o}=e,{diskOffset:r,writable:s}=o,{diskNumber:a}=o,c=0,d=0,u=e.offset-r,m=i.size;for(let[,G]of i){let{rawFilename:I,rawExtraFieldZip64:v,rawExtraFieldAES:P,rawComment:w,rawExtraFieldNTFS:F,rawExtraField:b,extendedTimestamp:R,extraFieldExtendedTimestampFlag:E,lastModDate:X}=G,A;if(R){A=new Uint8Array(9);let N=Aa(A);no(N,0,21589),no(N,2,5),oD(N,4,E),zi(N,5,Math.floor(X.getTime()/1e3))}else A=new Uint8Array;G.rawExtraFieldCDExtendedTimestamp=A,d+=46+Ki(I,w,v,P,F,A,b)}let p=new Uint8Array(d),g=Aa(p);await vf(o);let f=0;for(let[G,I]of Array.from(i.values()).entries()){let{offset:v,rawFilename:P,rawExtraFieldZip64:w,rawExtraFieldAES:F,rawExtraFieldCDExtendedTimestamp:b,rawExtraFieldNTFS:R,rawExtraField:E,rawComment:X,versionMadeBy:A,headerArray:N,directory:O,zip64:U,zip64UncompressedSize:Y,zip64CompressedSize:k,zip64DiskNumberStart:H,zip64Offset:J,msDosCompatible:te,internalFileAttribute:z,externalFileAttribute:q,diskNumberStart:ee,uncompressedSize:fe,compressedSize:_e}=I,le=Ki(w,F,b,R,E);zi(g,c,33639248),no(g,c+4,A);let ye=Aa(N);Y||zi(ye,18,fe),k||zi(ye,14,_e),Gs(p,N,c+6),no(g,c+30,le),no(g,c+32,Ki(X)),no(g,c+34,U&&H?65535:ee),no(g,c+36,z),q?zi(g,c+38,q):O&&te&&oD(g,c+38,16),zi(g,c+42,U&&J?4294967295:v),Gs(p,P,c+46),Gs(p,w,c+46+Ki(P)),Gs(p,F,c+46+Ki(P,w)),Gs(p,b,c+46+Ki(P,w,F)),Gs(p,R,c+46+Ki(P,w,F,b)),Gs(p,E,c+46+Ki(P,w,F,b,R)),Gs(p,X,c+46+Ki(P)+le);let Te=46+Ki(P,X)+le;if(c-f>o.availableSize&&(o.availableSize=0,await wf(s,p.slice(f,c)),f=c),c+=Te,n.onprogress)try{await n.onprogress(G+1,i.size,new uy(I))}catch{}}await wf(s,f?p.slice(f):p);let x=o.diskNumber,{availableSize:_}=o;_<22&&x++;let C=ho(e,n,HU);if(u>4294967295||d>4294967295||m>65535||x>65535){if(C===!1)throw new Error(c4);C=!0}let V=new Uint8Array(C?98:22),L=Aa(V);c=0,C&&(zi(L,0,101075792),Yl(L,4,BigInt(44)),no(L,12,45),no(L,14,45),zi(L,16,x),zi(L,20,a),Yl(L,24,BigInt(m)),Yl(L,32,BigInt(m)),Yl(L,40,BigInt(d)),Yl(L,48,BigInt(u)),zi(L,56,117853008),Yl(L,64,BigInt(u)+BigInt(d)),zi(L,72,x+1),ho(e,n,"supportZip64SplitFile",!0)&&(x=65535,a=65535),m=65535,u=4294967295,d=4294967295,c+=76),zi(L,c,101010256),no(L,c+4,x),no(L,c+6,a),no(L,c+8,m),no(L,c+10,m),zi(L,c+12,d),zi(L,c+16,u);let Z=Ki(t);if(Z)if(Z<=65535)no(L,c+20,Z);else throw new Error(Tit);await wf(s,V),Z&&await wf(s,t)}async function wf(e,t){let n=e.getWriter();try{await n.ready,e.size+=Ki(t),await n.write(t)}finally{n.releaseLock()}}function a4(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function ho(e,t,n,i){let o=t[n]===Ii?e.options[n]:t[n];return o===Ii?i:o}function t0e(e){return e+5*(Math.floor(e/16383)+1)}function oD(e,t,n){e.setUint8(t,n)}function no(e,t,n){e.setUint16(t,n,!0)}function zi(e,t,n){e.setUint32(t,n,!0)}function Yl(e,t,n){e.setBigUint64(t,n,!0)}function Gs(e,t,n){e.set(t,n)}function Aa(e){return new DataView(e.buffer)}function Ki(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}pV({Deflate:Npe,Inflate:abe});var fgi=T(S(),1);function Mit(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Xn=Mit;var bgi=T(S(),1);function Nit(e,t){this.position=e,this.headingPitchRange=t}var nw=Nit;var _gi=T(S(),1);function rD(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new be,this.tourEnd=new be,this.entryStart=new be,this.entryEnd=new be,this._activeEntries=[]}rD.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};rD.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;o0e.call(this,e,t,function(i){n.playlistIndex=0,i||i0e(n._activeEntries),n.tourEnd.raiseEvent(i)})};rD.prototype.stop=function(){i0e(this._activeEntries)};function i0e(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function o0e(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=kit.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(o,e.scene.camera,t);else{let r=this;i.play(function(){r.entryEnd.raiseEvent(i);let s=r._activeEntries.indexOf(i);s>=0&&r._activeEntries.splice(s,1)}),o(e,t,n)}}else l(n)&&n(!1)}function kit(e,t,n,i){let o=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(o,i),i)n(i);else{let r=this._activeEntries.indexOf(o);r>=0&&this._activeEntries.splice(r,1),this.playlistIndex++,o0e.call(this,e,t,n)}}var iw=rD;var Agi=T(S(),1);var Xgi=T(S(),1);var Ggi=T(S(),1),Xi=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Xi.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?Xi.Bounce.In(e*2)*.5:Xi.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5}}}}),ow=function(){return performance.now()},Uit=function(){function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];for(var o=0,r=n;o<r.length;o++){var s=r[o];(t=s._group)===null||t===void 0||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i=0,o=t;i<o.length;i++){var r=o[i];r._group=void 0,delete this._tweens[r.getId()],delete this._tweensAddedDuringUpdate[r.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,n){t===void 0&&(t=ow()),n===void 0&&(n=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<i.length;o++){var r=this._tweens[i[o]],s=!n;r&&r.update(t,s)===!1&&!n&&this.remove(r)}i=Object.keys(this._tweensAddedDuringUpdate)}},e}(),CV={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=CV.Utils.Linear;return t<0?r(e[0],e[1],i):t>1?r(e[n],e[n-1],n-i):r(e[o],e[o+1>n?n:o+1],i-o)},Bezier:function(e,t){for(var n=0,i=e.length-1,o=Math.pow,r=CV.Utils.Bernstein,s=0;s<=i;s++)n+=o(1-t,i-s)*o(t,s)*e[s]*r(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=CV.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(o=Math.floor(i=n*(1+t))),r(e[(o-1+n)%n],e[o],e[(o+1)%n],e[(o+2)%n],i-o)):t<0?e[0]-(r(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(r(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):r(e[o?o-1:0],e[o],e[n<o+1?n:o+1],e[n<o+2?n:o+2],i-o)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=CV.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:function(){var e=[1];return function(t){var n=1;if(e[t])return e[t];for(var i=t;i>1;i--)n*=i;return e[t]=n,n}}(),CatmullRom:function(e,t,n,i,o){var r=(n-e)*.5,s=(i-t)*.5,a=o*o,c=o*a;return(2*t-2*n+r+s)*c+(-3*t+3*n-2*r-s)*a+r*o+t}}},r0e=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),l4=new Uit,s0e=function(){function e(t,n){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Xi.Linear.None,this._interpolationFunction=CV.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=r0e.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof n=="object"?(this._group=n,n.add(this)):n===!0&&(this._group=l4,l4.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(t,n){if(n===void 0&&(n=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,n){if(t===void 0&&(t=ow()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var r in this._valuesEnd)o[r]=this._valuesEnd[r];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,n,i,o,r){for(var s in i){var a=t[s],c=Array.isArray(a),d=c?"array":typeof a,u=!c&&Array.isArray(i[s]);if(!(d==="undefined"||d==="function")){if(u){var m=i[s];if(m.length===0)continue;for(var p=[a],g=0,f=m.length;g<f;g+=1){var x=this._handleRelativeValue(a,m[g]);if(isNaN(x)){u=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(x)}u&&(i[s]=p)}if((d==="object"||c)&&a&&!u){n[s]=c?[]:{};var _=a;for(var C in _)n[s][C]=_[C];o[s]=c?[]:{};var m=i[s];if(!this._isDynamic){var V={};for(var C in m)V[C]=m[C];i[s]=m=V}this._setupProperties(_,n[s],m,o[s],r)}else(typeof n[s]>"u"||r)&&(n[s]=a),c||(n[s]*=1),u?o[s]=i[s].slice().reverse():o[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=ow()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=ow()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;t<n;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=Xi.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=CV.Linear),this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,n){var i=this,o;if(t===void 0&&(t=ow()),n===void 0&&(n=e.autoStartOnUpdate),this._isPaused)return!0;var r;if(!this._goToEnd&&!this._isPlaying)if(n)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=t-this._startTime,a=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),c=this._duration+this._repeat*a,d=function(){if(i._duration===0||s>c)return 1;var x=Math.trunc(s/a),_=s-x*a,C=Math.min(_/i._duration,1);return C===0&&s===i._duration?1:C},u=d(),m=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,m),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),this._duration===0||s>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((s-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(r in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[r]=="string"&&(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=a*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var g=0,f=this._chainedTweens.length;g<f;g++)this._chainedTweens[g].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,o){for(var r in i)if(n[r]!==void 0){var s=n[r]||0,a=i[r],c=Array.isArray(t[r]),d=Array.isArray(a),u=!c&&d;u?t[r]=this._interpolationFunction(a,o):typeof a=="object"&&a?this._updateProperties(t[r],s,a,o):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[r]=s+(a-s)*o))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e.autoStartOnUpdate=!1,e}();var Tgi=r0e.nextId,Ff=l4,Sgi=Ff.getAll.bind(Ff),Cgi=Ff.removeAll.bind(Ff),Vgi=Ff.add.bind(Ff),Lgi=Ff.remove.bind(Ff),Rgi=Ff.update.bind(Ff);var Dit={LINEAR_NONE:Xi.Linear.None,QUADRATIC_IN:Xi.Quadratic.In,QUADRATIC_OUT:Xi.Quadratic.Out,QUADRATIC_IN_OUT:Xi.Quadratic.InOut,CUBIC_IN:Xi.Cubic.In,CUBIC_OUT:Xi.Cubic.Out,CUBIC_IN_OUT:Xi.Cubic.InOut,QUARTIC_IN:Xi.Quartic.In,QUARTIC_OUT:Xi.Quartic.Out,QUARTIC_IN_OUT:Xi.Quartic.InOut,QUINTIC_IN:Xi.Quintic.In,QUINTIC_OUT:Xi.Quintic.Out,QUINTIC_IN_OUT:Xi.Quintic.InOut,SINUSOIDAL_IN:Xi.Sinusoidal.In,SINUSOIDAL_OUT:Xi.Sinusoidal.Out,SINUSOIDAL_IN_OUT:Xi.Sinusoidal.InOut,EXPONENTIAL_IN:Xi.Exponential.In,EXPONENTIAL_OUT:Xi.Exponential.Out,EXPONENTIAL_IN_OUT:Xi.Exponential.InOut,CIRCULAR_IN:Xi.Circular.In,CIRCULAR_OUT:Xi.Circular.Out,CIRCULAR_IN_OUT:Xi.Circular.InOut,ELASTIC_IN:Xi.Elastic.In,ELASTIC_OUT:Xi.Elastic.Out,ELASTIC_IN_OUT:Xi.Elastic.InOut,BACK_IN:Xi.Back.In,BACK_OUT:Xi.Back.Out,BACK_IN_OUT:Xi.Back.InOut,BOUNCE_IN:Xi.Bounce.In,BOUNCE_OUT:Xi.Bounce.Out,BOUNCE_IN_OUT:Xi.Bounce.InOut},Yr=Object.freeze(Dit);function sD(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}sD.prototype.play=function(e,t,n){if(this.activeCamera=t,l(e)&&e!==null){let o=this;this.activeCallback=function(r){delete o.activeCallback,delete o.activeCamera,e(l(r)?!1:r)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let o=new ce(this.view.position);t.flyToBoundingSphere(o,i)}};sD.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};sD.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Yr.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),l(e)&&(t=Tt(t,e)),t};var rw=sD;var kgi=T(S(),1);function d4(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}d4.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};d4.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var sw=d4;var b0e={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){let t=e.toLowerCase();return t=Ky(t),b0e[t]}},g4;typeof DOMParser<"u"&&(g4=new DOMParser);var Bit=new cU({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),my=32,a0e=2414016,c0e=1,l0e=16093e3,d0e=.1,u0e=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],m0e=["http://www.google.com/kml/ext/2.2"],Oit=["http://www.w3.org/2005/Atom"],ve={kml:u0e,gx:m0e,atom:Oit,kmlgx:u0e.concat(m0e)},y4={Document:R0e,Folder:lot,Placemark:dot,NetworkLink:xot,GroundOverlay:bot,PhotoOverlay:E0e,ScreenOverlay:pot,Tour:mot};function Af(e){this._dataSource=e,this._deferred=yl(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(Af.prototype,{dataSource:{get:function(){return this._dataSource}}});Af.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};Af.prototype.addPromise=function(e){this._promises.push(e)};Af.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};Af.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=Bd._getTimestamp()),this._process(e)};Af.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=Bd._getTimestamp(),e._process(!0)},0)};Af.prototype._nextNode=function(){let e=this._stack,t=e[e.length-1],n=t.index,i=t.nodes;if(n!==i.length)return++t.index,i[n]};Af.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};Af.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;l(i);){let o=y4[i.localName];if(l(o)&&(ve.kml.indexOf(i.namespaceURI)!==-1||ve.gx.indexOf(i.namespaceURI)!==-1)&&(o(t,i,n,this),this._timeoutSet||Bd._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function Yit(e){let t=e.slice(0,Math.min(4,e.size)),n=yl(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function Hit(e){let t=yl(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function g0e(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,o,r;for(let s in t)t.hasOwnProperty(s)&&(o=RegExp(`[< ]${s}:`),r=`xmlns:${s}=`,o.test(e)&&e.indexOf(r)===-1&&(l(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${r}"${t[s]}"`));return l(n)&&(e=n+i),e}function y0e(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,o,r;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),o=t,t=e.indexOf(i,t+1),t!==-1?(r=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(r+1,e.length),t=e.indexOf("xmlns:",o-1)):t=e.indexOf("xmlns:",o+1);return e}function zit(e,t){return Promise.resolve(e.getData(new kU)).then(function(n){n=g0e(n),n=y0e(n),t.kml=g4.parseFromString(n,"application/xml")})}function u4(e,t){let n=y(b0e.detectFromFilename(e.filename),"application/octet-stream");return Promise.resolve(e.getData(new MU(n))).then(function(i){t[e.filename]=i})}function Ud(e,t,n,i){let o=i.keys,r=new aw.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],d=c.getAttribute(n);if(l(d)){let m=new aw.default(d).absoluteTo(r).toString(),p=o.indexOf(m);if(p!==-1){let g=o[p];c.setAttribute(n,i[g]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",g)}}}}function Dd(e,t,n,i){let o=e.querySelectorAll(t);for(let r=0;r<o.length;r++){let s=o[r],a=s.getAttribute(n),c=x4(a,i);l(c)&&s.setAttribute(n,c.url)}}function x0e(e,t,n){let i=Es(e,"id");i=l(i)&&i.length!==0?i:Bn(),l(n)&&(i=n+i);let o=t.getById(i);return l(o)&&(i=Bn(),l(n)&&(i=n+i)),o=t.add(new jo({id:i})),l(o.kml)||(o.addProperty("kml"),o.kml=new Cot),o}function cw(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function dD(e,t){if(!l(e))return h.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return h.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),o=parseFloat(n[1]),r=parseFloat(n[2]);return i=isNaN(i)?0:i,o=isNaN(o)?0:o,r=isNaN(r)?0:r,h.fromDegrees(i,o,r,t)}function aD(e,t){if(!l(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!l(n))return;let i=n.length,o=new Array(i),r=0;for(let s=0;s<i;s++)o[r++]=dD(n[s],t);return o}function hy(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function Es(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Wi(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function h0e(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagNameNS("*",t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function gh(e,t,n){if(!l(e))return[];let i=[],o=e.childNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function $n(e,t,n){let i=Wi(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Wn(e,t,n){let i=Wi(e,t,n);if(l(i))return i.textContent.trim()}function yh(e,t,n){let i=Wi(e,t,n);if(l(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function x4(e,t,n){if(!l(e))return;let i;if(l(n)){e=e.replace(/\\/g,"/");let o=n[e];if(l(o))i=new Ee({url:o});else{let r=new aw.default(t.getUrlComponent()),s=new aw.default(e);o=n[s.absoluteTo(r)],l(o)&&(i=new Ee({url:o}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var Hl={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function p4(e,t){if(!l(e)||/^\s*$/gm.test(e))return;e[0]==="#"&&(e=e.substring(1));let n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,o=parseInt(e.substring(4,6),16)/255,r=parseInt(e.substring(6,8),16)/255;return t?(r>0?(Hl.maximumRed=r,Hl.red=void 0):(Hl.maximumRed=void 0,Hl.red=0),o>0?(Hl.maximumGreen=o,Hl.green=void 0):(Hl.maximumGreen=void 0,Hl.green=0),i>0?(Hl.maximumBlue=i,Hl.blue=void 0):(Hl.maximumBlue=void 0,Hl.blue=0),Hl.alpha=n,B.fromRandom(Hl)):new B(r,o,i,n)}function pT(e,t,n){let i=Wn(e,t,n);if(l(i))return p4(i,Wn(e,"colorMode",n)==="random")}function Kit(e){let t=Wi(e,"TimeStamp",ve.kmlgx),n=Wn(t,"when",ve.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=j.fromIso8601(n),o=new Ur;return o.addInterval(new Vn({start:i,stop:Be.MAXIMUM_VALUE})),o}function Jit(e){let t=Wi(e,"TimeSpan",ve.kmlgx);if(!l(t))return;let n,i=Wi(t,"begin",ve.kmlgx),o=l(i)?j.fromIso8601(i.textContent):void 0,r=Wi(t,"end",ve.kmlgx),s=l(r)?j.fromIso8601(r.textContent):void 0;if(l(o)&&l(s)){if(j.lessThan(s,o)){let a=o;o=s,s=a}n=new Ur,n.addInterval(new Vn({start:o,stop:s}))}else l(o)?(n=new Ur,n.addInterval(new Vn({start:o,stop:Be.MAXIMUM_VALUE}))):l(s)&&(n=new Ur,n.addInterval(new Vn({start:Be.MINIMUM_VALUE,stop:s})));return n}function _0e(){let e=new tc;return e.width=my,e.height=my,e.scaleByDistance=new Ut(a0e,c0e,l0e,d0e),e.pixelOffsetScaleByDistance=new Ut(a0e,c0e,l0e,d0e),e}function _4(){let e=new Em;return e.outline=!0,e.outlineColor=B.WHITE,e}function T0e(){let e=new Gm;return e.translucencyByDistance=new Ut(3e6,1,5e6,0),e.pixelOffset=new D(17,0),e.horizontalOrigin=gi.LEFT,e.font="16px sans-serif",e.style=Uo.FILL_AND_OUTLINE,e}function T4(e,t,n,i,o){let r=Wn(e,"href",ve.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),c=y($n(e,"x",ve.gx),0),d=y($n(e,"y",ve.gx),0);c=Math.min(c/32,7),d=7-Math.min(d/32,7);let u=8*d+c;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${u}.png`}let s=x4(r,n,i);if(o){let a=Wn(e,"refreshMode",ve.kml),c=Wn(e,"viewRefreshMode",ve.kml);a==="onInterval"||a==="onExpire"?St(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&St(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let d=y(Wn(e,"viewBoundScale",ve.kml),1),u=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",m=y(Wn(e,"viewFormat",ve.kml),u),p=Wn(e,"httpQuery",ve.kml);l(m)&&s.setQueryParameters(od(lD(m))),l(p)&&s.setQueryParameters(od(lD(p)));let g=t._ellipsoid;return C4(s,t.camera,t.canvas,d,t._lastCameraView.bbox,g),s}return s}function Qit(e,t,n,i,o){let r=$n(t,"scale",ve.kml),s=$n(t,"heading",ve.kml),a=pT(t,"color",ve.kml),c=Wi(t,"Icon",ve.kml),d=T4(c,e,i,o,!1);l(c)&&!l(d)&&(d=!1);let u=$n(c,"x",ve.gx),m=$n(c,"y",ve.gx),p=$n(c,"w",ve.gx),g=$n(c,"h",ve.gx),f=Wi(t,"hotSpot",ve.kml),x=hy(f,"x"),_=hy(f,"y"),C=Es(f,"xunits"),V=Es(f,"yunits"),L=n.billboard;l(L)||(L=_0e(),n.billboard=L),L.image=d,L.scale=r,L.color=a,(l(u)||l(m)||l(p)||l(g))&&(L.imageSubRegion=new Ke(u,m,p,g)),l(s)&&s!==0&&(L.rotation=W.toRadians(-s),L.alignedAxis=h.UNIT_Z),r=y(r,1);let Z,G;l(x)&&(C==="pixels"?Z=-x*r:C==="insetPixels"?Z=(x-my)*r:C==="fraction"&&(Z=-x*my*r),Z+=my*.5*r),l(_)&&(V==="pixels"?G=_*r:V==="insetPixels"?G=(-_+my)*r:V==="fraction"&&(G=_*my*r),G-=my*.5*r),(l(Z)||l(G))&&(L.pixelOffset=new D(Z,G))}function cD(e,t,n,i,o){for(let r=0,s=t.childNodes.length;r<s;r++){let a=t.childNodes.item(r);if(a.localName==="IconStyle")Qit(e,a,n,i,o);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=T0e(),n.label=c),c.scale=y($n(a,"scale",ve.kml),c.scale),c.fillColor=y(pT(a,"color",ve.kml),c.fillColor),c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new oc,n.polyline=c),c.width=$n(a,"width",ve.kml),c.material=pT(a,"color",ve.kml),l(pT(a,"outerColor",ve.gx))&&St("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l($n(a,"outerWidth",ve.gx))&&St("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l($n(a,"physicalWidth",ve.gx))&&St("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(yh(a,"labelVisibility",ve.gx))&&St("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=_4(),n.polygon=c),c.material=y(pT(a,"color",ve.kml),c.material),c.fill=y(yh(a,"fill",ve.kml),c.fill),c.outline=y(yh(a,"outline",ve.kml),c.outline)}else if(a.localName==="BalloonStyle"){let c=y(p4(Wn(a,"bgColor",ve.kml)),B.WHITE),d=y(p4(Wn(a,"textColor",ve.kml)),B.BLACK),u=Wn(a,"text",ve.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:d,text:u}}else if(a.localName==="ListStyle"){let c=Wn(a,"listItemType",ve.kml);(c==="radioFolder"||c==="checkOffOnly")&&St(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function jit(e,t,n,i,o){let r=new jo,s,a=-1,c=t.childNodes,d=c.length;for(let m=0;m<d;m++){let p=c[m];(p.localName==="Style"||p.localName==="StyleMap")&&(a=m)}if(a!==-1){let m=c[a];if(m.localName==="Style")cD(e,m,r,i,o);else{let p=gh(m,"Pair",ve.kml);for(let g=0;g<p.length;g++){let f=p[g],x=Wn(f,"key",ve.kml);if(x==="normal"){let _=Wn(f,"styleUrl",ve.kml);if(l(_))s=n.getById(_),l(s)||(s=n.getById(`#${_}`)),l(s)&&r.merge(s);else{let C=Wi(f,"Style",ve.kml);cD(e,C,r,i,o)}}else St(`kml-styleMap-${x}`,`KML - Unsupported StyleMap key: ${x}`)}}}let u=Wn(t,"styleUrl",ve.kml);if(l(u)){let m=u;if(u[0]!=="#"&&u.indexOf("#")!==-1){let p=u.split("#"),g=p[0];m=`${i.getDerivedResource({url:g}).getUrlComponent()}#${p[1]}`}s=n.getById(m),l(s)||(s=n.getById(`#${m}`)),l(s)&&r.merge(s)}return r}function qit(e,t,n){return t.fetchXML().then(function(i){return S0e(e,i,n,t,!0)})}function S0e(e,t,n,i,o,r){let s,a,c,d,u=h0e(t,"Style",ve.kml);if(l(u)){let x=u.length;for(s=0;s<x;s++)d=u[s],a=Es(d,"id"),l(a)&&(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new jo({id:a}),n.add(c),cD(e,d,c,i,r)))}let m=h0e(t,"StyleMap",ve.kml);if(l(m)){let x=m.length;for(s=0;s<x;s++){let _=m[s];if(a=Es(_,"id"),l(a)){let C=gh(_,"Pair",ve.kml);for(let V=0;V<C.length;V++){let L=C[V],Z=Wn(L,"key",ve.kml);if(Z==="normal"){if(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let G=Wn(L,"styleUrl",ve.kml);if(l(G)){G[0]!=="#"&&(G=`#${G}`),o&&l(i)&&(G=i.getUrlComponent()+G);let I=n.getById(G);l(I)&&c.merge(I)}else d=Wi(L,"Style",ve.kml),cD(e,d,c,i,r)}}else St(`kml-styleMap-${Z}`,`KML - Unsupported StyleMap key: ${Z}`)}}}}let p=[],g=t.getElementsByTagName("styleUrl"),f=g.length;for(s=0;s<f;s++){let x=g[s].textContent;if(x[0]!=="#"){let _=x.split("#");if(_.length===2){let C=_[0],V=i.getDerivedResource({url:C});p.push(qit(e,V,n))}}}return p}function S4(e,t,n){let i=new Fb(e,t.id,["position"]),o=new Lf(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new oc,t.polyline.positions=new wb([i,o])}function C0e(e,t){return!l(e)&&!l(t)||e==="clampToGround"?Qe.CLAMP_TO_GROUND:e==="relativeToGround"?Qe.RELATIVE_TO_GROUND:e==="absolute"?Qe.NONE:t==="clampToSeaFloor"?(St("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),Qe.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(St("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),Qe.RELATIVE_TO_GROUND):(l(e)?St("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):St("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),Qe.CLAMP_TO_GROUND)}function $it(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&St("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`),new Lf(e))}function eot(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&St("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${y(t,n)}`);let o=e.length;for(let r=0;r<o;r++){let s=e[r];i.scaleToGeodeticSurface(s,s)}return e}function uD(e,t,n,i){let o=t.label;l(o)||(o=l(n.label)?n.label.clone():T0e(),t.label=o),o.text=t.name;let r=t.billboard;l(r)||(r=l(n.billboard)?n.billboard.clone():_0e(),t.billboard=r),l(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(B.YELLOW,64);let s=1;l(r.scale)&&(s=r.scale.getValue(),s!==0?o.pixelOffset=new D(s*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),l(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function V0e(e,t){let n=e.path;l(n)||(n=new Wp,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function tot(e,t,n,i,o){let r=Wn(n,"coordinates",ve.kml),s=Wn(n,"altitudeMode",ve.kml),a=Wn(n,"altitudeMode",ve.gx),c=yh(n,"extrude",ve.kml),d=e._ellipsoid,u=dD(r,d);return i.position=u,uD(e,i,o,C0e(s,a)),c&&cw(s,a)&&S4(t,i,o),!0}function f0e(e,t,n,i,o){let r=Wi(n,"coordinates",ve.kml),s=Wn(n,"altitudeMode",ve.kml),a=Wn(n,"altitudeMode",ve.gx),c=yh(n,"extrude",ve.kml),d=yh(n,"tessellate",ve.kml),u=cw(s,a),m=$n(n,"drawOrder",ve.gx),p=e._ellipsoid,g=aD(r,p),f=o.polyline;if(u&&c){let x=new Pp;i.wall=x,x.positions=g;let _=o.polygon;l(_)&&(x.fill=_.fill,x.material=_.material),x.outline=!0,l(f)?(x.outlineColor=l(f.material)?f.material.color:B.WHITE,x.outlineWidth=f.width):l(_)&&(x.outlineColor=l(_.material)?_.material.color:B.WHITE)}else if(e._clampToGround&&!u&&d){let x=new oc;x.clampToGround=!0,i.polyline=x,x.positions=g,l(f)?(x.material=l(f.material)?f.material.color.getValue(Be.MINIMUM_VALUE):B.WHITE,x.width=y(f.width,1)):(x.material=B.WHITE,x.width=1),x.zIndex=m}else l(m)&&St("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!d&&St("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),f=l(f)?f.clone():new oc,i.polyline=f,f.positions=eot(g,s,a,p),(!d||u)&&(f.arcType=nn.NONE);return!0}function not(e,t,n,i,o){let r=Wi(n,"outerBoundaryIs",ve.kml),s=Wi(r,"LinearRing",ve.kml),a=Wi(s,"coordinates",ve.kml),c=e._ellipsoid,d=aD(a,c),u=yh(n,"extrude",ve.kml),m=Wn(n,"altitudeMode",ve.kml),p=Wn(n,"altitudeMode",ve.gx),g=cw(m,p),f=l(o.polygon)?o.polygon.clone():_4(),x=o.polyline;if(l(x)&&(f.outlineColor=l(x.material)?x.material.color:B.WHITE,f.outlineWidth=x.width),i.polygon=f,g?(f.perPositionHeight=!0,f.extrudedHeight=u?0:void 0):e._clampToGround||(f.height=0),l(d)){let _=new Ia(d),C=gh(n,"innerBoundaryIs",ve.kml);for(let V=0;V<C.length;V++){s=gh(C[V],"LinearRing",ve.kml);for(let L=0;L<s.length;L++)a=Wi(s[L],"coordinates",ve.kml),d=aD(a,c),l(d)&&_.holes.push(new Ia(d))}f.hierarchy=_}return!0}function iot(e,t,n,i,o){let r=Wn(n,"altitudeMode",ve.kml),s=Wn(n,"altitudeMode",ve.gx),a=gh(n,"coord",ve.gx),c=gh(n,"angles",ve.gx),d=gh(n,"when",ve.kml),u=yh(n,"extrude",ve.kml),m=cw(r,s),p=e._ellipsoid;c.length>0&&St("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,d.length),f=[],x=[];for(let C=0;C<g;C++){let V=dD(a[C].textContent,p);f.push(V),x.push(j.fromIso8601(d[C].textContent))}let _=new fa;return _.addSamples(x,f),i.position=_,uD(e,i,o,C0e(r,s)),V0e(i,o),i.availability=new Ur,d.length>0&&i.availability.addInterval(new Vn({start:x[0],stop:x[x.length-1]})),m&&u&&S4(t,i,o),!0}function p0e(e,t,n,i,o,r,s,a,c){let d=e[0],u=e[e.length-1],m=new fa;m.addSamples(e,t),n.intervals.addInterval(new Vn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:$it(m,s,a)})),i.addInterval(new Vn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new Vn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:r}))}function oot(e,t,n,i,o){let r=yh(n,"interpolate",ve.gx),s=gh(n,"Track",ve.gx),a,c,d,u=!1,m=new Mb,p=new Ur,g=new ma,f=e._ellipsoid;for(let x=0,_=s.length;x<_;x++){let C=s[x],V=gh(C,"when",ve.kml),L=gh(C,"coord",ve.gx),Z=Wn(C,"altitudeMode",ve.kml),G=Wn(C,"altitudeMode",ve.gx),I=cw(Z,G),v=yh(C,"extrude",ve.kml),P=Math.min(L.length,V.length),w=[];a=[];for(let F=0;F<P;F++){let b=dD(L[F].textContent,f);w.push(b),a.push(j.fromIso8601(V[F].textContent))}r&&(l(c)&&p0e([c,a[0]],[d,w[0]],g,p,m,!1,"absolute",void 0,!1),c=a[P-1],d=w[w.length-1]),p0e(a,w,g,p,m,I&&v,Z,G,!0),u=u||I&&v}return i.availability=p,i.position=g,uD(e,i,o),V0e(i,o),u&&(S4(t,i,o),i.polyline.show=m),!0}var L0e={Point:tot,LineString:f0e,LinearRing:f0e,Polygon:not,Track:iot,MultiTrack:oot,MultiGeometry:rot,Model:sot};function rot(e,t,n,i,o,r){let s=n.childNodes,a=!1;for(let c=0,d=s.length;c<d;c++){let u=s.item(c),m=L0e[u.localName];if(l(m)){let p=x0e(u,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,m(e,t,u,p,o)&&(a=!0)}}return a}function sot(e,t,n,i,o){return St("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function aot(e,t){let n=Wi(e,"ExtendedData",ve.kml);if(!l(n))return;l(Wi(n,"SchemaData",ve.kml))&&St("kml-schemaData","KML - SchemaData is unsupported"),l(Es(n,"xmlns:prefix"))&&St("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=gh(n,"Data",ve.kml);if(l(o)){let r=o.length;for(let s=0;s<r;s++){let a=o[s],c=Es(a,"name");l(c)&&(i[c]={displayName:Wn(a,"displayName",ve.kml),value:Wn(a,"value",ve.kml)})}}t.kml.extendedData=i}var fo;typeof document<"u"&&(fo=document.createElement("div"));function cot(e,t,n,i,o){let r,s,a,c=t.kml,d=c.extendedData,u=Wn(e,"description",ve.kml),m=y(t.balloonStyle,n.balloonStyle),p=B.WHITE,g=B.BLACK,f=u;l(m)&&(p=y(m.bgColor,B.WHITE),g=y(m.textColor,B.BLACK),f=y(m.text,u));let x;if(l(f)){if(f=f.replace("$[name]",y(t.name,"")),f=f.replace("$[description]",y(u,"")),f=f.replace("$[address]",y(c.address,"")),f=f.replace("$[Snippet]",y(c.snippet,"")),f=f.replace("$[id]",t.id),f=f.replace("$[geDirections]",""),l(d)){let V=f.match(/\$\[.+?\]/g);if(V!==null)for(r=0;r<V.length;r++){let L=V[r],Z=L.substr(2,L.length-3),G=/\/displayName$/.test(Z);Z=Z.replace(/\/displayName$/,""),x=d[Z],l(x)&&(x=G?x.displayName:x.value),l(x)&&(f=f.replace(L,y(x,"")))}}}else if(l(d)&&(a=Object.keys(d),a.length>0)){for(f='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<a.length;r++)s=a[r],x=d[s],f+=`<tr><th>${y(x.displayName,s)}</th><td>${y(x.value,"")}</td></tr>`;f+="</tbody></table>"}if(!l(f))return;f=Bit.link(f),fo.innerHTML=f;let _=fo.querySelectorAll("a");for(r=0;r<_.length;r++)_[r].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(Ud(fo,"a","href",i),Ud(fo,"link","href",i),Ud(fo,"area","href",i),Ud(fo,"img","src",i),Ud(fo,"iframe","src",i),Ud(fo,"video","src",i),Ud(fo,"audio","src",i),Ud(fo,"source","src",i),Ud(fo,"track","src",i),Ud(fo,"input","src",i),Ud(fo,"embed","src",i),Ud(fo,"script","src",i),Ud(fo,"video","poster",i)),Dd(fo,"a","href",o),Dd(fo,"link","href",o),Dd(fo,"area","href",o),Dd(fo,"img","src",o),Dd(fo,"iframe","src",o),Dd(fo,"video","src",o),Dd(fo,"audio","src",o),Dd(fo,"source","src",o),Dd(fo,"track","src",o),Dd(fo,"input","src",o),Dd(fo,"embed","src",o),Dd(fo,"script","src",o),Dd(fo,"video","poster",o);let C='<div class="cesium-infoBox-description-lighter" style="';C+="overflow:auto;",C+="word-wrap:break-word;",C+=`background-color:${p.toCssColorString()};`,C+=`color:${g.toCssColorString()};`,C+='">',C+=`${fo.innerHTML}</div>`,fo.innerHTML="",t.description=C}function mD(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=x0e(t,i,n.context),c=a.kml,d=jit(e,t,n.styleCollection,r,s),u=Wn(t,"name",ve.kml);a.name=u,a.parent=o;let m=Jit(t);l(m)||(m=Kit(t)),a.availability=m,L4(a);function p(L){return L?L.show&&p(L.parent):!0}let g=yh(t,"visibility",ve.kml);a.show=p(o)&&y(g,!0);let f=Wi(t,"author",ve.atom),x=c.author;x.name=Wn(f,"name",ve.atom),x.uri=Wn(f,"uri",ve.atom),x.email=Wn(f,"email",ve.atom);let _=Wi(t,"link",ve.atom),C=c.link;C.href=Es(_,"href"),C.hreflang=Es(_,"hreflang"),C.rel=Es(_,"rel"),C.type=Es(_,"type"),C.title=Es(_,"title"),C.length=Es(_,"length"),c.address=Wn(t,"address",ve.kml),c.phoneNumber=Wn(t,"phoneNumber",ve.kml),c.snippet=Wn(t,"Snippet",ve.kml),aot(t,a),cot(t,a,d,s,r);let V=e._ellipsoid;return G0e(t,a,V),Z0e(t,a,V),l(Wi(t,"Region",ve.kml))&&St("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:d}}function R0e(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function lot(e,t,n,i){let o=mD(e,t,n),r=Ye(n);r.parentEntity=o.entity,R0e(e,t,r,i)}function dot(e,t,n,i){let o=mD(e,t,n),r=o.entity,s=o.styleEntity,a=!1,c=t.childNodes;for(let d=0,u=c.length;d<u&&!a;d++){let m=c.item(d),p=L0e[m.localName];l(p)&&(p(e,n.entityCollection,m,r,s,r.id),a=!0)}a||(r.merge(s),uD(e,r,s))}var uot={FlyTo:fot,Wait:hot,SoundCue:m4,AnimatedUpdate:m4,TourControl:m4};function mot(e,t,n,i){let o=Wn(t,"name",ve.kml),r=Es(t,"id"),s=new iw(o,r),a=Wi(t,"Playlist",ve.gx);if(a){let c=e._ellipsoid,d=a.childNodes;for(let u=0;u<d.length;u++){let m=d[u];if(m.localName){let p=uot[m.localName];p?p(s,m,c):console.log(`Unknown KML Tour playlist entry type ${m.localName}`)}}}e._kmlTours.push(s)}function m4(e,t){St(`KML Tour unsupported node ${t.localName}`)}function hot(e,t){let n=$n(t,"duration",ve.gx);e.addPlaylistEntry(new sw(n))}function fot(e,t,n){let i=$n(t,"duration",ve.gx),o=Wn(t,"flyToMode",ve.gx),r={kml:{}};G0e(t,r,n),Z0e(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new rw(i,o,s);e.addPlaylistEntry(a)}function Z0e(e,t,n){let i=Wi(e,"Camera",ve.kml);if(l(i)){let o=y($n(i,"longitude",ve.kml),0),r=y($n(i,"latitude",ve.kml),0),s=y($n(i,"altitude",ve.kml),0),a=y($n(i,"heading",ve.kml),0),c=y($n(i,"tilt",ve.kml),0),d=y($n(i,"roll",ve.kml),0),u=h.fromDegrees(o,r,s,n),m=Ca.fromDegrees(a,c-90,d);t.kml.camera=new Av(u,m)}}function G0e(e,t,n){let i=Wi(e,"LookAt",ve.kml);if(l(i)){let o=y($n(i,"longitude",ve.kml),0),r=y($n(i,"latitude",ve.kml),0),s=y($n(i,"altitude",ve.kml),0),a=$n(i,"heading",ve.kml),c=$n(i,"tilt",ve.kml),d=y($n(i,"range",ve.kml),0);c=W.toRadians(y(c,0)),a=W.toRadians(y(a,0));let u=new Qu(a,c-W.PI_OVER_TWO,d),m=h.fromDegrees(o,r,s,n);t.kml.lookAt=new nw(m,u)}}function pot(e,t,n,i){let o=n.screenOverlayContainer;if(!l(o))return;let r=n.sourceResource,s=n.uriResolver,a=Wi(t,"Icon",ve.kml),c=T4(a,e,r,s,!1);if(!l(c))return;let d=document.createElement("img");e._screenOverlays.push(d),d.src=c.url,d.onload=function(){let u=["position: absolute"],m=Wi(t,"screenXY",ve.kml),p=Wi(t,"overlayXY",ve.kml),g=Wi(t,"size",ve.kml),f,x,_,C,V,L;l(g)&&(f=hy(g,"x"),x=hy(g,"y"),_=Es(g,"xunits"),C=Es(g,"yunits"),l(f)&&f!==-1&&f!==0&&(_==="fraction"?V=`width: ${Math.floor(f*100)}%`:_==="pixels"&&(V=`width: ${f}px`),u.push(V)),l(x)&&x!==-1&&x!==0&&(C==="fraction"?L=`height: ${Math.floor(x*100)}%`:C==="pixels"&&(L=`height: ${x}px`),u.push(L))),d.style=u.join(";");let Z=0,G=d.height;l(p)&&(f=hy(p,"x"),x=hy(p,"y"),_=Es(p,"xunits"),C=Es(p,"yunits"),l(f)&&(_==="fraction"?Z=f*d.width:(_==="pixels"||_==="insetPixels")&&(Z=f)),l(x)&&(C==="fraction"?G=x*d.height:(C==="pixels"||C==="insetPixels")&&(G=x))),l(m)&&(f=hy(m,"x"),x=hy(m,"y"),_=Es(m,"xunits"),C=Es(m,"yunits"),l(f)&&(_==="fraction"?V=`left: calc(${Math.floor(f*100)}% - ${Z}px)`:_==="pixels"?V=`left: ${f-Z}px`:_==="insetPixels"&&(V=`right: ${f-Z}px`),u.push(V)),l(x)&&(C==="fraction"?L=`bottom: calc(${Math.floor(x*100)}% - ${G}px)`:C==="pixels"?L=`bottom: ${x-G}px`:C==="insetPixels"&&(L=`top: ${x-G}px`),u.push(L))),d.style=u.join(";")},o.appendChild(d)}function bot(e,t,n,i){let r=mD(e,t,n).entity,s,a=!1,c=e._ellipsoid,d=aD(Wi(t,"LatLonQuad",ve.gx),c),u=$n(t,"drawOrder",ve.kml);if(l(d))s=_4(),s.hierarchy=new Ia(d),s.zIndex=u,r.polygon=s,a=!0;else{s=new Im,s.zIndex=u,r.rectangle=s;let f=Wi(t,"LatLonBox",ve.kml);if(l(f)){let x=$n(f,"west",ve.kml),_=$n(f,"south",ve.kml),C=$n(f,"east",ve.kml),V=$n(f,"north",ve.kml);l(x)&&(x=W.negativePiToPi(W.toRadians(x))),l(_)&&(_=W.clampToLatitudeRange(W.toRadians(_))),l(C)&&(C=W.negativePiToPi(W.toRadians(C))),l(V)&&(V=W.clampToLatitudeRange(W.toRadians(V))),s.coordinates=new ae(x,_,C,V);let L=$n(f,"rotation",ve.kml);if(l(L)){let Z=W.toRadians(L);s.rotation=Z,s.stRotation=Z}}}let m=Wi(t,"Icon",ve.kml),p=T4(m,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&St("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let f=$n(m,"x",ve.gx),x=$n(m,"y",ve.gx),_=$n(m,"w",ve.gx),C=$n(m,"h",ve.gx);(l(f)||l(x)||l(_)||l(C))&&St("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=pT(t,"color",ve.kml),s.material.transparent=!0}else s.material=pT(t,"color",ve.kml);let g=Wn(t,"altitudeMode",ve.kml);l(g)?g==="absolute"?(s.height=$n(t,"altitude",ve.kml),s.zIndex=void 0):g!=="clampToGround"&&St("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=Wn(t,"altitudeMode",ve.gx),g==="relativeToSeaFloor"?(St("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=$n(t,"altitude",ve.kml),s.zIndex=void 0):g==="clampToSeaFloor"?St("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(g)&&St("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`))}function E0e(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),St(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var fy={INTERVAL:0,EXPIRE:1,STOP:2};function lD(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var got=new ae,VV=new he,h4=new D,yot=new h;function C4(e,t,n,i,o,r){function s(d){return d<-W.PI_OVER_TWO?-W.PI_OVER_TWO:d>W.PI_OVER_TWO?W.PI_OVER_TWO:d}function a(d){return d>W.PI?d-W.TWO_PI:d<-W.PI?d+W.TWO_PI:d}let c=jy(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==oe.MORPHING){let d,u;if(o=y(o,got),l(n)&&(h4.x=n.clientWidth*.5,h4.y=n.clientHeight*.5,d=t.pickEllipsoid(h4,r,yot)),l(d)?u=r.cartesianToCartographic(d,VV):(u=ae.center(o,VV),d=r.cartographicToCartesian(u)),l(i)&&!W.equalsEpsilon(i,1,W.EPSILON9)){let C=o.width*i*.5,V=o.height*i*.5;o=new ae(a(u.longitude-C),s(u.latitude-V),a(u.longitude+C),s(u.latitude+V))}c=c.replace("[bboxWest]",W.toDegrees(o.west).toString()),c=c.replace("[bboxSouth]",W.toDegrees(o.south).toString()),c=c.replace("[bboxEast]",W.toDegrees(o.east).toString()),c=c.replace("[bboxNorth]",W.toDegrees(o.north).toString());let m=W.toDegrees(u.longitude).toString(),p=W.toDegrees(u.latitude).toString();c=c.replace("[lookatLon]",m),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",W.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",W.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",h.distance(t.positionWC,d)),c=c.replace("[lookatTerrainLon]",m),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",u.height.toString()),r.cartesianToCartographic(t.positionWC,VV),c=c.replace("[cameraLon]",W.toDegrees(VV.longitude).toString()),c=c.replace("[cameraLat]",W.toDegrees(VV.latitude).toString()),c=c.replace("[cameraAlt]",W.toDegrees(VV.height).toString());let g=t.frustum,f=g.aspectRatio,x="",_="";if(l(f)){let C=W.toDegrees(g.fov);f>1?(x=C,_=C/f):(_=C,x=C*f)}c=c.replace("[horizFov]",x.toString()),c=c.replace("[vertFov]",_.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(od(c))}function xot(e,t,n,i){let r=mD(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=Wi(t,"Link",ve.kml);if(l(c)||(c=Wi(t,"Url",ve.kml)),l(c)){let d=Wn(c,"href",ve.kml),u,m;if(l(d)){let p=d;if(d=x4(d,s,n.uriResolver),/^data:/.test(d.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=d.clone(),u=Wn(c,"viewRefreshMode",ve.kml),u==="onRegion"){St("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}m=y(Wn(c,"viewBoundScale",ve.kml),1);let _=u==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",C=y(Wn(c,"viewFormat",ve.kml),_),V=Wn(c,"httpQuery",ve.kml);l(C)&&d.setQueryParameters(od(lD(C))),l(V)&&d.setQueryParameters(od(lD(V)));let L=e._ellipsoid;C4(d,e.camera,e.canvas,m,e._lastCameraView.bbox,L)}let g={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},f=new Hs,x=V4(e,f,d,g).then(function(_){let C=e._entityCollection,V=f.values;C.suspendEvents();for(let G=0;G<V.length;G++){let I=V[G];l(I.parent)||(I.parent=r,L4(I)),C.add(I)}C.resumeEvents();let L=Wn(c,"refreshMode",ve.kml),Z=y($n(c,"refreshInterval",ve.kml),0);if(L==="onInterval"&&Z>0||L==="onExpire"||u==="onStop"){let G=Wi(_,"NetworkLinkControl",ve.kml),I=l(G),v=j.now(),P={id:Bn(),href:d,cookie:{},lastUpdated:v,updating:!1,entity:r,viewBoundScale:m,needsUpdate:!1,cameraUpdateTime:v},w=0;if(I&&(P.cookie=od(y(Wn(G,"cookie",ve.kml),"")),w=y($n(G,"minRefreshPeriod",ve.kml),0)),L==="onInterval")I&&(Z=Math.max(w,Z)),P.refreshMode=fy.INTERVAL,P.time=Z;else if(L==="onExpire"){let F;if(I&&(F=Wn(G,"expires",ve.kml)),l(F))try{let b=j.fromIso8601(F),R=j.secondsDifference(b,v);R>0&&R<w&&j.addSeconds(v,w,b),P.refreshMode=fy.EXPIRE,P.time=b}catch{St("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else St("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(P.refreshMode=fy.STOP,P.time=y($n(c,"viewRefreshTime",ve.kml),0)):St("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(P.refreshMode)&&e._networkLinks.set(P.id,P)}}).catch(function(_){St(`An error occured during loading ${d.url}`),e._error.raiseEvent(e,_)});i.addPromise(x)}}}function _ot(e,t,n,i){let o=y4[t.localName];return l(o)?o(e,t,n,i):E0e(e,t,n,i)}function b4(e,t,n,i,o,r,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:Wi(a,"Document",ve.kml),d=Wn(c,"name",ve.kml);l(d)||(d=Pb(i.getUrlComponent())),l(e._name)||(e._name=d);let u=new Bd._DeferredLoading(e),m=new Hs(e);return Promise.all(S0e(e,n,m,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let f=p.childNodes;for(let x=0;x<f.length;x++){let _=f[x];if(l(y4[_.localName])){p=_;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:m,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),_ot(e,p,g,u),t.resumeEvents(),u.wait().then(function(){return n.documentElement})})}function Tot(e,t,n,i,o){let r=rn("ThirdParty/Workers/z-worker-pako.js");pV({workerScripts:{deflate:[r,"./pako_deflate.min.js"],inflate:[r,"./pako_inflate.min.js"]}});let s=new eD(new Qb(n));return Promise.resolve(s.getEntries()).then(function(a){let c=[],d={},u;for(let m=0;m<a.length;m++){let p=a[m];p.directory||(/\.kml$/i.test(p.filename)&&(!l(u)||!/\//i.test(p.filename))?(l(u)&&c.push(u4(u,d)),u=p):c.push(u4(p,d)))}return l(u)&&c.push(zit(u,d)),Promise.all(c).then(function(){if(s.close(),!l(d.kml))throw new de("KMZ file does not contain a KML document.");return d.keys=Object.keys(d),b4(e,t,d.kml,i,d,o)})})}function V4(e,t,n,i){i=y(i,y.EMPTY_OBJECT);let o=i.sourceUri,r=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof Ee){n=Ee.createIfNeeded(n),c=n.fetchBlob(),o=y(o,n.clone());let d=e._resourceCredits,u=n.credits;if(l(u)){let m=u.length;for(let p=0;p<m;p++)d.push(u[p])}}else o=y(o,Ee.DEFAULT.clone());return o=Ee.createIfNeeded(o),l(a)&&(a=Xn(a)),Promise.resolve(c).then(function(d){return d instanceof Blob?Yit(d).then(function(u){return u?Tot(e,t,d,o,a):Hit(d).then(function(m){m=g0e(m),m=y0e(m);let p,g;try{p=g4.parseFromString(m,"application/xml")}catch(f){g=f.toString()}if(l(g)||p.body||p.documentElement.tagName==="parsererror"){let f=l(g)?g:p.documentElement.firstChild.nodeValue;throw f||(f=p.body.innerText),new de(f)}return b4(e,t,p,o,r,a,s)})}):b4(e,t,d,o,r,a,s)}).catch(function(d){return e._error.raiseEvent(e,d),console.log(d),Promise.reject(d)})}function Bd(e){e=y(e,y.EMPTY_OBJECT);let t=e.camera,n=e.canvas;this._changed=new be,this._error=new be,this._loading=new be,this._refresh=new be,this._unsupportedNode=new be,this._clock=void 0,this._entityCollection=new Hs(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new Yb,this._networkLinks=new Zt,this._entityCluster=new Zd,this.canvas=n,this.camera=t,this._lastCameraView={position:l(t)?h.clone(t.positionWC):void 0,direction:l(t)?h.clone(t.directionWC):void 0,up:l(t)?h.clone(t.upWC):void 0,bbox:l(t)?t.computeViewRectangle():ae.clone(ae.MAX_VALUE)},this._ellipsoid=y(e.ellipsoid,ne.default);let i=e.credit;typeof i=="string"&&(i=new Et(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}Bd.load=function(e,t){return t=y(t,y.EMPTY_OBJECT),new Bd(t).load(e,t)};Object.defineProperties(Bd.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},refreshEvent:{get:function(){return this._refresh}},unsupportedNodeEvent:{get:function(){return this._unsupportedNode}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}},kmlTours:{get:function(){return this._kmlTours}}});Bd.prototype.load=function(e,t){t=y(t,y.EMPTY_OBJECT),Dr.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=y(t.clampToGround,!1);let i=this;return V4(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=j.equals(s,Be.MINIMUM_VALUE),d=j.equals(a,Be.MAXIMUM_VALUE);if(!c||!d){let m;c&&(m=new Date,m.setHours(0,0,0,0),s=j.fromDate(m)),d&&(m=new Date,m.setHours(24,0,0,0),a=j.fromDate(m)),o=new rh,o.startTime=s,o.stopTime=a,o.currentTime=j.clone(s),o.clockRange=Br.LOOP_STOP,o.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(j.secondsDifference(a,s)/60,1),31556900))}let u=!1;return o!==i._clock&&(i._clock=o,u=!0),n!==i._name&&(u=!0),u&&i._changed.raiseEvent(i),Dr.setLoading(i,!1),i}).catch(function(o){return Dr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};Bd.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function L4(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function Sot(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=Wi(r,"NetworkLinkControl",ve.kml),c=l(a),d=0;if(c){if(l(Wi(a,"Update",ve.kml))){St("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=od(y(Wn(a,"cookie",ve.kml),"")),d=y($n(a,"minRefreshPeriod",ve.kml),0)}let u=j.now(),m=t.refreshMode;if(m===fy.INTERVAL)l(a)&&(t.time=Math.max(d,t.time));else if(m===fy.EXPIRE){let v;if(l(a)&&(v=Wn(a,"expires",ve.kml)),l(v))try{let P=j.fromIso8601(v),w=j.secondsDifference(P,u);w>0&&w<d&&j.addSeconds(u,d,P),t.time=P}catch{St("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else St("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,g=e._entityCollection,f=n.values;function x(v){g.remove(v);let P=v._children,w=P.length;for(let F=0;F<w;++F)x(P[F])}g.suspendEvents();let _=g.values.slice(),C;for(C=0;C<_.length;++C){let v=_[C];v.parent===p&&(v.parent=void 0,x(v))}for(g.resumeEvents(),g.suspendEvents(),C=0;C<f.length;C++){let v=f[C];l(v.parent)||(v.parent=p,L4(v)),g.add(v)}g.resumeEvents(),s?i.remove(t.id):t.lastUpdated=u;let V=g.computeAvailability(),L=V.start,Z=V.stop,G=j.equals(L,Be.MINIMUM_VALUE),I=j.equals(Z,Be.MAXIMUM_VALUE);if(!G||!I){let v=e._clock;(v.startTime!==L||v.stopTime!==Z)&&(v.startTime=L,v.stopTime=Z,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var f4=new Zt;Bd.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=j.now(),i=this;f4.removeAll();function o(u){let m=u._children,p=m.length;for(let g=0;g<p;++g){let f=m[g];f4.set(f.id,f),o(f)}}let r=!1,s=this._lastCameraView,a=this.camera;l(a)&&!(a.positionWC.equalsEpsilon(s.position,W.EPSILON7)&&a.directionWC.equalsEpsilon(s.direction,W.EPSILON7)&&a.upWC.equalsEpsilon(s.up,W.EPSILON7))&&(s.position=h.clone(a.positionWC),s.direction=h.clone(a.directionWC),s.up=h.clone(a.upWC),s.bbox=a.computeViewRectangle(),r=!0);let c=new Zt,d=!1;return t.values.forEach(function(u){let m=u.entity;if(!f4.contains(m.id)){if(!u.updating){let p=!1;if(u.refreshMode===fy.INTERVAL?j.secondsDifference(n,u.lastUpdated)>u.time&&(p=!0):u.refreshMode===fy.EXPIRE?j.greaterThan(n,u.time)&&(p=!0):u.refreshMode===fy.STOP&&(r&&(u.needsUpdate=!0,u.cameraUpdateTime=n),u.needsUpdate&&j.secondsDifference(n,u.cameraUpdateTime)>=u.time&&(p=!0)),p){o(m),u.updating=!0;let g=new Hs,f=u.href.clone();f.setQueryParameters(u.cookie);let x=y(i._ellipsoid,ne.default);C4(f,i.camera,i.canvas,u.viewBoundScale,s.bbox,x),V4(i,g,f,{context:m.id}).then(Sot(i,u,g,c,f)).catch(function(_){let C=`NetworkLink ${u.href} refresh failed: ${_}`;console.log(C),i._error.raiseEvent(i,C)}),d=!0}}c.set(u.id,u)}}),d&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function Cot(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}Bd._DeferredLoading=Af;Bd._getTimestamp=_i;var lw=Bd;var ixi=T(S(),1);function dw(){pe.throwInstantiationError()}dw.prototype.update=pe.throwInstantiationError;dw.prototype.getBoundingSphere=pe.throwInstantiationError;dw.prototype.isDestroyed=pe.throwInstantiationError;dw.prototype.destroy=pe.throwInstantiationError;var R4=dw;var Pxi=T(S(),1);var Z4=32,Vot="http://www.opengis.net/kml/2.2",_h="http://www.google.com/kml/ext/2.2",Lot="http://www.w3.org/2000/xmlns/";function hD(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var Rot=/^data:image\/([^,;]+)/;hD.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof Ee){if(e=Ee.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(Rot);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let o=e.fetchBlob().then(function(r){t._files[n]=r});return this._promises.push(o),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(o=>{e.toBlob(function(r){t._files[n]=r,o()})});return this._promises.push(i),n}return""};function Zot(e,t){return function(n){e._files[t]=n}}hD.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new de("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},o=n(e,t,i);for(let r in i)if(i.hasOwnProperty(r)){let s=Promise.resolve(i[r]);this._promises.push(s),s.then(Zot(this,r))}return o};Object.defineProperties(hD.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function fD(e){this._time=e}fD.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),y(i,t)};fD.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return gT(n)};fD.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function G4(){this._ids={},this._styles={},this._count=0}G4.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};G4.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function W0e(){this._ids={}}W0e.prototype.get=function(e){if(!l(e))return this.get(Bn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function E4(e){e=y(e,y.EMPTY_OBJECT);let t=e.entities,n=y(e.kmz,!1),i=E4._createState(e),o=t.values.filter(function(d){return!l(d.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(Lot,"xmlns:gx",_h);let a=r.createElement("Document");s.appendChild(a),v0e(i,a,o),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let u=new XMLSerializer().serializeToString(i.kmlDoc);return n?Got(u,c.files):{kml:u,externalFiles:c.files}})}function Got(e,t){let n=rn("ThirdParty/Workers/z-worker-pako.js");pV({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new Qv,o=new iD(i);return o.add("doc.kml",new NU(e)).then(function(){let r=Object.keys(t);return P0e(o,r,t,0)}).then(function(){return o.close()}).then(function(r){return{kmz:r}})}function P0e(e,t,n,i){if(t.length===i)return;let o=t[i];return e.add(o,new Qb(n[o])).then(function(){return P0e(e,t,n,i+1)})}E4._createState=function(e){let t=e.entities,n=new G4,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=y(e.defaultAvailability,i),s=y(e.sampleDuration,60);r.start===Be.MINIMUM_VALUE?r.stop===Be.MAXIMUM_VALUE?r=new Vn:j.addSeconds(r.stop,-10*s,r.start):r.stop===Be.MAXIMUM_VALUE&&j.addSeconds(r.start,10*s,r.stop);let a=new hD(e.modelCallback);return{kmlDoc:document.implementation.createDocument(Vot,"kml"),ellipsoid:y(e.ellipsoid,ne.default),idManager:new W0e,styleCache:n,externalFileHandler:a,time:o,valueGetter:new fD(o),sampleDuration:s,defaultAvailability:new Ur([r])}};function v0e(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,c,d,u;for(let m=0;m<a;++m){let p=n[m];c=[],d=[],u=[],Eot(e,p,d,u),Iot(e,p.polyline,d,u),X0e(e,p.rectangle,d,u,c),X0e(e,p.polygon,d,u,c),vot(e,p,p.model,d,u);let g,f=p.availability;l(f)&&(g=i.createElement("TimeSpan"),j.equals(f.start,Be.MINIMUM_VALUE)||g.appendChild(hn(i,"begin",j.toIso8601(f.start))),j.equals(f.stop,Be.MAXIMUM_VALUE)||g.appendChild(hn(i,"end",j.toIso8601(f.stop))));for(let C=0;C<c.length;++C){let V=c[C];V.setAttribute("id",s.get(p.id)),V.appendChild(hn(i,"name",p.name)),V.appendChild(hn(i,"visibility",p.show)),V.appendChild(hn(i,"description",p.description)),l(g)&&V.appendChild(g),t.appendChild(V)}let x=d.length;if(x>0){let C=i.createElement("Placemark");C.setAttribute("id",s.get(p.id));let V=p.name,L=p.label;if(l(L)){let G=i.createElement("LabelStyle"),I=r.get(L.text);V=l(I)&&I.length>0?I:V;let v=r.getColor(L.fillColor);l(v)&&(G.appendChild(hn(i,"color",v)),G.appendChild(hn(i,"colorMode","normal")));let P=r.get(L.scale);l(P)&&G.appendChild(hn(i,"scale",P)),u.push(G)}C.appendChild(hn(i,"name",V)),C.appendChild(hn(i,"visibility",p.show)),C.appendChild(hn(i,"description",p.description)),l(g)&&C.appendChild(g),t.appendChild(C);let Z=u.length;if(Z>0){let G=i.createElement("Style");for(let I=0;I<Z;++I)G.appendChild(u[I]);C.appendChild(hn(i,"styleUrl",o.get(G)))}if(d.length===1)C.appendChild(d[0]);else if(d.length>1){let G=i.createElement("MultiGeometry");for(let I=0;I<x;++I)G.appendChild(d[I]);C.appendChild(G)}}let _=p._children;if(_.length>0){let C=i.createElement("Folder");C.setAttribute("id",s.get(p.id)),C.appendChild(hn(i,"name",p.name)),C.appendChild(hn(i,"visibility",p.show)),C.appendChild(hn(i,"description",p.description)),t.appendChild(C),v0e(e,C,_)}}}var zl=new h,nl=new he,xh=new j;function Eot(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=y(t.billboard,t.point);if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){w0e(e,t,a,n,i);return}s.get(c,void 0,zl);let d=hn(o,"coordinates",bT(zl,r)),u=o.createElement("Point"),m=o.createElement("altitudeMode");m.appendChild(yT(e,a.heightReference)),u.appendChild(m),u.appendChild(d),n.push(u);let p=a instanceof tc?A0e(e,a):F0e(e,a);i.push(p)}function w0e(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,d=t.position,u=!0;d instanceof ma?(c=d.intervals,u=!1):c=y(t.availability,e.defaultAvailability);let m=n instanceof Xp,p,g,f,x=[];for(p=0;p<c.length;++p){let C=c.get(p),V=u?d:C.data,L=r.createElement("altitudeMode");V instanceof Lf?(V=V._value,L.appendChild(yT(e,Qe.CLAMP_TO_GROUND))):l(n)?L.appendChild(yT(e,n.heightReference)):L.appendChild(yT(e,Qe.NONE));let Z=[],G=[];if(V.isConstant){a.get(V,void 0,zl);let v=hn(r,"coordinates",bT(zl,s));Z.push(j.toIso8601(C.start)),G.push(v),Z.push(j.toIso8601(C.stop)),G.push(v)}else if(V instanceof fa)for(f=V._property._times,g=0;g<f.length;++g)Z.push(j.toIso8601(f[g])),V.getValueInReferenceFrame(f[g],Ai.FIXED,zl),G.push(bT(zl,s));else if(V instanceof Xd){f=V._times;let v=V._values;for(g=0;g<f.length;++g)Z.push(j.toIso8601(f[g])),h.fromArray(v,g*3,zl),G.push(bT(zl,s))}else{let v=e.sampleDuration;C.start.clone(xh),C.isStartIncluded||j.addSeconds(xh,v,xh);let P=C.stop;for(;j.lessThan(xh,P);)V.getValue(xh,zl),Z.push(j.toIso8601(xh)),G.push(bT(zl,s)),j.addSeconds(xh,v,xh);C.isStopIncluded&&j.equals(xh,P)&&(V.getValue(xh,zl),Z.push(j.toIso8601(xh)),G.push(bT(zl,s)))}let I=r.createElementNS(_h,"Track");I.appendChild(L);for(let v=0;v<Z.length;++v){let P=hn(r,"when",Z[v]),w=hn(r,"coord",G[v],_h);I.appendChild(P),I.appendChild(w)}m&&I.appendChild(M0e(e,n)),x.push(I)}if(x.length===1)i.push(x[0]);else if(x.length>1){let C=r.createElementNS(_h,"MultiTrack");for(p=0;p<x.length;++p)C.appendChild(x[p]);i.push(C)}if(l(n)&&!m){let C=n instanceof tc?A0e(e,n):F0e(e,n);o.push(C)}let _=t.path;if(l(_)){let C=a.get(_.width),V=_.material;if(l(V)||l(C)){let L=r.createElement("LineStyle");l(C)&&L.appendChild(hn(r,"width",C)),I4(e,V,L),o.push(L)}}}function F0e(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);l(r)&&(o.appendChild(hn(n,"color",r)),o.appendChild(hn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&o.appendChild(hn(n,"scale",s/Z4)),o}function A0e(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("IconStyle"),s=i.get(t.image);if(l(s)){s=o.texture(s);let p=n.createElement("Icon");p.appendChild(hn(n,"href",s));let g=i.get(t.imageSubRegion);l(g)&&(p.appendChild(hn(n,"x",g.x,_h)),p.appendChild(hn(n,"y",g.y,_h)),p.appendChild(hn(n,"w",g.width,_h)),p.appendChild(hn(n,"h",g.height,_h))),r.appendChild(p)}let a=i.getColor(t.color);l(a)&&(r.appendChild(hn(n,"color",a)),r.appendChild(hn(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&r.appendChild(hn(n,"scale",c));let d=i.get(t.pixelOffset);if(l(d)){c=y(c,1),D.divideByScalar(d,c,d);let p=i.get(t.width,Z4),g=i.get(t.height,Z4),f=i.get(t.horizontalOrigin,gi.CENTER);f===gi.CENTER?d.x-=p*.5:f===gi.RIGHT&&(d.x-=p);let x=i.get(t.verticalOrigin,Pn.CENTER);x===Pn.TOP?d.y+=g:x===Pn.CENTER&&(d.y+=g*.5);let _=n.createElement("hotSpot");_.setAttribute("x",-d.x),_.setAttribute("y",d.y),_.setAttribute("xunits","pixels"),_.setAttribute("yunits","pixels"),r.appendChild(_)}let u=i.get(t.rotation),m=i.get(t.alignedAxis);return l(u)&&h.equals(h.UNIT_Z,m)&&(u=W.toDegrees(-u),u===0&&(u=360),r.appendChild(hn(n,"heading",u))),r}function Iot(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter;if(!l(t))return;let a=o.createElement("LineString"),c=o.createElement("altitudeMode"),d=s.get(t.clampToGround,!1),u;d?(a.appendChild(hn(o,"tessellate",!0)),u=o.createTextNode("clampToGround")):u=o.createTextNode("absolute"),c.appendChild(u),a.appendChild(c);let m=t.positions,p=s.get(m),g=hn(o,"coordinates",bT(p,r));a.appendChild(g);let f=s.get(t.zIndex);d&&l(f)&&a.appendChild(hn(o,"drawOrder",f,_h)),n.push(a);let x=o.createElement("LineStyle"),_=s.get(t.width);l(_)&&x.appendChild(hn(o,"width",_)),I4(e,t.material,x),i.push(x)}function Xot(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0);n>0&&(r=n);let s=t.coordinates,a=o.get(s),c=[],d=[ae.northeast,ae.southeast,ae.southwest,ae.northwest];for(let g=0;g<4;++g)d[g](a,nl),c.push(`${W.toDegrees(nl.longitude)},${W.toDegrees(nl.latitude)},${r}`);let u=hn(i,"coordinates",c.join(" ")),m=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(u),m.appendChild(p),[m]}function I0e(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let u=0;u<a;++u)he.fromCartesian(t[u],r,nl),s.push(`${W.toDegrees(nl.longitude)},${W.toDegrees(nl.latitude)},${i?nl.height:n}`);let c=hn(o,"coordinates",s.join(" ")),d=o.createElement("LinearRing");return d.appendChild(c),d}function Wot(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0),s=o.get(t.perPositionHeight,!1);!s&&n>0&&(r=n);let a=[],c=t.hierarchy,d=o.get(c),u=Array.isArray(d)?d:d.positions,m=i.createElement("outerBoundaryIs");m.appendChild(I0e(e,u,r,s)),a.push(m);let p=d.holes;if(l(p)){let g=p.length;for(let f=0;f<g;++f){let x=i.createElement("innerBoundaryIs");x.appendChild(I0e(e,p[f].positions,r,s)),a.push(x)}}return a}function X0e(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof Im;if(a&&s.getMaterialType(t.material)==="Image"){Pot(e,t,o);return}let c=r.createElement("Polygon"),d=s.get(t.extrudedHeight,0);d>0&&c.appendChild(hn(r,"extrude",!0));let u=a?Xot(e,t,d):Wot(e,t,d),m=u.length;for(let _=0;_<m;++_)c.appendChild(u[_]);let p=r.createElement("altitudeMode");p.appendChild(yT(e,t.heightReference)),c.appendChild(p),n.push(c);let g=r.createElement("PolyStyle"),f=s.get(t.fill,!1);f&&g.appendChild(hn(r,"fill",f)),I4(e,t.material,g);let x=s.get(t.outline,!1);if(x){g.appendChild(hn(r,"outline",x));let _=r.createElement("LineStyle"),C=s.get(t.outlineWidth,1);_.appendChild(hn(r,"width",C));let V=s.getColor(t.outlineColor,B.BLACK);_.appendChild(hn(r,"color",V)),_.appendChild(hn(r,"colorMode","normal")),i.push(_)}i.push(g)}function Pot(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(yT(e,t.heightReference)),s.appendChild(a);let c=o.get(t.height);l(c)&&s.appendChild(hn(i,"altitude",c));let d=o.get(t.coordinates),u=i.createElement("LatLonBox");u.appendChild(hn(i,"north",W.toDegrees(d.north))),u.appendChild(hn(i,"south",W.toDegrees(d.south))),u.appendChild(hn(i,"east",W.toDegrees(d.east))),u.appendChild(hn(i,"west",W.toDegrees(d.west))),s.appendChild(u);let m=o.get(t.material),p=r.texture(m.image),g=i.createElement("Icon");g.appendChild(hn(i,"href",p)),s.appendChild(g);let f=m.color;l(f)&&s.appendChild(hn(i,"color",gT(m.color))),n.push(s)}function M0e(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("Model"),s=i.get(t.scale);if(l(s)){let d=n.createElement("scale");d.appendChild(hn(n,"x",s)),d.appendChild(hn(n,"y",s)),d.appendChild(hn(n,"z",s)),r.appendChild(d)}let a=n.createElement("Link"),c=o.model(t,e.time);return a.appendChild(hn(n,"href",c)),r.appendChild(a),r}function vot(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){w0e(e,t,n,i,o);return}let d=M0e(e,n),u=r.createElement("altitudeMode");u.appendChild(yT(e,n.heightReference)),d.appendChild(u),a.get(c,void 0,zl),he.fromCartesian(zl,s,nl);let m=r.createElement("Location");m.appendChild(hn(r,"longitude",W.toDegrees(nl.longitude))),m.appendChild(hn(r,"latitude",W.toDegrees(nl.latitude))),m.appendChild(hn(r,"altitude",nl.height)),d.appendChild(m),i.push(d)}function I4(e,t,n){let i=e.kmlDoc,o=e.valueGetter;if(!l(t))return;let r=o.get(t);if(!l(r))return;let s,a=o.getMaterialType(t),c,d;switch(a){case"Image":s=gT(B.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=gT(r.color);break;case"PolylineOutline":s=gT(r.color),c=gT(r.outlineColor),d=r.outlineWidth,n.appendChild(hn(i,"outerColor",c,_h)),n.appendChild(hn(i,"outerWidth",d,_h));break;case"Stripe":s=gT(r.oddColor);break}l(s)&&(n.appendChild(hn(i,"color",s)),n.appendChild(hn(i,"colorMode","normal")))}function yT(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,Qe.NONE),r;switch(o){case Qe.NONE:r=n.createTextNode("absolute");break;case Qe.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case Qe.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function bT(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)he.fromCartesian(e[o],t,nl),i.push(`${W.toDegrees(nl.longitude)},${W.toDegrees(nl.latitude)},${nl.height}`);return i.join(" ")}function hn(e,t,n,i){n=y(n,""),typeof n=="boolean"&&(n=n?"1":"0");let o=l(i)?e.createElementNS(i,t):e.createElement(t),r=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return o.appendChild(r),o}function gT(e){let t="",n=e.toBytes();for(let i=3;i>=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var X4=E4;var IKi=T(S(),1);var Fxi=T(S(),1);function wot(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let o=e.stack;return l(o)&&(t+=`
  8555. ${o}`),t}var Mf=wot;var Qxi=T(S(),1);var Oxi=T(S(),1);var Nxi=T(S(),1);async function Fot(e,t,n,i){return l(i)||(i=!1),Not(e,t,n,i)}function Aot(e,t,n){let i=e[0],o=i.terrainProvider.requestTileGeometry(i.x,i.y,i.level);if(!o)return!1;let r;return n?r=o.then(k0e(i)):r=o.then(k0e(i)).catch(kot(i)),e.shift(),t.push(r),!0}function Mot(e){return new Promise(function(t){setTimeout(t,e)})}function W4(e,t,n){return e.length?Aot(e,t,n)?W4(e,t,n):Mot(100).then(()=>W4(e,t,n)):Promise.resolve()}function Not(e,t,n,i){let o=e.tilingScheme,r,s=[],a={};for(r=0;r<n.length;++r){let d=o.positionToTileXY(n[r],t);if(!l(d))continue;let u=d.toString();if(!a.hasOwnProperty(u)){let m={x:d.x,y:d.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};a[u]=m,s.push(m)}a[u].positions.push(n[r])}let c=[];return W4(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function N0e(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function k0e(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let o=!1;for(let r=0;r<t.length;++r){let s=t[r];if(!N0e(s,i,n)){o=!0;break}}return o?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let r=0;r<t.length;++r){let s=t[r];N0e(s,i,n)}}):Promise.resolve()}}function kot(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var uw=Fot;var P4=new D;async function U0e(e,t,n){l(n)||(n=!1);let i=[],o=[],r=e.availability,s=[];for(let c=0;c<t.length;++c){let d=t[c],u=r.computeMaximumLevelAtPosition(d);if(o[c]=u,u===0){e.tilingScheme.positionToTileXY(d,1,P4);let p=e.loadTileDataAvailability(P4.x,P4.y,1);l(p)&&s.push(p)}let m=i[u];l(m)||(i[u]=m=[]),m.push(d)}await Promise.all(s),await Promise.all(i.map(function(c,d){if(l(c))return uw(e,d,c,n)}));let a=[];for(let c=0;c<t.length;++c){let d=t[c];r.computeMaximumLevelAtPosition(d)!==o[c]&&a.push(d)}return a.length>0&&await U0e(e,a,n),t}var xT=U0e;async function v4(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===oe.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!l(n))return r;let a=n.availability;if(!l(a)||t.mode===oe.SCENE2D)return r;let c=[ae.center(e),ae.southeast(e),ae.southwest(e),ae.northeast(e),ae.northwest(e)],d=await v4._sampleTerrainMostDetailed(n,c),u=!1,m=d.reduce(function(g,f){return l(f.height)?(u=!0,Math.max(f.height,g)):g},-Number.MAX_VALUE),p=r;return u&&(p.height+=m),p}v4._sampleTerrainMostDetailed=xT;var _T=v4;var jGi=T(S(),1);var hTi=T(S(),1);var oTi=T(S(),1);var qxi=T(S(),1),Uot={NONE:0,LERC:1},$u=Object.freeze(Uot);var E_i=T(S(),1);var m_i=T(S(),1);var e_i=T(S(),1),Dot={NONE:0,BITS12:1},Qs=Object.freeze(Dot);var TT=new h,Bot=new h,em=new D,pD=new M,Oot=new M,Yot=Math.pow(2,12);function xc(e,t,n,i,o,r,s,a,c,d){let u=Qs.NONE,m,p;if(l(t)&&l(n)&&l(i)&&l(o)){let g=t.minimum,f=t.maximum,x=h.subtract(f,g,Bot),_=i-n;Math.max(h.maximumComponent(x),_)<Yot-1?u=Qs.BITS12:u=Qs.NONE,m=M.inverseTransformation(o,new M);let V=h.negate(g,TT);M.multiply(M.fromTranslation(V,pD),m,m);let L=TT;L.x=1/x.x,L.y=1/x.y,L.z=1/x.z,M.multiply(M.fromScale(L,pD),m,m),p=M.clone(o),M.setTranslation(p,h.ZERO,p),o=M.clone(o,new M);let Z=M.fromTranslation(g,pD),G=M.fromScale(x,Oot),I=M.multiply(Z,G,pD);M.multiply(o,I,o),M.multiply(p,I,p)}this.quantization=u,this.minimumHeight=n,this.maximumHeight=i,this.center=h.clone(e),this.toScaledENU=m,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r,this.hasWebMercatorT=y(s,!1),this.hasGeodeticSurfaceNormals=y(a,!1),this.exaggeration=y(c,1),this.exaggerationRelativeHeight=y(d,0),this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}xc.prototype.encode=function(e,t,n,i,o,r,s,a){let c=i.x,d=i.y;if(this.quantization===Qs.BITS12){n=M.multiplyByPoint(this.toScaledENU,n,TT),n.x=W.clamp(n.x,0,1),n.y=W.clamp(n.y,0,1),n.z=W.clamp(n.z,0,1);let u=this.maximumHeight-this.minimumHeight,m=W.clamp((o-this.minimumHeight)/u,0,1);D.fromElements(n.x,n.y,em);let p=wn.compressTextureCoordinates(em);D.fromElements(n.z,m,em);let g=wn.compressTextureCoordinates(em);D.fromElements(c,d,em);let f=wn.compressTextureCoordinates(em);if(e[t++]=p,e[t++]=g,e[t++]=f,this.hasWebMercatorT){D.fromElements(s,0,em);let x=wn.compressTextureCoordinates(em);e[t++]=x}}else h.subtract(n,this.center,TT),e[t++]=TT.x,e[t++]=TT.y,e[t++]=TT.z,e[t++]=o,e[t++]=c,e[t++]=d,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=wn.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var Hot=new h,D0e=new h;xc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,o=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let r=this.stride;for(let s=0;s<o;s++){for(let u=0;u<i;u++){let m=s*i+u,p=s*r+u;t[p]=e[m]}let a=this.decodePosition(t,s,Hot),c=n.geodeticSurfaceNormal(a,D0e),d=s*r+this._offsetGeodeticSurfaceNormal;t[d]=c.x,t[d+1]=c.y,t[d+2]=c.z}};xc.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let o=this.stride;for(let r=0;r<i;r++)for(let s=0;s<o;s++){let a=r*n+s,c=r*o+s;t[c]=e[a]}};xc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new h),t*=this.stride,this.quantization===Qs.BITS12){let i=wn.decompressTextureCoordinates(e[t],em);n.x=i.x,n.y=i.y;let o=wn.decompressTextureCoordinates(e[t+1],em);return n.z=o.x,M.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],h.add(n,this.center,n)};xc.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,o=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,D0e),a=this.decodeHeight(e,t),c=_r.getHeight(a,i,o)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};xc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new D),t*=this.stride,this.quantization===Qs.BITS12?wn.decompressTextureCoordinates(e[t+2],n):D.fromElements(e[t+4],e[t+5],n)};xc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===Qs.BITS12?wn.decompressTextureCoordinates(e[t+1],em).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};xc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===Qs.BITS12?wn.decompressTextureCoordinates(e[t+3],em).x:e[t+6]};xc.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,o=Math.floor(i),r=(i-o)*256;return D.fromElements(o,r,n)};xc.prototype.decodeGeodeticSurfaceNormal=function(e,t,n){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,n.x=e[t],n.y=e[t+1],n.z=e[t+2],n};xc.prototype._calculateStrideAndOffsets=function(){let e=0;switch(this.quantization){case Qs.BITS12:e+=3;break;default:e+=6}this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var bD={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},gD={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};xc.prototype.getAttributes=function(e){let t=Q.FLOAT,n=Q.getSizeInBytes(t),i=this.stride*n,o=0,r=[];function s(a,c){r.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:o,strideInBytes:i}),o+=c*n}if(this.quantization===Qs.NONE){s(bD.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(bD.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(bD.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(gD.compressed0,a?4:3),c&&s(gD.compressed1,1),this.hasGeodeticSurfaceNormals&&s(gD.geodeticSurfaceNormal,3)}return r};xc.prototype.getAttributeLocations=function(){return this.quantization===Qs.NONE?bD:gD};xc.clone=function(e,t){if(l(e))return l(t)||(t=new xc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=h.clone(e.center),t.toScaledENU=M.clone(e.toScaledENU),t.fromScaledENU=M.clone(e.fromScaledENU),t.matrix=M.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var _c=xc;var Nf={};Nf.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var w4=new h,zot=new M,Kot=new h,Jot=new h;Nf.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,s=W.PI_OVER_TWO,a=W.toRadians,c=e.heightmap,d=e.width,u=e.height,m=e.skirtHeight,p=m>0,g=y(e.isGeographic,!0),f=y(e.ellipsoid,ne.default),x=1/f.maximumRadius,_=ae.clone(e.nativeRectangle),C=ae.clone(e.rectangle),V,L,Z,G;l(C)?(V=C.west,L=C.south,Z=C.east,G=C.north):g?(V=a(_.west),L=a(_.south),Z=a(_.east),G=a(_.north)):(V=_.west*x,L=s-2*o(r(-_.south*x)),Z=_.east*x,G=s-2*o(r(-_.north*x)));let I=e.relativeToCenter,v=l(I);I=v?I:h.ZERO;let P=y(e.includeWebMercatorT,!1),w=y(e.exaggeration,1),F=y(e.exaggerationRelativeHeight,0),R=w!==1,E=y(e.structure,Nf.DEFAULT_STRUCTURE),X=y(E.heightScale,Nf.DEFAULT_STRUCTURE.heightScale),A=y(E.heightOffset,Nf.DEFAULT_STRUCTURE.heightOffset),N=y(E.elementsPerHeight,Nf.DEFAULT_STRUCTURE.elementsPerHeight),O=y(E.stride,Nf.DEFAULT_STRUCTURE.stride),U=y(E.elementMultiplier,Nf.DEFAULT_STRUCTURE.elementMultiplier),Y=y(E.isBigEndian,Nf.DEFAULT_STRUCTURE.isBigEndian),k=ae.computeWidth(_),H=ae.computeHeight(_),J=k/(d-1),te=H/(u-1);g||(k*=x,H*=x);let z=f.radiiSquared,q=z.x,ee=z.y,fe=z.z,_e=65536,le=-65536,ye=Ft.eastNorthUpToFixedFrame(I,f),Te=M.inverseTransformation(ye,zot),Xe,Le;P&&(Xe=Zi.geodeticLatitudeToMercatorAngle(L),Le=1/(Zi.geodeticLatitudeToMercatorAngle(G)-Xe));let ke=Kot;ke.x=Number.POSITIVE_INFINITY,ke.y=Number.POSITIVE_INFINITY,ke.z=Number.POSITIVE_INFINITY;let Oe=Jot;Oe.x=Number.NEGATIVE_INFINITY,Oe.y=Number.NEGATIVE_INFINITY,Oe.z=Number.NEGATIVE_INFINITY;let at=Number.POSITIVE_INFINITY,Mt=d*u,Lt=m>0?d*2+u*2:0,Ie=Mt+Lt,je=new Array(Ie),et=new Array(Ie),He=new Array(Ie),Dt=P?new Array(Ie):[],Ce=R?new Array(Ie):[],Ve=0,ct=u,Di=0,mt=d;p&&(--Ve,++ct,--Di,++mt);let _o=1e-5;for(let $e=Ve;$e<ct;++$e){let pt=$e;pt<0&&(pt=0),pt>=u&&(pt=u-1);let It=_.north-te*pt;g?It=a(It):It=s-2*o(r(-It*x));let yn=(It-L)/(G-L);yn=W.clamp(yn,0,1);let po=$e===Ve,rr=$e===ct-1;m>0&&(po?It+=_o*H:rr&&(It-=_o*H));let Oa=t(It),Ya=n(It),as=fe*Ya,Qn;P&&(Qn=(Zi.geodeticLatitudeToMercatorAngle(It)-Xe)*Le);for(let xs=Di;xs<mt;++xs){let Gr=xs;Gr<0&&(Gr=0),Gr>=d&&(Gr=d-1);let hl=pt*(d*O)+Gr*O,To;if(N===1)To=c[hl];else{To=0;let So;if(Y)for(So=0;So<N;++So)To=To*U+c[hl+So];else for(So=N-1;So>=0;--So)To=To*U+c[hl+So]}To=To*X+A,le=Math.max(le,To),_e=Math.min(_e,To);let Hr=_.west+J*Gr;g?Hr=a(Hr):Hr=Hr*x;let rp=(Hr-V)/(Z-V);rp=W.clamp(rp,0,1);let fl=pt*d+Gr;if(m>0){let So=xs===Di,su=xs===mt-1,TS=po||rr||So||su;if((po||rr)&&(So||su))continue;TS&&(To-=m,So?(fl=Mt+(u-pt-1),Hr-=_o*k):rr?fl=Mt+u+(d-Gr-1):su?(fl=Mt+u+d+pt,Hr+=_o*k):po&&(fl=Mt+u+d+u+Gr))}let sp=Oa*t(Hr),Ha=Oa*n(Hr),Er=q*sp,Ta=ee*Ha,T0=1/i(Er*sp+Ta*Ha+as*Ya),di=Er*T0,Gc=Ta*T0,nd=as*T0,ru=new h;ru.x=di+sp*To,ru.y=Gc+Ha*To,ru.z=nd+Ya*To,M.multiplyByPoint(Te,ru,w4),h.minimumByComponent(w4,ke,ke),h.maximumByComponent(w4,Oe,Oe),at=Math.min(at,To),je[fl]=ru,He[fl]=new D(rp,yn),et[fl]=To,P&&(Dt[fl]=Qn),R&&(Ce[fl]=f.geodeticSurfaceNormal(ru))}}let fr=ce.fromPoints(je),Zc;l(C)&&(Zc=En.fromRectangle(C,_e,le,f));let Zr;v&&(Zr=new Xb(f).computeHorizonCullingPointPossiblyUnderEllipsoid(I,je,_e));let ss=new M0(ke,Oe,I),Ne=new _c(I,ss,at,le,ye,!1,P,R,w,F),ut=new Float32Array(Ie*Ne.stride),Je=0;for(let $e=0;$e<Ie;++$e)Je=Ne.encode(ut,Je,je[$e],He[$e],et[$e],void 0,Dt[$e],Ce[$e]);return{vertices:ut,maximumHeight:le,minimumHeight:_e,encoding:Ne,boundingSphere3D:fr,orientedBoundingBox:Zc,occludeePointInScaledSpace:Zr}};var LV=Nf;var W_i=T(S(),1);function py(){pe.throwInstantiationError()}Object.defineProperties(py.prototype,{credits:{get:pe.throwInstantiationError},waterMask:{get:pe.throwInstantiationError}});py.prototype.interpolateHeight=pe.throwInstantiationError;py.prototype.isChildAvailable=pe.throwInstantiationError;py.prototype.createMesh=pe.throwInstantiationError;py.prototype.upsample=pe.throwInstantiationError;py.prototype.wasCreatedByUpsampling=pe.throwInstantiationError;py.maximumAsynchronousTasks=5;var Th=py;var w_i=T(S(),1);function Qot(e,t,n,i,o,r,s,a,c,d,u,m,p,g,f,x){this.center=e,this.vertices=t,this.stride=y(d,6),this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=s,this.boundingSphere3D=a,this.occludeePointInScaledSpace=c,this.orientedBoundingBox=u,this.encoding=m,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=g,this.eastIndicesNorthToSouth=f,this.northIndicesWestToEast=x}var tm=Qot;var U_i=T(S(),1);function il(){pe.throwInstantiationError()}Object.defineProperties(il.prototype,{errorEvent:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},hasWaterMask:{get:pe.throwInstantiationError},hasVertexNormals:{get:pe.throwInstantiationError},availability:{get:pe.throwInstantiationError}});var B0e=[];il.getRegularGridIndices=function(e,t){let n=B0e[e];l(n)||(B0e[e]=n=[]);let i=n[t];return l(i)||(e*t<W.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),z0e(e,t,i,0)),i};var O0e=[];il.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=O0e[e];l(n)||(O0e[e]=n=[]);let i=n[t];if(!l(i)){let o=il.getRegularGridIndices(e,t),r=H0e(e,t),s=r.westIndicesSouthToNorth,a=r.southIndicesEastToWest,c=r.eastIndicesNorthToSouth,d=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:d}}return i};var Y0e=[];il.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=Y0e[e];l(n)||(Y0e[e]=n=[]);let i=n[t];if(!l(i)){let o=e*t,r=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=o+s,d=r+a,u=H0e(e,t),m=u.westIndicesSouthToNorth,p=u.southIndicesEastToWest,g=u.eastIndicesNorthToSouth,f=u.northIndicesWestToEast,x=Ae.createTypedArray(c,d);z0e(e,t,x,0),il.addSkirtIndices(m,p,g,f,o,x,r),i=n[t]={indices:x,westIndicesSouthToNorth:m,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:f,indexCountWithoutSkirts:r}}return i};il.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=yD(e,a,r,s),a+=e.length,s=yD(t,a,r,s),a+=t.length,s=yD(n,a,r,s),a+=n.length,yD(i,a,r,s)};function H0e(e,t){let n=new Array(t),i=new Array(e),o=new Array(t),r=new Array(e),s;for(s=0;s<e;++s)r[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)o[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:o,northIndicesWestToEast:r}}function z0e(e,t,n,i){let o=0;for(let r=0;r<t-1;++r){for(let s=0;s<e-1;++s){let a=o,c=a+e,d=c+1,u=a+1;n[i++]=a,n[i++]=c,n[i++]=u,n[i++]=u,n[i++]=c,n[i++]=d,++o}++o}}function yD(e,t,n,i){let o=e[0],r=e.length;for(let s=1;s<r;++s){let a=e[s];n[i++]=o,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,o=a,++t}return i}il.heightmapTerrainQuality=.25;il.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*il.heightmapTerrainQuality/(t*n)};il.prototype.requestTileGeometry=pe.throwInstantiationError;il.prototype.getLevelMaximumGeometricError=pe.throwInstantiationError;il.prototype.getTileDataAvailable=pe.throwInstantiationError;il.prototype.loadTileDataAvailability=pe.throwInstantiationError;var ts=il;function jb(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=y(e.childTileMask,15),this._encoding=y(e.encoding,$u.NONE);let t=LV.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=y(n.heightScale,t.heightScale),n.heightOffset=y(n.heightOffset,t.heightOffset),n.elementsPerHeight=y(n.elementsPerHeight,t.elementsPerHeight),n.stride=y(n.stride,t.stride),n.elementMultiplier=y(n.elementMultiplier,t.elementMultiplier),n.isBigEndian=y(n.isBigEndian,t.isBigEndian)):n=t,this._structure=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===$u.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(jb.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var K0e="createVerticesFromHeightmap",jot=new bi(K0e),qot=new bi(K0e,Th.maximumAsynchronousTasks);jb.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,d=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),m=c.cartographicToCartesian(ae.center(u)),p=this._structure,f=ts.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(f*4,1e3);let _=(a?qot:jot).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:d,rectangle:u,relativeToCenter:m,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Ri,exaggeration:r,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(_))return;let C=this;return Promise.resolve(_).then(function(V){let L;C._skirtHeight>0?L=ts.getRegularGridAndSkirtIndicesAndEdgeIndices(V.gridWidth,V.gridHeight):L=ts.getRegularGridIndicesAndEdgeIndices(V.gridWidth,V.gridHeight);let Z=V.gridWidth*V.gridHeight;return C._mesh=new tm(m,new Float32Array(V.vertices),L.indices,L.indexCountWithoutSkirts,Z,V.minimumHeight,V.maximumHeight,ce.clone(V.boundingSphere3D),h.clone(V.occludeePointInScaledSpace),V.numberOfAttributes,En.clone(V.orientedBoundingBox),_c.clone(V.encoding),L.westIndicesSouthToNorth,L.southIndicesEastToWest,L.eastIndicesNorthToSouth,L.northIndicesWestToEast),C._buffer=void 0,C._mesh})};jb.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),d=t.tileXYToRectangle(n,i,o),u=a.cartographicToCartesian(ae.center(d)),m=this._structure,g=ts.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(g*4,1e3);let f=LV.computeVertices({heightmap:this._buffer,structure:m,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:d,relativeToCenter:u,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Ri,exaggeration:r,exaggerationRelativeHeight:s});this._buffer=void 0;let x;this._skirtHeight>0?x=ts.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):x=ts.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let _=f.gridWidth*f.gridHeight;return this._mesh=new tm(u,f.vertices,x.indices,x.indexCountWithoutSkirts,_,f.minimumHeight,f.maximumHeight,f.boundingSphere3D,f.occludeePointInScaledSpace,f.encoding.stride,f.orientedBoundingBox,f.encoding,x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),this._mesh};jb.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,c=r.elementMultiplier,d=r.isBigEndian,u=r.heightOffset,m=r.heightScale,p=l(this._mesh),g=this._encoding===$u.LERC;if(!p&&g)return;let x;if(p){let _=this._mesh.vertices,C=this._mesh.encoding;x=J0e(_,C,u,m,e,i,o,t,n)}else x=$ot(this._buffer,a,c,s,d,e,i,o,t,n),x=x*m+u;return x};jb.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(a))return;let c=this._width,d=this._height,u=this._structure,m=u.stride,p=new this._bufferType(c*d*m),g=a.vertices,f=a.encoding,x=e.tileXYToRectangle(t,n,i),_=e.tileXYToRectangle(o,r,s),C=u.heightOffset,V=u.heightScale,L=u.elementsPerHeight,Z=u.elementMultiplier,G=u.isBigEndian,I=Math.pow(Z,L-1);for(let v=0;v<d;++v){let P=W.lerp(_.north,_.south,v/(d-1));for(let w=0;w<c;++w){let F=W.lerp(_.west,_.east,w/(c-1)),b=J0e(g,f,C,V,x,c,d,F,P);b=b<u.lowestEncodedHeight?u.lowestEncodedHeight:b,b=b>u.highestEncodedHeight?u.highestEncodedHeight:b,ert(p,L,Z,I,m,G,v*c+w,b)}}return Promise.resolve(new jb({buffer:p,width:c,height:d,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};jb.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};jb.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function $ot(e,t,n,i,o,r,s,a,c,d){let u=(c-r.west)*(s-1)/(r.east-r.west),m=(d-r.south)*(a-1)/(r.north-r.south),p=u|0,g=p+1;g>=s&&(g=s-1,p=s-2);let f=m|0,x=f+1;x>=a&&(x=a-1,f=a-2);let _=u-p,C=m-f;f=a-1-f,x=a-1-x;let V=xD(e,t,n,i,o,f*s+p),L=xD(e,t,n,i,o,f*s+g),Z=xD(e,t,n,i,o,x*s+p),G=xD(e,t,n,i,o,x*s+g);return Q0e(_,C,V,L,Z,G)}function J0e(e,t,n,i,o,r,s,a,c){let d=(a-o.west)*(r-1)/(o.east-o.west),u=(c-o.south)*(s-1)/(o.north-o.south),m=d|0,p=m+1;p>=r&&(p=r-1,m=r-2);let g=u|0,f=g+1;f>=s&&(f=s-1,g=s-2);let x=d-m,_=u-g;g=s-1-g,f=s-1-f;let C=(t.decodeHeight(e,g*r+m)-n)/i,V=(t.decodeHeight(e,g*r+p)-n)/i,L=(t.decodeHeight(e,f*r+m)-n)/i,Z=(t.decodeHeight(e,f*r+p)-n)/i;return Q0e(x,_,C,V,L,Z)}function Q0e(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function xD(e,t,n,i,o,r){r*=i;let s=0,a;if(o)for(a=0;a<t;++a)s=s*n+e[r+a];else for(a=t-1;a>=0;--a)s=s*n+e[r+a];return s}function ert(e,t,n,i,o,r,s,a){s*=o;let c;if(r)for(c=0;c<t-1;++c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;else for(c=t-1;c>0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var Ma=jb;function RV(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Yi({ellipsoid:y(e.ellipsoid,ne.default)})),this._levelZeroMaximumGeometricError=ts.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be}Object.defineProperties(RV.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});RV.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Ma({buffer:new Uint8Array(16*16),width:16,height:16}))};RV.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};RV.prototype.getTileDataAvailable=function(e,t,n){};RV.prototype.loadTileDataAvailability=function(e,t,n){};var kf=RV;var pTi=T(S(),1),mw=`uniform vec4 u_initialColor;
  8556. #if TEXTURE_UNITS > 0
  8557. uniform sampler2D u_dayTextures[TEXTURE_UNITS];
  8558. uniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];
  8559. uniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];
  8560. #ifdef APPLY_ALPHA
  8561. uniform float u_dayTextureAlpha[TEXTURE_UNITS];
  8562. #endif
  8563. #ifdef APPLY_DAY_NIGHT_ALPHA
  8564. uniform float u_dayTextureNightAlpha[TEXTURE_UNITS];
  8565. uniform float u_dayTextureDayAlpha[TEXTURE_UNITS];
  8566. #endif
  8567. #ifdef APPLY_SPLIT
  8568. uniform float u_dayTextureSplit[TEXTURE_UNITS];
  8569. #endif
  8570. #ifdef APPLY_BRIGHTNESS
  8571. uniform float u_dayTextureBrightness[TEXTURE_UNITS];
  8572. #endif
  8573. #ifdef APPLY_CONTRAST
  8574. uniform float u_dayTextureContrast[TEXTURE_UNITS];
  8575. #endif
  8576. #ifdef APPLY_HUE
  8577. uniform float u_dayTextureHue[TEXTURE_UNITS];
  8578. #endif
  8579. #ifdef APPLY_SATURATION
  8580. uniform float u_dayTextureSaturation[TEXTURE_UNITS];
  8581. #endif
  8582. #ifdef APPLY_GAMMA
  8583. uniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];
  8584. #endif
  8585. #ifdef APPLY_IMAGERY_CUTOUT
  8586. uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS];
  8587. #endif
  8588. #ifdef APPLY_COLOR_TO_ALPHA
  8589. uniform vec4 u_colorsToAlpha[TEXTURE_UNITS];
  8590. #endif
  8591. uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];
  8592. #endif
  8593. #if defined(HAS_WATER_MASK) && (defined(SHOW_REFLECTIVE_OCEAN) || defined(APPLY_MATERIAL))
  8594. uniform sampler2D u_waterMask;
  8595. uniform vec4 u_waterMaskTranslationAndScale;
  8596. uniform float u_zoomedOutOceanSpecularIntensity;
  8597. #endif
  8598. #ifdef SHOW_OCEAN_WAVES
  8599. uniform sampler2D u_oceanNormalMap;
  8600. #endif
  8601. #if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)
  8602. uniform vec2 u_lightingFadeDistance;
  8603. #endif
  8604. #ifdef TILE_LIMIT_RECTANGLE
  8605. uniform vec4 u_cartographicLimitRectangle;
  8606. #endif
  8607. #ifdef GROUND_ATMOSPHERE
  8608. uniform vec2 u_nightFadeDistance;
  8609. #endif
  8610. #ifdef ENABLE_CLIPPING_PLANES
  8611. uniform highp sampler2D u_clippingPlanes;
  8612. uniform mat4 u_clippingPlanesMatrix;
  8613. uniform vec4 u_clippingPlanesEdgeStyle;
  8614. #endif
  8615. #ifdef ENABLE_CLIPPING_POLYGONS
  8616. uniform highp sampler2D u_clippingDistance;
  8617. in vec2 v_clippingPosition;
  8618. flat in int v_regionIndex;
  8619. #endif
  8620. #if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
  8621. uniform float u_minimumBrightness;
  8622. #endif
  8623. #ifdef COLOR_CORRECT
  8624. uniform vec3 u_hsbShift; // Hue, saturation, brightness
  8625. #endif
  8626. #ifdef HIGHLIGHT_FILL_TILE
  8627. uniform vec4 u_fillHighlightColor;
  8628. #endif
  8629. #ifdef TRANSLUCENT
  8630. uniform vec4 u_frontFaceAlphaByDistance;
  8631. uniform vec4 u_backFaceAlphaByDistance;
  8632. uniform vec4 u_translucencyRectangle;
  8633. #endif
  8634. #ifdef UNDERGROUND_COLOR
  8635. uniform vec4 u_undergroundColor;
  8636. uniform vec4 u_undergroundColorAlphaByDistance;
  8637. #endif
  8638. #ifdef ENABLE_VERTEX_LIGHTING
  8639. uniform float u_lambertDiffuseMultiplier;
  8640. uniform float u_vertexShadowDarkness;
  8641. #endif
  8642. in vec3 v_positionMC;
  8643. in vec3 v_positionEC;
  8644. in vec3 v_textureCoordinates;
  8645. in vec3 v_normalMC;
  8646. in vec3 v_normalEC;
  8647. #ifdef APPLY_MATERIAL
  8648. in float v_height;
  8649. in float v_slope;
  8650. in float v_aspect;
  8651. #endif
  8652. #if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
  8653. in float v_distance;
  8654. #endif
  8655. #if defined(GROUND_ATMOSPHERE) || defined(FOG)
  8656. in vec3 v_atmosphereRayleighColor;
  8657. in vec3 v_atmosphereMieColor;
  8658. in float v_atmosphereOpacity;
  8659. #endif
  8660. #if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
  8661. float interpolateByDistance(vec4 nearFarScalar, float distance)
  8662. {
  8663. float startDistance = nearFarScalar.x;
  8664. float startValue = nearFarScalar.y;
  8665. float endDistance = nearFarScalar.z;
  8666. float endValue = nearFarScalar.w;
  8667. float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);
  8668. return mix(startValue, endValue, t);
  8669. }
  8670. #endif
  8671. #if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL)
  8672. vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor)
  8673. {
  8674. return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);
  8675. }
  8676. #endif
  8677. #ifdef TRANSLUCENT
  8678. bool inTranslucencyRectangle()
  8679. {
  8680. return
  8681. v_textureCoordinates.x > u_translucencyRectangle.x &&
  8682. v_textureCoordinates.x < u_translucencyRectangle.z &&
  8683. v_textureCoordinates.y > u_translucencyRectangle.y &&
  8684. v_textureCoordinates.y < u_translucencyRectangle.w;
  8685. }
  8686. #endif
  8687. vec4 sampleAndBlend(
  8688. vec4 previousColor,
  8689. sampler2D textureToSample,
  8690. vec2 tileTextureCoordinates,
  8691. vec4 textureCoordinateRectangle,
  8692. vec4 textureCoordinateTranslationAndScale,
  8693. float textureAlpha,
  8694. float textureNightAlpha,
  8695. float textureDayAlpha,
  8696. float textureBrightness,
  8697. float textureContrast,
  8698. float textureHue,
  8699. float textureSaturation,
  8700. float textureOneOverGamma,
  8701. float split,
  8702. vec4 colorToAlpha,
  8703. float nightBlend)
  8704. {
  8705. // This crazy step stuff sets the alpha to 0.0 if this following condition is true:
  8706. // tileTextureCoordinates.s < textureCoordinateRectangle.s ||
  8707. // tileTextureCoordinates.s > textureCoordinateRectangle.p ||
  8708. // tileTextureCoordinates.t < textureCoordinateRectangle.t ||
  8709. // tileTextureCoordinates.t > textureCoordinateRectangle.q
  8710. // In other words, the alpha is zero if the fragment is outside the rectangle
  8711. // covered by this texture. Would an actual 'if' yield better performance?
  8712. vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);
  8713. textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;
  8714. alphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);
  8715. textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;
  8716. #if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)
  8717. textureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend);
  8718. #endif
  8719. vec2 translation = textureCoordinateTranslationAndScale.xy;
  8720. vec2 scale = textureCoordinateTranslationAndScale.zw;
  8721. vec2 textureCoordinates = tileTextureCoordinates * scale + translation;
  8722. vec4 value = texture(textureToSample, textureCoordinates);
  8723. vec3 color = value.rgb;
  8724. float alpha = value.a;
  8725. #ifdef APPLY_COLOR_TO_ALPHA
  8726. vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);
  8727. colorDiff.r = czm_maximumComponent(colorDiff);
  8728. alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);
  8729. #endif
  8730. #if !defined(APPLY_GAMMA)
  8731. vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));
  8732. color = tempColor.rgb;
  8733. alpha = tempColor.a;
  8734. #else
  8735. color = pow(color, vec3(textureOneOverGamma));
  8736. #endif
  8737. #ifdef APPLY_SPLIT
  8738. float splitPosition = czm_splitPosition;
  8739. // Split to the left
  8740. if (split < 0.0 && gl_FragCoord.x > splitPosition) {
  8741. alpha = 0.0;
  8742. }
  8743. // Split to the right
  8744. else if (split > 0.0 && gl_FragCoord.x < splitPosition) {
  8745. alpha = 0.0;
  8746. }
  8747. #endif
  8748. #ifdef APPLY_BRIGHTNESS
  8749. color = mix(vec3(0.0), color, textureBrightness);
  8750. #endif
  8751. #ifdef APPLY_CONTRAST
  8752. color = mix(vec3(0.5), color, textureContrast);
  8753. #endif
  8754. #ifdef APPLY_HUE
  8755. color = czm_hue(color, textureHue);
  8756. #endif
  8757. #ifdef APPLY_SATURATION
  8758. color = czm_saturation(color, textureSaturation);
  8759. #endif
  8760. float sourceAlpha = alpha * textureAlpha;
  8761. float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);
  8762. outAlpha += sign(outAlpha) - 1.0;
  8763. vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;
  8764. // When rendering imagery for a tile in multiple passes,
  8765. // some GPU/WebGL implementation combinations will not blend fragments in
  8766. // additional passes correctly if their computation includes an unmasked
  8767. // divide-by-zero operation,
  8768. // even if it's not in the output or if the output has alpha zero.
  8769. //
  8770. // For example, without sanitization for outAlpha,
  8771. // this renders without artifacts:
  8772. // if (outAlpha == 0.0) { outColor = vec3(0.0); }
  8773. //
  8774. // but using czm_branchFreeTernary will cause portions of the tile that are
  8775. // alpha-zero in the additional pass to render as black instead of blending
  8776. // with the previous pass:
  8777. // outColor = czm_branchFreeTernary(outAlpha == 0.0, vec3(0.0), outColor);
  8778. //
  8779. // So instead, sanitize against divide-by-zero,
  8780. // store this state on the sign of outAlpha, and correct on return.
  8781. return vec4(outColor, max(outAlpha, 0.0));
  8782. }
  8783. vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend);
  8784. vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade);
  8785. const float fExposure = 2.0;
  8786. vec3 computeEllipsoidPosition()
  8787. {
  8788. float mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0);
  8789. vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0);
  8790. xy *= czm_viewport.zw * mpp * 0.5;
  8791. vec3 direction = normalize(vec3(xy, -czm_currentFrustum.x));
  8792. czm_ray ray = czm_ray(vec3(0.0), direction);
  8793. vec3 ellipsoid_center = czm_view[3].xyz;
  8794. czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);
  8795. vec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start);
  8796. return (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz;
  8797. }
  8798. void main()
  8799. {
  8800. #ifdef TILE_LIMIT_RECTANGLE
  8801. if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x ||
  8802. v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y)
  8803. {
  8804. discard;
  8805. }
  8806. #endif
  8807. #ifdef ENABLE_CLIPPING_PLANES
  8808. float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix);
  8809. #endif
  8810. #if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR)
  8811. vec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)); // normalized surface normal in model coordinates
  8812. vec3 normalEC = czm_normal3D * normalMC; // normalized surface normal in eye coordinates
  8813. #endif
  8814. #if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)
  8815. float nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0);
  8816. #else
  8817. float nightBlend = 0.0;
  8818. #endif
  8819. // The clamp below works around an apparent bug in Chrome Canary v23.0.1241.0
  8820. // where the fragment shader sees textures coordinates < 0.0 and > 1.0 for the
  8821. // fragments on the edges of tiles even though the vertex shader is outputting
  8822. // coordinates strictly in the 0-1 range.
  8823. vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend);
  8824. #ifdef SHOW_TILE_BOUNDARIES
  8825. if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||
  8826. v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))
  8827. {
  8828. color = vec4(1.0, 0.0, 0.0, 1.0);
  8829. }
  8830. #endif
  8831. #if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)
  8832. float cameraDist;
  8833. if (czm_sceneMode == czm_sceneMode2D)
  8834. {
  8835. cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5;
  8836. }
  8837. else if (czm_sceneMode == czm_sceneModeColumbusView)
  8838. {
  8839. cameraDist = -czm_view[3].z;
  8840. }
  8841. else
  8842. {
  8843. cameraDist = length(czm_view[3]);
  8844. }
  8845. float fadeOutDist = u_lightingFadeDistance.x;
  8846. float fadeInDist = u_lightingFadeDistance.y;
  8847. if (czm_sceneMode != czm_sceneMode3D) {
  8848. vec3 radii = czm_ellipsoidRadii;
  8849. float maxRadii = max(radii.x, max(radii.y, radii.z));
  8850. fadeOutDist -= maxRadii;
  8851. fadeInDist -= maxRadii;
  8852. }
  8853. float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);
  8854. #else
  8855. float fade = 0.0;
  8856. #endif
  8857. #if defined(HAS_WATER_MASK) && (defined(SHOW_REFLECTIVE_OCEAN) || defined(APPLY_MATERIAL))
  8858. vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;
  8859. vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;
  8860. vec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;
  8861. waterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y;
  8862. float mask = texture(u_waterMask, waterMaskTextureCoordinates).r;
  8863. #ifdef SHOW_REFLECTIVE_OCEAN
  8864. if (mask > 0.0)
  8865. {
  8866. mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);
  8867. vec2 ellipsoidTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC);
  8868. vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC.zyx);
  8869. vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));
  8870. color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade);
  8871. }
  8872. #endif
  8873. #endif
  8874. #ifdef APPLY_MATERIAL
  8875. czm_materialInput materialInput;
  8876. materialInput.st = v_textureCoordinates.st;
  8877. materialInput.normalEC = normalize(v_normalEC);
  8878. materialInput.positionToEyeEC = -v_positionEC;
  8879. materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC));
  8880. materialInput.slope = v_slope;
  8881. materialInput.height = v_height;
  8882. materialInput.aspect = v_aspect;
  8883. #ifdef HAS_WATER_MASK
  8884. materialInput.waterMask = mask;
  8885. #endif
  8886. czm_material material = czm_getMaterial(materialInput);
  8887. vec4 materialColor = vec4(material.diffuse, material.alpha);
  8888. color = alphaBlend(materialColor, color);
  8889. #endif
  8890. #ifdef ENABLE_VERTEX_LIGHTING
  8891. float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + u_vertexShadowDarkness, 0.0, 1.0);
  8892. vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);
  8893. #elif defined(ENABLE_DAYNIGHT_SHADING)
  8894. float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);
  8895. diffuseIntensity = mix(1.0, diffuseIntensity, fade);
  8896. vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);
  8897. #else
  8898. vec4 finalColor = color;
  8899. #endif
  8900. #ifdef ENABLE_CLIPPING_PLANES
  8901. vec4 clippingPlanesEdgeColor = vec4(1.0);
  8902. clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb;
  8903. float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a;
  8904. if (clipDistance < clippingPlanesEdgeWidth)
  8905. {
  8906. finalColor = clippingPlanesEdgeColor;
  8907. }
  8908. #endif
  8909. #ifdef ENABLE_CLIPPING_POLYGONS
  8910. vec2 clippingPosition = v_clippingPosition;
  8911. int regionIndex = v_regionIndex;
  8912. clipPolygons(u_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);
  8913. #endif
  8914. #ifdef HIGHLIGHT_FILL_TILE
  8915. finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a);
  8916. #endif
  8917. #if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)
  8918. vec3 atmosphereLightDirection = czm_sunDirectionWC;
  8919. #else
  8920. vec3 atmosphereLightDirection = czm_lightDirectionWC;
  8921. #endif
  8922. #if defined(GROUND_ATMOSPHERE) || defined(FOG)
  8923. if (!czm_backFacing())
  8924. {
  8925. bool dynamicLighting = false;
  8926. #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))
  8927. dynamicLighting = true;
  8928. #endif
  8929. vec3 rayleighColor;
  8930. vec3 mieColor;
  8931. float opacity;
  8932. vec3 positionWC;
  8933. vec3 lightDirection;
  8934. // When the camera is far away (camera distance > nightFadeOutDistance), the scattering is computed in the fragment shader.
  8935. // Otherwise, the scattering is computed in the vertex shader.
  8936. #ifdef PER_FRAGMENT_GROUND_ATMOSPHERE
  8937. positionWC = computeEllipsoidPosition();
  8938. lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));
  8939. computeAtmosphereScattering(
  8940. positionWC,
  8941. lightDirection,
  8942. rayleighColor,
  8943. mieColor,
  8944. opacity
  8945. );
  8946. #else
  8947. positionWC = v_positionMC;
  8948. lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));
  8949. rayleighColor = v_atmosphereRayleighColor;
  8950. mieColor = v_atmosphereMieColor;
  8951. opacity = v_atmosphereOpacity;
  8952. #endif
  8953. #ifdef COLOR_CORRECT
  8954. const bool ignoreBlackPixels = true;
  8955. rayleighColor = czm_applyHSBShift(rayleighColor, u_hsbShift, ignoreBlackPixels);
  8956. mieColor = czm_applyHSBShift(mieColor, u_hsbShift, ignoreBlackPixels);
  8957. #endif
  8958. vec4 groundAtmosphereColor = computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity);
  8959. // Fog is applied to tiles selected for fog, close to the Earth.
  8960. #ifdef FOG
  8961. vec3 fogColor = groundAtmosphereColor.rgb;
  8962. // If there is lighting, apply that to the fog.
  8963. #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
  8964. float darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0);
  8965. fogColor *= darken;
  8966. #endif
  8967. #ifndef HDR
  8968. fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb);
  8969. fogColor.rgb = czm_inverseGamma(fogColor.rgb);
  8970. #endif
  8971. finalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, czm_fogVisualDensityScalar), finalColor.a);
  8972. #else
  8973. // Apply ground atmosphere. This happens when the camera is far away from the earth.
  8974. // The transmittance is based on optical depth i.e. the length of segment of the ray inside the atmosphere.
  8975. // This value is larger near the "circumference", as it is further away from the camera. We use it to
  8976. // brighten up that area of the ground atmosphere.
  8977. const float transmittanceModifier = 0.5;
  8978. float transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0);
  8979. vec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance;
  8980. #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
  8981. float fadeInDist = u_nightFadeDistance.x;
  8982. float fadeOutDist = u_nightFadeDistance.y;
  8983. float sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0);
  8984. float darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0);
  8985. vec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken);
  8986. finalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity);
  8987. #endif
  8988. #ifndef HDR
  8989. finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb);
  8990. #else
  8991. finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6);
  8992. #endif
  8993. finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade);
  8994. #endif
  8995. }
  8996. #endif
  8997. #ifdef UNDERGROUND_COLOR
  8998. if (czm_backFacing())
  8999. {
  9000. float distanceFromEllipsoid = max(czm_eyeHeight, 0.0);
  9001. float distance = max(v_distance - distanceFromEllipsoid, 0.0);
  9002. float blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance);
  9003. vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount);
  9004. finalColor = alphaBlend(undergroundColor, finalColor);
  9005. }
  9006. #endif
  9007. #ifdef TRANSLUCENT
  9008. if (inTranslucencyRectangle())
  9009. {
  9010. vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance;
  9011. finalColor.a *= interpolateByDistance(alphaByDistance, v_distance);
  9012. }
  9013. #endif
  9014. out_FragColor = finalColor;
  9015. }
  9016. #ifdef SHOW_REFLECTIVE_OCEAN
  9017. float waveFade(float edge0, float edge1, float x)
  9018. {
  9019. float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
  9020. return pow(1.0 - y, 5.0);
  9021. }
  9022. float linearFade(float edge0, float edge1, float x)
  9023. {
  9024. return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
  9025. }
  9026. // Based on water rendering by Jonas Wagner:
  9027. // http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog
  9028. // low altitude wave settings
  9029. const float oceanFrequencyLowAltitude = 825000.0;
  9030. const float oceanAnimationSpeedLowAltitude = 0.004;
  9031. const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;
  9032. const float oceanSpecularIntensity = 0.5;
  9033. // high altitude wave settings
  9034. const float oceanFrequencyHighAltitude = 125000.0;
  9035. const float oceanAnimationSpeedHighAltitude = 0.008;
  9036. const float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;
  9037. vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade)
  9038. {
  9039. vec3 positionToEyeEC = -positionEyeCoordinates;
  9040. float positionToEyeECLength = length(positionToEyeEC);
  9041. // The double normalize below works around a bug in Firefox on Android devices.
  9042. vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC));
  9043. // Fade out the waves as the camera moves far from the surface.
  9044. float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);
  9045. #ifdef SHOW_OCEAN_WAVES
  9046. // high altitude waves
  9047. float time = czm_frameNumber * oceanAnimationSpeedHighAltitude;
  9048. vec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);
  9049. vec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);
  9050. // low altitude waves
  9051. time = czm_frameNumber * oceanAnimationSpeedLowAltitude;
  9052. noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);
  9053. vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);
  9054. // blend the 2 wave layers based on distance to surface
  9055. float highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);
  9056. float lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);
  9057. vec3 normalTangentSpace =
  9058. (highAltitudeFade * normalTangentSpaceHighAltitude) +
  9059. (lowAltitudeFade * normalTangentSpaceLowAltitude);
  9060. normalTangentSpace = normalize(normalTangentSpace);
  9061. // fade out the normal perturbation as we move farther from the water surface
  9062. normalTangentSpace.xy *= waveIntensity;
  9063. normalTangentSpace = normalize(normalTangentSpace);
  9064. #else
  9065. vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);
  9066. #endif
  9067. vec3 normalEC = enuToEye * normalTangentSpace;
  9068. const vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);
  9069. // Use diffuse light to highlight the waves
  9070. float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue;
  9071. vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade);
  9072. #ifdef SHOW_OCEAN_WAVES
  9073. // Where diffuse light is low or non-existent, use wave highlights based solely on
  9074. // the wave bumpiness and no particular light direction.
  9075. float tsPerturbationRatio = normalTangentSpace.z;
  9076. vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);
  9077. #else
  9078. vec3 nonDiffuseHighlight = vec3(0.0);
  9079. #endif
  9080. // Add specular highlights in 3D, and in all modes when zoomed in.
  9081. float specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0);
  9082. float surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);
  9083. float specular = specularIntensity * surfaceReflectance;
  9084. #ifdef HDR
  9085. specular *= 1.4;
  9086. float e = 0.2;
  9087. float d = 3.3;
  9088. float c = 1.7;
  9089. vec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular));
  9090. #else
  9091. vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular;
  9092. #endif
  9093. return vec4(color, imageryColor.a);
  9094. }
  9095. #endif // #ifdef SHOW_REFLECTIVE_OCEAN
  9096. `;var gTi=T(S(),1),hw=`#ifdef QUANTIZATION_BITS12
  9097. in vec4 compressed0;
  9098. in float compressed1;
  9099. #else
  9100. in vec4 position3DAndHeight;
  9101. in vec4 textureCoordAndEncodedNormals;
  9102. #endif
  9103. #ifdef GEODETIC_SURFACE_NORMALS
  9104. in vec3 geodeticSurfaceNormal;
  9105. #endif
  9106. #ifdef EXAGGERATION
  9107. uniform vec2 u_verticalExaggerationAndRelativeHeight;
  9108. #endif
  9109. uniform vec3 u_center3D;
  9110. uniform mat4 u_modifiedModelView;
  9111. uniform mat4 u_modifiedModelViewProjection;
  9112. uniform vec4 u_tileRectangle;
  9113. // Uniforms for 2D Mercator projection
  9114. uniform vec2 u_southAndNorthLatitude;
  9115. uniform vec2 u_southMercatorYAndOneOverHeight;
  9116. out vec3 v_positionMC;
  9117. out vec3 v_positionEC;
  9118. out vec3 v_textureCoordinates;
  9119. out vec3 v_normalMC;
  9120. out vec3 v_normalEC;
  9121. #ifdef APPLY_MATERIAL
  9122. out float v_slope;
  9123. out float v_aspect;
  9124. out float v_height;
  9125. #endif
  9126. #if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
  9127. out float v_distance;
  9128. #endif
  9129. #if defined(FOG) || defined(GROUND_ATMOSPHERE)
  9130. out vec3 v_atmosphereRayleighColor;
  9131. out vec3 v_atmosphereMieColor;
  9132. out float v_atmosphereOpacity;
  9133. #endif
  9134. #ifdef ENABLE_CLIPPING_POLYGONS
  9135. uniform highp sampler2D u_clippingExtents;
  9136. out vec2 v_clippingPosition;
  9137. flat out int v_regionIndex;
  9138. #endif
  9139. // These functions are generated at runtime.
  9140. vec4 getPosition(vec3 position, float height, vec2 textureCoordinates);
  9141. float get2DYPositionFraction(vec2 textureCoordinates);
  9142. vec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)
  9143. {
  9144. return u_modifiedModelViewProjection * vec4(position, 1.0);
  9145. }
  9146. float get2DMercatorYPositionFraction(vec2 textureCoordinates)
  9147. {
  9148. // The width of a tile at level 11, in radians and assuming a single root tile, is
  9149. // 2.0 * czm_pi / pow(2.0, 11.0)
  9150. // We want to just linearly interpolate the 2D position from the texture coordinates
  9151. // when we're at this level or higher. The constant below is the expression
  9152. // above evaluated and then rounded up at the 4th significant digit.
  9153. const float maxTileWidth = 0.003068;
  9154. float positionFraction = textureCoordinates.y;
  9155. float southLatitude = u_southAndNorthLatitude.x;
  9156. float northLatitude = u_southAndNorthLatitude.y;
  9157. if (northLatitude - southLatitude > maxTileWidth)
  9158. {
  9159. float southMercatorY = u_southMercatorYAndOneOverHeight.x;
  9160. float oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;
  9161. float currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);
  9162. currentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);
  9163. positionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);
  9164. }
  9165. return positionFraction;
  9166. }
  9167. float get2DGeographicYPositionFraction(vec2 textureCoordinates)
  9168. {
  9169. return textureCoordinates.y;
  9170. }
  9171. vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)
  9172. {
  9173. float yPositionFraction = get2DYPositionFraction(textureCoordinates);
  9174. vec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);
  9175. return u_modifiedModelViewProjection * rtcPosition2D;
  9176. }
  9177. vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)
  9178. {
  9179. return getPositionPlanarEarth(position, 0.0, textureCoordinates);
  9180. }
  9181. vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)
  9182. {
  9183. return getPositionPlanarEarth(position, height, textureCoordinates);
  9184. }
  9185. vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)
  9186. {
  9187. // We do not do RTC while morphing, so there is potential for jitter.
  9188. // This is unlikely to be noticeable, though.
  9189. vec3 position3DWC = position + u_center3D;
  9190. float yPositionFraction = get2DYPositionFraction(textureCoordinates);
  9191. vec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);
  9192. vec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);
  9193. return czm_modelViewProjection * morphPosition;
  9194. }
  9195. #ifdef QUANTIZATION_BITS12
  9196. uniform vec2 u_minMaxHeight;
  9197. uniform mat4 u_scaleAndBias;
  9198. #endif
  9199. void main()
  9200. {
  9201. #ifdef QUANTIZATION_BITS12
  9202. vec2 xy = czm_decompressTextureCoordinates(compressed0.x);
  9203. vec2 zh = czm_decompressTextureCoordinates(compressed0.y);
  9204. vec3 position = vec3(xy, zh.x);
  9205. float height = zh.y;
  9206. vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);
  9207. height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;
  9208. position = (u_scaleAndBias * vec4(position, 1.0)).xyz;
  9209. #if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y) || defined(APPLY_MATERIAL)
  9210. float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;
  9211. float encodedNormal = compressed1;
  9212. #elif defined(INCLUDE_WEB_MERCATOR_Y)
  9213. float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;
  9214. float encodedNormal = 0.0;
  9215. #elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)
  9216. float webMercatorT = textureCoordinates.y;
  9217. float encodedNormal = compressed0.w;
  9218. #else
  9219. float webMercatorT = textureCoordinates.y;
  9220. float encodedNormal = 0.0;
  9221. #endif
  9222. #else
  9223. // A single float per element
  9224. vec3 position = position3DAndHeight.xyz;
  9225. float height = position3DAndHeight.w;
  9226. vec2 textureCoordinates = textureCoordAndEncodedNormals.xy;
  9227. #if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y)
  9228. float webMercatorT = textureCoordAndEncodedNormals.z;
  9229. float encodedNormal = textureCoordAndEncodedNormals.w;
  9230. #elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)
  9231. float webMercatorT = textureCoordinates.y;
  9232. float encodedNormal = textureCoordAndEncodedNormals.z;
  9233. #elif defined(INCLUDE_WEB_MERCATOR_Y)
  9234. float webMercatorT = textureCoordAndEncodedNormals.z;
  9235. float encodedNormal = 0.0;
  9236. #else
  9237. float webMercatorT = textureCoordinates.y;
  9238. float encodedNormal = 0.0;
  9239. #endif
  9240. #endif
  9241. vec3 position3DWC = position + u_center3D;
  9242. #ifdef GEODETIC_SURFACE_NORMALS
  9243. vec3 ellipsoidNormal = geodeticSurfaceNormal;
  9244. #else
  9245. vec3 ellipsoidNormal = normalize(position3DWC);
  9246. #endif
  9247. #if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)
  9248. float exaggeration = u_verticalExaggerationAndRelativeHeight.x;
  9249. float relativeHeight = u_verticalExaggerationAndRelativeHeight.y;
  9250. float newHeight = (height - relativeHeight) * exaggeration + relativeHeight;
  9251. // stop from going through center of earth
  9252. float minRadius = min(min(czm_ellipsoidRadii.x, czm_ellipsoidRadii.y), czm_ellipsoidRadii.z);
  9253. newHeight = max(newHeight, -minRadius);
  9254. vec3 offset = ellipsoidNormal * (newHeight - height);
  9255. position += offset;
  9256. position3DWC += offset;
  9257. height = newHeight;
  9258. #endif
  9259. gl_Position = getPosition(position, height, textureCoordinates);
  9260. v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;
  9261. v_positionMC = position3DWC; // position in model coordinates
  9262. v_textureCoordinates = vec3(textureCoordinates, webMercatorT);
  9263. #if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)
  9264. vec3 normalMC = czm_octDecode(encodedNormal);
  9265. #if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)
  9266. vec3 projection = dot(normalMC, ellipsoidNormal) * ellipsoidNormal;
  9267. vec3 rejection = normalMC - projection;
  9268. normalMC = normalize(projection + rejection * exaggeration);
  9269. #endif
  9270. v_normalMC = normalMC;
  9271. v_normalEC = czm_normal3D * v_normalMC;
  9272. #endif
  9273. #ifdef ENABLE_CLIPPING_POLYGONS
  9274. vec2 sphericalLatLong = czm_approximateSphericalCoordinates(position3DWC);
  9275. sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);
  9276. vec2 minDistance = vec2(czm_infinity);
  9277. v_clippingPosition = vec2(czm_infinity);
  9278. v_regionIndex = -1;
  9279. for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) {
  9280. vec4 extents = unpackClippingExtents(u_clippingExtents, regionIndex);
  9281. vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz;
  9282. vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0));
  9283. vec2 distance = abs(rectUv - clamped) * extents.wz;
  9284. float threshold = 0.01;
  9285. if (minDistance.x > distance.x || minDistance.y > distance.y) {
  9286. minDistance = distance;
  9287. v_clippingPosition = rectUv;
  9288. if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) {
  9289. v_regionIndex = regionIndex;
  9290. }
  9291. }
  9292. }
  9293. #endif
  9294. #if defined(FOG) || (defined(GROUND_ATMOSPHERE) && !defined(PER_FRAGMENT_GROUND_ATMOSPHERE))
  9295. bool dynamicLighting = false;
  9296. #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))
  9297. dynamicLighting = true;
  9298. #endif
  9299. #if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)
  9300. vec3 atmosphereLightDirection = czm_sunDirectionWC;
  9301. #else
  9302. vec3 atmosphereLightDirection = czm_lightDirectionWC;
  9303. #endif
  9304. vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC));
  9305. computeAtmosphereScattering(
  9306. position3DWC,
  9307. lightDirection,
  9308. v_atmosphereRayleighColor,
  9309. v_atmosphereMieColor,
  9310. v_atmosphereOpacity
  9311. );
  9312. #endif
  9313. #if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
  9314. v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);
  9315. #endif
  9316. #ifdef APPLY_MATERIAL
  9317. float northPoleZ = czm_ellipsoidRadii.z;
  9318. vec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ);
  9319. vec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal));
  9320. float dotProd = abs(dot(ellipsoidNormal, v_normalMC));
  9321. v_slope = acos(dotProd);
  9322. vec3 normalRejected = ellipsoidNormal * dotProd;
  9323. vec3 normalProjected = v_normalMC - normalRejected;
  9324. vec3 aspectVector = normalize(normalProjected);
  9325. v_aspect = acos(dot(aspectVector, vectorEastMC));
  9326. float determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal);
  9327. v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect);
  9328. v_height = height;
  9329. #endif
  9330. }
  9331. `;var xTi=T(S(),1),ZV=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) {
  9332. vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
  9333. vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
  9334. czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);
  9335. float atmosphereInnerRadius = length(positionWC);
  9336. computeScattering(
  9337. primaryRay,
  9338. length(cameraToPositionWC),
  9339. lightDirection,
  9340. atmosphereInnerRadius,
  9341. rayleighColor,
  9342. mieColor,
  9343. opacity
  9344. );
  9345. }
  9346. `;var XTi=T(S(),1);var CTi=T(S(),1);var trt=new D;function nrt(e,t){let n=e.unionClippingRegions,i=e.length,o=hs.useFloatTexture(t),r=hs.getTextureResolution(e,t,trt),s=r.x,a=r.y,c=o?rrt(s,a):srt(s,a);return c+=`
  9347. `,c+=n?irt(i):ort(i),c}function irt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
  9348. {
  9349. vec4 position = czm_windowToEyeCoordinates(fragCoord);
  9350. vec3 clipNormal = vec3(0.0);
  9351. vec3 clipPosition = vec3(0.0);
  9352. float clipAmount;
  9353. float pixelWidth = czm_metersPerPixel(position);
  9354. bool breakAndDiscard = false;
  9355. for (int i = 0; i < ${e}; ++i)
  9356. {
  9357. vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
  9358. clipNormal = clippingPlane.xyz;
  9359. clipPosition = -clippingPlane.w * clipNormal;
  9360. float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
  9361. clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));
  9362. if (amount <= 0.0)
  9363. {
  9364. breakAndDiscard = true;
  9365. break;
  9366. }
  9367. }
  9368. if (breakAndDiscard) {
  9369. discard;
  9370. }
  9371. return clipAmount;
  9372. }
  9373. `}function ort(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
  9374. {
  9375. bool clipped = true;
  9376. vec4 position = czm_windowToEyeCoordinates(fragCoord);
  9377. vec3 clipNormal = vec3(0.0);
  9378. vec3 clipPosition = vec3(0.0);
  9379. float clipAmount = 0.0;
  9380. float pixelWidth = czm_metersPerPixel(position);
  9381. for (int i = 0; i < ${e}; ++i)
  9382. {
  9383. vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
  9384. clipNormal = clippingPlane.xyz;
  9385. clipPosition = -clippingPlane.w * clipNormal;
  9386. float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
  9387. clipAmount = max(amount, clipAmount);
  9388. clipped = clipped && (amount <= 0.0);
  9389. }
  9390. if (clipped)
  9391. {
  9392. discard;
  9393. }
  9394. return clipAmount;
  9395. }
  9396. `}function rrt(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
  9397. {
  9398. int pixY = clippingPlaneNumber / ${e};
  9399. int pixX = clippingPlaneNumber - (pixY * ${e});
  9400. float u = (float(pixX) + 0.5) * ${o};
  9401. float v = (float(pixY) + 0.5) * ${r};
  9402. vec4 plane = texture(packedClippingPlanes, vec2(u, v));
  9403. return czm_transformPlane(plane, transform);
  9404. }
  9405. `}function srt(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
  9406. {
  9407. int clippingPlaneStartIndex = clippingPlaneNumber * 2;
  9408. int pixY = clippingPlaneStartIndex / ${e};
  9409. int pixX = clippingPlaneStartIndex - (pixY * ${e});
  9410. float u = (float(pixX) + 0.5) * ${o};
  9411. float v = (float(pixY) + 0.5) * ${r};
  9412. vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;
  9413. vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
  9414. vec4 plane;
  9415. plane.xyz = czm_octDecode(oct, 65535.0);
  9416. plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${o}, v)));
  9417. return czm_transformPlane(plane, transform);
  9418. }
  9419. `}var qb=nrt;function art(e,t,n,i,o,r){this.numberOfDayTextures=e,this.flags=t,this.material=n,this.shaderProgram=i,this.clippingShaderState=o,this.clippingPolygonShaderState=r}function F4(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function crt(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",o;switch(e){case oe.SCENE3D:o=t;break;case oe.SCENE2D:case oe.COLUMBUS_VIEW:o=n;break;case oe.MORPHING:o=i;break}return o}function lrt(e){return e.webgl2?`void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) {
  9420. czm_clipPolygons(clippingDistance, regionsLength, clippingPosition, regionIndex);
  9421. }`:`void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) {
  9422. }`}function drt(e){return e.webgl2?`vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) {
  9423. return czm_unpackClippingExtents(extentsTexture, index);
  9424. }`:`vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) {
  9425. return vec4();
  9426. }`}function urt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}F4.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,o=e.applyBrightness,r=e.applyContrast,s=e.applyHue,a=e.applySaturation,c=e.applyGamma,d=e.applyAlpha,u=e.applyDayNightAlpha,m=e.applySplit,p=e.hasWaterMask,g=e.showReflectiveOcean,f=e.showOceanWaves,x=e.enableLighting,_=e.dynamicAtmosphereLighting,C=e.dynamicAtmosphereLightingFromSun,V=e.showGroundAtmosphere,L=e.perFragmentGroundAtmosphere,Z=e.hasVertexNormals,G=e.useWebMercatorProjection,I=e.enableFog,v=e.enableClippingPlanes,P=e.clippingPlanes,w=e.enableClippingPolygons,F=e.clippingPolygons,b=e.clippedByBoundaries,R=e.hasImageryLayerCutout,E=e.colorCorrect,X=e.highlightFillTile,A=e.colorToAlpha,N=e.hasGeodeticSurfaceNormals,O=e.hasExaggeration,U=e.showUndergroundColor,Y=e.translucent,k=0,H="",te=n.renderedMesh.encoding;te.quantization===Qs.BITS12&&(k=1,H="QUANTIZATION_BITS12");let q=0,ee="";b&&(q=1,ee="TILE_LIMIT_RECTANGLE");let fe=0,_e="";R&&(fe=1,_e="APPLY_IMAGERY_CUTOUT");let le=t.mode,ye=le|o<<2|r<<3|s<<4|a<<5|c<<6|d<<7|p<<8|g<<9|f<<10|x<<11|_<<12|C<<13|V<<14|L<<15|Z<<16|G<<17|I<<18|k<<19|m<<20|v<<21|w<<22|q<<23|fe<<24|E<<25|X<<26|A<<27|N<<28|O<<29|U<<30|Y<<31|u<<32,Te=0;l(P)&&P.length>0&&(Te=v?P.clippingPlanesState:0);let Xe=0;l(F)&&F.length>0&&(Xe=w?F.clippingPolygonsState:0);let Le=n.surfaceShader;if(l(Le)&&Le.numberOfDayTextures===i&&Le.flags===ye&&Le.material===this.material&&Le.clippingShaderState===Te&&Le.clippingPolygonShaderState===Xe)return Le.shaderProgram;let ke=this._shadersByTexturesFlags[i];if(l(ke)||(ke=this._shadersByTexturesFlags[i]=[]),Le=ke[ye],!l(Le)||Le.material!==this.material||Le.clippingShaderState!==Te||Le.clippingPolygonShaderState!==Xe){let Oe=this.baseVertexShaderSource.clone(),at=this.baseFragmentShaderSource.clone();Te!==0&&at.sources.unshift(qb(P,t.context)),Xe!==0&&(at.sources.unshift(lrt(t.context)),Oe.sources.unshift(drt(t.context))),Oe.defines.push(H),at.defines.push(`TEXTURE_UNITS ${i}`,ee,_e),o&&at.defines.push("APPLY_BRIGHTNESS"),r&&at.defines.push("APPLY_CONTRAST"),s&&at.defines.push("APPLY_HUE"),a&&at.defines.push("APPLY_SATURATION"),c&&at.defines.push("APPLY_GAMMA"),d&&at.defines.push("APPLY_ALPHA"),u&&at.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&at.defines.push("HAS_WATER_MASK"),g&&(at.defines.push("SHOW_REFLECTIVE_OCEAN"),Oe.defines.push("SHOW_REFLECTIVE_OCEAN")),f&&at.defines.push("SHOW_OCEAN_WAVES"),A&&at.defines.push("APPLY_COLOR_TO_ALPHA"),U&&(Oe.defines.push("UNDERGROUND_COLOR"),at.defines.push("UNDERGROUND_COLOR")),Y&&(Oe.defines.push("TRANSLUCENT"),at.defines.push("TRANSLUCENT")),x&&(Z?(Oe.defines.push("ENABLE_VERTEX_LIGHTING"),at.defines.push("ENABLE_VERTEX_LIGHTING")):(Oe.defines.push("ENABLE_DAYNIGHT_SHADING"),at.defines.push("ENABLE_DAYNIGHT_SHADING"))),_&&(Oe.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),at.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),C&&(Oe.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),at.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),V&&(Oe.defines.push("GROUND_ATMOSPHERE"),at.defines.push("GROUND_ATMOSPHERE"),L&&(Oe.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),at.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),Oe.defines.push("INCLUDE_WEB_MERCATOR_Y"),at.defines.push("INCLUDE_WEB_MERCATOR_Y"),I&&(Oe.defines.push("FOG"),at.defines.push("FOG")),m&&at.defines.push("APPLY_SPLIT"),v&&at.defines.push("ENABLE_CLIPPING_PLANES"),w&&(at.defines.push("ENABLE_CLIPPING_POLYGONS"),Oe.defines.push("ENABLE_CLIPPING_POLYGONS"),F.inverse&&at.defines.push("CLIPPING_INVERSE"),at.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${F.extentsCount}`),Oe.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${F.extentsCount}`)),E&&at.defines.push("COLOR_CORRECT"),X&&at.defines.push("HIGHLIGHT_FILL_TILE"),N&&Oe.defines.push("GEODETIC_SURFACE_NORMALS"),O&&Oe.defines.push("EXAGGERATION");let Mt=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend)
  9427. {
  9428. vec4 color = initialColor;
  9429. `;R&&(Mt+=` vec4 cutoutAndColorResult;
  9430. bool texelUnclipped;
  9431. `);for(let Ie=0;Ie<i;++Ie)R?Mt+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${Ie}];
  9432. texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;
  9433. cutoutAndColorResult = sampleAndBlend(
  9434. `:Mt+=` color = sampleAndBlend(
  9435. `,Mt+=` color,
  9436. u_dayTextures[${Ie}],
  9437. u_dayTextureUseWebMercatorT[${Ie}] ? textureCoordinates.xz : textureCoordinates.xy,
  9438. u_dayTextureTexCoordsRectangle[${Ie}],
  9439. u_dayTextureTranslationAndScale[${Ie}],
  9440. ${d?`u_dayTextureAlpha[${Ie}]`:"1.0"},
  9441. ${u?`u_dayTextureNightAlpha[${Ie}]`:"1.0"},
  9442. ${u?`u_dayTextureDayAlpha[${Ie}]`:"1.0"},
  9443. ${o?`u_dayTextureBrightness[${Ie}]`:"0.0"},
  9444. ${r?`u_dayTextureContrast[${Ie}]`:"0.0"},
  9445. ${s?`u_dayTextureHue[${Ie}]`:"0.0"},
  9446. ${a?`u_dayTextureSaturation[${Ie}]`:"0.0"},
  9447. ${c?`u_dayTextureOneOverGamma[${Ie}]`:"0.0"},
  9448. ${m?`u_dayTextureSplit[${Ie}]`:"0.0"},
  9449. ${A?`u_colorsToAlpha[${Ie}]`:"vec4(0.0)"},
  9450. nightBlend );
  9451. `,R&&(Mt+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);
  9452. `);Mt+=` return color;
  9453. }`,at.sources.push(Mt),Oe.sources.push(crt(le)),Oe.sources.push(urt(G));let Lt=tn.fromCache({context:t.context,vertexShaderSource:Oe,fragmentShaderSource:at,attributeLocations:te.getAttributeLocations()});Le=ke[ye]=new art(i,ye,this.material,Lt,Te,Xe)}return n.surfaceShader=Le,Le.shaderProgram};F4.prototype.destroy=function(){let e,t,n=this._shadersByTexturesFlags;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];if(!l(o))continue;for(e in o)o.hasOwnProperty(e)&&(t=o[e],l(t)&&t.shaderProgram.destroy())}return me(this)};var fw=F4;var LZi=T(S(),1);var PTi=T(S(),1),mrt={NONE:-1,PARTIAL:0,FULL:1},mr=Object.freeze(mrt);var xSi=T(S(),1);var MTi=T(S(),1);function _D(e,t,n,i,o,r,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=o,this.timesRetried=y(r,0),this.retry=!1,this.error=s}_D.reportError=function(e,t,n,i,o,r,s,a){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=o,c.y=r,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new _D(t,i,o,r,s,0,a),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${Mf(i)}`),c};_D.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Zo=_D;var kTi=T(S(),1),hrt={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},ai=Object.freeze(hrt);var DTi=T(S(),1),frt={START:0,LOADING:1,DONE:2,FAILED:3},js=Object.freeze(frt);var OTi=T(S(),1),prt={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},co=Object.freeze(prt);function tr(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new h,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=co.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new ce,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(tr.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===co.RECEIVING||e===co.TRANSFORMING),i=this.imagery;for(let o=0,r=i.length;n&&o<r;++o){let s=i[o];n=!l(s.loadingImagery)||s.loadingImagery.state!==ai.TRANSITIONING}return n}},renderedMesh:{get:function(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}}});var brt=new he;function A4(e,t,n,i,o,r){let s=e.getExaggeratedPosition(i,o,r);if(l(t)&&t!==oe.SCENE3D){let c=n.ellipsoid.cartesianToCartographic(s,brt);s=n.project(c,r),s=h.fromElements(s.z,s.x,s.y,r)}return s}var grt=new h,yrt=new h,xrt=new h;tr.prototype.pick=function(e,t,n,i,o){let r=this.renderedMesh;if(!l(r))return;let s=r.vertices,a=r.indices,c=r.encoding,d=a.length,u=Number.MAX_VALUE;for(let m=0;m<d;m+=3){let p=a[m],g=a[m+1],f=a[m+2],x=A4(c,t,n,s,p,grt),_=A4(c,t,n,s,g,yrt),C=A4(c,t,n,s,f,xrt),V=qn.rayTriangleParametric(e,x,_,C,i);l(V)&&V<u&&V>=0&&(u=V)}return u!==Number.MAX_VALUE?pn.getPoint(e,u,o):void 0};tr.prototype.freeResources=function(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=co.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let e=this.imagery;for(let t=0,n=e.length;t<n;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()};tr.prototype.freeVertexArray=function(){tr._freeVertexArray(this.vertexArray),this.vertexArray=void 0,tr._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};tr.initialize=function(e,t,n){let i=e.data;l(i)||(i=e.data=new tr),e.state===js.START&&(_rt(e,t,n),e.state=js.LOADING)};tr.processStateMachine=function(e,t,n,i,o,r,s){tr.initialize(e,n,i);let a=e.data;if(e.state===js.LOADING&&Trt(e,t,n,i,o,r),s)return;let c=e.renderable;e.renderable=l(a.vertexArray);let d=a.terrainState===co.READY;e.upsampledFromParent=l(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let u=a.processImagery(e,n,t);if(d&&u){let m=e._loadedCallbacks,p={};for(let g in m)m.hasOwnProperty(g)&&(m[g](e)||(p[g]=m[g]));e._loadedCallbacks=p,e.state=js.DONE}c&&(e.renderable=!0)};tr.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,s=!1,a=!0,c=o.imagery,d,u;for(d=0,u=c.length;d<u;++d){let m=c[d];if(!l(m.loadingImagery)){r=!1;continue}if(m.loadingImagery.state===ai.PLACEHOLDER){let g=m.loadingImagery.imageryLayer;if(g.ready){m.freeResources(),c.splice(d,1),g._createTileImagerySkeletons(e,t,d),--d,u=c.length;continue}else r=!1}let p=m.processStateMachine(e,n,i);a=a&&p,s=s||p||l(m.readyImagery),r=r&&l(m.loadingImagery)&&(m.loadingImagery.state===ai.FAILED||m.loadingImagery.state===ai.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(s||a),a};function j0e(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,c=_c.clone(s);c.hasGeodeticSurfaceNormals=t,c=_c.clone(c);let d=c.stride,u=new Float32Array(a*d);t?s.addGeodeticSurfaceNormals(r,u,n):s.removeGeodeticSurfaceNormals(r,u),o.vertices=u,o.stride=d,o!==e.mesh?(tr._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=tr._createVertexArrayForMesh(i.context,o)):(tr._freeVertexArray(e.vertexArray),e.vertexArray=tr._createVertexArrayForMesh(i.context,o)),tr._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}tr.prototype.addGeodeticSurfaceNormals=function(e,t){j0e(this,!0,e,t)};tr.prototype.removeGeodeticSurfaceNormals=function(e){j0e(this,!1,void 0,e)};tr.prototype.updateExaggeration=function(e,t,n){let i=this,o=i.renderedMesh;if(o===void 0)return;let r=t.verticalExaggeration,s=t.verticalExaggerationRelativeHeight,a=r!==1,c=o.encoding,d=c.exaggeration!==r,u=c.exaggerationRelativeHeight!==s;if(d||u){if(d)if(a&&!c.hasGeodeticSurfaceNormals){let m=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(m,t)}else!a&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=r,c.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let m=e.customData,p=m.length;for(let g=0;g<p;g++){let f=m[g];f.level=-1}}}};function _rt(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(i)&&l(e.parent)){let o=e.parent,r=o.data;l(r)&&l(r.terrainData)&&(i=r.terrainData.isChildAvailable(o.x,o.y,e.x,e.y))}i===!1&&(e.data.terrainState=co.FAILED);for(let o=0,r=n.length;o<r;++o){let s=n.get(o);s.show&&s._createTileImagerySkeletons(e,t)}}function Trt(e,t,n,i,o,r){let s=e.data,a=e.parent;if(s.terrainState===co.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||tr.processStateMachine(a,t,n,i,o,r,!0)),s.terrainState===co.FAILED&&Srt(s,e,t,n,e.x,e.y,e.level),s.terrainState===co.UNLOADED&&Crt(s,n,e.x,e.y,e.level),s.terrainState===co.RECEIVED&&Lrt(s,t,n,e.x,e.y,e.level),s.terrainState===co.TRANSFORMED&&(Rrt(s,t.context,n,e.x,e.y,e.level,r),s.updateExaggeration(e,t,o)),s.terrainState>=co.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)Grt(t.context,s);else{let d=s._findAncestorTileWithTerrainData(e);l(d)&&l(d.data.waterMaskTexture)&&(s.waterMaskTexture=d.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,d,s.waterMaskTranslationAndScale))}}function Srt(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=js.FAILED;return}let c=a.data.terrainData,d=a.x,u=a.y,m=a.level;if(!l(c))return;let p=c.upsample(i.tilingScheme,d,u,m,o,r,s);l(p)&&(e.terrainState=co.RECEIVING,Promise.resolve(p).then(function(g){l(g)&&(e.terrainData=g,e.terrainState=co.RECEIVED)}).catch(function(){e.terrainState=co.FAILED}))}function Crt(e,t,n,i,o){function r(c){if(!l(c)){e.terrainState=co.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=co.RECEIVED,e.request=void 0}function s(c){if(e.request.state===jn.CANCELLED){e.terrainData=void 0,e.terrainState=co.UNLOADED,e.request=void 0;return}e.terrainState=co.FAILED,e.request=void 0;let d=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=Zo.reportError(t._requestError,t,t.errorEvent,d,n,i,o),t._requestError.retry&&a()}function a(){let c=new Ho({throttle:!1,throttleByServer:!0,type:cs.TERRAIN});e.request=c;let d=t.requestTileGeometry(n,i,o,c);l(d)?(e.terrainState=co.RECEIVING,Promise.resolve(d).then(function(u){r(u)}).catch(function(u){s(u)})):(e.terrainState=co.UNLOADED,e.request=void 0)}a()}var Vrt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Lrt(e,t,n,i,o,r){let s=n.tilingScheme,a=Vrt;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let d=e.terrainData.createMesh(a);l(d)&&(e.terrainState=co.TRANSFORMING,Promise.resolve(d).then(function(u){e.mesh=u,e.terrainState=co.TRANSFORMED}).catch(function(){e.terrainState=co.FAILED}))}tr._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=xt.createVertexBuffer({context:e,typedArray:n,usage:Me.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},s=r[e.id];if(!l(s)||s.isDestroyed()){let a=t.indices;s=xt.createIndexBuffer({context:e,typedArray:a,usage:Me.STATIC_DRAW,indexDatatype:Ae.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,r[e.id]=s,t.indices.indexBuffers=r}else++s.referenceCount;return new ti({context:e,attributes:o,indexBuffer:s})};tr._freeVertexArray=function(e){if(l(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),l(t)&&!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function Rrt(e,t,n,i,o,r,s){e.vertexArray=tr._createVertexArrayForMesh(t,e.mesh),e.terrainState=co.READY,e.fill=e.fill&&e.fill.destroy(s)}function Zrt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Pt.create({context:e,pixelFormat:ot.LUMINANCE,pixelDatatype:qe.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new en({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:$t.LINEAR,magnificationFilter:hi.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function Grt(e,t){let n=t.terrainData.waterMask,i=Zrt(e),o,r=n.length;if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=Pt.create({context:e,pixelFormat:ot.LUMINANCE,pixelDatatype:qe.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,se.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}tr.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;l(t)&&(!l(t.data)||!l(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};tr.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,s=o.height,a=r/i.width,c=s/i.height;return n.x=a*(o.west-i.west)/r,n.y=c*(o.south-i.south)/s,n.z=a,n.w=c,n};var nm=tr;var qLi=T(S(),1);var $Vi=T(S(),1);var HVi=T(S(),1);var gCi=T(S(),1);var ZSi=T(S(),1);function by(e){if(e=y(e,y.EMPTY_OBJECT),this._ellipsoid=y(e.ellipsoid,ne.default),this._numberOfLevelZeroTilesX=y(e.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=y(e.numberOfLevelZeroTilesY,1),this._projection=new Zi(this._ellipsoid),l(e.rectangleSouthwestInMeters)&&l(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new D(-i,-i),this._rectangleNortheastInMeters=new D(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new ae(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(by.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});by.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};by.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};by.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(ae.southwest(e)),o=n.project(ae.northeast(e));return l(t)?(t.west=i.x,t.south=i.y,t.east=o.x,t.north=o.y,t):new ae(i.x,i.y,o.x,o.y)};by.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.getNumberOfXTilesAtLevel(n),r=this.getNumberOfYTilesAtLevel(n),s=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,a=this._rectangleSouthwestInMeters.x+e*s,c=this._rectangleSouthwestInMeters.x+(e+1)*s,d=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,u=this._rectangleNortheastInMeters.y-t*d,m=this._rectangleNortheastInMeters.y-(t+1)*d;return l(i)?(i.west=a,i.south=m,i.east=c,i.north=u,i):new ae(a,m,c,u)};by.prototype.tileXYToRectangle=function(e,t,n,i){let o=this.tileXYToNativeRectangle(e,t,n,i),r=this._projection,s=r.unproject(new D(o.west,o.south)),a=r.unproject(new D(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=a.longitude,o.north=a.latitude,o};by.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ae.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,d=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,m=this._projection.project(e),p=m.x-this._rectangleSouthwestInMeters.x,g=this._rectangleNortheastInMeters.y-m.y,f=p/a|0;f>=o&&(f=o-1);let x=g/d|0;return x>=r&&(x=r-1),l(n)?(n.x=f,n.y=x,n):new D(f,x)};var ns=by;var WSi=T(S(),1);var M4,q0e="AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmQpcUfxe1Yndhf82d5oKkQJ4_7VPaBQGYSISOMaRew7Sy-eTX1JQ4XwaC8v5aCvV72O6LCPs5Ss1pXXH-0uEw6bSRhTeQYHOmikutC2OMyZt6lu0VfT7FA-jVMO_UsunWNTf2cycP2O4IeDN_UV9G-VNmUu2jRvCHioi8o72ua4238s2219cYLEmcoGRJGVJTA.AT1_PjLvyih0",GV={};GV.defaultAccessToken=q0e;GV.defaultWorldImageryServer=new Ee({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});GV.defaultWorldHillshadeServer=new Ee({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});GV.defaultWorldOceanServer=new Ee({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});GV.getDefaultTokenCredit=function(e){if(e===q0e){if(!l(M4)){let t='<b> This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i> with an API key from your ArcGIS Developer account before using the ArcGIS tile services. You can sign up for a free ArcGIS Developer account at <a href="https://developers.arcgis.com/">https://developers.arcgis.com/</a>.</b>';M4=new Et(t,!0)}return M4}};var Od=GV;var MSi=T(S(),1);function N4(e){e=y(e,y.EMPTY_OBJECT),this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=Ee.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=bm(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=r.width,d=e.pixelsToCheck;for(let u=0,m=d.length;a&&u<m;++u){let p=d[u],g=p.x*4+p.y*c;s[g+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function o(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(o)}N4.prototype.isReady=function(){return this._isReady};N4.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=bm(e),o=e.width;for(let r=0,s=t.length;r<s;++r){let a=t[r],c=a.x*4+a.y*o;for(let d=0;d<4;++d){let u=c+d;if(i[u]!==n[u])return!1}}return!0};var pw=N4;var USi=T(S(),1);function k4(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}k4.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let o=i.toLowerCase();t>1&&o==="name"?(t=1,n=i):t>2&&o==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}l(n)&&(this.name=e[n])};k4.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r)&&(typeof r=="object"?i+=`<tr><td>${o}</td><td>${t(r)}</td></tr>`:i+=`<tr><td>${o}</td><td>${r}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var Sh=k4;var zSi=T(S(),1);function EV(){pe.throwInstantiationError()}Object.defineProperties(EV.prototype,{rectangle:{get:pe.throwInstantiationError},tileWidth:{get:pe.throwInstantiationError},tileHeight:{get:pe.throwInstantiationError},maximumLevel:{get:pe.throwInstantiationError},minimumLevel:{get:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},tileDiscardPolicy:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError},proxy:{get:pe.throwInstantiationError},hasAlphaChannel:{get:pe.throwInstantiationError}});EV.prototype.getTileCredits=function(e,t,n){pe.throwInstantiationError()};EV.prototype.requestImage=function(e,t,n,i){pe.throwInstantiationError()};EV.prototype.pickFeatures=function(e,t,n,i,o){pe.throwInstantiationError()};var Ert=/\.ktx2$/i;EV.loadImage=function(e,t){let n=Ee.createIfNeeded(t);return Ert.test(n.url)?_l(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var ol=EV;var JSi=T(S(),1),Irt={SATELLITE:1,OCEANS:2,HILLSHADE:3},Ch=Object.freeze(Irt);function $0e(e){this.useTiles=y(e.usePreCachedTilesIfAvailable,!0);let t=e.ellipsoid;this.tilingScheme=y(e.tilingScheme,new Yi({ellipsoid:t})),this.rectangle=y(e.rectangle,this.tilingScheme.rectangle),this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new Et(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=y(e.tileWidth,256),this.tileHeight=y(e.tileHeight,256),this.maximumLevel=e.maximumLevel}$0e.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!l(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new pw({missingImageUrl:ege(e,0,0,this.maximumLevel).url,pixelsToCheck:[new D(0,0),new D(200,20),new D(20,200),new D(80,110),new D(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function Xrt(e,t){let n=e.tileInfo;if(!l(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new ns({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Yi({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new de(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Zi,o=e.fullExtent,r=i.unproject(new h(Math.max(o.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(o.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new h(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new ae(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ae.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new de(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new Et(e.copyrightText)]:t.credit=new Et(e.copyrightText))}function Wrt(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new de(n)}async function Prt(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Xrt(i,t)}catch(i){Wrt(e,i)}}function Uf(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new Yi({ellipsoid:e.ellipsoid})),this._useTiles=y(e.usePreCachedTilesIfAvailable,!0),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0;let t=e.credit;typeof t=="string"&&(t=new Et(t)),this.enablePickFeatures=y(e.enablePickFeatures,!0),this._errorEvent=new be}Uf.fromBasemapType=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n,i,o;switch(e){case Ch.SATELLITE:{n=y(t.token,Od.defaultAccessToken),i=Ee.createIfNeeded(Od.defaultWorldImageryServer),i.appendForwardSlash();let r=Od.getDefaultTokenCredit(n);l(r)&&(o=Et.clone(r))}break;case Ch.OCEANS:{n=y(t.token,Od.defaultAccessToken),i=Ee.createIfNeeded(Od.defaultWorldOceanServer),i.appendForwardSlash();let r=Od.getDefaultTokenCredit(n);l(r)&&(o=Et.clone(r))}break;case Ch.HILLSHADE:{n=y(t.token,Od.defaultAccessToken),i=Ee.createIfNeeded(Od.defaultWorldHillshadeServer),i.appendForwardSlash();let r=Od.getDefaultTokenCredit(n);l(r)&&(o=Et.clone(r))}break;default:}return Uf.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function ege(e,t,n,i,o){let r;if(e._useTiles)r=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:o});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Ri?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),r=e._resource.getDerivedResource({url:"export",request:o,queryParameters:c})}return r}Object.defineProperties(Uf.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}});Uf.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Ee.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new Uf(t);i._resource=n;let o=new $0e(t);return y(t.usePreCachedTilesIfAvailable,!0)&&await Prt(n,o),o.build(i),i};Uf.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Uf.prototype.requestImage=function(e,t,n,i){return ol.loadImage(this,ege(this,e,t,n,i))};Uf.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof Ri)s=W.toDegrees(i),a=W.toDegrees(o),c="4326";else{let p=this._tilingScheme.projection.project(new he(i,o,0));s=p.x,a=p.y,c="3857"}let d="visible";l(this._layers)&&(d+=`:${this._layers}`);let u={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:d};return this._resource.getDerivedResource({url:"identify",queryParameters:u}).fetchJson().then(function(p){let g=[],f=p.results;if(!l(f))return g;for(let x=0;x<f.length;++x){let _=f[x],C=new Sh;if(C.data=_,C.name=_.value,C.properties=_.attributes,C.configureDescriptionFromProperties(_.attributes),_.geometryType==="esriGeometryPoint"&&_.geometry){let V=_.geometry.spatialReference&&_.geometry.spatialReference.wkid?_.geometry.spatialReference.wkid:4326;if(V===4326||V===4283)C.position=he.fromDegrees(_.geometry.x,_.geometry.y,_.geometry.z);else if(V===102100||V===900913||V===3857){let L=new Zi;C.position=L.unproject(new h(_.geometry.x,_.geometry.y,_.geometry.z))}}g.push(C)}return g})};Uf._metadataCache={};var $b=Uf;var MCi=T(S(),1);var xCi=T(S(),1),vrt={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"},IV=Object.freeze(vrt);var SCi=T(S(),1);function bw(e){}bw.prototype.isReady=function(){return!0};bw.prototype.shouldDiscardImage=function(e){return bw.EMPTY_IMAGE===e};var TD;Object.defineProperties(bw,{EMPTY_IMAGE:{get:function(){return l(TD)||(TD=new Image,TD.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),TD}}});var XV=bw;function tge(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}tge.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let n=0,i=t.length;n<i;++n){let o=t[n];if(o.credit instanceof Et)break;o.credit=new Et(o.attribution);let r=o.coverageAreas;for(let s=0,a=o.coverageAreas.length;s<a;++s){let c=r[s],d=c.bbox;c.bbox=new ae(W.toRadians(d[1]),W.toRadians(d[0]),W.toRadians(d[3]),W.toRadians(d[2]))}}};function wrt(e,t){if(e.resourceSets.length!==1)throw new de("metadata does not specify one resource in resourceSets");let n=e.resourceSets[0].resources[0];t.tileWidth=n.imageWidth,t.tileHeight=n.imageHeight,t.maximumLevel=n.zoomMax-1,t.imageUrlSubdomains=n.imageUrlSubdomains,t.imageUrlTemplate=n.imageUrl;let i=n.imageryProviders;l(n.imageryProviders)&&(i=n.imageryProviders.filter(o=>o.coverageAreas?.some(r=>l(r.bbox)))),t.attributionList=i}function Frt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Zo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new de(i)}async function Art(e,t,n){let i=e.url,o=Is._metadataCache[i];l(o)||(o=e.fetchJsonp("jsonp"),Is._metadataCache[i]=o);try{let r=await o;return wrt(r,t)}catch(r){Frt(e,r,n)}}function Is(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=y(e.mapStyle,IV.AERIAL),this._mapLayer=e.mapLayer,this._culture=y(e.culture,""),this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new XV),this._proxy=e.proxy,this._credit=new Et(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${Is.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new ns({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new be}Object.defineProperties(Is.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},mapLayer:{get:function(){return this._mapLayer}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return l(this.mapLayer)}}});Is.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.tileProtocol;l(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=y(t.mapStyle,IV.AERIAL),o=Ee.createIfNeeded(e);o.appendForwardSlash();let r={incl:"ImageryProviders",key:t.key,uriScheme:n};l(t.mapLayer)&&(r.mapLayer=t.mapLayer),l(t.culture)&&(r.culture=t.culture);let s=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:r}),a=new Is(t);a._resource=o;let c=new tge(t);return await Art(s,c),c.build(a),a};var Mrt=new ae;Is.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,Mrt);return Urt(this._attributionList,n,i)};Is.prototype.requestImage=function(e,t,n,i){let o=ol.loadImage(this,Nrt(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?XV.EMPTY_IMAGE:Promise.reject(r)})};Is.prototype.pickFeatures=function(e,t,n,i,o){};Is.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;e&r&&(s|=1),t&r&&(s|=2),i+=s}return i};Is.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];s&1&&(t|=r),s&2&&(n|=r)}return{x:t,y:n,level:i}};Is._logoUrl=void 0;Object.defineProperties(Is,{logoUrl:{get:function(){return l(Is._logoUrl)||(Is._logoUrl=rn("Assets/Images/bing_maps_credit.png")),Is._logoUrl},set:function(e){Is._logoUrl=e}}});function Nrt(e,t,n,i,o){let r=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:r,request:o,templateValues:{quadkey:Is.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var krt=new ae;function Urt(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let s=e[o],a=s.coverageAreas,c=!1;for(let d=0,u=s.coverageAreas.length;!c&&d<u;++d){let m=a[d];if(t>=m.zoomMin&&t<=m.zoomMax){let p=ae.intersection(n,m.bbox,krt);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}Is._metadataCache={};var gw=Is;var p1i=T(S(),1);var e1i=T(S(),1);var nge=/{[^}]+}/g,ige={x:Yrt,y:zrt,z:Qrt,s:jrt,reverseX:Hrt,reverseY:Krt,reverseZ:Jrt,westDegrees:qrt,southDegrees:$rt,eastDegrees:est,northDegrees:tst,westProjected:nst,southProjected:ist,eastProjected:ost,northProjected:rst,width:sst,height:ast},Drt=Tt(ige,{i:cst,j:lst,reverseI:dst,reverseJ:ust,longitudeDegrees:hst,latitudeDegrees:fst,longitudeProjected:pst,latitudeProjected:bst,format:yst});function yw(e){e=y(e,y.EMPTY_OBJECT),this._errorEvent=new be;let t=Ee.createIfNeeded(e.url),n=Ee.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():l(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._tilingScheme=y(e.tilingScheme,new ns({ellipsoid:e.ellipsoid})),this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._rectangle=ae.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new Et(o)),this._credit=o,this._hasAlphaChannel=y(e.hasAlphaChannel,!0);let r=e.customTags,s=Tt(ige,r),a=Tt(Drt,r);this._tags=s,this._pickFeaturesTags=a,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=y(e.enablePickFeatures,!0)}Object.defineProperties(yw.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}});yw.prototype.getTileCredits=function(e,t,n){};yw.prototype.requestImage=function(e,t,n,i){return ol.loadImage(this,Brt(this,e,t,n,i))};yw.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(d,u){return d.callback(u)}function c(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let d=s._getFeatureInfoFormats[r],u=Ort(s,e,t,n,i,o,d.format);return++r,d.type==="json"?u.fetchJson().then(d.callback).catch(c):d.type==="xml"?u.fetchXML().then(d.callback).catch(c):d.type==="text"||d.type==="html"?u.fetchText().then(d.callback).catch(c):u.fetch({responseType:d.format}).then(a.bind(void 0,d)).catch(c)}return c()};var SD=!1,Yd=new ae,CD=!1,xw=new ae;function Brt(e,t,n,i,o){SD=!1,CD=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},d=s.match(nge);return l(d)&&d.forEach(function(u){let m=u.substring(1,u.length-1);l(a[m])&&(c[m]=a[m](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var U4=!1,PV=new D,D4=!1;function Ort(e,t,n,i,o,r,s){SD=!1,CD=!1,U4=!1,D4=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),d=e._pickFeaturesTags,u={},m=c.match(nge);return l(m)&&m.forEach(function(p){let g=p.substring(1,p.length-1);l(d[g])&&(u[g]=d[g](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:u})}function vV(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let o=i.length;o>1&&(n=n.length>=o?n:new Array(o-n.toString().length+1).join("0")+n)}}return n}function Yrt(e,t,n,i){return vV(e,"{x}",t)}function Hrt(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return vV(e,"{reverseX}",o)}function zrt(e,t,n,i){return vV(e,"{y}",n)}function Krt(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return vV(e,"{reverseY}",o)}function Jrt(e,t,n,i){let o=e.maximumLevel,r=l(o)&&i<o?o-i-1:i;return vV(e,"{reverseZ}",r)}function Qrt(e,t,n,i){return vV(e,"{z}",i)}function jrt(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function VD(e,t,n,i){SD||(e.tilingScheme.tileXYToRectangle(t,n,i,Yd),Yd.west=W.toDegrees(Yd.west),Yd.south=W.toDegrees(Yd.south),Yd.east=W.toDegrees(Yd.east),Yd.north=W.toDegrees(Yd.north),SD=!0)}function qrt(e,t,n,i){return VD(e,t,n,i),Yd.west}function $rt(e,t,n,i){return VD(e,t,n,i),Yd.south}function est(e,t,n,i){return VD(e,t,n,i),Yd.east}function tst(e,t,n,i){return VD(e,t,n,i),Yd.north}function LD(e,t,n,i){CD||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,xw),CD=!0)}function nst(e,t,n,i){return LD(e,t,n,i),xw.west}function ist(e,t,n,i){return LD(e,t,n,i),xw.south}function ost(e,t,n,i){return LD(e,t,n,i),xw.east}function rst(e,t,n,i){return LD(e,t,n,i),xw.north}function sst(e,t,n,i){return e.tileWidth}function ast(e,t,n,i){return e.tileHeight}function cst(e,t,n,i,o,r,s){return RD(e,t,n,i,o,r),PV.x}function lst(e,t,n,i,o,r,s){return RD(e,t,n,i,o,r),PV.y}function dst(e,t,n,i,o,r,s){return RD(e,t,n,i,o,r),e.tileWidth-PV.x-1}function ust(e,t,n,i,o,r,s){return RD(e,t,n,i,o,r),e.tileHeight-PV.y-1}var mst=new ae,WV=new h;function RD(e,t,n,i,o,r,s){if(U4)return;B4(e,t,n,i,o,r);let a=WV,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,mst);PV.x=e.tileWidth*(a.x-c.west)/c.width|0,PV.y=e.tileHeight*(c.north-a.y)/c.height|0,U4=!0}function hst(e,t,n,i,o,r,s){return W.toDegrees(o)}function fst(e,t,n,i,o,r,s){return W.toDegrees(r)}function pst(e,t,n,i,o,r,s){return B4(e,t,n,i,o,r),WV.x}function bst(e,t,n,i,o,r,s){return B4(e,t,n,i,o,r),WV.y}var gst=new he;function B4(e,t,n,i,o,r,s){if(!D4){if(e.tilingScheme.projection instanceof Ri)WV.x=W.toDegrees(o),WV.y=W.toDegrees(r);else{let a=gst;a.longitude=o,a.latitude=r,e.tilingScheme.projection.project(a,WV)}D4=!0}}function yst(e,t,n,i,o,r,s){return s}var Na=yw;function im(e){Na.call(this,e)}im._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return im._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof Dh)return im._metadataFailure(e,t);throw o}};im.fromUrl=async function(e,t){let n=Ee.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=y(t,y.EMPTY_OBJECT);let r=await im._requestMetadata(t,i,o);return new im(r)};l(Object.create)&&(im.prototype=Object.create(Na.prototype),im.prototype.constructor=im);function oge(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function rge(e,t,n){let i=e.positionToTileXY(ae.southwest(t),n),o=e.positionToTileXY(ae.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}im._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,d,u,m,p=[],g=e.childNodes[0].childNodes;for(let P=0;P<g.length;P++)if(r.test(g.item(P).nodeName))d=g.item(P);else if(a.test(g.item(P).nodeName)){m=g.item(P);let w=g.item(P).childNodes;for(let F=0;F<w.length;F++)s.test(w.item(F).nodeName)&&p.push(w.item(F))}else c.test(g.item(P).nodeName)&&(u=g.item(P));let f;if(!l(m)||!l(u))throw f=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(o)&&Zo.reportError(void 0,o,o.errorEvent,f),new de(f);let x=y(t.fileExtension,d.getAttribute("extension")),_=y(t.tileWidth,parseInt(d.getAttribute("width"),10)),C=y(t.tileHeight,parseInt(d.getAttribute("height"),10)),V=y(t.minimumLevel,parseInt(p[0].getAttribute("order"),10)),L=y(t.maximumLevel,parseInt(p[p.length-1].getAttribute("order"),10)),Z=m.getAttribute("profile"),G=t.tilingScheme;if(!l(G))if(Z==="geodetic"||Z==="global-geodetic")G=new Yi({ellipsoid:t.ellipsoid});else if(Z==="mercator"||Z==="global-mercator")G=new ns({ellipsoid:t.ellipsoid});else throw f=`${i.url} specifies an unsupported profile attribute, ${Z}.`,l(o)&&Zo.reportError(void 0,o,o.errorEvent,f),new de(f);let I=ae.clone(t.rectangle);if(!l(I)){let P,w,F,b;y(t.flipXY,!1)?(F=new D(parseFloat(u.getAttribute("miny")),parseFloat(u.getAttribute("minx"))),b=new D(parseFloat(u.getAttribute("maxy")),parseFloat(u.getAttribute("maxx")))):(F=new D(parseFloat(u.getAttribute("minx")),parseFloat(u.getAttribute("miny"))),b=new D(parseFloat(u.getAttribute("maxx")),parseFloat(u.getAttribute("maxy"))));let E=Z==="geodetic"||Z==="mercator";if(G.projection instanceof Ri||E)P=he.fromDegrees(F.x,F.y),w=he.fromDegrees(b.x,b.y);else{let X=G.projection;P=X.unproject(F),w=X.unproject(b)}I=new ae(P.longitude,P.latitude,w.longitude,w.latitude)}return I=oge(I,G),V=rge(G,I,V),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${x}`}),tilingScheme:G,rectangle:I,tileWidth:_,tileHeight:C,minimumLevel:V,maximumLevel:L,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};im._metadataFailure=function(e,t){let n=y(e.fileExtension,"png"),i=y(e.tileWidth,256),o=y(e.tileHeight,256),r=e.maximumLevel,s=l(e.tilingScheme)?e.tilingScheme:new ns({ellipsoid:e.ellipsoid}),a=y(e.rectangle,s.rectangle);a=oge(a,s);let c=rge(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:o,minimumLevel:c,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var gy=im;var E1i=T(S(),1);function sge(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}sge.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function xst(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let o=0;o<n.layers.length;o++)if(n.layers[o].id===t.channel){i=n.layers[o];break}if(!l(i)){let o=`Could not find layer with channel (id) of ${t.channel}.`;throw new de(o)}if(!l(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new de(o)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new Yi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ae(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new ns({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new de(o)}return!0}function _st(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),Zo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new de(i)}async function Tst(e,t,n){try{let i=await e.fetchText();xst(i,t)}catch(i){_st(i,e,n)}}function Kl(e){e=y(e,{}),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new Et(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${Kl.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new be}Object.defineProperties(Kl.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});Kl.fromUrl=async function(e,t,n){n=y(n,{});let i=y(n.path,"/default_map"),o=Ee.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});o.appendForwardSlash();let r=o.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new sge(n);s.channel=t,await Tst(r,s);let a=new Kl(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};Kl.prototype.getTileCredits=function(e,t,n){};Kl.prototype.requestImage=function(e,t,n,i){let o=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return ol.loadImage(this,o)};Kl.prototype.pickFeatures=function(e,t,n,i,o){};Kl._logoUrl=void 0;Object.defineProperties(Kl,{logoUrl:{get:function(){return l(Kl._logoUrl)||(Kl._logoUrl=rn("Assets/Images/google_earth_credit.png")),Kl._logoUrl},set:function(e){Kl._logoUrl=e}}});var _w=Kl;var F1i=T(S(),1);var Sst=/\/$/,age=new Et('&copy; <a href="https://www.mapbox.com/about/maps/">Mapbox</a> &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function wV(e){e=y(e,y.EMPTY_OBJECT);let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Ee.createIfNeeded(y(e.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=t,this._accessToken=n;let o=y(e.format,"png");/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();Sst.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new Et(s))):s=age,this._resource=i,this._imageryProvider=new Na({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(wV.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});wV.prototype.getTileCredits=function(e,t,n){};wV.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};wV.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};wV._defaultCredit=age;var Tw=wV;var K1i=T(S(),1);function ST(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=y(e.rectangle,ae.MAX_VALUE),n=new Yi({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new be;let i=e.credit;typeof i=="string"&&(i=new Et(i)),this._credit=i;let o=Ee.createIfNeeded(e.url);this._resource=o,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(ST.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});function Cst(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=Zo.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return O4(e,n,r);throw l(n)&&(n._hasError=!0),new de(o)}async function O4(e,t,n){try{return await ol.loadImage(null,e)}catch(i){return Cst(e,i,t,n)}}ST.fromUrl=async function(e,t){let n=Ee.createIfNeeded(e),i=await O4(n);t=y(t,y.EMPTY_OBJECT);let o=new ST({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};ST.prototype.getTileCredits=function(e,t,n){};ST.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await O4(this._resource,this);return this._image=o,Zo.reportSuccess(this._errorEvent),o}return this._image};ST.prototype.pickFeatures=function(e,t,n,i,o){};var Sw=ST;var yVi=T(S(),1);var eVi=T(S(),1);function Vst(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=Lst:e==="xml"?n=Est:(e==="html"||e==="text")&&(n=cge)),this.callback=n}function Lst(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new Sh;if(r.data=o,r.properties=o.properties,r.configureNameFromProperties(o.properties),r.configureDescriptionFromProperties(o.properties),l(o.geometry)&&o.geometry.type==="Point"){let s=o.geometry.coordinates[0],a=o.geometry.coordinates[1];r.position=he.fromDegrees(s,a)}t.push(r)}return t}var Y4="http://www.mapinfo.com/mxp",Rst="http://www.esri.com/wms",Zst="http://www.opengis.net/wfs",Gst="http://www.opengis.net/gml";function Est(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===Y4)return Ist(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Rst)return Xst(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===Zst)return Wst(e);if(t.localName==="ServiceExceptionReport")throw new de(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Pst(e):vst(e)}function Ist(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Y4,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(Y4,"Val");for(let d=0;d<a.length;++d){let u=a[d];if(u.hasAttribute("ref")){let m=u.getAttribute("ref"),p=u.textContent.trim();s[m]=p}}let c=new Sh;c.data=r,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function Xst(e){let t=e.documentElement,n=[],i,o=t.getElementsByTagNameNS("*","FIELDS");if(o.length>0)for(let r=0;r<o.length;++r){let s=o[r];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let d=a[c];i[d.name]=d.value}n.push(ZD(s,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<r.length;++s){let a=r[s];i={};let c=a.childNodes;for(let d=0;d<c.length;++d){let u=c[d];u.nodeType===Node.ELEMENT_NODE&&(i[u.localName]=u.textContent)}n.push(ZD(a,i))}}return n}function Wst(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Gst,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};H4(r,s),t.push(ZD(r,s))}return t}function Pst(e){let t=[],n,i=e.documentElement.childNodes;for(let r=0;r<i.length;r++)if(i[r].nodeType===Node.ELEMENT_NODE){n=i[r];break}if(!l(n))throw new de("Unable to find first child of the feature info xml document");let o=n.childNodes;for(let r=0;r<o.length;++r){let s=o[r];if(s.nodeType===Node.ELEMENT_NODE){let a={};H4(s,a),t.push(ZD(s,a))}}return t}function H4(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let o=e.childNodes[i];o.nodeType===Node.ELEMENT_NODE&&(n=!1),!(o.localName==="Point"||o.localName==="LineString"||o.localName==="Polygon"||o.localName==="boundedBy")&&o.hasChildNodes()&&H4(o,t)&&(t[o.localName]=o.textContent)}return n}function ZD(e,t){let n=new Sh;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function vst(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new Sh;return o.data=e,o.description=n.innerHTML,[o]}var wst=/<body>\s*<\/body>/im,Fst=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,Ast=/<title>([\s\S]*)<\/title>/im;function cge(e){if(wst.test(e)||Fst.test(e))return;let t,n=Ast.exec(e);n&&n.length>1&&(t=n[1]);let i=new Sh;return i.name=t,i.description=e,i.data=e,[i]}var CT=Vst;var aVi=T(S(),1);function Cw(e){e=y(e,y.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(Cw.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});Cw.prototype.getFromCache=function(e,t,n,i){let o=lge(e,t,n),r,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[o])){let a=s[o];r=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[o]}return r};Cw.prototype.checkApproachingInterval=function(e,t,n,i){let o=lge(e,t,n),r=this._tilesRequestedForInterval,s=dge(this),a={key:o,priorityFunction:i.priorityFunction};(!l(s)||!uge(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};Cw.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),o=this._currentIntervalIndex;if(i!==o){let s=this._tileCache[o];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let r=dge(this);if(l(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=uge(this,c,r),a||s.push(c)}}};function lge(e,t,n){return`${e}-${t}-${n}`}function Mst(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function dge(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,o=n.canAnimate&&n.shouldAnimate,r=n.multiplier;if(!o&&r!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return r>0?(s=j.secondsDifference(c.stop,i),++a):(s=j.secondsDifference(c.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function uge(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];l(r)||(r=o[i]={});let s=t.key;if(l(r[s]))return!0;let a=Mst(s),c=new Ho({throttle:!1,throttleByServer:!0,type:cs.IMAGERY,priorityFunction:t.priorityFunction}),d=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(d)?(r[s]={promise:d,request:c},!0):!1}var VT=Cw;var Nst=[3034,3035,3042,3043,3044],kst=[4471,4559];function Vh(e){if(e=y(e,y.EMPTY_OBJECT),l(e.times)&&!l(e.clock))throw new pe("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=y(e.getFeatureInfoUrl,e.url);let t=Ee.createIfNeeded(e.url),n=Ee.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(Vh.DefaultParameters,!0),n.setQueryParameters(Vh.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(mge(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(mge(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new VT({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,d,u){return hge(i,s,a,c,d,u)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let o={};if(o.layers=e.layers,o.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",o.width="{width}",o.height="{height}",parseFloat(t.queryParameters.version)>=1.3){o.crs=y(e.crs,e.tilingScheme&&e.tilingScheme.projection instanceof Zi?"EPSG:3857":"CRS:84");let s=o.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!kst.includes(a)||Nst.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=y(e.srs,e.tilingScheme&&e.tilingScheme.projection instanceof Zi?"EPSG:3857":"EPSG:4326");t.setQueryParameters(o,!0),n.setQueryParameters(o,!0);let r={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(r.i="{i}",r.j="{j}"):(r.x="{i}",r.y="{j}"),n.setQueryParameters(r,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new Na({url:t,pickFeaturesUrl:n,tilingScheme:y(e.tilingScheme,new Yi({ellipsoid:e.ellipsoid})),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:y(e.getFeatureInfoFormats,Vh.DefaultGetFeatureInfoFormats),enablePickFeatures:e.enablePickFeatures})}function hge(e,t,n,i,o,r){let s=l(r)?r.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,o)}function Ust(e,t,n,i,o,r,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,o,r)}Object.defineProperties(Vh.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});Vh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Vh.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=hge(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};Vh.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return Ust(this,e,t,n,i,o,s)};Vh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});Vh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});Vh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new CT("json","application/json")),Object.freeze(new CT("xml","text/xml")),Object.freeze(new CT("text","text/html"))]);function mge(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var Vw=Vh;var IVi=T(S(),1);var Dst=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function Lw(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=Ee.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,o=t.url,r=o.match(/{/g);if(!l(r)||r.length===1&&/{s}/.test(o))t.setQueryParameters(Dst),this._useKvp=!0;else{let m={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(m),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=y(e.format,"image/jpeg"),this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new ns({ellipsoid:e.ellipsoid}),this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._minimumLevel=y(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=y(e.rectangle,this._tilingScheme.rectangle),this._dimensions=e.dimensions;let s=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new VT({clock:e.clock,times:e.times,requestImageFunction:function(m,p,g,f,x){return fge(s,m,p,g,f,x)},reloadFunction:function(){l(s._reload)&&s._reload()}}));let a=this._tilingScheme.positionToTileXY(ae.southwest(this._rectangle),this._minimumLevel),c=this._tilingScheme.positionToTileXY(ae.northeast(this._rectangle),this._minimumLevel),d=(Math.abs(c.x-a.x)+1)*(Math.abs(c.y-a.y)+1);this._errorEvent=new be;let u=e.credit;this._credit=typeof u=="string"?new Et(u):u,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():l(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function fge(e,t,n,i,o,r){let s=e._tileMatrixLabels,a=l(s)?s[i]:i.toString(),c=e._subdomains,d=e._dimensions,u=l(r)?r.data:void 0,m,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:c[(t+n+i)%c.length]},m=e._resource.getDerivedResource({request:o}),m.setTemplateValues(p),l(d)&&m.setTemplateValues(d),l(u)&&m.setTemplateValues(u);else{let g={};g.tilematrix=a,g.layer=e._layer,g.style=e._style,g.tilerow=n,g.tilecol=t,g.tilematrixset=e._tileMatrixSetID,g.format=e._format,l(d)&&(g=Tt(g,d)),l(u)&&(g=Tt(g,u)),p={s:c[(t+n+i)%c.length]},m=e._resource.getDerivedResource({queryParameters:g,request:o}),m.setTemplateValues(p)}return ol.loadImage(e,m)}Object.defineProperties(Lw.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}}});Lw.prototype.getTileCredits=function(e,t,n){};Lw.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=fge(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};Lw.prototype.pickFeatures=function(e,t,n,i,o){};var Rw=Lw;var Bst={ARCGIS_MAPSERVER:$b.fromUrl,BING:async(e,t)=>gw.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,_w.fromUrl(e,n,t)},MAPBOX:(e,t)=>new Tw({url:e,...t}),SINGLE_TILE:Sw.fromUrl,TMS:gy.fromUrl,URL_TEMPLATE:(e,t)=>new Na({url:e,...t}),WMS:(e,t)=>new Vw({url:e,...t}),WMTS:(e,t)=>new Rw({url:e,...t})};function Df(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileCredits=void 0,this._errorEvent=new be}Object.defineProperties(Df.prototype,{rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}}});Df.fromAssetId=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=fd._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=Df._endpointCache[i];l(o)||(o=n.fetchJson(),Df._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new de(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=r.externalType;if(!l(a))s=await gy.fromUrl(new fd(r,n));else{let d=Bst[a];if(!l(d))throw new de(`Unrecognized Cesium ion imagery type: ${a}`);let u={...r.options},m=u.url;delete u.url,s=await d(m,u)}let c=new Df(t);return s.errorEvent.addEventListener(function(d){d.provider=c,c._errorEvent.raiseEvent(d)}),c._tileCredits=fd.getCreditsFromEndpoint(r,n),c._imageryProvider=s,c};Df.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};Df.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Df.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};Df._endpointCache={};var e0=Df;var KVi=T(S(),1),Ost={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},t0=Object.freeze(Ost);function Yst(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.style,t0.AERIAL);return e0.fromAssetId(t)}var n0=Yst;var tLi=T(S(),1),Zw=`uniform sampler2D u_texture;
  9454. in vec2 v_textureCoordinates;
  9455. void main()
  9456. {
  9457. out_FragColor = texture(u_texture, v_textureCoordinates);
  9458. }
  9459. `;var iLi=T(S(),1),Gw=`in vec4 position;
  9460. in float webMercatorT;
  9461. uniform vec2 u_textureDimensions;
  9462. out vec2 v_textureCoordinates;
  9463. void main()
  9464. {
  9465. v_textureCoordinates = vec2(position.x, webMercatorT);
  9466. gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));
  9467. }
  9468. `;var cLi=T(S(),1);function FV(e,t,n,i,o){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let r=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(r,s,a)}this.state=ai.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!l(o)&&e.ready&&(o=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=o}FV.createPlaceholder=function(e){let t=new FV(e,0,0,0);return t.addReference(),t.state=ai.PLACEHOLDER,t};FV.prototype.addReference=function(){++this.referenceCount};FV.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),me(this),0):this.referenceCount};FV.prototype.processStateMachine=function(e,t,n){this.state===ai.UNLOADED&&!n&&(this.state=ai.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===ai.RECEIVED&&(this.state=ai.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===ai.READY&&t&&!this.texture;(this.state===ai.TEXTURE_LOADED||i)&&(this.state=ai.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var AV=FV;var mLi=T(S(),1);function z4(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}z4.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};z4.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===ai.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this),!0;let r=i.parent,s;for(;l(r)&&(r.state!==ai.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==ai.FAILED&&r.state!==ai.INVALID&&(s=s||r),r=r.parent;return this.readyImagery!==r&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=r,l(r)&&(r.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),i.state===ai.FAILED||i.state===ai.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var MV=z4;function Ti(e,t){this._imageryProvider=e,this._readyEvent=new be,this._errorEvent=new be,t=y(t,y.EMPTY_OBJECT),e=y(e,y.EMPTY_OBJECT),this.alpha=y(t.alpha,y(e._defaultAlpha,1)),this.nightAlpha=y(t.nightAlpha,y(e._defaultNightAlpha,1)),this.dayAlpha=y(t.dayAlpha,y(e._defaultDayAlpha,1)),this.brightness=y(t.brightness,y(e._defaultBrightness,Ti.DEFAULT_BRIGHTNESS)),this.contrast=y(t.contrast,y(e._defaultContrast,Ti.DEFAULT_CONTRAST)),this.hue=y(t.hue,y(e._defaultHue,Ti.DEFAULT_HUE)),this.saturation=y(t.saturation,y(e._defaultSaturation,Ti.DEFAULT_SATURATION)),this.gamma=y(t.gamma,y(e._defaultGamma,Ti.DEFAULT_GAMMA)),this.splitDirection=y(t.splitDirection,Ti.DEFAULT_SPLIT),this.minificationFilter=y(t.minificationFilter,y(e._defaultMinificationFilter,Ti.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=y(t.magnificationFilter,y(e._defaultMagnificationFilter,Ti.DEFAULT_MAGNIFICATION_FILTER)),this.show=y(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=y(t.rectangle,ae.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new MV(AV.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=y(t.colorToAlphaThreshold,Ti.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD)}Object.defineProperties(Ti.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return l(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});Ti.DEFAULT_BRIGHTNESS=1;Ti.DEFAULT_CONTRAST=1;Ti.DEFAULT_HUE=0;Ti.DEFAULT_SATURATION=1;Ti.DEFAULT_GAMMA=1;Ti.DEFAULT_SPLIT=vr.NONE;Ti.DEFAULT_MINIFICATION_FILTER=$t.LINEAR;Ti.DEFAULT_MAGNIFICATION_FILTER=hi.LINEAR;Ti.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Ti.fromProviderAsync=function(e,t){let n=new Ti(void 0,t);return Qst(n,Promise.resolve(e)),n};Ti.fromWorldImagery=function(e){return e=y(e,y.EMPTY_OBJECT),Ti.fromProviderAsync(n0({style:e.style}),e)};Ti.prototype.isBaseLayer=function(){return this._isBaseLayer};Ti.prototype.isDestroyed=function(){return!1};Ti.prototype.destroy=function(){return me(this)};var gge=new ae,pge=new ae,K4=new ae,yge=new ae;Ti.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ae.intersection(e.rectangle,t)};Ti.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!l(t)||l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;l(n)||(n=i.imagery.length);let o=this._imageryProvider;if(!this.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let r=o.tilingScheme.projection instanceof Zi&&e.rectangle.north<Zi.MaximumLatitude&&e.rectangle.south>-Zi.MaximumLatitude,s=ae.intersection(o.rectangle,this._rectangle,gge),a=ae.intersection(e.rectangle,s,pge);if(!l(a)){if(!this.isBaseLayer())return!1;let E=s,X=e.rectangle;a=pge,X.south>=E.north?a.north=a.south=E.north:X.north<=E.south?a.north=a.south=E.south:(a.south=Math.max(X.south,E.south),a.north=Math.min(X.north,E.north)),X.west>=E.east?a.west=a.east=E.east:X.east<=E.west?a.west=a.east=E.west:(a.west=Math.max(X.west,E.west),a.east=Math.min(X.east,E.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let u=1*t.getLevelMaximumGeometricError(e.level),m=Kst(this,u,c);m=Math.max(0,m);let p=o.maximumLevel;if(m>p&&(m=p),l(o.minimumLevel)){let E=o.minimumLevel;m<E&&(m=E)}let g=o.tilingScheme,f=g.positionToTileXY(ae.northwest(a),m),x=g.positionToTileXY(ae.southeast(a),m),_=e.rectangle.width/512,C=e.rectangle.height/512,V=g.tileXYToRectangle(f.x,f.y,m);Math.abs(V.south-e.rectangle.north)<C&&f.y<x.y&&++f.y,Math.abs(V.east-e.rectangle.west)<_&&f.x<x.x&&++f.x;let L=g.tileXYToRectangle(x.x,x.y,m);Math.abs(L.north-e.rectangle.south)<C&&x.y>f.y&&--x.y,Math.abs(L.west-e.rectangle.east)<_&&x.x>f.x&&--x.x;let Z=ae.clone(e.rectangle,yge),G=g.tileXYToRectangle(f.x,f.y,m),I=ae.intersection(G,s,K4),v;r?(g.rectangleToNativeRectangle(Z,Z),g.rectangleToNativeRectangle(G,G),g.rectangleToNativeRectangle(I,I),g.rectangleToNativeRectangle(s,s),v=g.tileXYToNativeRectangle.bind(g),_=Z.width/512,C=Z.height/512):v=g.tileXYToRectangle.bind(g);let P,w=0,F=1,b;!this.isBaseLayer()&&Math.abs(I.west-Z.west)>=_&&(w=Math.min(1,(I.west-Z.west)/Z.width)),!this.isBaseLayer()&&Math.abs(I.north-Z.north)>=C&&(F=Math.max(0,(I.north-Z.south)/Z.height));let R=F;for(let E=f.x;E<=x.x;E++)if(P=w,G=v(E,f.y,m),I=ae.simpleIntersection(G,s,K4),!!l(I)){w=Math.min(1,(I.east-Z.west)/Z.width),E===x.x&&(this.isBaseLayer()||Math.abs(I.east-Z.east)<_)&&(w=1),F=R;for(let X=f.y;X<=x.y;X++){if(b=F,G=v(E,X,m),I=ae.simpleIntersection(G,s,K4),!l(I))continue;F=Math.max(0,(I.south-Z.south)/Z.height),X===x.y&&(this.isBaseLayer()||Math.abs(I.south-Z.south)<C)&&(F=0);let A=new se(P,F,w,b),N=this.getImageryFromCache(E,X,m);i.imagery.splice(n,0,new MV(N,A,r)),++n}}return!0};Ti.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,gge),i=c.rectangleToNativeRectangle(i,yge)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new se(s*(i.west-n.west)/o,a*(i.south-n.south)/r,s,a)};Ti.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return o();e.image=s,e.state=ai.RECEIVED,e.request=void 0,Zo.reportSuccess(n._requestImageError)}function o(s){if(e.request.state===jn.CANCELLED){e.state=ai.UNLOADED,e.request=void 0;return}e.state=ai.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=Zo.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r()}function r(){let s=new Ho({throttle:!1,throttleByServer:!0,type:cs.IMAGERY});e.request=s,e.state=ai.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=ai.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(c){i(c)}).catch(function(c){o(c)})}r()};Ti.prototype._createTextureWebGL=function(e,t){let n=new en({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Pt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Pt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?ot.RGBA:ot.RGB,sampler:n})};Ti.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let r=n.tileDiscardPolicy;if(l(r)){if(!r.isReady()){t.state=ai.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=ai.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Zi?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=ai.TEXTURE_LOADED};function bge(e,t,n){return`${e}:${t}:${n}`}Ti.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===$t.LINEAR&&i===hi.LINEAR&&!ot.isCompressedFormat(t.pixelFormat)&&W.isPowerOfTwo(t.width)&&W.isPowerOfTwo(t.height)){n=$t.LINEAR_MIPMAP_LINEAR;let r=Bt.maximumTextureFilterAnisotropy,s=Math.min(r,y(this._maximumAnisotropy,r)),a=bge(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let d=c[a];l(d)||(d=c[a]=new en({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(Qh.NICEST),t.sampler=d}else{let r=bge(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];l(a)||(a=s[r]=new en({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};Ti.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=y(n,!0),n&&!(this._imageryProvider.tilingScheme.projection instanceof Ri)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new Xc({persists:!0,owner:this,preExecute:function(c){zst(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(r,c),t.state=ai.READY,t.releaseReference()},canceled:function(){t.state=ai.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=ai.READY};Ti.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};Ti.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Ti.prototype.getImageryFromCache=function(e,t,n,i){let o=xge(e,t,n),r=this._imageryCache[o];return l(r)||(r=new AV(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};Ti.prototype.removeImageryFromCache=function(e){let t=xge(e.x,e.y,e.level);delete this._imageryCache[t]};function xge(e,t,n){return JSON.stringify([e,t,n])}var GD={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new D,texture:void 0},Hst=zt.supportsTypedArrays()?new Float32Array(2*64):void 0;function zst(e,t,n,i){let o=t.cache.imageryLayer_reproject;if(!l(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let _=new Float32Array(2*64*2),C=0;for(let I=0;I<64;++I){let v=I/63;_[C++]=0,_[C++]=v,_[C++]=1,_[C++]=v}let V={position:0,webMercatorT:1},L=ts.getRegularGridIndices(2,64),Z=xt.createIndexBuffer({context:t,typedArray:L,usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT});o.vertexArray=new ti({context:t,attributes:[{index:V.position,vertexBuffer:xt.createVertexBuffer({context:t,typedArray:_,usage:Me.STATIC_DRAW}),componentsPerAttribute:2},{index:V.webMercatorT,vertexBuffer:xt.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Me.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:Z});let G=new De({sources:[Gw]});o.shaderProgram=tn.fromCache({context:t,vertexShaderSource:G,fragmentShaderSource:Zw,attributeLocations:V}),o.sampler=new en({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:$t.LINEAR,magnificationFilter:hi.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;GD.textureDimensions.x=r,GD.textureDimensions.y=s,GD.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let u=1/(.5*Math.log((1+a)/(1-a))-c),m=new Pt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});W.isPowerOfTwo(r)&&W.isPowerOfTwo(s)&&m.generateMipmap(Qh.NICEST);let p=i.south,g=i.north,f=Hst,x=0;for(let _=0;_<64;++_){let C=_/63,V=W.lerp(p,g,C);a=Math.sin(V);let Z=(.5*Math.log((1+a)/(1-a))-c)*u;f[x++]=Z,f[x++]=Z}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(f),e.shaderProgram=o.shaderProgram,e.outputTexture=m,e.uniformMap=GD,e.vertexArray=o.vertexArray}function Kst(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Ri?1:Math.cos(n),a=o.rectangle,d=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,u=Math.log(d)/Math.log(2);return Math.round(u)|0}function Jst(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Qst(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){Jst(e._errorEvent,i)}}var ka=Ti;var VRi=T(S(),1);var eRi=T(S(),1),jst={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},gn=jst;var nRi=T(S(),1),_ge={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=_ge.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},Kn=_ge;function kV(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se}kV.prototype.update=function(e,t,n){this.changedThisFrame&&(Zge(e,t,this.tile,n),this.changedThisFrame=!1)};kV.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};kV.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):nm._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var qst=new lg;kV.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=qst;a.clear();for(let d=0;d<t.length;++d){let u=t[d];l(u.data.vertexArray)&&a.enqueue(t[d])}let c=a.dequeue();for(;c!==void 0;){let d=c.findTileToWest(r),u=c.findTileToSouth(r),m=c.findTileToEast(r),p=c.findTileToNorth(r);Xs(e,n,c,d,s,gn.EAST,!1,a,i),Xs(e,n,c,u,s,gn.NORTH,!1,a,i),Xs(e,n,c,m,s,gn.WEST,!1,a,i),Xs(e,n,c,p,s,gn.SOUTH,!1,a,i);let g=d.findTileToNorth(r),f=d.findTileToSouth(r),x=m.findTileToNorth(r),_=m.findTileToSouth(r);Xs(e,n,c,g,s,gn.SOUTHEAST,!1,a,i),Xs(e,n,c,x,s,gn.SOUTHWEST,!1,a,i),Xs(e,n,c,f,s,gn.NORTHEAST,!1,a,i),Xs(e,n,c,_,s,gn.NORTHWEST,!1,a,i),c=a.dequeue()}};function Xs(e,t,n,i,o,r,s,a,c){if(i===void 0)return;let d=i;for(;d&&(d._lastSelectionResultFrame!==o||Kn.wasKicked(d._lastSelectionResult)||Kn.originalResult(d._lastSelectionResult)===Kn.CULLED);){if(s)return;let u=d.parent;if(r>=gn.NORTHWEST&&u!==void 0)switch(r){case gn.NORTHWEST:d=d===u.northwestChild?u:void 0;break;case gn.NORTHEAST:d=d===u.northeastChild?u:void 0;break;case gn.SOUTHWEST:d=d===u.southwestChild?u:void 0;break;case gn.SOUTHEAST:d=d===u.southeastChild?u:void 0;break}else d=u}if(d!==void 0){if(d._lastSelectionResult===Kn.RENDERED){if(l(d.data.vertexArray))return;$st(e,t,n,d,r,o,a,c);return}if(Kn.originalResult(i._lastSelectionResult)!==Kn.CULLED)switch(r){case gn.WEST:Xs(e,t,n,i.northwestChild,o,r,!0,a,c),Xs(e,t,n,i.southwestChild,o,r,!0,a,c);break;case gn.EAST:Xs(e,t,n,i.southeastChild,o,r,!0,a,c),Xs(e,t,n,i.northeastChild,o,r,!0,a,c);break;case gn.SOUTH:Xs(e,t,n,i.southwestChild,o,r,!0,a,c),Xs(e,t,n,i.southeastChild,o,r,!0,a,c);break;case gn.NORTH:Xs(e,t,n,i.northeastChild,o,r,!0,a,c),Xs(e,t,n,i.northwestChild,o,r,!0,a,c);break;case gn.NORTHWEST:Xs(e,t,n,i.northwestChild,o,r,!0,a,c);break;case gn.NORTHEAST:Xs(e,t,n,i.northeastChild,o,r,!0,a,c);break;case gn.SOUTHWEST:Xs(e,t,n,i.southwestChild,o,r,!0,a,c);break;case gn.SOUTHEAST:Xs(e,t,n,i.southeastChild,o,r,!0,a,c);break;default:throw new pe("Invalid edge")}}}function $st(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new kV(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),eat(e,t,n,i,o,a)}function eat(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(Zge(e,t,n,r),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let d,u;switch(o){case gn.WEST:d=s.westMeshes,u=s.westTiles;break;case gn.SOUTH:d=s.southMeshes,u=s.southTiles;break;case gn.EAST:d=s.eastMeshes,u=s.eastTiles;break;case gn.NORTH:d=s.northMeshes,u=s.northTiles;break;case gn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case gn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case gn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case gn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||d[0]!==a||d.length!==1,d[0]=a,u[0]=n,d.length=1,u.length=1;return}let m,p,g,f,x=n.rectangle,_,C=i.rectangle;switch(o){case gn.WEST:for(_=(C.north-C.south)*W.EPSILON5,m=0;m<u.length&&(g=u[m],f=g.rectangle,!W.greaterThan(x.north,f.south,_));++m);for(p=m;p<u.length&&(g=u[p],f=g.rectangle,!W.greaterThanOrEquals(x.south,f.north,_));++p);break;case gn.SOUTH:for(_=(C.east-C.west)*W.EPSILON5,m=0;m<u.length&&(g=u[m],f=g.rectangle,!W.lessThan(x.west,f.east,_));++m);for(p=m;p<u.length&&(g=u[p],f=g.rectangle,!W.lessThanOrEquals(x.east,f.west,_));++p);break;case gn.EAST:for(_=(C.north-C.south)*W.EPSILON5,m=0;m<u.length&&(g=u[m],f=g.rectangle,!W.lessThan(x.south,f.north,_));++m);for(p=m;p<u.length&&(g=u[p],f=g.rectangle,!W.lessThanOrEquals(x.north,f.south,_));++p);break;case gn.NORTH:for(_=(C.east-C.west)*W.EPSILON5,m=0;m<u.length&&(g=u[m],f=g.rectangle,!W.greaterThan(x.east,f.west,_));++m);for(p=m;p<u.length&&(g=u[p],f=g.rectangle,!W.greaterThanOrEquals(x.west,f.east,_));++p);break}p-m===1?(s.changedThisFrame=s.changedThisFrame||d[m]!==a,d[m]=a,u[m]=n):(s.changedThisFrame=!0,d.splice(m,p-m,a),u.splice(m,p-m,n))}var LT=new he,tat=new he,NV=new h,q4=new h,J4=new D,Q4=new D,Hd=new D;function wD(){this.height=0,this.encodedNormal=new D}function ED(e,t,n,i,o,r,s,a,c){if(l(o))return o;let d;if(l(r)&&l(s))d=(r.height+s.height)*.5;else if(l(r))d=r.height;else if(l(s))d=s.height;else if(l(a))d=a.height;else{let m=e.tile.data.tileBoundingRegion,p=0,g=0;l(m)&&(p=m.minimumHeight,g=m.maximumHeight),d=(p+g)*.5}return Gge(e,t,n,i,d,c),c}var nat={minimumHeight:0,maximumHeight:0},iat=new h,Tge=new wD,Sge=new wD,Cge=new wD,Vge=new wD,oat=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,rat={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function Zge(e,t,n,i){nm.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,d=a!==1,u=n.tilingScheme.ellipsoid,m=XD(r,u,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,Cge),p=XD(r,u,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,Tge),g=XD(r,u,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,Sge),f=XD(r,u,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,Vge);m=ED(r,u,0,1,m,p,f,g,Cge),p=ED(r,u,0,0,p,m,g,f,Tge),g=ED(r,u,1,1,g,p,f,m,Sge),f=ED(r,u,1,1,f,g,m,p,Vge);let x=p.height,_=g.height,C=m.height,V=f.height,L=Math.min(x,_,C,V),Z=Math.max(x,_,C,V),G=(L+Z)*.5,I,v,P=e.getLevelMaximumGeometricError(n.level),w=u.maximumRadius-P,F=Math.acos(w/u.maximumRadius)*4;if(F*=1.5,s.width>F&&Z-L<=P){let E=new Ma({width:9,height:9,buffer:oat,structure:{heightOffset:Z}}),X=rat;X.tilingScheme=n.tilingScheme,X.x=n.x,X.y=n.y,X.level=n.level,X.exaggeration=a,X.exaggerationRelativeHeight=c,r.mesh=E._createMeshSync(X)}else{let E=d,X=ae.center(s,tat);X.height=G;let A=u.cartographicToCartesian(X,iat),N=new _c(A,void 0,void 0,void 0,void 0,!0,!0,E,a,c),O=5,U;for(U=r.westMeshes,I=0,v=U.length;I<v;++I)O+=U[I].eastIndicesNorthToSouth.length;for(U=r.southMeshes,I=0,v=U.length;I<v;++I)O+=U[I].northIndicesWestToEast.length;for(U=r.eastMeshes,I=0,v=U.length;I<v;++I)O+=U[I].westIndicesSouthToNorth.length;for(U=r.northMeshes,I=0,v=U.length;I<v;++I)O+=U[I].southIndicesEastToWest.length;let Y=nat;Y.minimumHeight=L,Y.maximumHeight=Z;let k=N.stride,H=new Float32Array(O*k),J=0,te=J;J=ID(u,s,N,H,J,0,1,m.height,m.encodedNormal,1,Y),J=PD(r,u,N,H,J,r.westTiles,r.westMeshes,gn.EAST,Y);let z=J;J=ID(u,s,N,H,J,0,0,p.height,p.encodedNormal,0,Y),J=PD(r,u,N,H,J,r.southTiles,r.southMeshes,gn.NORTH,Y);let q=J;J=ID(u,s,N,H,J,1,0,g.height,g.encodedNormal,0,Y),J=PD(r,u,N,H,J,r.eastTiles,r.eastMeshes,gn.WEST,Y);let ee=J;J=ID(u,s,N,H,J,1,1,f.height,f.encodedNormal,1,Y),J=PD(r,u,N,H,J,r.northTiles,r.northMeshes,gn.SOUTH,Y),L=Y.minimumHeight,Z=Y.maximumHeight;let fe=En.fromRectangle(s,L,Z,n.tilingScheme.ellipsoid),_e=Zi.geodeticLatitudeToMercatorAngle(s.south),le=1/(Zi.geodeticLatitudeToMercatorAngle(s.north)-_e),ye=(Zi.geodeticLatitudeToMercatorAngle(X.latitude)-_e)*le,Te=u.geodeticSurfaceNormalCartographic(LT,q4),Xe=wn.octEncode(Te,J4),Le=J;N.encode(H,J*k,fe.center,D.fromElements(.5,.5,Hd),G,Xe,ye,Te),++J;let ke=J,Oe=ke<256?1:2,at=(ke-1)*3,Mt=at*Oe,Lt=(H.length-ke*k)*Float32Array.BYTES_PER_ELEMENT,Ie;if(Lt>=Mt){let Ve=ke*k*Float32Array.BYTES_PER_ELEMENT;Ie=ke<256?new Uint8Array(H.buffer,Ve,at):new Uint16Array(H.buffer,Ve,at)}else Ie=ke<256?new Uint8Array(at):new Uint16Array(at);H=new Float32Array(H.buffer,0,ke*k);let je=0;for(I=0;I<ke-2;++I)Ie[je++]=Le,Ie[je++]=I,Ie[je++]=I+1;Ie[je++]=Le,Ie[je++]=I,Ie[je++]=0;let et=[];for(I=z;I>=te;--I)et.push(I);let He=[];for(I=q;I>=z;--I)He.push(I);let Dt=[];for(I=ee;I>=q;--I)Dt.push(I);let Ce=[];for(Ce.push(0),I=Le-1;I>=ee;--I)Ce.push(I);r.mesh=new tm(N.center,H,Ie,at,ke,L,Z,ce.fromOrientedBoundingBox(fe),mat(e,fe.center,s,L,Z),N.stride,fe,N,et,He,Dt,Ce)}let b=t.context;r._destroyVertexArray(i),r.vertexArray=nm._createVertexArrayForMesh(b,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let R=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let E=o._findAncestorTileWithTerrainData(n);l(E)&&l(E.data.waterMaskTexture)&&(r.waterMaskTexture=E.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,E,r.waterMaskTranslationAndScale))}l(R)&&(--R.referenceCount,R.referenceCount===0&&R.destroy())}function ID(e,t,n,i,o,r,s,a,c,d,u){let m=LT;m.longitude=W.lerp(t.west,t.east,r),m.latitude=W.lerp(t.south,t.north,s),m.height=a;let p=e.cartographicToCartesian(m,NV),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,q4));let f=Q4;return f.x=r,f.y=s,n.encode(i,o*n.stride,p,f,a,c,d,g),u.minimumHeight=Math.min(u.minimumHeight,a),u.maximumHeight=Math.max(u.maximumHeight,a),o+1}var vD=new ae;function Ew(e,t,n,i){let o=e.rectangle,r=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(o=ae.clone(e.rectangle,vD),o.west-=W.TWO_PI,o.east-=W.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=ae.clone(e.rectangle,vD),o.west+=W.TWO_PI,o.east+=W.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,c=(r.east-o.west)/s,d=o.north-o.south,u=(r.south-o.south)/d,m=(r.north-o.south)/d,p=(n.x-a)/(c-a),g=(n.y-u)/(m-u);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(g)<Math.EPSILON5?g=0:Math.abs(g-1)<Math.EPSILON5&&(g=1),i.x=p,i.y=g,i}var sat=new D;function j4(e,t,n,i,o){let r=e.encoding,s=e.vertices;if(o.height=r.decodeHeight(s,t),r.hasVertexNormals)r.getOctEncodedNormal(s,t,o.encodedNormal);else{let a=o.encodedNormal;a.x=0,a.y=0}}var aat=new D,cat=new h;function lat(e,t,n,i,o,r,s,a,c,d){let u=i.encoding,m=i.vertices,p=Ew(t,n,u.decodeTextureCoordinates(m,o,Hd),Hd),g=Ew(t,n,u.decodeTextureCoordinates(m,r,Q4),Q4),f;c?f=(s-p.x)/(g.x-p.x):f=(a-p.y)/(g.y-p.y);let x=u.decodeHeight(m,o),_=u.decodeHeight(m,r),C=n.rectangle;LT.longitude=W.lerp(C.west,C.east,s),LT.latitude=W.lerp(C.south,C.north,a),d.height=LT.height=W.lerp(x,_,f);let V;if(u.hasVertexNormals){let L=u.getOctEncodedNormal(m,o,sat),Z=u.getOctEncodedNormal(m,r,aat),G=wn.octDecode(L.x,L.y,NV),I=wn.octDecode(Z.x,Z.y,cat);V=h.lerp(G,I,f,NV),h.normalize(V,V),wn.octEncode(V,d.encodedNormal)}else V=e.geodeticSurfaceNormalCartographic(LT,NV),wn.octEncode(V,d.encodedNormal)}function Gge(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(LT,NV);wn.octEncode(s,r.encodedNormal)}function XD(e,t,n,i,o,r,s,a,c,d,u){if(Rge(e,t,a,s,!1,n,i,u)||Rge(e,t,d,c,!0,n,i,u))return u;let p;if($4(o,r))return n===0?i===0?p=r.eastIndicesNorthToSouth[0]:p=r.southIndicesEastToWest[0]:i===0?p=r.northIndicesWestToEast[0]:p=r.westIndicesSouthToNorth[0],j4(r,p,n,i,u),u;let g;if(n===0?i===0?g=WD(e.westMeshes,e.westTiles,gn.EAST,e.southMeshes,e.southTiles,gn.NORTH,n,i):g=WD(e.northMeshes,e.northTiles,gn.SOUTH,e.westMeshes,e.westTiles,gn.EAST,n,i):i===0?g=WD(e.southMeshes,e.southTiles,gn.NORTH,e.eastMeshes,e.eastTiles,gn.WEST,n,i):g=WD(e.eastMeshes,e.eastTiles,gn.WEST,e.northMeshes,e.northTiles,gn.SOUTH,n,i),l(g))return Gge(e,t,n,i,g,u),u}function WD(e,t,n,i,o,r,s,a){let c=Lge(e,t,!1,n,s,a),d=Lge(i,o,!0,r,s,a);return l(c)&&l(d)?(c+d)*.5:l(c)?c:d}function PD(e,t,n,i,o,r,s,a,c){for(let d=0;d<r.length;++d)o=dat(e,t,n,i,o,r[d],s[d],a,c);return o}function dat(e,t,n,i,o,r,s,a,c){let d=r.rectangle;a===gn.EAST&&e.tile.x===0?(d=ae.clone(r.rectangle,vD),d.west-=W.TWO_PI,d.east-=W.TWO_PI):a===gn.WEST&&r.x===0&&(d=ae.clone(r.rectangle,vD),d.west+=W.TWO_PI,d.east+=W.TWO_PI);let u=e.tile.rectangle,m,p;o>0&&(n.decodeTextureCoordinates(i,o-1,Hd),m=Hd.x,p=Hd.y);let g,f;switch(a){case gn.WEST:g=s.westIndicesSouthToNorth,f=!1;break;case gn.NORTH:g=s.northIndicesWestToEast,f=!0;break;case gn.EAST:g=s.eastIndicesNorthToSouth,f=!1;break;case gn.SOUTH:g=s.southIndicesEastToWest,f=!0;break}let x=r,_=e.tile,C=s.encoding,V=s.vertices,L=n.stride,Z,G;C.hasWebMercatorT&&(Z=Zi.geodeticLatitudeToMercatorAngle(u.south),G=1/(Zi.geodeticLatitudeToMercatorAngle(u.north)-Z));for(let I=0;I<g.length;++I){let v=g[I],P=C.decodeTextureCoordinates(V,v,Hd);Ew(x,_,P,P);let w=P.x,F=P.y,b=f?w:F;if(b<0||b>1||Math.abs(w-m)<W.EPSILON5&&Math.abs(F-p)<W.EPSILON5)continue;let R=Math.abs(w)<W.EPSILON5||Math.abs(w-1)<W.EPSILON5,E=Math.abs(F)<W.EPSILON5||Math.abs(F-1)<W.EPSILON5;if(R&&E)continue;let X=C.decodePosition(V,v,NV),A=C.decodeHeight(V,v),N;C.hasVertexNormals?N=C.getOctEncodedNormal(V,v,J4):(N=J4,N.x=0,N.y=0);let O=F;if(C.hasWebMercatorT){let Y=W.lerp(u.south,u.north,F);O=(Zi.geodeticLatitudeToMercatorAngle(Y)-Z)*G}let U;n.hasGeodeticSurfaceNormals&&(U=t.geodeticSurfaceNormal(X,q4)),n.encode(i,o*L,X,P,A,N,O,U),c.minimumHeight=Math.min(c.minimumHeight,A),c.maximumHeight=Math.max(c.maximumHeight,A),++o}return o}function Lge(e,t,n,i,o,r){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let d=s;d!==a;d+=c){let u=e[d],m=t[d];if(!$4(m,u))continue;let p;switch(i){case gn.WEST:p=u.westIndicesSouthToNorth;break;case gn.SOUTH:p=u.southIndicesEastToWest;break;case gn.EAST:p=u.eastIndicesNorthToSouth;break;case gn.NORTH:p=u.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return u.encoding.decodeHeight(u.vertices,g)}}function $4(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function Rge(e,t,n,i,o,r,s,a){let c,d,u,m,p,g=i[o?0:n.length-1],f=n[o?0:n.length-1];if($4(g,f)&&(r===0?s===0?(c=o?f.northIndicesWestToEast:f.eastIndicesNorthToSouth,d=o,u=o):(c=o?f.eastIndicesNorthToSouth:f.southIndicesEastToWest,d=!o,u=!1):s===0?(c=o?f.westIndicesSouthToNorth:f.northIndicesWestToEast,d=!o,u=!0):(c=o?f.southIndicesEastToWest:f.westIndicesSouthToNorth,d=o,u=!o),c.length>0)){m=o?0:c.length-1,p=c[m],f.encoding.decodeTextureCoordinates(f.vertices,p,Hd);let x=Ew(g,e.tile,Hd,Hd);if(x.x===r&&x.y===s)return j4(f,p,r,s,a),!0;if(m=Eo(c,d?r:s,function(_,C){f.encoding.decodeTextureCoordinates(f.vertices,_,Hd);let V=Ew(g,e.tile,Hd,Hd);return u?d?V.x-r:V.y-s:d?r-V.x:s-V.y}),m<0){if(m=~m,m>0&&m<c.length)return lat(t,g,e.tile,f,c[m-1],c[m],r,s,d,a),!0}else return j4(f,c[m],r,s,a),!0}return!1}var uat=[new h,new h,new h,new h];function mat(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=uat;return h.fromRadians(n.west,n.south,o,a,c[0]),h.fromRadians(n.east,n.south,o,a,c[1]),h.fromRadians(n.west,n.north,o,a,c[2]),h.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var UV=kV;function nr(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.showWaterEffect=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=_n.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new be,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(nr.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(nr.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(nr.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(nr.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new be,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new B(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this.cartographicLimitRectangle=ae.clone(ae.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0}Object.defineProperties(nr.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=se.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},tilingScheme:{get:function(){if(l(this._terrainProvider))return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){hs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){km.setOwner(e,this,"_clippingPolygons")}}});function hat(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}nr.prototype.update=function(e){this._imageryLayers._update()};function fat(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let o=e._imageryLayers;for(let r=0,s=o.length;r<s;++r){let a=o.get(r);a.ready&&a.show&&l(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}nr.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(hat)})),fat(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)nm._freeVertexArray(t[i]);t.length=0};nr.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let o=0,r=t.length;o<r;++o){let s=t[o];l(s)&&(s.length=0)}let n=this._clippingPlanes;l(n)&&n.enabled&&n.update(e);let i=this._clippingPolygons;l(i)&&i.enabled&&(i.update(e),i.queueCommands(e)),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};nr.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=Ue.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:nc.LESS}}),this._blendRenderState=Ue.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:nc.LESS_OR_EQUAL},blending:un.ALPHA_BLEND});let s=Ye(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=Ue.fromCache(s),s=Ye(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=Ue.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&UV.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);let t=this.quadtree,n=e.verticalExaggeration,i=e.verticalExaggerationRelativeHeight,o=this._oldVerticalExaggeration!==n||this._oldVerticalExaggerationRelativeHeight!==i;this._oldVerticalExaggeration=n,this._oldVerticalExaggerationRelativeHeight=i,o&&t.forEachLoadedTile(function(s){s.data.updateExaggeration(s,e,t)});let r=this._tilesToRenderByTextureCount;for(let s=0,a=r.length;s<a;++s){let c=r[s];if(l(c))for(let d=0,u=c.length;d<u;++d){let m=c[d],p=m.data.tileBoundingRegion;Mat(this,m,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function Pge(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}nr.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)Pge(t[n],e)};nr.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};nr.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};nr.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===Kn.CULLED_BUT_NEEDED,o=n.terrainState),nm.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i),n=t.data,i&&o!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==mr.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,nm.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var pat=new ce,vge=new ae,bat=new ae,gat=new he;function AD(e,t){if(t.west<t.east)return t;let n=ae.clone(t,bat);return ae.center(e,gat).longitude>0?n.east=W.PI:n.west=-W.PI,n}function wge(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(l(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(l(i)&&i.enabled||!ae.equals(e.cartographicLimitRectangle,ae.MAX_VALUE))}nr.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=wge(this,t);if(t.fog.enabled&&!o&&W.fog(i,t.fog.density)>=1)return mr.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return mr.PARTIAL;let a=t.cullingVolume,c=s.boundingVolume;l(c)||(c=s.boundingSphere),r.clippedByBoundaries=!1;let d=AD(e.rectangle,this.cartographicLimitRectangle),u=ae.simpleIntersection(d,e.rectangle,vge);if(!l(u))return mr.NONE;if(ae.equals(u,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==oe.SCENE3D&&(c=pat,ce.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,c),h.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===oe.MORPHING&&l(r.renderedMesh)&&(c=ce.union(s.boundingSphere,c,c))),!l(c))return mr.PARTIAL;let m=this._clippingPlanes;if(l(m)&&m.enabled){let _=m.computeIntersectionWithBoundingVolume(c);if(e.isClipped=_!==Jt.INSIDE,_===Jt.OUTSIDE)return mr.NONE}let p=this._clippingPolygons;if(l(p)&&p.enabled){let _=p.computeIntersectionWithBoundingVolume(s);e.isClipped=_!==Jt.OUTSIDE}let g,f=a.computeVisibility(c);if(f===Jt.OUTSIDE?g=mr.NONE:f===Jt.INTERSECTING?g=mr.PARTIAL:f===Jt.INSIDE&&(g=mr.FULL),g===mr.NONE)return g;let x=t.mode===oe.SCENE3D&&t.camera.frustum instanceof an;if(t.mode===oe.SCENE3D&&!x&&l(n)&&!o){let _=r.occludeePointInScaledSpace;return!l(_)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(_,s.minimumHeight)?g:mr.NONE}return g};nr.prototype.canRefine=function(e){return l(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var yat=[],xat=[];nr.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=yat;i.length=this._imageryLayers.length;let o=!1,r=!1,s;l(n)&&(o=n.terrainState===co.READY,r=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=r;if(l(s))for(a=0,c=s.length;a<c;++a){let m=s[a],p=m.loadingImagery,g=!l(p)||p.state===ai.FAILED||p.state===ai.INVALID,f=(m.loadingImagery||m.readyImagery).imageryLayer._layerIndex;i[f]=g&&i[f]}let d=this.quadtree._lastSelectionFrameNumber,u=xat;for(u.length=0,u.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);u.length>0;){let m=u.pop(),p=m._lastSelectionResultFrame===d?m._lastSelectionResult:Kn.NONE;if(p===Kn.RENDERED){let g=m.data;if(!l(g))continue;if(!o&&m.data.terrainState===co.READY)return!1;let f=m.data.imagery;for(a=0,c=f.length;a<c;++a){let x=f[a],_=x.loadingImagery,C=!l(_)||_.state===ai.FAILED||_.state===ai.INVALID,V=(x.loadingImagery||x.readyImagery).imageryLayer._layerIndex;if(C&&!i[V])return!1}}else p===Kn.REFINED&&u.push(m.southwestChild,m.southeastChild,m.northwestChild,m.northeastChild)}return!0};var _at=new h;nr.prototype.computeTileLoadPriority=function(e,t){let n=e.data;if(n===void 0)return 0;let i=n.tileBoundingRegion.boundingVolume;if(i===void 0)return 0;let o=t.camera.positionWC,r=t.camera.directionWC,s=h.subtract(i.center,o,_at),a=h.magnitude(s);return a<W.EPSILON5?0:(h.divideByScalar(s,a,s),(1-h.dot(s,r))*e._distance)};var Ege=new M,FD=new M,Tat=new se,Sat=new se,Cat=new se,Vat=new h,Ige=new h,Lat=new h,Rat=new h;nr.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,c=i.length;a<c;++a){let d=i[a];l(d.readyImagery)&&d.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];l(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var Zat=[new h,new h,new h,new h];function Xge(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=Zat;return h.fromRadians(n.west,n.south,o,a,c[0]),h.fromRadians(n.east,n.south,o,a,c[1]),h.fromRadians(n.west,n.north,o,a,c[2]),h.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}nr.prototype.computeDistanceToTile=function(e,t){Gat(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let o=n.tileBoundingRegion,r=o.minimumHeight,s=o.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,d=Math.abs(c-r),u=Math.abs(c-s);d>u?(o.minimumHeight=r,o.maximumHeight=r):(o.minimumHeight=s,o.maximumHeight=s)}let a=o.distanceToCamera(t);return o.minimumHeight=r,o.maximumHeight=s,a};function Gat(e,t,n){let i=e.data;i===void 0&&(i=e.data=new nm);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Mu({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,c=!1,d=e,u=i.mesh,m=i.terrainData;if(u!==void 0&&u.minimumHeight!==void 0&&u.maximumHeight!==void 0)r.minimumHeight=u.minimumHeight,r.maximumHeight=u.maximumHeight,c=!0;else if(m!==void 0&&m._minimumHeight!==void 0&&m._maximumHeight!==void 0)r.minimumHeight=m._minimumHeight,r.maximumHeight=m._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let g=p.data;if(g!==void 0){let f=g.mesh,x=g.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0){r.minimumHeight=f.minimumHeight,r.maximumHeight=f.maximumHeight;break}else if(x!==void 0&&x._minimumHeight!==void 0&&x._maximumHeight!==void 0){r.minimumHeight=x._minimumHeight,r.maximumHeight=x._maximumHeight;break}}p=p.parent}d=p}if(d!==void 0){let p=n.verticalExaggeration,g=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,r.minimumHeight=_r.getHeight(r.minimumHeight,p,g),r.maximumHeight=_r.getHeight(r.maximumHeight,p,g)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=En.clone(u.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=ce.clone(u.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=h.clone(u.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=Xge(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let x=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||x)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=Xge(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=d,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}nr.prototype.isDestroyed=function(){return!1};nr.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),me(this)};function Eat(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,c=a.length,d;for(d=0;d<c;++d)if(o=a[d],r=y(o.readyImagery,o.loadingImagery),r.imageryLayer===t){s=d;break}if(s!==-1){let u=s+e;if(o=a[u],r=l(o)?y(o.readyImagery,o.loadingImagery):void 0,!l(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,u);for(d=s;d<u;++d)a[d].freeResources();a.splice(s,e)}return!0}}nr.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let n=this._terrainProvider,i=this,o=this._imageryLayersUpdatedEvent,r=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(l(s._loadedCallbacks[e._layerIndex]))return;let a,c=s.data.imagery,d=c.length,u=-1,m=0;for(a=0;a<d;++a){let g=c[a];if(y(g.readyImagery,g.loadingImagery).imageryLayer===e)u===-1&&(u=a),++m;else if(u!==-1)break}if(u===-1)return;let p=u+m;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=Eat(m,e,n),s.state=js.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=js.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==Kn.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};nr.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,o=-1,r=0;for(let s=0,a=i.length;s<a;++s){let c=i[s],d=c.loadingImagery;if(l(d)||(d=c.readyImagery),d.imageryLayer===e)o===-1&&(o=s),c.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),l(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};nr.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};nr.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var Iat=new M,Xat=new M;function Wge(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_verticalExaggerationAndRelativeHeight:function(){return this.properties.verticalExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,o=M.multiplyByPoint(i,this.properties.rtc,Ige);return M.setTranslation(i,o,Ege),Ege},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=M.multiplyByPoint(i,this.properties.rtc,Ige);return M.setTranslation(i,r,FD),M.multiply(o,FD,FD),FD},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=l(i)?M.multiply(e.context.uniformState.view,i.modelMatrix,Iat):M.IDENTITY;return M.inverseTranspose(o,Xat)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_clippingDistance:function(){let i=t._clippingPolygons.clippingTexture;return l(i)?i:e.context.defaultTexture},u_clippingExtents:function(){let i=t._clippingPolygons.extentsTexture;return l(i)?i:e.context.defaultTexture},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},properties:{initialColor:new se(0,0,.5,1),fillHighlightColor:new B(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new D(65e5,9e6),nightFadeDistance:new D(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new h(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new h(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new h,center3D:void 0,rtc:new h,modifiedModelView:new M,tileRectangle:new se,verticalExaggerationAndRelativeHeight:new D(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new D,southMercatorYAndOneOverHeight:new D,waterMask:void 0,waterMaskTranslationAndScale:new se,minMaxHeight:new D,scaleAndBias:new M,clippingPlanesEdgeColor:B.clone(B.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new se,frontFaceAlphaByDistance:new se,backFaceAlphaByDistance:new se,localizedTranslucencyRectangle:new se,undergroundColor:B.clone(B.TRANSPARENT),undergroundColorAlphaByDistance:new se,lambertDiffuseMultiplier:0,vertexShadowDarkness:0}};return l(t.materialUniformMap)?Tt(n,t.materialUniformMap):n}function Wat(e,t,n){let i=n.data,o,r;if(l(i.vertexArray)?(o=i.mesh,r=i.vertexArray):l(i.fill)&&l(i.fill.vertexArray)&&(o=i.fill.mesh,r=i.fill.vertexArray),!(!l(o)||!l(r))){if(l(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===o)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=Pat(e,r,o),i.wireframeVertexArray.mesh=o}}function Pat(e,t,n){let o={indices:n.indices,primitiveType:Fe.TRIANGLES};Fn.toWireframe(o);let r=o.indices,s=xt.createIndexBuffer({context:e,typedArray:r,usage:Me.STATIC_DRAW,indexDatatype:Ae.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new ti({context:e,attributes:t._attributes,indexBuffer:s})}var Fge,Age,MD;(function(){let e=new Gt({geometry:Lm.fromDimensions({dimensions:new h(2,2,2)})}),t=new Gt({geometry:new Tb({radius:1})}),n=new M,i,o;function r(s){return new In({geometryInstances:s,appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1})}Fge=function(s,a){return s===i||(MD(),i=s,n=M.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Kt.fromColor(a),o=r(e)),o},Age=function(s,a){return s===i||(MD(),i=s,n=M.fromTranslation(s.center,n),n=M.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Kt.fromColor(a),o=r(t)),o},MD=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var vat=new se(0,0,0,0),wat={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,enableClippingPolygons:void 0,clippingPolygons:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0},Fat=B.TRANSPARENT,Aat=new Ut;function Mat(e,t,n){let i=t.data;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new UV(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(l(r)&&l(r.credits)){let Ve=r.credits;for(let ct=0,Di=Ve.length;ct<Di;++ct)o.addCreditToNextFrame(Ve[ct])}let s=Bt.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(a)&&l(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let d=n.cameraUnderground,u=n.globeTranslucencyState,m=u.translucent,p=u.frontFaceAlphaByDistance,g=u.backFaceAlphaByDistance,f=u.rectangle,x=y(e.undergroundColor,Fat),_=y(e.undergroundColorAlphaByDistance,Aat),C=wge(e,n)&&n.mode===oe.SCENE3D&&x.alpha>0&&(_.nearValue>0||_.farValue>0),V=e.lambertDiffuseMultiplier,L=e.vertexShadowDarkness,Z=e.hasWaterMask&&l(a),G=Z&&e.showWaterEffect,I=e.oceanNormalMap,v=G&&l(I),P=e.terrainProvider,w=l(P)&&e.terrainProvider.hasVertexNormals,F=n.fog.enabled&&n.fog.renderable&&!d,b=e.showGroundAtmosphere&&n.mode===oe.SCENE3D,R=_n.castShadows(e.shadows)&&!m,E=_n.receiveShadows(e.shadows)&&!m,X=e.hueShift,A=e.saturationShift,N=e.brightnessShift,O=!(W.equalsEpsilon(X,0,W.EPSILON7)&&W.equalsEpsilon(A,0,W.EPSILON7)&&W.equalsEpsilon(N,0,W.EPSILON7)),U=!1;if(b){let Ve=h.magnitude(n.camera.positionWC),ct=e.nightFadeOutDistance;U=Ve>ct}Z&&--s,v&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--s,--s),s-=u.numberOfTextureUniforms;let Y=i.renderedMesh,k=Y.center,H=Y.encoding,J=i.tileBoundingRegion,te=n.verticalExaggeration,z=n.verticalExaggerationRelativeHeight,q=te!==1,ee=H.hasGeodeticSurfaceNormals,fe=Tat,_e=0,le=0,ye=0,Te=0,Xe=!1;if(n.mode!==oe.SCENE3D){let Ve=n.mapProjection,ct=Ve.project(ae.southwest(t.rectangle),Lat),Di=Ve.project(ae.northeast(t.rectangle),Rat);if(fe.x=ct.x,fe.y=ct.y,fe.z=Di.x,fe.w=Di.y,n.mode!==oe.MORPHING&&(k=Vat,k.x=0,k.y=(fe.z+fe.x)*.5,k.z=(fe.w+fe.y)*.5,fe.x-=k.y,fe.y-=k.z,fe.z-=k.y,fe.w-=k.z),n.mode===oe.SCENE2D&&H.quantization===Qs.BITS12){let mt=1/(Math.pow(2,12)-1)*.5,_o=(fe.z-fe.x)*mt,fr=(fe.w-fe.y)*mt;fe.x-=_o,fe.y-=fr,fe.z+=_o,fe.w+=fr}Ve instanceof Zi&&(_e=t.rectangle.south,le=t.rectangle.north,ye=Zi.geodeticLatitudeToMercatorAngle(_e),Te=1/(Zi.geodeticLatitudeToMercatorAngle(le)-ye),Xe=!0)}let Le=wat;Le.frameState=n,Le.surfaceTile=i,Le.hasWaterMask=Z,Le.showReflectiveOcean=G,Le.showOceanWaves=v,Le.enableLighting=e.enableLighting,Le.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Le.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Le.showGroundAtmosphere=b,Le.atmosphereLightIntensity=e.atmosphereLightIntensity,Le.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Le.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Le.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Le.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Le.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Le.perFragmentGroundAtmosphere=U,Le.hasVertexNormals=w,Le.useWebMercatorProjection=Xe,Le.clippedByBoundaries=i.clippedByBoundaries,Le.hasGeodeticSurfaceNormals=ee,Le.hasExaggeration=q;let ke=i.imagery,Oe=0,at=ke.length,Mt=e.showSkirts&&!d&&!m,Lt=e.backFaceCulling&&!d&&!m,Ie=Lt?e._renderState:e._disableCullingRenderState,je=Lt?e._blendRenderState:e._disableCullingBlendRenderState,et=Ie,He=e._firstPassInitialColor,Dt=n.context;if(l(e._debug.boundingSphereTile)||MD(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let Ve=e._drawCommands.length;for(let ct=0;ct<Ve;++ct)e._uniformMaps[ct]=Wge(n,e)}do{let Ve=0,ct,Di;if(e._drawCommands.length<=e._usedDrawCommands?(ct=new tt,ct.owner=t,ct.cull=!1,ct.boundingVolume=new ce,ct.orientedBoundingBox=void 0,Di=Wge(n,e),e._drawCommands.push(ct),e._uniformMaps.push(Di)):(ct=e._drawCommands[e._usedDrawCommands],Di=e._uniformMaps[e._usedDrawCommands]),ct.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let Ta=J.boundingVolume,bo=J.boundingSphere;l(Ta)?Fge(Ta,B.RED).update(n):l(bo)&&Age(bo,B.RED).update(n)}let mt=Di.properties;se.clone(He,mt.initialColor),mt.oceanNormalMap=I,mt.lightingFadeDistance.x=e.lightingFadeOutDistance,mt.lightingFadeDistance.y=e.lightingFadeInDistance,mt.nightFadeDistance.x=e.nightFadeOutDistance,mt.nightFadeDistance.y=e.nightFadeInDistance,mt.atmosphereLightIntensity=e.atmosphereLightIntensity,mt.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,mt.atmosphereMieCoefficient=e.atmosphereMieCoefficient,mt.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,mt.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,mt.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,mt.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let _o=d?g:p,fr=d?p:g;l(_o)&&(se.fromElements(_o.near,_o.nearValue,_o.far,_o.farValue,mt.frontFaceAlphaByDistance),se.fromElements(fr.near,fr.nearValue,fr.far,fr.farValue,mt.backFaceAlphaByDistance)),se.fromElements(_.near,_.nearValue,_.far,_.farValue,mt.undergroundColorAlphaByDistance),B.clone(x,mt.undergroundColor),mt.lambertDiffuseMultiplier=V,mt.vertexShadowDarkness=L;let Zc=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;Zc&&B.clone(e.fillHighlightColor,mt.fillHighlightColor),mt.verticalExaggerationAndRelativeHeight.x=te,mt.verticalExaggerationAndRelativeHeight.y=z,mt.center3D=Y.center,h.clone(k,mt.rtc),se.clone(fe,mt.tileRectangle),mt.southAndNorthLatitude.x=_e,mt.southAndNorthLatitude.y=le,mt.southMercatorYAndOneOverHeight.x=ye,mt.southMercatorYAndOneOverHeight.y=Te;let Zr=Sat,ss=AD(t.rectangle,e.cartographicLimitRectangle),Ne=Cat,ut=AD(t.rectangle,f);h.fromElements(X,A,N,mt.hsbShift);let Je=t.rectangle,$e=1/Je.width,pt=1/Je.height;Zr.x=(ss.west-Je.west)*$e,Zr.y=(ss.south-Je.south)*pt,Zr.z=(ss.east-Je.west)*$e,Zr.w=(ss.north-Je.south)*pt,se.clone(Zr,mt.localizedCartographicLimitRectangle),Ne.x=(ut.west-Je.west)*$e,Ne.y=(ut.south-Je.south)*pt,Ne.z=(ut.east-Je.west)*$e,Ne.w=(ut.north-Je.south)*pt,se.clone(Ne,mt.localizedTranslucencyRectangle);let It=F&&W.fog(t._distance,n.fog.density)>W.EPSILON3;O=O&&(It||b);let yn=!1,po=!1,rr=!1,Oa=!1,Ya=!1,as=!1,Qn=!1,xs=!1,Gr=!1,hl=!1;for(;Ve<s&&Oe<at;){let Ta=ke[Oe],bo=Ta.readyImagery;if(++Oe,!l(bo)||bo.imageryLayer.alpha===0)continue;let T0=Ta.useWebMercatorT?bo.textureWebMercator:bo.texture,di=bo.imageryLayer;l(Ta.textureTranslationAndScale)||(Ta.textureTranslationAndScale=di._calculateTextureTranslationAndScale(t,Ta)),mt.dayTextures[Ve]=T0,mt.dayTextureTranslationAndScale[Ve]=Ta.textureTranslationAndScale,mt.dayTextureTexCoordsRectangle[Ve]=Ta.textureCoordinateRectangle,mt.dayTextureUseWebMercatorT[Ve]=Ta.useWebMercatorT,mt.dayTextureAlpha[Ve]=di.alpha,as=as||mt.dayTextureAlpha[Ve]!==1,mt.dayTextureNightAlpha[Ve]=di.nightAlpha,Qn=Qn||mt.dayTextureNightAlpha[Ve]!==1,mt.dayTextureDayAlpha[Ve]=di.dayAlpha,Qn=Qn||mt.dayTextureDayAlpha[Ve]!==1,mt.dayTextureBrightness[Ve]=di.brightness,yn=yn||mt.dayTextureBrightness[Ve]!==ka.DEFAULT_BRIGHTNESS,mt.dayTextureContrast[Ve]=di.contrast,po=po||mt.dayTextureContrast[Ve]!==ka.DEFAULT_CONTRAST,mt.dayTextureHue[Ve]=di.hue,rr=rr||mt.dayTextureHue[Ve]!==ka.DEFAULT_HUE,mt.dayTextureSaturation[Ve]=di.saturation,Oa=Oa||mt.dayTextureSaturation[Ve]!==ka.DEFAULT_SATURATION,mt.dayTextureOneOverGamma[Ve]=1/di.gamma,Ya=Ya||mt.dayTextureOneOverGamma[Ve]!==1/ka.DEFAULT_GAMMA,mt.dayTextureSplit[Ve]=di.splitDirection,xs=xs||mt.dayTextureSplit[Ve]!==0;let Gc=mt.dayTextureCutoutRectangles[Ve];if(l(Gc)||(Gc=mt.dayTextureCutoutRectangles[Ve]=new se),se.clone(se.ZERO,Gc),l(di.cutoutRectangle)){let So=AD(Je,di.cutoutRectangle),su=ae.simpleIntersection(So,Je,vge);Gr=l(su)||Gr,Gc.x=(So.west-Je.west)*$e,Gc.y=(So.south-Je.south)*pt,Gc.z=(So.east-Je.west)*$e,Gc.w=(So.north-Je.south)*pt}let nd=mt.colorsToAlpha[Ve];l(nd)||(nd=mt.colorsToAlpha[Ve]=new se);let ru=l(di.colorToAlpha)&&di.colorToAlphaThreshold>0;if(hl=hl||ru,ru){let So=di.colorToAlpha;nd.x=So.red,nd.y=So.green,nd.z=So.blue,nd.w=di.colorToAlphaThreshold}else nd.w=-1;if(l(bo.credits)){let So=bo.credits;for(let su=0,TS=So.length;su<TS;++su)o.addCreditToNextFrame(So[su])}++Ve}mt.dayTextures.length=Ve,mt.waterMask=a,se.clone(c,mt.waterMaskTranslationAndScale),mt.minMaxHeight.x=H.minimumHeight,mt.minMaxHeight.y=H.maximumHeight,M.clone(H.matrix,mt.scaleAndBias);let To=e._clippingPlanes,Hr=l(To)&&To.enabled&&t.isClipped;Hr&&(mt.clippingPlanesEdgeColor=B.clone(To.edgeColor,mt.clippingPlanesEdgeColor),mt.clippingPlanesEdgeWidth=To.edgeWidth);let rp=e._clippingPolygons,fl=l(rp)&&rp.enabled&&t.isClipped;Le.numberOfDayTextures=Ve,Le.applyBrightness=yn,Le.applyContrast=po,Le.applyHue=rr,Le.applySaturation=Oa,Le.applyGamma=Ya,Le.applyAlpha=as,Le.applyDayNightAlpha=Qn,Le.applySplit=xs,Le.enableFog=It,Le.enableClippingPlanes=Hr,Le.clippingPlanes=To,Le.enableClippingPolygons=fl,Le.clippingPolygons=rp,Le.hasImageryLayerCutout=Gr,Le.colorCorrect=O,Le.highlightFillTile=Zc,Le.colorToAlpha=hl,Le.showUndergroundColor=C,Le.translucent=m;let sp=i.renderedMesh.indices.length;Mt||(sp=i.renderedMesh.indexCountWithoutSkirts),ct.shaderProgram=e._surfaceShaderSet.getShaderProgram(Le),ct.castShadows=R,ct.receiveShadows=E,ct.renderState=et,ct.primitiveType=Fe.TRIANGLES,ct.vertexArray=i.vertexArray||i.fill.vertexArray,ct.count=sp,ct.uniformMap=Di,ct.pass=Ge.GLOBE,e._debug.wireframe&&(Wat(Dt,e,t),l(i.wireframeVertexArray)&&(ct.vertexArray=i.wireframeVertexArray,ct.primitiveType=Fe.LINES,ct.count=sp*2));let Ha=ct.boundingVolume,Er=ct.orientedBoundingBox;n.mode!==oe.SCENE3D?(ce.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,J.minimumHeight,J.maximumHeight,Ha),h.fromElements(Ha.center.z,Ha.center.x,Ha.center.y,Ha.center),n.mode===oe.MORPHING&&(Ha=ce.union(J.boundingSphere,Ha,Ha))):(ct.boundingVolume=ce.clone(J.boundingSphere,Ha),ct.orientedBoundingBox=En.clone(J.boundingVolume,Er)),ct.dirty=!0,m&&u.updateDerivedCommands(ct,n),Pge(ct,n),et=je,He=vat}while(Oe<at)}var Iw=nr;var IZi=T(S(),1);function Mge(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ae.clone(ae.MAX_VALUE)}Object.defineProperties(Mge.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=Ut.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=Ut.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=ae.clone(ae.MAX_VALUE)),ae.clone(e,this._rectangle)}}});var Xw=Mge;var NZi=T(S(),1);function Ws(){this._layers=[],this.layerAdded=new be,this.layerRemoved=new be,this.layerMoved=new be,this.layerShownOrHidden=new be}Object.defineProperties(Ws.prototype,{length:{get:function(){return this._layers.length}}});Ws.prototype.add=function(e,t){l(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};Ws.prototype.addImageryProvider=function(e,t){let n=new ka(e);return this.add(n,t),n};Ws.prototype.remove=function(e,t){t=y(t,!0);let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};Ws.prototype.removeAll=function(e){e=y(e,!0);let t=this._layers;for(let n=0,i=t.length;n<i;n++){let o=t[n];this.layerRemoved.raiseEvent(o,n),e&&o.destroy()}this._layers=[]};Ws.prototype.contains=function(e){return this.indexOf(e)!==-1};Ws.prototype.indexOf=function(e){return this._layers.indexOf(e)};Ws.prototype.get=function(e){return this._layers[e]};function ND(e,t){return e.indexOf(t)}function Nge(e,t,n){let i=e._layers;if(t=W.clamp(t,0,i.length-1),n=W.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e._update(),e.layerMoved.raiseEvent(o,n,t)}Ws.prototype.raise=function(e){let t=ND(this._layers,e);Nge(this,t,t+1)};Ws.prototype.lower=function(e){let t=ND(this._layers,e);Nge(this,t,t-1)};Ws.prototype.raiseToTop=function(e){let t=ND(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))};Ws.prototype.lowerToBottom=function(e){let t=ND(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var Nat=new ae;function kge(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let a=0;!l(r)&&a<o.length;++a){let c=o[a];ae.contains(c.rectangle,t)&&(r=c)}if(!l(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],d=c.readyImagery;if(!l(d)||!d.imageryLayer.ready)continue;let u=d.imageryLayer.imageryProvider;if(n&&!l(u.pickFeatures)||!ae.contains(d.rectangle,t))continue;let m=Nat,p=1/1024;m.west=W.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-p),m.east=W.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+p),m.south=W.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-p),m.north=W.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+p),ae.contains(m,t)&&i(d)}}Ws.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(kge(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};Ws.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[],r=[];if(kge(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let c=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);l(c)&&(o.push(c),r.push(s.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(s){let a=[];for(let c=0;c<s.length;++c){let d=s[c],u=r[c];if(l(d)&&d.length>0)for(let m=0;m<d.length;++m){let p=d[m];p.imageryLayer=u,l(p.position)||(p.position=i),a.push(p)}}return a})};Ws.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Ws.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Ws.prototype.isDestroyed=function(){return!1};Ws.prototype.destroy=function(){return this.removeAll(!0),me(this)};Ws.prototype._update=function(){let e=!0,t=this._layers,n,i,o,r;for(o=0,r=t.length;o<r;++o)i=t[o],i._layerIndex=o,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(o=0,r=n.length;o<r;++o)i=n[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var Ww=Ws;var xGi=T(S(),1);var BZi=T(S(),1);function Uge(e){this._ellipsoid=new Xb(e.ellipsoid,h.ZERO)}Object.defineProperties(Uge.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var Pw=Uge;var JZi=T(S(),1);function rl(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=Kn.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=js.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}rl.createLevelZeroTiles=function(e){let t=e.getNumberOfXTilesAtLevel(0),n=e.getNumberOfYTilesAtLevel(0),i=new Array(t*n),o=0;for(let r=0;r<n;++r)for(let s=0;s<t;++s)i[o++]=new rl({tilingScheme:e,x:s,y:r,level:0});return i};rl.prototype._updateCustomData=function(e,t,n){let i=this.customData,o,r,s;if(l(t)&&l(n)){for(i=i.filter(function(a){return n.indexOf(a)===-1}),this._customData=i,s=this._rectangle,o=0;o<t.length;++o)r=t[o],ae.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=e}else{let a=this._parent;if(l(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let c=a.customData;for(o=0;o<c.length;++o)r=c[o],ae.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(rl.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return l(this._southwestChild)||(this._southwestChild=new rl({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return l(this._southeastChild)||(this._southeastChild=new rl({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return l(this._northwestChild)||(this._northwestChild=new rl({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return l(this._northeastChild)||(this._northeastChild=new rl({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<js.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});rl.prototype.findLevelZeroTile=function(e,t,n){let i=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=i:t>=i&&(t-=i),!(n<0||n>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(o){return o.x===t&&o.y===n})[0]};rl.prototype.findTileToWest=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;let n=t.findTileToWest(e);if(n!==void 0)return t.southwestChild===this?n.southeastChild:n.northeastChild};rl.prototype.findTileToEast=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;let n=t.findTileToEast(e);if(n!==void 0)return t.southeastChild===this?n.southwestChild:n.northwestChild};rl.prototype.findTileToSouth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;let n=t.findTileToSouth(e);if(n!==void 0)return t.southwestChild===this?n.northwestChild:n.northeastChild};rl.prototype.findTileToNorth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;let n=t.findTileToNorth(e);if(n!==void 0)return t.northwestChild===this?n.southwestChild:n.southeastChild};rl.prototype.freeResources=function(){this.state=js.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),kD(this._southwestChild),this._southwestChild=void 0,kD(this._southeastChild),this._southeastChild=void 0,kD(this._northwestChild),this._northwestChild=void 0,kD(this._northeastChild),this._northeastChild=void 0};function kD(e){l(e)&&e.freeResources()}var vw=rl;var qZi=T(S(),1);function UD(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}UD.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};UD.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),Dge(this,t)),t=i}};function Dge(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}UD.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&Dge(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var ww=UD;function om(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new ww,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=y(e.maximumScreenSpaceError,2),this.tileCacheSize=y(e.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new Pw({ellipsoid:n}),this._tileLoadProgressEvent=new be,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(om.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});om.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function kat(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,Oge(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let r=n[i].customData,s=r.length;for(let a=0;a<s;++a){let c=r[a];c.level=0,e._addHeightCallbacks.push(c)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}om.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==js.START&&e(t),t=t.replacementNext};om.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};om.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let o=n._addHeightCallbacks,r=o.length;for(let s=0;s<r;++s)if(o[s]===i){o.splice(s,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};om.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function Oge(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}om.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(kat(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),Oge(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};om.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),Oat(this,e),ect(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function Uat(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=be.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(o(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(o,r){return Math.max(o,r.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}om.prototype.endFrame=function(e){!e.passes.render||e.mode===oe.MORPHING||(Qat(this,e),$at(this,e),Uat(this,e))};om.prototype.isDestroyed=function(){return!1};om.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var Aw,Bge=new he;function Dat(e,t){let n=ae.center(e.rectangle,Bge),i=n.longitude-Aw.longitude,o=n.latitude-Aw.latitude;n=ae.center(t.rectangle,Bge);let r=n.longitude-Aw.longitude,s=n.latitude-Aw.latitude;return i*i+o*o-(r*r+s*s)}var Bat=new h,Fw=[];function Oat(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o,r=e._tileProvider;if(!l(e._levelZeroTiles)){let x=r.tilingScheme;if(l(x)){let _=r.tilingScheme;e._levelZeroTiles=vw.createLevelZeroTiles(_);let C=e._levelZeroTiles.length;if(Fw.length<C)for(Fw=new Array(C),o=0;o<C;++o)Fw[o]===void 0&&(Fw[o]=new Mw)}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,c=a.length>1?e._occluders:void 0;Aw=t.camera.positionCartographic,a.sort(Dat);let d=e._addHeightCallbacks,u=e._removeHeightCallbacks,m=t.frameNumber,p;if(d.length>0||u.length>0){for(o=0,p=a.length;o<p;++o)s=a[o],s._updateCustomData(m,d,u);d.length=0,u.length=0}let g=t.camera;e._cameraPositionCartographic=g.positionCartographic;let f=M.getTranslation(g.transform,Bat);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(f,e._cameraReferenceFrameOriginCartographic),o=0,p=a.length;o<p;++o)s=a[o],e._tileReplacementQueue.markTileRendered(s),s.renderable?Ua(e,s,r,t,c,!1,Fw[o]):(i0(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=m}function i0(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function Mw(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function Yge(){this.southwest=new Mw,this.southeast=new Mw,this.northwest=new Mw,this.northeast=new Mw}Yge.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,o=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&o.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||o.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+o.notYetRenderableCount};var nj=new Array(31);for(let e=0;e<nj.length;++e)nj[e]=new Yge;function Yat(e,t,n,i,o){let r=e._debug;++r.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n._updateCustomData(t.frameNumber),n.level>r.maxDepthVisited&&(r.maxDepthVisited=n.level);let s=Kat(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,d=n.northwestChild,u=n.northeastChild,m=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===m?n._lastSelectionResult:Kn.NONE,g=e.tileProvider;if(s||i){let f=Kn.originalResult(p)===Kn.RENDERED,x=Kn.originalResult(p)===Kn.CULLED||p===Kn.NONE,_=n.state===js.DONE,C=f||x||_;if(C||l(g.canRenderWithoutLosingDetail)&&(C=g.canRenderWithoutLosingDetail(n)),C){s&&i0(e,e._tileLoadQueueMedium,n,t),DD(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Kn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Kn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&i0(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&d.upsampledFromParent&&u.upsampledFromParent){DD(e,n),i0(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(d),e._tileReplacementQueue.markTileRendered(u),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Kn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Kn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Kn.REFINED;let x=e._tilesToRender.length,_=e._tileLoadQueueLow.length,C=e._tileLoadQueueMedium.length,V=e._tileLoadQueueHigh.length,L=e._tileToUpdateHeights.length;if(Hat(e,a,c,d,u,t,i,o),x!==e._tilesToRender.length){let Z=o.allAreRenderable,G=o.anyWereRenderedLastFrame,I=o.notYetRenderableCount,v=!1;if(!Z&&!G){let P=e._tilesToRender;for(let F=x;F<P.length;++F){let b=P[F];for(;b!==void 0&&b._lastSelectionResult!==Kn.KICKED&&b!==n;)b._lastSelectionResult=Kn.kick(b._lastSelectionResult),b=b.parent}e._tilesToRender.length=x,e._tileToUpdateHeights.length=L,DD(e,n),n._lastSelectionResult=Kn.RENDERED;let w=p===Kn.RENDERED;!w&&I>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=_,e._tileLoadQueueMedium.length=C,e._tileLoadQueueHigh.length=V,i0(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,v=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=w,w||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!v&&i0(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Kn.RENDERED,DD(e,n),i0(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Kn.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function Hat(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,d=e._tileProvider,u=e._occluders,m=nj[t.level],p=m.southwest,g=m.southeast,f=m.northwest,x=m.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Ua(e,t,d,r,u,s,p),Ua(e,n,d,r,u,s,g),Ua(e,i,d,r,u,s,f),Ua(e,o,d,r,u,s,x)):(Ua(e,i,d,r,u,s,f),Ua(e,t,d,r,u,s,p),Ua(e,o,d,r,u,s,x),Ua(e,n,d,r,u,s,g)):c.latitude<t.rectangle.north?(Ua(e,n,d,r,u,s,g),Ua(e,t,d,r,u,s,p),Ua(e,o,d,r,u,s,x),Ua(e,i,d,r,u,s,f)):(Ua(e,o,d,r,u,s,x),Ua(e,i,d,r,u,s,f),Ua(e,n,d,r,u,s,g),Ua(e,t,d,r,u,s,p)),m.combine(a)}function zat(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ae.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ae.contains(n,e._cameraReferenceFrameOriginCartographic)}function Ua(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==mr.NONE)return Yat(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,zat(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&i0(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:Kn.NONE;c!==Kn.CULLED_BUT_NEEDED&&c!==Kn.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=Kn.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(i0(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=Kn.CULLED):t._lastSelectionResult=Kn.CULLED;t._lastSelectionResultFrame=i.frameNumber}function Kat(e,t,n){if(t.mode===oe.SCENE2D||t.camera.frustum instanceof an||t.camera.frustum instanceof Pr)return Jat(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),o=n._distance,r=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*r/(o*s);return t.fog.enabled&&(a-=W.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function Jat(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;l(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,d=e._tileProvider.getLevelMaximumGeometricError(n.level),u=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,c),m=d/u;return t.fog.enabled&&t.mode!==oe.SCENE2D&&(m-=W.fog(n._distance,t.fog.density)*t.fog.sse),m/=t.pixelRatio,m}function DD(e,t){e._tilesToRender.push(t)}function Qat(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,o=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&o.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let r=_i()+e._loadQueueTimeSlice,s=e._tileProvider,a=ej(e,t,s,r,n,!1);a=ej(e,t,s,r,i,a),ej(e,t,s,r,o,a)}function jat(e,t){return e._loadPriority-t._loadPriority}function ej(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(jat);for(let s=0,a=o.length;s<a&&(_i()<i||!r);++s){let c=o[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var DV=new pn,tj=new he,yy=new h,qat=[];function $at(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=qat;n.length=0;let i=e._tileToUpdateHeights,o=_i(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,c=t.mapProjection,d=e.tileProvider.tilingScheme.ellipsoid,u;for(;i.length>0;){let m=i[0];if(!l(m.data)||!l(m.data.mesh)){let x=m._lastSelectionResultFrame===e._lastSelectionFrameNumber?m._lastSelectionResult:Kn.NONE;(x===Kn.RENDERED||x===Kn.CULLED_BUT_NEEDED)&&n.push(m),i.shift(),e._lastTileIndex=0;continue}let p=m.customData,g=p.length,f=!1;for(u=e._lastTileIndex;u<g;++u){let x=p[u],_=m.data.terrainData,C=l(_)&&_.wasCreatedByUpsampling();if(m.level>x.level&&!C){if(l(x.positionOnEllipsoidSurface)||(x.positionOnEllipsoidSurface=h.fromRadians(x.positionCartographic.longitude,x.positionCartographic.latitude,0,d)),a===oe.SCENE3D){let L=d.geodeticSurfaceNormal(x.positionOnEllipsoidSurface,DV.direction),Z=d.getSurfaceNormalIntersectionWithZAxis(x.positionOnEllipsoidSurface,11500,DV.origin);if(!l(Z)){let G=0;l(m.data.tileBoundingRegion)&&(G=m.data.tileBoundingRegion.minimumHeight);let I=Math.min(G,-11500),v=h.multiplyByScalar(L,Math.abs(I)+1,yy);h.subtract(x.positionOnEllipsoidSurface,v,DV.origin)}}else he.clone(x.positionCartographic,tj),tj.height=-11500,c.project(tj,yy),h.fromElements(yy.z,yy.x,yy.y,yy),h.clone(yy,DV.origin),h.clone(h.UNIT_X,DV.direction);let V=m.data.pick(DV,a,c,!1,yy);l(V)&&(l(x.callback)&&x.callback(V),x.level=m.level)}if(_i()>=s){f=!0;break}}if(f){e._lastTileIndex=u;break}else e._lastTileIndex=0,i.shift()}for(u=0;u<n.length;u++)i.push(n[u])}function ect(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let o=0,r=i.length;o<r;++o){let s=i[o];n.showTileThisFrame(s,t)}}var Nw=om;function Lh(e){e=y(e,ne.default);let t=new kf({ellipsoid:e}),n=new Ww;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new fw,this._material=void 0,this._surface=new Nw({tileProvider:new Iw({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new be,this._undergroundColor=B.clone(B.BLACK),this._undergroundColorAlphaByDistance=new Ut(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new Xw,oj(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Ee({url:rn("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=ne.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=W.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=W.PI*e.minimumRadius,this.nightFadeOutDistance=W.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*W.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=_n.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(Lh.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return l(this._surface)?this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},clippingPolygons:{get:function(){return this._surface.tileProvider.clippingPolygons},set:function(e){this._surface.tileProvider.clippingPolygons=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=ae.clone(ae.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),l(this._material)&&oj(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,oj(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=B.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=Ut.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function oj(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[Um,ZV];l(e._material)&&(!n||e._terrainProvider.requestVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(mw),e._surfaceShaderSet.baseVertexShaderSource=new De({sources:[Um,ZV,hw],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new De({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function tct(e){return function(t,n){let i=ce.distanceSquaredTo(t.pickBoundingSphere,e),o=ce.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var nct=[],ict={start:0,stop:0};Lh.prototype.pickWorldCoordinates=function(e,t,n,i){n=y(n,!0);let o=t.mode,r=t.mapProjection,s=nct;s.length=0;let a=this._surface._tilesToRender,c=a.length,d,u;for(u=0;u<c;++u){d=a[u];let p=d.data;if(!l(p))continue;let g=p.pickBoundingSphere;if(o!==oe.SCENE3D)p.pickBoundingSphere=g=ce.fromRectangleWithHeights2D(d.rectangle,r,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,g),h.fromElements(g.center.z,g.center.x,g.center.y,g.center);else if(l(p.renderedMesh))ce.clone(p.tileBoundingRegion.boundingSphere,g);else continue;let f=qn.raySphere(e,g,ict);l(f)&&s.push(p)}s.sort(tct(e.origin));let m;for(c=s.length,u=0;u<c&&(m=s[u].pick(e,t.mode,t.mapProjection,n,i),!l(m));++u);return m};var oct=new he;Lh.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==oe.SCENE3D){n=h.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,oct);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var rct=new h,Hge=new h,sct=new he,act=new pn;function ij(e,t){return l(e)&&ae.contains(e.rectangle,t)?e:void 0}Lh.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,o=t.length;for(i=0;i<o&&(n=t[i],!ae.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=ij(n._southwestChild,e)||ij(n._southeastChild,e)||ij(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(r=n);if(n=r,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=h.fromRadians(e.longitude,e.latitude,0,a,rct),d=act,u=a.geodeticSurfaceNormal(c,d.direction),m=a.getSurfaceNormalIntersectionWithZAxis(c,11500,d.origin);if(!l(m)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let f=Math.min(y(g,0),-11500),x=h.multiplyByScalar(u,Math.abs(f)+1,Hge);h.subtract(c,x,d.origin)}let p=n.data.pick(d,void 0,s,!1,Hge);if(l(p))return a.cartesianToCartographic(p,sct).height};Lh.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};Lh.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=l(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let d=this;a.fetchImage().then(function(u){c===d._oceanNormalMapResource.url&&(d._oceanNormalMap=d._oceanNormalMap&&d._oceanNormalMap.destroy(),d._oceanNormalMap=new Pt({context:e.context,source:u}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let r=e.passes,s=e.mode;r.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===oe.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=o,n.showWaterEffect=this.showWaterEffect,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};Lh.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};Lh.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};Lh.prototype.isDestroyed=function(){return!1};Lh.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),me(this)};var kw=Lh;var oIi=T(S(),1);var pEi=T(S(),1);var sEi=T(S(),1);var $Gi=T(S(),1);function cct(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var Uw=cct;var sye={},lct=32.184,dct=2451545,zge=-.0529921,Kge=-.1059842,Jge=13.0120009,Qge=13.3407154,jge=.9856003,qge=26.4057084,$ge=13.064993,eye=.3287146,tye=1.7484877,nye=-.1589763,iye=.0036096,oye=.1643573,rye=12.9590088,rj=new j;sye.ComputeMoon=function(e,t){l(e)||(e=j.now()),rj=j.addSeconds(e,lct,rj);let n=j.totalDays(rj)-dct,i=n/zn.DAYS_PER_JULIAN_CENTURY,o=(125.045+zge*n)*W.RADIANS_PER_DEGREE,r=(250.089+Kge*n)*W.RADIANS_PER_DEGREE,s=(260.008+Jge*n)*W.RADIANS_PER_DEGREE,a=(176.625+Qge*n)*W.RADIANS_PER_DEGREE,c=(357.529+jge*n)*W.RADIANS_PER_DEGREE,d=(311.589+qge*n)*W.RADIANS_PER_DEGREE,u=(134.963+$ge*n)*W.RADIANS_PER_DEGREE,m=(276.617+eye*n)*W.RADIANS_PER_DEGREE,p=(34.226+tye*n)*W.RADIANS_PER_DEGREE,g=(15.134+nye*n)*W.RADIANS_PER_DEGREE,f=(119.743+iye*n)*W.RADIANS_PER_DEGREE,x=(239.961+oye*n)*W.RADIANS_PER_DEGREE,_=(25.053+rye*n)*W.RADIANS_PER_DEGREE,C=Math.sin(o),V=Math.sin(r),L=Math.sin(s),Z=Math.sin(a),G=Math.sin(c),I=Math.sin(d),v=Math.sin(u),P=Math.sin(m),w=Math.sin(p),F=Math.sin(g),b=Math.sin(f),R=Math.sin(x),E=Math.sin(_),X=Math.cos(o),A=Math.cos(r),N=Math.cos(s),O=Math.cos(a),U=Math.cos(c),Y=Math.cos(d),k=Math.cos(u),H=Math.cos(m),J=Math.cos(p),te=Math.cos(g),z=Math.cos(f),q=Math.cos(x),ee=Math.cos(_),fe=(269.9949+.0031*i-3.8787*C-.1204*V+.07*L-.0172*Z+.0072*I-.0052*F+.0043*E)*W.RADIANS_PER_DEGREE,_e=(66.5392+.013*i+1.5419*X+.0239*A-.0278*N+.0068*O-.0029*Y+9e-4*k+8e-4*te-9e-4*ee)*W.RADIANS_PER_DEGREE,le=(38.3213+13.17635815*n-14e-13*n*n+3.561*C+.1208*V-.0642*L+.0158*Z+.0252*G-.0066*I-.0047*v-.0046*P+.0028*w+.0052*F+.004*b+.0019*R-.0044*E)*W.RADIANS_PER_DEGREE,ye=(13.17635815-14e-13*(2*n)+3.561*X*zge+.1208*A*Kge-.0642*N*Jge+.0158*O*Qge+.0252*U*jge-.0066*Y*qge-.0047*k*$ge-.0046*H*eye+.0028*J*tye+.0052*te*nye+.004*z*iye+.0019*q*oye-.0044*ee*rye)/86400*W.RADIANS_PER_DEGREE;return l(t)||(t=new Uw),t.rightAscension=fe,t.declination=_e,t.rotation=le,t.rotationRate=ye,t};var Dw=sye;function aye(e){(!l(e)||typeof e!="function")&&(e=Dw.ComputeMoon),this._computeFunction=e}var uct=new h,mct=new h,hct=new h;function fct(e,t,n){let i=uct;i.x=Math.cos(e+W.PI_OVER_TWO),i.y=Math.sin(e+W.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=hct;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=h.cross(r,i,mct);return l(n)||(n=new $),n[0]=i.x,n[1]=s.x,n[2]=r.x,n[3]=i.y,n[4]=s.y,n[5]=r.y,n[6]=i.z,n[7]=s.z,n[8]=r.z,n}var pct=new $,bct=new we;aye.prototype.evaluate=function(e,t){l(e)||(e=j.now());let n=this._computeFunction(e),i=fct(n.rightAscension,n.declination,t),o=W.zeroToTwoPi(n.rotation),r=we.fromAxisAngle(h.UNIT_Z,o,bct),s=$.fromQuaternion(we.conjugate(r,r),pct);return $.multiply(s,i,i)};var Bw=aye;var BEi=T(S(),1);var gEi=T(S(),1),BV=`uniform vec3 u_radii;
  9469. uniform vec3 u_oneOverEllipsoidRadiiSquared;
  9470. in vec3 v_positionEC;
  9471. vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side)
  9472. {
  9473. vec3 positionEC = czm_pointAlongRay(ray, intersection);
  9474. vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;
  9475. vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared));
  9476. vec3 sphericalNormal = normalize(positionMC / u_radii);
  9477. vec3 normalMC = geodeticNormal * side; // normalized surface normal (always facing the viewer) in model coordinates
  9478. vec3 normalEC = normalize(czm_normal * normalMC); // normalized surface normal in eye coordinates
  9479. vec2 st = czm_ellipsoidTextureCoordinates(sphericalNormal);
  9480. vec3 positionToEyeEC = -positionEC;
  9481. czm_materialInput materialInput;
  9482. materialInput.s = st.s;
  9483. materialInput.st = st;
  9484. materialInput.str = (positionMC + u_radii) / u_radii;
  9485. materialInput.normalEC = normalEC;
  9486. materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);
  9487. materialInput.positionToEyeEC = positionToEyeEC;
  9488. czm_material material = czm_getMaterial(materialInput);
  9489. #ifdef ONLY_SUN_LIGHTING
  9490. return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC);
  9491. #else
  9492. return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
  9493. #endif
  9494. }
  9495. void main()
  9496. {
  9497. // PERFORMANCE_TODO: When dynamic branching is available, compute ratio of maximum and minimum radii
  9498. // in the vertex shader. Only when it is larger than some constant, march along the ray.
  9499. // Otherwise perform one intersection test which will be the common case.
  9500. // Test if the ray intersects a sphere with the ellipsoid's maximum radius.
  9501. // For very oblate ellipsoids, using the ellipsoid's radii for an intersection test
  9502. // may cause false negatives. This will discard fragments before marching the ray forward.
  9503. float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5;
  9504. vec3 direction = normalize(v_positionEC);
  9505. vec3 ellipsoidCenter = czm_modelView[3].xyz;
  9506. float t1 = -1.0;
  9507. float t2 = -1.0;
  9508. float b = -2.0 * dot(direction, ellipsoidCenter);
  9509. float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius;
  9510. float discriminant = b * b - 4.0 * c;
  9511. if (discriminant >= 0.0) {
  9512. t1 = (-b - sqrt(discriminant)) * 0.5;
  9513. t2 = (-b + sqrt(discriminant)) * 0.5;
  9514. }
  9515. if (t1 < 0.0 && t2 < 0.0) {
  9516. discard;
  9517. }
  9518. float t = min(t1, t2);
  9519. if (t < 0.0) {
  9520. t = 0.0;
  9521. }
  9522. // March ray forward to intersection with larger sphere and find
  9523. czm_ray ray = czm_ray(t * direction, direction);
  9524. vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z);
  9525. czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii);
  9526. if (czm_isEmpty(intersection))
  9527. {
  9528. discard;
  9529. }
  9530. // If the viewer is outside, compute outsideFaceColor, with normals facing outward.
  9531. vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);
  9532. // If the viewer either is inside or can see inside, compute insideFaceColor, with normals facing inward.
  9533. vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);
  9534. out_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);
  9535. out_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);
  9536. #if (defined(WRITE_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
  9537. t = (intersection.start != 0.0) ? intersection.start : intersection.stop;
  9538. vec3 positionEC = czm_pointAlongRay(ray, t);
  9539. vec4 positionCC = czm_projection * vec4(positionEC, 1.0);
  9540. #ifdef LOG_DEPTH
  9541. czm_writeLogDepth(1.0 + positionCC.w);
  9542. #else
  9543. float z = positionCC.z / positionCC.w;
  9544. float n = czm_depthRange.near;
  9545. float f = czm_depthRange.far;
  9546. gl_FragDepth = (z * (f - n) + f + n) * 0.5;
  9547. #endif
  9548. #endif
  9549. }
  9550. `;var xEi=T(S(),1),OV=`in vec3 position;
  9551. uniform vec3 u_radii;
  9552. out vec3 v_positionEC;
  9553. void main()
  9554. {
  9555. // In the vertex data, the cube goes from (-1.0, -1.0, -1.0) to (1.0, 1.0, 1.0) in model coordinates.
  9556. // Scale to consider the radii. We could also do this once on the CPU when using the BoxGeometry,
  9557. // but doing it here allows us to change the radii without rewriting the vertex data, and
  9558. // allows all ellipsoids to reuse the same vertex data.
  9559. vec4 p = vec4(u_radii * position, 1.0);
  9560. v_positionEC = (czm_modelView * p).xyz; // position in eye coordinates
  9561. gl_Position = czm_modelViewProjection * p; // position in clip coordinates
  9562. // With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums
  9563. // and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the
  9564. // ellipsoid (does not write depth) that was rendered in the farther frustum.
  9565. //
  9566. // Here, we clamp the depth in the vertex shader to avoid being overwritten; however, this creates
  9567. // artifacts since some fragments can be alpha blended twice. This is solved by only rendering
  9568. // the ellipsoid in the closest frustum to the viewer.
  9569. gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);
  9570. czm_vertexLogDepth();
  9571. }
  9572. `;var sj={position:0};function BD(e){e=y(e,y.EMPTY_OBJECT),this.center=h.clone(y(e.center,h.ZERO)),this._center=new h,this.radii=h.clone(e.radii),this._radii=new h,this._oneOverEllipsoidRadiiSquared=new h,this._boundingSphere=new ce,this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this._modelMatrix=new M,this._computedModelMatrix=new M,this.show=y(e.show,!0),this.material=y(e.material,Oi.fromType(Oi.ColorType)),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=y(e.debugShowBoundingVolume,!1),this.onlySunLighting=y(e.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=y(e.depthTestEnabled,!0),this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new tt({owner:y(e._owner,this)}),this._pickCommand=new tt({owner:y(e._owner,this),pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function gct(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=Ra.createGeometry(Ra.fromDimensions({dimensions:new h(2,2,2),vertexFormat:We.POSITION_ONLY}));return t=ti.fromGeometry({context:e,geometry:n,attributeLocations:sj,bufferUsage:Me.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}BD.prototype.update=function(e){if(!this.show||e.mode!==oe.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=Ue.fromCache({cull:{enabled:!0,face:yi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?un.ALPHA_BLEND:void 0})),l(this._va)||(this._va=gct(t));let o=!1,r=this.radii;if(!h.equals(this._radii,r)){h.clone(r,this._radii);let x=this._oneOverEllipsoidRadiiSquared;x.x=1/(r.x*r.x),x.y=1/(r.y*r.y),x.z=1/(r.z*r.z),o=!0}(!M.equals(this.modelMatrix,this._modelMatrix)||!h.equals(this.center,this._center))&&(M.clone(this.modelMatrix,this._modelMatrix),h.clone(this.center,this._center),M.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(h.clone(h.ZERO,this._boundingSphere.center),this._boundingSphere.radius=h.maximumComponent(r),ce.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,d=this._useLogDepth!==c;this._useLogDepth=c;let u=this._colorCommand,m,p;(s||a||i||d)&&(m=new De({sources:[OV]}),p=new De({sources:[this.material.shaderSource,BV]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(m.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=tn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:sj}),u.vertexArray=this._va,u.renderState=this._rs,u.shaderProgram=this._sp,u.uniformMap=Tt(this._uniforms,this.material._uniforms),u.executeInClosestFrustum=n);let g=e.commandList,f=e.passes;if(f.render&&(u.boundingVolume=this._boundingSphere,u.debugShowBoundingVolume=this.debugShowBoundingVolume,u.modelMatrix=this._computedModelMatrix,u.pass=n?Ge.TRANSLUCENT:Ge.OPAQUE,g.push(u)),f.pick){let x=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!l(this._pickSP)||d)&&(m=new De({sources:[OV]}),p=new De({sources:[this.material.shaderSource,BV],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(m.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=tn.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:sj}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._pickSP,x.uniformMap=Tt(Tt(this._uniforms,this._pickUniforms),this.material._uniforms),x.executeInClosestFrustum=n),x.boundingVolume=this._boundingSphere,x.modelMatrix=this._computedModelMatrix,x.pass=n?Ge.TRANSLUCENT:Ge.OPAQUE,g.push(x)}};BD.prototype.isDestroyed=function(){return!1};BD.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),me(this)};var Ow=BD;function Yw(e){e=y(e,y.EMPTY_OBJECT);let t=e.textureUrl;l(t)||(t=rn("Assets/Textures/moonSmall.jpg")),this.show=y(e.show,!0),this.textureUrl=t,this._ellipsoid=y(e.ellipsoid,ne.MOON),this.onlySunLighting=y(e.onlySunLighting,!0),this._ellipsoidPrimitive=new Ow({radii:this.ellipsoid.radii,material:Oi.fromType(Oi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new Bw}Object.defineProperties(Yw.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var OD=new $,yct=new $,xct=new h,YD=[];Yw.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(Ft.computeIcrfToFixedMatrix(n,OD))||Ft.computeTemeToPseudoFixedMatrix(n,OD);let i=this._axes.evaluate(n,yct);$.transpose(i,i),$.multiply(OD,i,i);let o=v0.computeMoonPositionInEarthInertialFrame(n,xct);$.multiplyByVector(OD,o,o),M.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=YD,YD.length=0,t.update(e),e.commandList=r,YD.length===1?YD[0]:void 0};Yw.prototype.isDestroyed=function(){return!1};Yw.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),me(this)};var Hw=Yw;var nYi=T(S(),1);var sIi=T(S(),1);var aj=[],cj=[];function _ct(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=aj,d=cj,u,m;for(u=0;u<s;++u)c[u]=e[i+u];for(m=0;m<a;++m)d[m]=e[o+m+1];u=0,m=0;for(let p=i;p<=r;++p){let g=c[u],f=d[m];u<s&&(m>=a||t(g,f,n)<=0)?(e[p]=g,++u):m<a&&(e[p]=f,++m)}}function lj(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);lj(e,t,n,i,r),lj(e,t,n,r+1,o),_ct(e,t,n,i,r,o)}function Tct(e,t,n){let i=e.length,o=Math.ceil(i*.5);aj.length=o,cj.length=o,lj(e,t,n,0,i-1),aj.length=0,cj.length=0}var o0=Tct;var bIi=T(S(),1);function Tc(e,t){this._occluderPosition=h.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var HD=new h;Object.defineProperties(Tc.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=h.clone(e,this._cameraPosition);let t=h.subtract(this._occluderPosition,e,HD),n=h.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=h.multiplyByScalar(t,n,HD);let a=o*o*n;s=h.add(e,h.multiplyByScalar(r,a,HD),HD)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});Tc.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new Tc(e,t)};var lye=new h;Tc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,lye),n=this._occluderRadius;if(n=h.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=h.subtract(e,this._cameraPosition,t),n*n>h.magnitudeSquared(t)}return!1};var Sct=new h;Tc.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,Sct),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,lye),o=this._occluderRadius-n;if(o=h.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i),o*o+n*n>h.magnitudeSquared(i)):!1;if(o>0){i=h.subtract(t,this._cameraPosition,i);let r=h.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>r*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+a>r)}return!0}return!1};var Cct=new h;Tc.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return mr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,Cct),o=this._occluderRadius-n,r=h.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i);let s=h.magnitudeSquared(i);return o*o+n*n<s?mr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?mr.FULL:mr.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?mr.PARTIAL:mr.FULL))}}return mr.NONE};var zD=new h;Tc.computeOccludeePoint=function(e,t,n){let i=h.clone(t),o=h.clone(e.center),r=e.radius,s=n.length,a=h.normalize(h.subtract(i,o,zD),zD),c=-h.dot(a,o),d=Tc._anyRotationVector(o,a,c),u=Tc._horizonToPlaneNormalDotProduct(e,a,c,d,n[0]);if(!u)return;let m;for(let g=1;g<s;++g){if(m=Tc._horizonToPlaneNormalDotProduct(e,a,c,d,n[g]),!m)return;m<u&&(u=m)}if(u<.0017453283658983088)return;let p=r/u;return h.add(o,h.multiplyByScalar(a,p,zD),zD)};var Vct=[];Tc.computeOccludeePointFromRectangle=function(e,t){t=y(t,ne.default);let n=ae.subsample(e,t,0,Vct),i=ce.fromPoints(n),o=h.ZERO;if(!h.equals(o,i.center))return Tc.computeOccludeePoint(new ce(o,t.minimumRadius),i.center,n)};var Lct=new h;Tc._anyRotationVector=function(e,t,n){let i=h.abs(t,Lct),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new h,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=h.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=h.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=h.UNIT_Z);let a=(h.dot(t,i)+n)/-h.dot(t,s);return h.normalize(h.subtract(h.add(i,h.multiplyByScalar(s,a,r),i),e,i),i)};var Rct=new h;Tc._rotationVector=function(e,t,n,i,o){let r=h.subtract(i,e,Rct);if(r=h.normalize(r,r),h.dot(t,r)<.9999999847691291){let s=h.cross(t,r,r);if(h.magnitude(s)>W.EPSILON13)return h.normalize(s,new h)}return o};var dj=new h,Zct=new h,KD=new h,cye=new h;Tc._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=h.clone(o,dj),s=h.clone(e.center,Zct),a=e.radius,c=h.subtract(s,r,KD),d=h.magnitudeSquared(c),u=a*a;if(d<u)return!1;let m=d-u,p=Math.sqrt(m),f=1/Math.sqrt(d),_=p*f*p;c=h.normalize(c,c);let C=h.add(r,h.multiplyByScalar(c,_,cye),cye),V=Math.sqrt(m-_*_),L=this._rotationVector(s,t,n,r,i),Z=h.fromElements(L.x*L.x*c.x+(L.x*L.y-L.z)*c.y+(L.x*L.z+L.y)*c.z,(L.x*L.y+L.z)*c.x+L.y*L.y*c.y+(L.y*L.z-L.x)*c.z,(L.x*L.z-L.y)*c.x+(L.y*L.z+L.x)*c.y+L.z*L.z*c.z,dj);Z=h.normalize(Z,Z);let G=h.multiplyByScalar(Z,V,dj);L=h.normalize(h.subtract(h.add(C,G,KD),s,KD),KD);let I=h.dot(t,L);L=h.normalize(h.subtract(h.subtract(C,G,L),s,L),L);let v=h.dot(t,L);return I<v?I:v};var zw=Tc;var XIi=T(S(),1);var LIi=T(S(),1);function Bf(e){e=y(e,y.EMPTY_OBJECT),this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this._cullingVolume=new ms,this._perspectiveMatrix=new M,this._infinitePerspective=new M}function uj(e){let{top:t,bottom:n,right:i,left:o,near:r,far:s}=e;(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||s!==e._far)&&(e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=s,e._perspectiveMatrix=M.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=M.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective))}Object.defineProperties(Bf.prototype,{projectionMatrix:{get:function(){return uj(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return uj(this),this._infinitePerspective}}});var Gct=new h,Ect=new h,Ict=new h,Xct=new h;Bf.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,d=this.far,u=h.cross(t,n,Gct),m=Ect;h.multiplyByScalar(t,c,m),h.add(e,m,m);let p=Ict;h.multiplyByScalar(t,d,p),h.add(e,p,p);let g=Xct;h.multiplyByScalar(u,a,g),h.add(m,g,g),h.subtract(g,e,g),h.normalize(g,g),h.cross(g,n,g),h.normalize(g,g);let f=i[0];return l(f)||(f=i[0]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-h.dot(g,e),h.multiplyByScalar(u,s,g),h.add(m,g,g),h.subtract(g,e,g),h.cross(n,g,g),h.normalize(g,g),f=i[1],l(f)||(f=i[1]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-h.dot(g,e),h.multiplyByScalar(n,r,g),h.add(m,g,g),h.subtract(g,e,g),h.cross(u,g,g),h.normalize(g,g),f=i[2],l(f)||(f=i[2]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-h.dot(g,e),h.multiplyByScalar(n,o,g),h.add(m,g,g),h.subtract(g,e,g),h.cross(g,u,g),h.normalize(g,g),f=i[3],l(f)||(f=i[3]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-h.dot(g,e),f=i[4],l(f)||(f=i[4]=new se),f.x=t.x,f.y=t.y,f.z=t.z,f.w=-h.dot(t,m),h.negate(t,g),f=i[5],l(f)||(f=i[5]=new se),f.x=g.x,f.y=g.y,f.z=g.z,f.w=-h.dot(g,p),this._cullingVolume};Bf.prototype.getPixelDimensions=function(e,t,n,i,o){uj(this);let r=1/this.near,s=this.top*r,a=2*i*n*s/t;s=this.right*r;let c=2*i*n*s/e;return o.x=c,o.y=a,o};Bf.prototype.clone=function(e){return l(e)||(e=new Bf),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};Bf.prototype.equals=function(e){return l(e)&&e instanceof Bf&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Bf.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Bf&&W.equalsEpsilon(this.right,e.right,t,n)&&W.equalsEpsilon(this.left,e.left,t,n)&&W.equalsEpsilon(this.top,e.top,t,n)&&W.equalsEpsilon(this.bottom,e.bottom,t,n)&&W.equalsEpsilon(this.near,e.near,t,n)&&W.equalsEpsilon(this.far,e.far,t,n)};var sl=Bf;function Jl(e){e=y(e,y.EMPTY_OBJECT),this._offCenterFrustum=new sl,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=y(e.near,1),this._near=this.near,this.far=y(e.far,5e8),this._far=this.far,this.xOffset=y(e.xOffset,0),this._xOffset=this.xOffset,this.yOffset=y(e.yOffset,0),this._yOffset=this.yOffset}Jl.packedLength=6;Jl.pack=function(e,t,n){return n=y(n,0),t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};Jl.unpack=function(e,t,n){return t=y(t,0),l(n)||(n=new Jl),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function Rh(e){if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(Jl.prototype,{projectionMatrix:{get:function(){return Rh(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return Rh(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return Rh(this),this._fovy}},sseDenominator:{get:function(){return Rh(this),this._sseDenominator}},offCenterFrustum:{get:function(){return Rh(this),this._offCenterFrustum}}});Jl.prototype.computeCullingVolume=function(e,t,n){return Rh(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Jl.prototype.getPixelDimensions=function(e,t,n,i,o){return Rh(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Jl.prototype.clone=function(e){return l(e)||(e=new Jl),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};Jl.prototype.equals=function(e){return!l(e)||!(e instanceof Jl)?!1:(Rh(this),Rh(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Jl.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Jl)?!1:(Rh(this),Rh(e),W.equalsEpsilon(this.fov,e.fov,t,n)&&W.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Li=Jl;var YIi=T(S(),1);var PIi=T(S(),1),Kw=`in vec2 v_textureCoordinates;
  9573. const float M_PI = 3.141592653589793;
  9574. float vdcRadicalInverse(int i)
  9575. {
  9576. float r;
  9577. float base = 2.0;
  9578. float value = 0.0;
  9579. float invBase = 1.0 / base;
  9580. float invBi = invBase;
  9581. for (int x = 0; x < 100; x++)
  9582. {
  9583. if (i <= 0)
  9584. {
  9585. break;
  9586. }
  9587. r = mod(float(i), base);
  9588. value += r * invBi;
  9589. invBi *= invBase;
  9590. i = int(float(i) * invBase);
  9591. }
  9592. return value;
  9593. }
  9594. vec2 hammersley2D(int i, int N)
  9595. {
  9596. return vec2(float(i) / float(N), vdcRadicalInverse(i));
  9597. }
  9598. vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N)
  9599. {
  9600. float alphaRoughnessSquared = alphaRoughness * alphaRoughness;
  9601. float phi = 2.0 * M_PI * xi.x;
  9602. float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y));
  9603. float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
  9604. vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);
  9605. vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
  9606. vec3 tangentX = normalize(cross(upVector, N));
  9607. vec3 tangentY = cross(N, tangentX);
  9608. return tangentX * H.x + tangentY * H.y + N * H.z;
  9609. }
  9610. /**
  9611. * Estimate the geometric self-shadowing of the microfacets in a surface,
  9612. * using the Smith Joint GGX visibility function.
  9613. * Note: Vis = G / (4 * NdotL * NdotV)
  9614. * see Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs. Journal of Computer Graphics Techniques, 3
  9615. * see Real-Time Rendering. Page 331 to 336.
  9616. * see https://google.github.io/filament/Filament.md.html#materialsystem/specularbrdf/geometricshadowing(specularg)
  9617. *
  9618. * @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
  9619. * @param {float} NdotL The cosine of the angle between the surface normal and the direction to the light source.
  9620. * @param {float} NdotV The cosine of the angle between the surface normal and the direction to the camera.
  9621. */
  9622. float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV)
  9623. {
  9624. float alphaRoughnessSq = alphaRoughness * alphaRoughness;
  9625. float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
  9626. float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
  9627. float GGX = GGXV + GGXL; // 2.0 if NdotL = NdotV = 1.0
  9628. if (GGX > 0.0)
  9629. {
  9630. return 0.5 / GGX; // 1/4 if NdotL = NdotV = 1.0
  9631. }
  9632. return 0.0;
  9633. }
  9634. vec2 integrateBrdf(float roughness, float NdotV)
  9635. {
  9636. vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV);
  9637. float A = 0.0;
  9638. float B = 0.0;
  9639. const int NumSamples = 1024;
  9640. float alphaRoughness = roughness * roughness;
  9641. for (int i = 0; i < NumSamples; i++)
  9642. {
  9643. vec2 xi = hammersley2D(i, NumSamples);
  9644. vec3 H = importanceSampleGGX(xi, alphaRoughness, vec3(0.0, 0.0, 1.0));
  9645. vec3 L = 2.0 * dot(V, H) * H - V;
  9646. float NdotL = clamp(L.z, 0.0, 1.0);
  9647. float NdotH = clamp(H.z, 0.0, 1.0);
  9648. float VdotH = clamp(dot(V, H), 0.0, 1.0);
  9649. if (NdotL > 0.0)
  9650. {
  9651. float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV);
  9652. float G_Vis = 4.0 * G * VdotH * NdotL / NdotH;
  9653. float Fc = pow(1.0 - VdotH, 5.0);
  9654. A += (1.0 - Fc) * G_Vis;
  9655. B += Fc * G_Vis;
  9656. }
  9657. }
  9658. return vec2(A, B) / float(NumSamples);
  9659. }
  9660. void main()
  9661. {
  9662. out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0);
  9663. }
  9664. `;function Jw(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(Jw.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function Wct(e,t,n){let i=t.createViewportQuadCommand(Kw,{framebuffer:n,renderState:Ue.fromCache({viewport:new Ke(0,0,256,256)})});e._drawCommand=i}Jw.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Pt({context:t,width:256,height:256,pixelFormat:ot.RGBA,pixelDatatype:qe.UNSIGNED_BYTE,sampler:en.NEAREST});this._colorTexture=n;let i=new Wr({context:t,colorTextures:[n],destroyAttachments:!1});Wct(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};Jw.prototype.isDestroyed=function(){return!1};Jw.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),me(this)};var Qw=Jw;var wXi=T(S(),1);var iXi=T(S(),1);var hye={};function Pct(e,t,n){let i,o,r;if(e instanceof Li){let s=Math.tan(.5*e.fovy);return i=e.near,o=e.near*s,r=e.aspectRatio*o,Math.max(t*i/r,n*i/o)}else if(e instanceof sl)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var vct=new h,dye=new h;function fye(e,t,n,i){if(l(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,c=s-r;return function(d){let u=n(d);if(d<=.5){let p=(u-o)/a;return W.lerp(e,-W.PI_OVER_TWO,p)}let m=(u-r)/c;return W.lerp(-W.PI_OVER_TWO,t,1-m)}}return function(o){return W.lerp(e,t,o)}}function hj(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!l(r)){let a=e.position,c=t,d=e.up,u=e.right,m=e.frustum,p=h.subtract(a,c,vct),g=h.magnitude(h.multiplyByScalar(d,h.dot(p,d),dye)),f=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),dye));r=Math.min(Pct(m,g,f)*.2,1e9)}if(s<r){let d=-Math.pow((r-n)*1e6,.125),u=Math.pow((r-i)*1e6,1/8);return function(m){let p=m*(u-d)+d;return-Math.pow(p,8)/1e6+r}}return function(a){return W.lerp(n,i,a)}}function jw(e,t){return W.equalsEpsilon(e,W.TWO_PI,W.EPSILON11)&&(e=0),t>e+Math.PI?e+=W.TWO_PI:t<e-Math.PI&&(e-=W.TWO_PI),e}var pye=new h;function wct(e,t,n,i,o,r,s,a){let c=e.camera,d=h.clone(c.position,pye),u=c.pitch,m=jw(c.heading,i),p=jw(c.roll,r),g=hj(c,n,d.z,n.z,s),f=fye(u,o,g,a);function x(_){let C=_.time/t;c.setView({orientation:{heading:W.lerp(m,i,C),pitch:f(C),roll:W.lerp(p,r,C)}}),D.lerp(d,n,C,c.position),c.position.z=g(C)}return x}function Fct(e,t){e.longitude<t.longitude?e.longitude+=W.TWO_PI:t.longitude+=W.TWO_PI}function Act(e,t){let n=e.longitude-t.longitude;n<-W.PI?e.longitude+=W.TWO_PI:n>W.PI&&(t.longitude+=W.TWO_PI)}var Mct=new he,Nct=new he;function kct(e,t,n,i,o,r,s,a,c,d){let u=e.camera,p=e.mapProjection.ellipsoid,g=he.clone(u.positionCartographic,Mct),f=u.pitch,x=jw(u.heading,i),_=jw(u.roll,r),C=p.cartesianToCartographic(n,Nct);g.longitude=W.zeroToTwoPi(g.longitude),C.longitude=W.zeroToTwoPi(C.longitude);let V=!1;if(l(a)){let I=W.zeroToTwoPi(a),v=Math.min(g.longitude,C.longitude),P=Math.max(g.longitude,C.longitude),w=I>=v&&I<=P;if(l(c)){let F=Math.abs(g.longitude-C.longitude),b=W.TWO_PI-F;(w?F:b)<(w?b:F)*c&&!w&&(V=!0)}else w||(V=!0)}V?Fct(g,C):Act(g,C);let L=hj(u,n,g.height,C.height,s),Z=fye(f,o,L,d);function G(){let I=g.longitude,v=C.longitude,P=g.latitude,w=C.latitude;return function(b){let R=b.time/t,E=h.fromRadians(W.lerp(I,v,R),W.lerp(P,w,R),L(R),p);u.setView({destination:E,orientation:{heading:W.lerp(x,i,R),pitch:Z(R),roll:W.lerp(_,r,R)}})}}return G()}function Uct(e,t,n,i,o,r,s){let a=e.camera,c=h.clone(a.position,pye),d=jw(a.heading,i),u=a.frustum.right-a.frustum.left,m=hj(a,n,u,n.z,s);function p(g){let f=g.time/t;a.setView({orientation:{heading:W.lerp(d,i,f)}}),D.lerp(c,n,f,a.position);let x=m(f),_=a.frustum,C=_.top/_.right,V=(x-(_.right-_.left))*.5;_.right+=V,_.left-=V,_.top=C*_.right,_.bottom=-_.top}return p}var uye=new he,Dct=new h;function mj(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function mye(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}hye.createTween=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=t.destination,i=e.mode;if(i===oe.MORPHING)return mj();let o=y(t.convert,!0),r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,d=t.flyOverLongitudeWeight,u=t.pitchAdjustHeight,m=t.easingFunction;o&&i!==oe.SCENE3D&&(s.cartesianToCartographic(n,uye),n=r.project(uye,Dct));let p=e.camera,g=t.endTransform;l(g)&&p._setTransform(g);let f=t.duration;l(f)||(f=Math.ceil(h.distance(p.position,n)/1e6)+2,f=Math.min(f,3));let x=y(t.heading,0),_=y(t.pitch,-W.PI_OVER_TWO),C=y(t.roll,0),V=e.screenSpaceCameraController;V.enableInputs=!1;let L=mye(V,t.complete),Z=mye(V,t.cancel),G=p.frustum,I=e.mode===oe.SCENE2D;if(I=I&&D.equalsEpsilon(p.position,n,W.EPSILON6),I=I&&W.equalsEpsilon(Math.max(G.right-G.left,G.top-G.bottom),n.z,W.EPSILON6),I=I||e.mode!==oe.SCENE2D&&h.equalsEpsilon(n,p.position,W.EPSILON10),I=I&&W.equalsEpsilon(W.negativePiToPi(x),W.negativePiToPi(p.heading),W.EPSILON10)&&W.equalsEpsilon(W.negativePiToPi(_),W.negativePiToPi(p.pitch),W.EPSILON10)&&W.equalsEpsilon(W.negativePiToPi(C),W.negativePiToPi(p.roll),W.EPSILON10),I)return mj(L,Z);let v=new Array(4);if(v[oe.SCENE2D]=Uct,v[oe.SCENE3D]=kct,v[oe.COLUMBUS_VIEW]=wct,f<=0)return mj(function(){v[i](e,1,n,x,_,C,a,c,d,u)({time:1}),typeof L=="function"&&L()},Z);let P=v[i](e,f,n,x,_,C,a,c,d,u);if(!l(m)){let w=p.positionCartographic.height,F=i===oe.SCENE3D?s.cartesianToCartographic(n).height:n.z;w>F&&w>11500?m=Yr.CUBIC_OUT:m=Yr.QUINTIC_IN_OUT}return{duration:f,easingFunction:m,startObject:{time:0},stopObject:{time:f},update:P,complete:L,cancel:Z}};var qw=hye;var rXi=T(S(),1),Bct={ROTATE:0,INFINITE_SCROLL:1},Ql=Object.freeze(Bct);function on(e){this._scene=e,this._transform=M.clone(M.IDENTITY),this._invTransform=M.clone(M.IDENTITY),this._actualTransform=M.clone(M.IDENTITY),this._actualInvTransform=M.clone(M.IDENTITY),this._transformChanged=!1,this.position=new h,this._position=new h,this._positionWC=new h,this._positionCartographic=new he,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new h,this._direction=new h,this._directionWC=new h,this.up=new h,this._up=new h,this._upWC=new h,this.right=new h,this._right=new h,this._rightWC=new h,this.frustum=new Li,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=W.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new be,this._moveEnd=new be,this._changed=new be,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this._changedRoll=void 0,this.percentageChanged=.5,this._viewMatrix=new M,this._invViewMatrix=new M,Cye(this),this._mode=oe.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new he(Math.PI,W.PI_OVER_TWO)),this._max2Dfrustum=void 0,wye(this,on.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=h.magnitude(this.position);n+=n*on.DEFAULT_VIEW_FACTOR,h.normalize(this.position,this.position),h.multiplyByScalar(this.position,n,this.position)}on.TRANSFORM_2D=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);on.TRANSFORM_2D_INVERSE=M.inverseTransformation(on.TRANSFORM_2D,new M);on.DEFAULT_VIEW_RECTANGLE=ae.fromDegrees(-95,-20,-70,90);on.DEFAULT_VIEW_FACTOR=.5;on.DEFAULT_OFFSET=new Qu(0,-W.PI_OVER_FOUR,0);function Cye(e){M.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),M.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),M.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function Oct(e){if(!l(e._oldPositionWC))e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=h.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=h.magnitude(t),e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=_i()):e.timeSinceMoved=Math.max(_i()-e._lastMovedTimestamp,0)/1e3}}on.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==oe.SCENE2D};on.prototype._updateCameraChanged=function(){let e=this;if(Oct(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%W.TWO_PI;i=i>W.PI?W.TWO_PI-i:i;let o=i/Math.PI;o>t&&(e._changedHeading=n);let r=e.roll;l(e._changedRoll)||(e._changedRoll=r);let s=Math.abs(e._changedRoll-r)%W.TWO_PI;s=s>W.PI?W.TWO_PI-s:s;let a=s/Math.PI;if(a>t&&(e._changedRoll=r),(a>t||o>t)&&e._changed.raiseEvent(Math.max(a,o)),e._mode===oe.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,g=e._changedPosition,f=e.frustum,x=e._changedFrustum,_=p.x+f.left,C=p.x+f.right,V=g.x+x.left,L=g.x+x.right,Z=p.y+f.bottom,G=p.y+f.top,I=g.y+x.bottom,v=g.y+x.top,P=Math.max(_,V),w=Math.min(C,L),F=Math.max(Z,I),b=Math.min(G,v),R;if(P>=w||F>=G)R=1;else{let E=x;_<V&&C>L&&Z<I&&G>v&&(E=f),R=1-(w-P)*(b-F)/((E.right-E.left)*(E.top-E.bottom))}R>t&&(e._changed.raiseEvent(R),e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection);return}let c=W.acosClamped(h.dot(e.directionWC,e._changedDirection)),d;l(e.frustum.fovy)?d=c/(e.frustum.fovy*.5):d=c;let m=h.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(d>t||m>t)&&(e._changed.raiseEvent(Math.max(d,m)),e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection))};function Yct(e){Ft.basisTo2D(e._projection,e._transform,e._actualTransform)}var Hct=new he,zct=new h,JD=new h,Kct=new se,Jct=new se,Qct=new se,jct=new se,qct=new se;function $ct(e){let t=e._projection,n=t.ellipsoid,i=M.getColumn(e._transform,3,Kct),o=n.cartesianToCartographic(i,Hct),r=t.project(o,zct),s=Jct;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=se.clone(se.UNIT_X,qct),c=se.add(M.getColumn(e._transform,0,JD),i,JD);n.cartesianToCartographic(c,o),t.project(o,r);let d=Qct;d.x=r.z,d.y=r.x,d.z=r.y,d.w=0,h.subtract(d,s,d),d.x=0;let u=jct;if(h.magnitudeSquared(d)>W.EPSILON10)h.cross(a,d,u);else{let m=se.add(M.getColumn(e._transform,1,JD),i,JD);n.cartesianToCartographic(m,o),t.project(o,r),u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,h.subtract(u,s,u),u.x=0,h.magnitudeSquared(u)<W.EPSILON10&&(se.clone(se.UNIT_Y,d),se.clone(se.UNIT_Z,u))}h.cross(u,a,d),h.normalize(d,d),h.cross(a,d,u),h.normalize(u,u),M.setColumn(e._actualTransform,0,d,e._actualTransform),M.setColumn(e._actualTransform,1,u,e._actualTransform),M.setColumn(e._actualTransform,2,a,e._actualTransform),M.setColumn(e._actualTransform,3,s,e._actualTransform)}var fj=new h;function Cc(e){let t=e._mode,n=!1,i=0;t===oe.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let o=e._position,r=!h.equals(o,e.position)||n;r&&(o=h.clone(e.position,e._position));let s=e._direction,a=!h.equals(s,e.direction);a&&(h.normalize(e.direction,e.direction),s=h.clone(e.direction,e._direction));let c=e._up,d=!h.equals(c,e.up);d&&(h.normalize(e.up,e.up),c=h.clone(e.up,e._up));let u=e._right,m=!h.equals(u,e.right);m&&(h.normalize(e.right,e.right),u=h.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(M.inverseTransformation(e._transform,e._invTransform),e._mode===oe.COLUMBUS_VIEW||e._mode===oe.SCENE2D?M.equals(M.IDENTITY,e._transform)?M.clone(on.TRANSFORM_2D,e._actualTransform):e._mode===oe.COLUMBUS_VIEW?Yct(e):$ct(e):M.clone(e._transform,e._actualTransform),M.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(r||p)if(e._positionWC=M.multiplyByPoint(g,o,e._positionWC),t===oe.SCENE3D||t===oe.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let f=fj;f.x=e._positionWC.y,f.y=e._positionWC.z,f.z=e._positionWC.x,t===oe.SCENE2D&&(f.z=i),e._projection.unproject(f,e._positionCartographic)}if(a||d||m){let f=h.dot(s,h.cross(c,u,fj));if(Math.abs(1-f)>W.EPSILON2){let x=1/h.magnitudeSquared(c),_=h.dot(c,s)*x,C=h.multiplyByScalar(s,_,fj);c=h.normalize(h.subtract(c,C,e._up),e._up),h.clone(c,e.up),u=h.cross(s,c,e._right),h.clone(u,e.right)}}(a||p)&&(e._directionWC=M.multiplyByPointAsVector(g,s,e._directionWC),h.normalize(e._directionWC,e._directionWC)),(d||p)&&(e._upWC=M.multiplyByPointAsVector(g,c,e._upWC),h.normalize(e._upWC,e._upWC)),(m||p)&&(e._rightWC=M.multiplyByPointAsVector(g,u,e._rightWC),h.normalize(e._rightWC,e._rightWC)),(r||a||d||m||p)&&Cye(e)}function Vye(e,t){let n;return W.equalsEpsilon(Math.abs(e.z),1,W.EPSILON3)?n=Math.atan2(t.y,t.x)-W.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-W.PI_OVER_TWO,W.TWO_PI-W.zeroToTwoPi(n)}function Lye(e){return W.PI_OVER_TWO-W.acosClamped(e.z)}function Rye(e,t,n){let i=0;return W.equalsEpsilon(Math.abs(e.z),1,W.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=W.zeroToTwoPi(i+W.TWO_PI)),i}var qD=new M,$D=new M;Object.defineProperties(on.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Cc(this),this._invTransform}},viewMatrix:{get:function(){return Cc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Cc(this),this._invViewMatrix}},positionCartographic:{get:function(){return Cc(this),this._positionCartographic}},positionWC:{get:function(){return Cc(this),this._positionWC}},directionWC:{get:function(){return Cc(this),this._directionWC}},upWC:{get:function(){return Cc(this),this._upWC}},rightWC:{get:function(){return Cc(this),this._rightWC}},heading:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,qD),n=Ft.eastNorthUpToFixedFrame(this.positionWC,e,$D);this._setTransform(n);let i=Vye(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,qD),n=Ft.eastNorthUpToFixedFrame(this.positionWC,e,$D);this._setTransform(n);let i=Lye(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,qD),n=Ft.eastNorthUpToFixedFrame(this.positionWC,e,$D);this._setTransform(n);let i=Rye(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});on.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==oe.MORPHING,t=this._mode===oe.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,o=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=o*n.right,n.bottom=-n.top}this._mode===oe.SCENE2D&&Iye(this,this.position)};var elt=new h,tlt=new h,nlt=new h;on.prototype._setTransform=function(e){let t=h.clone(this.positionWC,elt),n=h.clone(this.upWC,tlt),i=h.clone(this.directionWC,nlt);M.clone(e,this._transform),this._transformChanged=!0,Cc(this);let o=this._actualInvTransform;M.multiplyByPoint(o,t,this.position),M.multiplyByPointAsVector(o,i,this.direction),M.multiplyByPointAsVector(o,n,this.up),h.cross(this.direction,this.up,this.right),Cc(this)};var ilt=new D,olt=new pn,rlt=new h,slt=new h;function Zye(e){if(!M.equals(M.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=ilt;i.x=t.drawingBufferWidth/2,i.y=t.drawingBufferHeight/2;let o;if(l(n)){let a=e.getPickRay(i,olt);o=n.pickWorldCoordinates(a,t,!0,rlt)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,slt));let s;if(l(o)||l(r)){let a=l(r)?h.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=l(o)?h.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}on.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof an&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=Zye(this)))};var eB=new h,xj=new M,alt=new M,_j=new we,Tj=new $,Gye=new he;function clt(e,t,n){let i=M.clone(e.transform,xj),o=Ft.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,alt);e._setTransform(o),h.clone(h.ZERO,e.position),n.heading=n.heading-W.PI_OVER_TWO;let r=we.fromHeadingPitchRoll(n,_j),s=$.fromQuaternion(r,Tj);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function llt(e,t,n,i){let o=M.clone(e.transform,xj);if(e._setTransform(M.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,Gye);t=a.project(c,eB)}h.clone(t,e.position)}n.heading=n.heading-W.PI_OVER_TWO;let r=we.fromHeadingPitchRoll(n,_j),s=$.fromQuaternion(r,Tj);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function dlt(e,t,n,i){let o=M.clone(e.transform,xj);if(e._setTransform(M.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,d=c.ellipsoid.cartesianToCartographic(t,Gye);t=c.project(d,eB)}D.clone(t,e.position);let r=-t.z*.5,s=-r,a=e.frustum;if(s>r){let c=a.top/a.right;a.right=s,a.left=r,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===Ql.ROTATE){n.heading=n.heading-W.PI_OVER_TWO,n.pitch=-W.PI_OVER_TWO,n.roll=0;let r=we.fromHeadingPitchRoll(n,_j),s=$.fromQuaternion(r,Tj);$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(o)}var ult=new h,mlt=new h,hlt=new h;function Eye(e,t,n,i){let o=h.clone(n.direction,ult),r=h.clone(n.up,mlt);if(e._scene.mode===oe.SCENE3D){let a=e._projection.ellipsoid,c=Ft.eastNorthUpToFixedFrame(t,a,qD),d=M.inverseTransformation(c,$D);M.multiplyByPointAsVector(d,o,o),M.multiplyByPointAsVector(d,r,r)}let s=h.cross(o,r,hlt);return i.heading=Vye(o,r),i.pitch=Lye(o),i.roll=Rye(o,r,s),i}var yj={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},YV=new Ca;on.prototype.setView=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.orientation,y.EMPTY_OBJECT),n=this._mode;if(n===oe.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=y(e.convert,!0),o=y(e.destination,h.clone(this.positionWC,eB));l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,eB),i=!1),l(t.direction)&&(t=Eye(this,o,t,yj.orientation)),YV.heading=y(t.heading,0),YV.pitch=y(t.pitch,-W.PI_OVER_TWO),YV.roll=y(t.roll,0),n===oe.SCENE3D?clt(this,o,YV):n===oe.SCENE2D?dlt(this,o,YV,i):llt(this,o,YV,i)};var flt=new h;on.prototype.flyHome=function(e){let t=this._mode;if(t===oe.MORPHING&&this._scene.completeMorph(),t===oe.SCENE2D)this.flyTo({destination:on.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:M.IDENTITY});else if(t===oe.SCENE3D){let n=this.getRectangleCameraCoordinates(on.DEFAULT_VIEW_RECTANGLE),i=h.magnitude(n);i+=i*on.DEFAULT_VIEW_FACTOR,h.normalize(n,n),h.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:M.IDENTITY})}else if(t===oe.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new h(0,-1,1);i=h.multiplyByScalar(h.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(h.normalize(i,flt).z),roll:0},endTransform:M.IDENTITY,convert:!1})}};on.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new se),Cc(this),M.multiplyByVector(this._actualInvTransform,e,t)};on.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),Cc(this),M.multiplyByPoint(this._actualInvTransform,e,t)};on.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),Cc(this),M.multiplyByPointAsVector(this._actualInvTransform,e,t)};on.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new se),Cc(this),M.multiplyByVector(this._actualTransform,e,t)};on.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),Cc(this),M.multiplyByPoint(this._actualTransform,e,t)};on.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),Cc(this),M.multiplyByPointAsVector(this._actualTransform,e,t)};function Iye(e,t){let n=e._scene.mapMode2D===Ql.ROTATE,i=e._maxCoord.x,o=e._maxCoord.y,r,s;n?(s=i,r=-s):(s=t.x-i*2,r=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=r),t.y>o&&(t.y=o),t.y<-o&&(t.y=-o)}var bye=new h;on.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,bye),h.add(n,bye,n),this._mode===oe.SCENE2D&&Iye(this,n),this._adjustOrthographicFrustum(!0)};on.prototype.moveForward=function(e){e=y(e,this.defaultMoveAmount),this._mode===oe.SCENE2D?tB(this,e):this.move(this.direction,e)};on.prototype.moveBackward=function(e){e=y(e,this.defaultMoveAmount),this._mode===oe.SCENE2D?tB(this,-e):this.move(this.direction,-e)};on.prototype.moveUp=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,e)};on.prototype.moveDown=function(e){e=y(e,this.defaultMoveAmount),this.move(this.up,-e)};on.prototype.moveRight=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,e)};on.prototype.moveLeft=function(e){e=y(e,this.defaultMoveAmount),this.move(this.right,-e)};on.prototype.lookLeft=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.up,-e)};on.prototype.lookRight=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.up,e)};on.prototype.lookUp=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.right,-e)};on.prototype.lookDown=function(e){e=y(e,this.defaultLookAmount),this._mode!==oe.SCENE2D&&this.look(this.right,e)};var plt=new we,blt=new $;on.prototype.look=function(e,t){let n=y(t,this.defaultLookAmount),i=we.fromAxisAngle(e,-n,plt),o=$.fromQuaternion(i,blt),r=this.direction,s=this.up,a=this.right;$.multiplyByVector(o,r,r),$.multiplyByVector(o,s,s),$.multiplyByVector(o,a,a)};on.prototype.twistLeft=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,e)};on.prototype.twistRight=function(e){e=y(e,this.defaultLookAmount),this.look(this.direction,-e)};var glt=new we,ylt=new $;on.prototype.rotate=function(e,t){let n=y(t,this.defaultRotateAmount),i=we.fromAxisAngle(e,-n,glt),o=$.fromQuaternion(i,ylt);$.multiplyByVector(o,this.position,this.position),$.multiplyByVector(o,this.direction,this.direction),$.multiplyByVector(o,this.up,this.up),h.cross(this.direction,this.up,this.right),h.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};on.prototype.rotateDown=function(e){e=y(e,this.defaultRotateAmount),Xye(this,e)};on.prototype.rotateUp=function(e){e=y(e,this.defaultRotateAmount),Xye(this,-e)};var xlt=new h,_lt=new h,Tlt=new h,gye=new h;function Xye(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,W.EPSILON2)){let i=h.normalize(n,xlt),o=h.equalsEpsilon(i,e.constrainedAxis,W.EPSILON2),r=h.equalsEpsilon(i,h.negate(e.constrainedAxis,gye),W.EPSILON2);if(!o&&!r){let s=h.normalize(e.constrainedAxis,_lt),a=h.dot(i,s),c=W.acosClamped(a);t>0&&t>c&&(t=c-W.EPSILON4),a=h.dot(i,h.negate(s,gye)),c=W.acosClamped(a),t<0&&-t>c&&(t=-c+W.EPSILON4);let d=h.cross(s,i,Tlt);e.rotate(d,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}on.prototype.rotateRight=function(e){e=y(e,this.defaultRotateAmount),Wye(this,-e)};on.prototype.rotateLeft=function(e){e=y(e,this.defaultRotateAmount),Wye(this,e)};function Wye(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function tB(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let o=n.top-t,r=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===Ql.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),o<=r&&(o=1,r=-1),i=n.right/n.top,n.top=o,n.bottom=r,n.right=n.top*i,n.left=-n.right}else{let o=n.right-t,r=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===Ql.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),o<=r&&(o=1,r=-1),i=n.top/n.right,n.right=o,n.left=r,n.top=n.right*i,n.bottom=-n.top}}function Pye(e,t){e.move(e.direction,t)}on.prototype.zoomIn=function(e){e=y(e,this.defaultZoomAmount),this._mode===oe.SCENE2D?tB(this,e):Pye(this,e)};on.prototype.zoomOut=function(e){e=y(e,this.defaultZoomAmount),this._mode===oe.SCENE2D?tB(this,-e):Pye(this,-e)};on.prototype.getMagnitude=function(){if(this._mode===oe.SCENE3D)return h.magnitude(this.position);if(this._mode===oe.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===oe.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var Slt=new M;on.prototype.lookAt=function(e,t){let n=this._scene,i=y(n.ellipsoid,ne.default),o=Ft.eastNorthUpToFixedFrame(e,i,Slt);this.lookAtTransform(o,t)};var Clt=new h,Vlt=new we,Llt=new we,Rlt=new $;function vye(e,t,n){t=W.clamp(t,-W.PI_OVER_TWO,W.PI_OVER_TWO),e=W.zeroToTwoPi(e)-W.PI_OVER_TWO;let i=we.fromAxisAngle(h.UNIT_Y,-t,Vlt),o=we.fromAxisAngle(h.UNIT_Z,-e,Llt),r=we.multiply(o,i,o),s=$.fromQuaternion(r,Rlt),a=h.clone(h.UNIT_X,Clt);return $.multiplyByVector(s,a,a),h.negate(a,a),h.multiplyByScalar(a,n,a),a}on.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=vye(t.heading,t.pitch,t.range):n=t,this._mode===oe.SCENE2D){D.clone(D.ZERO,this.position),h.negate(n,this.up),this.up.z=0,h.magnitudeSquared(this.up)<W.EPSILON10&&h.clone(h.UNIT_Y,this.up),h.normalize(this.up,this.up),this._setTransform(M.IDENTITY),h.negate(h.UNIT_Z,this.direction),h.cross(this.direction,this.up,this.right),h.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=h.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}h.clone(n,this.position),h.negate(this.position,this.direction),h.normalize(this.direction,this.direction),h.cross(this.direction,h.UNIT_Z,this.right),h.magnitudeSquared(this.right)<W.EPSILON10&&h.clone(h.UNIT_X,this.right),h.normalize(this.right,this.right),h.cross(this.right,this.direction,this.up),h.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var $w=new he,Zlt=new he,Glt=new h,Elt=new h,Ilt=new h,Xlt=new h,Wlt=new h,Plt=new h,vlt=new h,pj=new h,wlt={direction:new h,right:new h,up:new h},yye;function Sc(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function wye(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:wlt,{north:s,south:a,west:c}=t,{east:d}=t;c>d&&(d+=W.TWO_PI);let u=(c+d)*.5,m;if(a<-W.PI_OVER_TWO+W.RADIANS_PER_DEGREE&&s>W.PI_OVER_TWO-W.RADIANS_PER_DEGREE)m=0;else{let w=$w;w.longitude=u,w.latitude=s,w.height=0;let F=Zlt;F.longitude=u,F.latitude=a,F.height=0;let b=yye;(!l(b)||b.ellipsoid!==o)&&(yye=b=new Rp(void 0,void 0,o)),b.setEndPoints(w,F),m=b.interpolateUsingFraction(.5,$w).latitude}let p=$w;p.longitude=u,p.latitude=m,p.height=0;let g=o.cartographicToCartesian(p,vlt),f=$w;f.longitude=d,f.latitude=s;let x=o.cartographicToCartesian(f,Glt);f.longitude=c;let _=o.cartographicToCartesian(f,Ilt);f.longitude=u;let C=o.cartographicToCartesian(f,Wlt);f.latitude=a;let V=o.cartographicToCartesian(f,Plt);f.longitude=d;let L=o.cartographicToCartesian(f,Xlt);f.longitude=c;let Z=o.cartographicToCartesian(f,Elt);h.subtract(_,g,_),h.subtract(L,g,L),h.subtract(x,g,x),h.subtract(Z,g,Z),h.subtract(C,g,C),h.subtract(V,g,V);let G=o.geodeticSurfaceNormal(g,r.direction);h.negate(G,G);let I=h.cross(G,h.UNIT_Z,r.right);h.normalize(I,I);let v=h.cross(I,G,r.up),P;if(e.frustum instanceof an){let w=Math.max(h.distance(x,_),h.distance(L,Z)),F=Math.max(h.distance(x,L),h.distance(_,Z)),b,R,E=e.frustum._offCenterFrustum,X=E.right/E.top,A=F*X;w>A?(b=w,R=b/X):(R=F,b=A),P=Math.max(b,R)}else{let w=Math.tan(e.frustum.fovy*.5),F=e.frustum.aspectRatio*w;if(P=Math.max(Sc(G,v,_,w),Sc(G,v,L,w),Sc(G,v,x,w),Sc(G,v,Z,w),Sc(G,v,C,w),Sc(G,v,V,w),Sc(G,I,_,F),Sc(G,I,L,F),Sc(G,I,x,F),Sc(G,I,Z,F),Sc(G,I,C,F),Sc(G,I,V,F)),a<0&&s>0){let b=$w;b.longitude=c,b.latitude=0,b.height=0;let R=o.cartographicToCartesian(b,pj);h.subtract(R,g,R),P=Math.max(P,Sc(G,v,R,w),Sc(G,I,R,F)),b.longitude=d,R=o.cartographicToCartesian(b,pj),h.subtract(R,g,R),P=Math.max(P,Sc(G,v,R,w),Sc(G,I,R,F))}}return h.add(g,h.multiplyByScalar(G,-P,pj),n)}var Flt=new he,Alt=new h,Mlt=new h;function Nlt(e,t,n){let i=e._projection;t.west>t.east&&(t=ae.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=Flt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,Alt);M.multiplyByPoint(o,a,a),M.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,Mlt);if(M.multiplyByPoint(o,c,c),M.multiplyByPoint(r,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let d=Math.tan(e.frustum.fovy*.5),u=e.frustum.aspectRatio*d;n.z=Math.max((a.x-c.x)/u,(a.y-c.y)/d)*.5}else{let d=a.x-c.x,u=a.y-c.y;n.z=Math.max(d,u)}return n}var klt=new he,Ult=new h,Dlt=new h;function Blt(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===Ql.INFINITE_SCROLL?o+=W.TWO_PI:(t=ae.MAX_VALUE,o=t.east));let r=klt;r.longitude=o,r.latitude=t.north;let s=i.project(r,Ult);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,Dlt),c=Math.abs(s.x-a.x)*.5,d=Math.abs(s.y-a.y)*.5,u,m,p=e.frustum.right/e.frustum.top,g=d*p;return c>g?(u=c,m=u/p):(m=d,u=g),d=Math.max(2*u,2*m),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,r=i.unproject(n,r),r.height=d,n=i.project(r,n),n}on.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new h),n===oe.SCENE3D)return wye(this,e,t);if(n===oe.COLUMBUS_VIEW)return Nlt(this,e,t);if(n===oe.SCENE2D)return Blt(this,e,t)};var Olt=new pn;function Ylt(e,t,n,i){n=y(n,ne.default);let o=e.getPickRay(t,Olt),r=qn.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return pn.getPoint(o,s,i)}var Hlt=new pn;function zlt(e,t,n,i){let r=e.getPickRay(t,Hlt).origin;r=h.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-W.PI_OVER_TWO||s.latitude>W.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var Klt=new pn;function Jlt(e,t,n,i){let o=e.getPickRay(t,Klt),r=-o.origin.x/o.direction.x;pn.getPoint(o,r,i);let s=n.unproject(new h(i.y,i.z,0));if(!(s.latitude<-W.PI_OVER_TWO||s.latitude>W.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}on.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new h),t=y(t,ne.default),this._mode===oe.SCENE3D)n=Ylt(this,e,t,n);else if(this._mode===oe.SCENE2D)n=zlt(this,e,this._projection,n);else if(this._mode===oe.COLUMBUS_VIEW)n=Jlt(this,e,this._projection,n);else return;return n}};var Qlt=new h,jlt=new h,qlt=new h;function $lt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,d=2/o*t.x-1,u=2/r*(r-t.y)-1,m=e.positionWC;h.clone(m,n.origin);let p=h.multiplyByScalar(e.directionWC,c,Qlt);h.add(m,p,p);let g=h.multiplyByScalar(e.rightWC,d*c*a,jlt),f=h.multiplyByScalar(e.upWC,u*c*s,qlt),x=h.add(p,g,n.direction);return h.add(x,f,x),h.subtract(x,m,x),h.normalize(x,x),n}var QD=new h;function edt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/o*t.x-1;c*=(s.right-s.left)*.5;let d=2/r*(r-t.y)-1;d*=(s.top-s.bottom)*.5;let u=n.origin;return h.clone(e.position,u),h.multiplyByScalar(e.right,c,QD),h.add(QD,u,u),h.multiplyByScalar(e.up,d,QD),h.add(QD,u,u),h.clone(e.directionWC,n.direction),(e._mode===oe.COLUMBUS_VIEW||e._mode===oe.SCENE2D)&&h.fromElements(n.origin.z,n.origin.x,n.origin.y,n.origin),n}on.prototype.getPickRay=function(e,t){l(t)||(t=new pn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?$lt(this,e,t):edt(this,e,t)};var tdt=new h,ndt=new h;on.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,tdt),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),ndt);return Math.max(0,h.magnitude(n)-e.radius)};var idt=new D;on.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,idt);return Math.max(o.x,o.y)};function odt(e,t,n,i,o,r){let s=h.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>o?s.z-=n.z-o:n.z<-o&&(s.z+=-o-n.z);function a(c){let d=h.lerp(t,s,c.time,new h);e.worldToCameraCoordinatesPoint(d,e.position)}return{easingFunction:Yr.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var rdt=new h,xye=new h,sdt=new h,adt=new h;function cdt(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(h.UNIT_X,rdt),r=-h.dot(o,n)/h.dot(o,i),s=h.add(n,h.multiplyByScalar(i,r,xye),xye);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,sdt);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,d=h.magnitude(h.subtract(n,s,adt)),u=c*d,m=a*d,p=e._maxCoord.x,g=e._maxCoord.y,f=Math.max(u-p,p),x=Math.max(m-g,g);if(n.z<-f||n.z>f||n.y<-x||n.y>x){let _=s.y<-f||s.y>f,C=s.z<-x||s.z>x;if(_||C)return odt(e,n,s,f,x,t)}}on.prototype.createCorrectPositionTween=function(e){if(this._mode===oe.COLUMBUS_VIEW)return cdt(this,e)};var ldt=new h,qs={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};on.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};on.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=qs.destination,e.orientation.heading=qs.heading,e.orientation.pitch=qs.pitch,e.orientation.roll=qs.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};on.prototype.flyTo=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.destination;if(this._mode===oe.MORPHING)return;this.cancelFlight();let i=t instanceof ae;i&&(t=this.getRectangleCameraCoordinates(t,ldt));let o=y(e.orientation,y.EMPTY_OBJECT);if(l(o.direction)&&(o=Eye(this,t,o,yj.orientation)),l(e.duration)&&e.duration<=0){let u=yj;u.destination=e.destination,u.orientation.heading=o.heading,u.orientation.pitch=o.pitch,u.orientation.roll=o.roll,u.convert=e.convert,u.endTransform=e.endTransform,this.setView(u),typeof e.complete=="function"&&e.complete();return}let r=this,s;qs.destination=t,qs.heading=o.heading,qs.pitch=o.pitch,qs.roll=o.roll,qs.duration=e.duration,qs.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},qs.cancel=e.cancel,qs.endTransform=e.endTransform,qs.convert=i?!1:e.convert,qs.maximumHeight=e.maximumHeight,qs.pitchAdjustHeight=e.pitchAdjustHeight,qs.flyOverLongitude=e.flyOverLongitude,qs.flyOverLongitudeWeight=e.flyOverLongitudeWeight,qs.easingFunction=e.easingFunction;let a=this._scene,c=qw.createTween(a,qs);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let d=this._scene.preloadFlightCamera;this._mode!==oe.SCENE2D&&(l(d)||(d=on.clone(this)),d.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=d.frustum.computeCullingVolume(d.positionWC,d.directionWC,d.upWC))};function ddt(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function udt(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let o,r,s=n.right/n.top,a=t*s;return t>a?(o=t,r=o/s):(r=t,o=a),Math.max(o,r)*1.5}var mdt=100;function Fye(e,t,n){n=Qu.clone(l(n)?n:on.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!l(r)||r===0){let s=t.radius;s===0?n.range=mdt:e.frustum instanceof an||e._mode===oe.SCENE2D?n.range=udt(e,s):n.range=ddt(e,s),n.range=W.clamp(n.range,i,o)}return n}on.prototype.viewBoundingSphere=function(e,t){t=Fye(this,e,t),this.lookAt(e.center,t)};var hdt=new M,fdt=new h,pdt=new h,bdt=new h,gdt=new h,ydt=new se,xdt=new we,_dt=new $;on.prototype.flyToBoundingSphere=function(e,t){t=y(t,y.EMPTY_OBJECT);let n=this._mode===oe.SCENE2D||this._mode===oe.COLUMBUS_VIEW;this._setTransform(M.IDENTITY);let i=Fye(this,e,t.offset),o;n?o=h.multiplyByScalar(h.UNIT_Z,i.range,fdt):o=vye(i.heading,i.pitch,i.range);let r=this._scene,s=y(r.ellipsoid,ne.default),a=Ft.eastNorthUpToFixedFrame(e.center,s,hdt);M.multiplyByPoint(a,o,o);let c,d;if(!n){if(c=h.subtract(e.center,o,pdt),h.normalize(c,c),d=M.multiplyByPointAsVector(a,h.UNIT_Z,bdt),1-Math.abs(h.dot(c,d))<W.EPSILON6){let m=we.fromAxisAngle(c,i.heading,xdt),p=$.fromQuaternion(m,_dt);h.fromCartesian4(M.getColumn(a,1,ydt),d),$.multiplyByVector(p,d,d)}let u=h.cross(c,d,gdt);h.cross(u,c,d),h.normalize(d,d)}this.flyTo({destination:o,orientation:{direction:c,up:d},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var _ye=new h,Tye=new h,bj=new h,Sye=new h,eF=[new h,new h,new h,new h];function Tdt(e,t){let n=t.radii,i=e.positionWC,o=h.multiplyComponents(t.oneOverRadii,i,_ye),r=h.magnitude(o),s=h.normalize(o,Tye),a,c;h.equalsEpsilon(s,h.UNIT_Z,W.EPSILON10)?(a=new h(0,1,0),c=new h(0,0,1)):(a=h.normalize(h.cross(h.UNIT_Z,s,bj),bj),c=h.normalize(h.cross(s,a,Sye),Sye));let d=Math.sqrt(h.magnitudeSquared(o)-1),u=h.multiplyByScalar(s,1/r,_ye),m=d/r,p=h.multiplyByScalar(a,m,Tye),g=h.multiplyByScalar(c,m,bj),f=h.add(u,g,eF[0]);h.subtract(f,p,f),h.multiplyComponents(n,f,f);let x=h.subtract(u,g,eF[1]);h.subtract(x,p,x),h.multiplyComponents(n,x,x);let _=h.subtract(u,g,eF[2]);h.add(_,p,_),h.multiplyComponents(n,_,_);let C=h.add(u,g,eF[3]);return h.add(C,p,C),h.multiplyComponents(n,C,C),eF}var gj=new D,Sdt=new h,xy=[new he,new he,new he,new he];function jD(e,t,n,i,o,r){gj.x=e,gj.y=t;let s=i.pickEllipsoid(gj,o,Sdt);return l(s)?(xy[n]=o.cartesianToCartographic(s,xy[n]),1):(xy[n]=o.cartesianToCartographic(r[n],xy[n]),0)}on.prototype.computeViewRectangle=function(e,t){e=y(e,ne.default);let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new ce(h.ZERO,e.maximumRadius);if(n.computeVisibility(i)===Jt.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,c=0,d=Tdt(this,e);if(c+=jD(0,0,0,this,e,d),c+=jD(0,a,1,this,e,d),c+=jD(s,a,2,this,e,d),c+=jD(s,0,3,this,e,d),c<2)return ae.MAX_VALUE;t=ae.fromCartographicArray(xy,t);let u=0,m=xy[3].longitude;for(let p=0;p<4;++p){let g=xy[p].longitude,f=Math.abs(g-m);f>W.PI?u+=W.TWO_PI-f:u+=f,m=g}return W.equalsEpsilon(Math.abs(u),W.TWO_PI,W.EPSILON9)&&(t.west=-W.PI,t.east=W.PI,xy[0].latitude>=0?t.north=W.PI_OVER_TWO:t.south=-W.PI_OVER_TWO),t};on.prototype.switchToPerspectiveFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof Li)return;let e=this._scene;this.frustum=new Li,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=W.toRadians(60)};on.prototype.switchToOrthographicFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof an)return;let e=Zye(this),t=this._scene;this.frustum=new an,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};on.clone=function(e,t){return l(t)||(t=new on(e._scene)),h.clone(e.position,t.position),h.clone(e.direction,t.direction),h.clone(e.up,t.up),h.clone(e.right,t.right),M.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var io=on;var AXi=T(S(),1);function Cdt(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var rm=Cdt;var YXi=T(S(),1);var Uye=T(id(),1),Aye=576,Vdt=100,tF="#ffffff",nB="#48b";function Dye(e,t){this.credit=e,this.count=y(t,1)}function Ldt(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(Et.equals(o,t))return!0}return!1}function Rdt(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;Et.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var Bye="cesium-credit-delimiter";function Mye(e){let t=document.createElement("span");return t.textContent=e,t.className=Bye,t}function Nye(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function kye(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(r=s,l(n)&&(r*=2,s>0)){let d=r-1;if(o.length<=d)e.appendChild(Mye(n));else{let u=o[d];u.className!==Bye&&e.replaceChild(Mye(n),u)}}let c=a.element;if(o.length<=r)e.appendChild(Nye(c,i));else{let d=o[r];d._creditId!==a._id&&e.replaceChild(Nye(c,i),d)}}}for(++r;r<o.length;)e.removeChild(o[r])}function Zdt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<Aye?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=Aye&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function Gdt(e){let t=`
  9665. .cesium-credit-lightbox-overlay {
  9666. display: none;
  9667. z-index: 1;
  9668. position: absolute;
  9669. top: 0;
  9670. left: 0;
  9671. width: 100%;
  9672. height: 100%;
  9673. background-color: rgba(80, 80, 80, 0.8);
  9674. }
  9675. .cesium-credit-lightbox {
  9676. background-color: #303336;
  9677. color: ${tF};
  9678. position: relative;
  9679. min-height: ${Vdt}px;
  9680. margin: auto;
  9681. }
  9682. .cesium-credit-lightbox > ul > li a,
  9683. .cesium-credit-lightbox > ul > li a:visited,
  9684. .cesium-credit-wrapper a,
  9685. .cesium-credit-wrapper a:visited {
  9686. color: ${tF};
  9687. }
  9688. .cesium-credit-lightbox > ul > li a:hover {
  9689. color: ${nB};
  9690. }
  9691. .cesium-credit-lightbox.cesium-credit-lightbox-expanded {
  9692. border: 1px solid #444;
  9693. border-radius: 5px;
  9694. max-width: 370px;
  9695. }
  9696. .cesium-credit-lightbox.cesium-credit-lightbox-mobile {
  9697. height: 100%;
  9698. width: 100%;
  9699. }
  9700. .cesium-credit-lightbox-title {
  9701. padding: 20px 20px 0 20px;
  9702. }
  9703. .cesium-credit-lightbox-close {
  9704. font-size: 18pt;
  9705. cursor: pointer;
  9706. position: absolute;
  9707. top: 0;
  9708. right: 6px;
  9709. color: ${tF};
  9710. }
  9711. .cesium-credit-lightbox-close:hover {
  9712. color: ${nB};
  9713. }
  9714. .cesium-credit-lightbox > ul {
  9715. margin: 0;
  9716. padding: 12px 20px 12px 40px;
  9717. font-size: 13px;
  9718. }
  9719. .cesium-credit-lightbox > ul > li {
  9720. padding-bottom: 6px;
  9721. }
  9722. .cesium-credit-lightbox > ul > li * {
  9723. padding: 0;
  9724. margin: 0;
  9725. }
  9726. .cesium-credit-expand-link {
  9727. padding-left: 5px;
  9728. cursor: pointer;
  9729. text-decoration: underline;
  9730. color: ${tF};
  9731. }
  9732. .cesium-credit-expand-link:hover {
  9733. color: ${nB};
  9734. }
  9735. .cesium-credit-text {
  9736. color: ${tF};
  9737. }
  9738. .cesium-credit-delimiter {
  9739. padding: 0 5px;
  9740. }
  9741. .cesium-credit-textContainer *,
  9742. .cesium-credit-logoContainer * {
  9743. display: inline;
  9744. }
  9745. .cesium-credit-textContainer a:hover {
  9746. color: ${nB}
  9747. }
  9748. .cesium-credit-textContainer .cesium-credit-wrapper:first-of-type {
  9749. padding-left: 5px;
  9750. }
  9751. `;function n(r){if(r.shadowRoot)return r.shadowRoot;if(r.getRootNode){let s=r.getRootNode();if(s instanceof ShadowRoot)return s}}let i=y(n(e),document.head),o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function hr(e,t,n){let i=this;n=y(n,document.body);let o=document.createElement("div");o.className="cesium-credit-lightbox-overlay",n.appendChild(o);let r=document.createElement("div");r.className="cesium-credit-lightbox",o.appendChild(r);function s(f){r.contains(f.target)||i.hideLightbox()}o.addEventListener("click",s,!1);let a=document.createElement("div");a.className="cesium-credit-lightbox-title",a.textContent="Data provided by:",r.appendChild(a);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="&times;",c.className="cesium-credit-lightbox-close",r.appendChild(c);let d=document.createElement("ul");r.appendChild(d);let u=document.createElement("div");u.className="cesium-credit-logoContainer",u.style.display="inline",e.appendChild(u);let m=document.createElement("div");m.className="cesium-credit-textContainer",m.style.display="inline",e.appendChild(m);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),Gdt(e);let g=Et.clone(hr.cesiumCredit);this._delimiter=y(t,"\u2022"),this._screenContainer=m,this._cesiumCreditContainer=u,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=d,this._lightbox=o,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=g,this._previousCesiumCredit=void 0,this._currentCesiumCredit=g,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Zt,lightboxCredits:new Zt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function Oye(e,t,n,i){i=y(i,1);let o=t.get(n.id);if(l(o))o.count<Number.MAX_VALUE&&(o.count+=i);else{let r=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<r.length?(o=r[s],o.credit=n,o.count=i):(o=new Dye(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}hr.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=Et.clone(Yye())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,Oye(this,t,e)};hr.prototype.addStaticCredit=function(e){let t=this._staticCredits;Ldt(t,e)||t.push(e)};hr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};hr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};hr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};hr.prototype.update=function(){this._expanded&&Zdt(this)};hr.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let o=0;o<i.length;++o){let r=i[o],s=r.showOnScreen?t:n;r.isIon()&&Et.equals(hr.cesiumCredit,this._cesiumCredit)||Oye(this,s,r,Number.MAX_VALUE)}Et.equals(hr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Et.clone(hr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};hr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;kye(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",kye(this._creditList,t,void 0,"li"),Rdt(this)};hr.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),me(this)};hr.prototype.isDestroyed=function(){return!1};hr._cesiumCredit=void 0;hr._cesiumCreditInitialized=!1;var iB;function Yye(){if(!l(iB)){let e=rn("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new Uye.default(e).path()),iB=new Et(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return hr._cesiumCreditInitialized||(hr._cesiumCredit=iB,hr._cesiumCreditInitialized=!0),iB}Object.defineProperties(hr,{cesiumCredit:{get:function(){return Yye(),hr._cesiumCredit},set:function(e){hr._cesiumCredit=e,hr._cesiumCreditInitialized=!0}}});hr.CreditDisplayElement=Dye;var nF=hr;var BWi=T(S(),1);var lWi=T(S(),1);var oB=0,Edt=1;function RT(e){let t=e.frustum,n=e.orientation,i=e.origin,o=y(e.vertexFormat,We.DEFAULT),r=y(e._drawNearPlane,!0),s,a;t instanceof Li?(s=oB,a=Li.packedLength):t instanceof an&&(s=Edt,a=an.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=we.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+h.packedLength+we.packedLength+We.packedLength}RT.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===oB?(Li.pack(o,t,n),n+=Li.packedLength):(an.pack(o,t,n),n+=an.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,we.pack(e._orientation,t,n),n+=we.packedLength,We.pack(e._vertexFormat,t,n),n+=We.packedLength,t[n]=e._drawNearPlane?1:0,t};var Idt=new Li,Xdt=new an,Wdt=new we,Pdt=new h,vdt=new We;RT.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o;i===oB?(o=Li.unpack(e,t,Idt),t+=Li.packedLength):(o=an.unpack(e,t,Xdt),t+=an.packedLength);let r=h.unpack(e,t,Pdt);t+=h.packedLength;let s=we.unpack(e,t,Wdt);t+=we.packedLength;let a=We.unpack(e,t,vdt);t+=We.packedLength;let c=e[t]===1;if(!l(n))return new RT({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:c});let d=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(d),n._frustumType=i,n._origin=h.clone(r,n._origin),n._orientation=we.clone(s,n._orientation),n._vertexFormat=We.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function HV(e,t,n,i,o,r,s,a){let c=e/3*2;for(let d=0;d<4;++d)l(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),l(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),l(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;o[c]=0,o[c+1]=0,o[c+2]=1,o[c+3]=0,o[c+4]=1,o[c+5]=1,o[c+6]=0,o[c+7]=1}var wdt=new $,Fdt=new M,Sj=new M,Hye=new h,zye=new h,Kye=new h,Adt=new h,Mdt=new h,Ndt=new h,_y=new Array(3),iF=new Array(4);iF[0]=new se(-1,-1,1,1);iF[1]=new se(1,-1,1,1);iF[2]=new se(1,1,1,1);iF[3]=new se(-1,1,1,1);var Jye=new Array(4);for(let e=0;e<4;++e)Jye[e]=new se;RT._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let c=$.fromQuaternion(t,wdt),d=y(r,Hye),u=y(s,zye),m=y(a,Kye);d=$.getColumn(c,0,d),u=$.getColumn(c,1,u),m=$.getColumn(c,2,m),h.normalize(d,d),h.normalize(u,u),h.normalize(m,m),h.negate(d,d);let p=M.computeView(e,m,u,d,Fdt),g,f,x=i.projectionMatrix;if(n===oB){let _=M.multiply(x,p,Sj);f=M.inverse(_,Sj)}else g=M.inverseTransformation(p,Sj);l(f)?(_y[0]=i.near,_y[1]=i.far):(_y[0]=0,_y[1]=i.near,_y[2]=i.far);for(let _=0;_<2;++_)for(let C=0;C<4;++C){let V=se.clone(iF[C],Jye[C]);if(l(f)){V=M.multiplyByVector(f,V,V);let L=1/V.w;h.multiplyByScalar(V,L,V),h.subtract(V,e,V),h.normalize(V,V);let Z=h.dot(m,V);h.multiplyByScalar(V,_y[_]/Z,V),h.add(V,e,V)}else{let L=i.offCenterFrustum;l(L)&&(i=L);let Z=_y[_],G=_y[_+1];V.x=(V.x*(i.right-i.left)+i.left+i.right)*.5,V.y=(V.y*(i.top-i.bottom)+i.bottom+i.top)*.5,V.z=(V.z*(Z-G)-Z-G)*.5,V.w=1,M.multiplyByVector(g,V,V)}o[12*_+C*3]=V.x,o[12*_+C*3+1]=V.y,o[12*_+C*3+2]=V.z}};RT.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=e._vertexFormat,a=r?6:5,c=new Float64Array(3*4*6);RT._computeNearFarPlanes(i,o,t,n,c);let d=3*4*2;c[d]=c[3*4],c[d+1]=c[3*4+1],c[d+2]=c[3*4+2],c[d+3]=c[0],c[d+4]=c[1],c[d+5]=c[2],c[d+6]=c[3*3],c[d+7]=c[3*3+1],c[d+8]=c[3*3+2],c[d+9]=c[3*7],c[d+10]=c[3*7+1],c[d+11]=c[3*7+2],d+=3*4,c[d]=c[3*5],c[d+1]=c[3*5+1],c[d+2]=c[3*5+2],c[d+3]=c[3],c[d+4]=c[4],c[d+5]=c[5],c[d+6]=c[0],c[d+7]=c[1],c[d+8]=c[2],c[d+9]=c[3*4],c[d+10]=c[3*4+1],c[d+11]=c[3*4+2],d+=3*4,c[d]=c[3],c[d+1]=c[4],c[d+2]=c[5],c[d+3]=c[3*5],c[d+4]=c[3*5+1],c[d+5]=c[3*5+2],c[d+6]=c[3*6],c[d+7]=c[3*6+1],c[d+8]=c[3*6+2],c[d+9]=c[3*2],c[d+10]=c[3*2+1],c[d+11]=c[3*2+2],d+=3*4,c[d]=c[3*2],c[d+1]=c[3*2+1],c[d+2]=c[3*2+2],c[d+3]=c[3*6],c[d+4]=c[3*6+1],c[d+5]=c[3*6+2],c[d+6]=c[3*7],c[d+7]=c[3*7+1],c[d+8]=c[3*7+2],c[d+9]=c[3*3],c[d+10]=c[3*3+1],c[d+11]=c[3*3+2],r||(c=c.subarray(3*4));let u=new mn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:c})});if(l(s.normal)||l(s.tangent)||l(s.bitangent)||l(s.st)){let p=l(s.normal)?new Float32Array(12*a):void 0,g=l(s.tangent)?new Float32Array(3*4*a):void 0,f=l(s.bitangent)?new Float32Array(3*4*a):void 0,x=l(s.st)?new Float32Array(2*4*a):void 0,_=Hye,C=zye,V=Kye,L=h.negate(_,Adt),Z=h.negate(C,Mdt),G=h.negate(V,Ndt);d=0,r&&(HV(d,p,g,f,x,G,_,C),d+=3*4),HV(d,p,g,f,x,V,L,C),d+=3*4,HV(d,p,g,f,x,L,G,C),d+=3*4,HV(d,p,g,f,x,Z,G,L),d+=3*4,HV(d,p,g,f,x,_,V,C),d+=3*4,HV(d,p,g,f,x,C,V,L),l(p)&&(u.normal=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:p})),l(g)&&(u.tangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:g})),l(f)&&(u.bitangent=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:f})),l(x)&&(u.st=new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:2,values:x}))}let m=new Uint16Array(6*a);for(let p=0;p<a;++p){let g=p*6,f=p*4;m[g]=f,m[g+1]=f+1,m[g+2]=f+2,m[g+3]=f,m[g+4]=f+2,m[g+5]=f+3}return new ht({attributes:u,indices:m,primitiveType:Fe.TRIANGLES,boundingSphere:ce.fromVertices(c)})};var ZT=RT;var VWi=T(S(),1);var Cj=0,kdt=1;function oF(e){let t=e.frustum,n=e.orientation,i=e.origin,o=y(e._drawNearPlane,!0),r,s;t instanceof Li?(r=Cj,s=Li.packedLength):t instanceof an&&(r=kdt,s=an.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=we.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+h.packedLength+we.packedLength}oF.pack=function(e,t,n){n=y(n,0);let i=e._frustumType,o=e._frustum;return t[n++]=i,i===Cj?(Li.pack(o,t,n),n+=Li.packedLength):(an.pack(o,t,n),n+=an.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,we.pack(e._orientation,t,n),n+=we.packedLength,t[n]=e._drawNearPlane?1:0,t};var Udt=new Li,Ddt=new an,Bdt=new we,Odt=new h;oF.unpack=function(e,t,n){t=y(t,0);let i=e[t++],o;i===Cj?(o=Li.unpack(e,t,Udt),t+=Li.packedLength):(o=an.unpack(e,t,Ddt),t+=an.packedLength);let r=h.unpack(e,t,Odt);t+=h.packedLength;let s=we.unpack(e,t,Bdt);t+=we.packedLength;let a=e[t]===1;if(!l(n))return new oF({frustum:o,origin:r,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(c),n._frustumType=i,n._origin=h.clone(r,n._origin),n._orientation=we.clone(s,n._orientation),n._drawNearPlane=a,n};oF.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=new Float64Array(3*4*2);ZT._computeNearFarPlanes(i,o,t,n,s);let a=new mn({position:new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:s})}),c,d,u=r?2:1,m=new Uint16Array(8*(u+1)),p=r?0:1;for(;p<2;++p)c=r?p*8:0,d=p*4,m[c]=d,m[c+1]=d+1,m[c+2]=d+1,m[c+3]=d+2,m[c+4]=d+2,m[c+5]=d+3,m[c+6]=d+3,m[c+7]=d;for(p=0;p<2;++p)c=(u+p)*8,d=p*4,m[c]=d,m[c+1]=d+4,m[c+2]=d+1,m[c+3]=d+5,m[c+4]=d+2,m[c+5]=d+6,m[c+6]=d+3,m[c+7]=d+7;return new ht({attributes:a,indices:m,primitiveType:Fe.LINES,boundingSphere:ce.fromVertices(s)})};var rF=oF;function rB(e){e=y(e,y.EMPTY_OBJECT),this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=y(e.color,B.CYAN),this._updateOnChange=y(e.updateOnChange,!0),this.show=y(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var Ydt=new h,Hdt=new $,zdt=new we,Kdt=new Li,Jdt=new sl,Qdt=new an,jdt=new Pr,qdt=new B,$dt=[1,1e5];rB.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,o;if(this._updateOnChange){for(o=t.length,i=0;i<o;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let r=this._camera,s=r.frustum,a;s instanceof Li?a=Kdt:s instanceof sl?a=Jdt:s instanceof an?a=Qdt:a=jdt,a=s.clone(a);let c,d=this._frustumSplits;!l(d)||d.length<=1?(d=$dt,d[0]=this._camera.frustum.near,d[1]=this._camera.frustum.far,c=1):c=d.length-1;let u=r.positionWC,m=r.directionWC,p=r.upWC,g=r.rightWC;g=h.negate(g,Ydt);let f=Hdt;$.setColumn(f,0,g,f),$.setColumn(f,1,p,f),$.setColumn(f,2,m,f);let x=we.fromRotationMatrix(f,zdt);for(t.length=n.length=c,i=0;i<c;++i)a.near=d[i],a.far=d[i+1],t[i]=new In({geometryInstances:new Gt({geometry:new ZT({origin:u,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Kt.fromColor(B.fromAlpha(this._color,.1,qdt))},id:this.id,pickPrimitive:this}),appearance:new dn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new In({geometryInstances:new Gt({geometry:new rF({origin:u,orientation:x,frustum:a,_drawNearPlane:i===0}),attributes:{color:Kt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};rB.prototype.isDestroyed=function(){return!1};rB.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return me(this)};var Of=rB;var b2i=T(S(),1);var YWi=T(S(),1),sF=`in vec4 positionEC;
  9752. void main()
  9753. {
  9754. vec3 position;
  9755. vec3 direction;
  9756. if (czm_orthographicIn3D == 1.0)
  9757. {
  9758. vec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw;
  9759. vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); // left, bottom
  9760. vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top
  9761. position = vec3(mix(minPlane, maxPlane, uv), 0.0);
  9762. direction = vec3(0.0, 0.0, -1.0);
  9763. }
  9764. else
  9765. {
  9766. position = vec3(0.0);
  9767. direction = normalize(positionEC.xyz);
  9768. }
  9769. czm_ray ray = czm_ray(position, direction);
  9770. vec3 ellipsoid_center = czm_view[3].xyz;
  9771. czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);
  9772. if (!czm_isEmpty(intersection))
  9773. {
  9774. out_FragColor = vec4(1.0, 1.0, 0.0, 1.0);
  9775. }
  9776. else
  9777. {
  9778. discard;
  9779. }
  9780. czm_writeLogDepth();
  9781. }
  9782. `;var zWi=T(S(),1),aF=`in vec4 position;
  9783. out vec4 positionEC;
  9784. void main()
  9785. {
  9786. positionEC = czm_modelView * position;
  9787. gl_Position = czm_modelViewProjection * position;
  9788. czm_vertexLogDepth();
  9789. }
  9790. `;function lF(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=y(e,0)}var cF=zt.supportsTypedArrays()?new Float32Array(12):[],Qye=new h,jye=new h,Vj=new h,qye=new h,sB=new h;function eut(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof an)o=h.ZERO,r=i.rightWC,s=i.upWC;else{let m=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,m,Qye),g=h.normalize(p,jye),f=h.normalize(h.cross(h.UNIT_Z,p,Vj),Vj),x=h.normalize(h.cross(g,f,qye),qye),_=h.magnitude(p),C=Math.sqrt(_*_-1);o=h.multiplyByScalar(g,1/_,Qye);let V=C/_;r=h.multiplyByScalar(f,V,jye),s=h.multiplyByScalar(x,V,Vj)}let a=h.add(o,s,sB);h.subtract(a,r,a),h.multiplyComponents(n,a,a),h.pack(a,cF,0);let c=h.subtract(o,s,sB);h.subtract(c,r,c),h.multiplyComponents(n,c,c),h.pack(c,cF,3);let d=h.add(o,s,sB);h.add(d,r,d),h.multiplyComponents(n,d,d),h.pack(d,cF,6);let u=h.subtract(o,s,sB);return h.add(u,r,u),h.multiplyComponents(n,u,u),h.pack(u,cF,9),cF}lF.prototype.update=function(e){if(this._mode=e.mode,e.mode!==oe.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new ne(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(l(this._command)||(this._rs=Ue.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new tt({renderState:this._rs,boundingVolume:new ce(h.ZERO,i.maximumRadius),pass:Ge.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new De({sources:[aF]}),a=new De({sources:[sF]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=tn.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=eut(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new ht({attributes:{position:new Ze({componentDatatype:Q.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Fe.TRIANGLES});this._va=ti.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Me.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};lF.prototype.execute=function(e,t){this._mode===oe.SCENE3D&&this._command.execute(e,t)};lF.prototype.isDestroyed=function(){return!1};lF.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var dF=lF;var V2i=T(S(),1);function KV(){}var tut=/\bgl_FragDepth\b/,nut=/\bdiscard\b/;function iut(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(l(n))return n;let i=t.fragmentShaderSource,o=!1,r=i.sources;for(let a=0;a<r.length;++a)if(tut.test(r[a])||nut.test(r[a])){o=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!o&&!s){let a=`void main()
  9791. {
  9792. out_FragColor = vec4(1.0);
  9793. }
  9794. `;i=new De({sources:[a]})}else if(!o&&s){let a=`void main()
  9795. {
  9796. out_FragColor = vec4(1.0);
  9797. czm_writeLogDepth();
  9798. }
  9799. `;i=new De({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function out(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ue.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=Ue.fromCache(o);return n[t.id]=r,r}KV.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=tt.shallowClone(t,i.depthOnlyCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=iut(n,t.shaderProgram),i.depthOnlyCommand.renderState=out(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var rut=/\s+czm_writeLogDepth\(/,sut=/\s+czm_vertexLogDepth\(/;function aut(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(l(i))return i;let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,c=r.sources;for(let u=0;u<c.length;++u)if(sut.test(c[u])){a=!0;break}if(!a){for(let m=0;m<c.length;++m)c[m]=De.replaceMain(c[m],"czm_log_depth_main");c.push(`
  9800. void main()
  9801. {
  9802. czm_log_depth_main();
  9803. czm_vertexLogDepth();
  9804. }
  9805. `)}c=s.sources,a=!1;for(let u=0;u<c.length;++u)rut.test(c[u])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let d="";if(!a){for(let u=0;u<c.length;u++)c[u]=De.replaceMain(c[u],"czm_log_depth_main");d=`
  9806. void main()
  9807. {
  9808. czm_log_depth_main();
  9809. czm_writeLogDepth();
  9810. }
  9811. `}return c.push(d),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}KV.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=tt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=aut(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function cut(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(l(i))return i;let o=t._attributeLocations,{sources:r,defines:s}=t.fragmentShaderSource,c=r.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",d=`void main ()
  9812. {
  9813. czm_non_pick_main();
  9814. if (${c}.a == 0.0) {
  9815. discard;
  9816. }
  9817. ${c} = ${n};
  9818. } `,u=r.length,m=new Array(u+1);for(let g=0;g<u;++g)m[g]=De.replaceMain(r[g],"czm_non_pick_main");m[u]=d;let p=new De({sources:m,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function $ye(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ue.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=Ue.fromCache(o);return n[t.id]=r,r}KV.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=tt.shallowClone(t,i.pickCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=cut(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=$ye(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function zV(e,t,n){let i=e.length;for(let o=0;o<i;o++)e[o].trimStart().split(/\s+/)[0]===t&&(e[o]=`${t} ${n}`)}function exe(e){return e.isArray?e.arrayLength:Rt.getComponentCount(e.type)}function lut(e){let t=exe(e);return e.normalized?t===1?"float":`vec${t}`:t===1?"int":`ivec${t}`}function dut(e,t,n){let i=n.schemaId,o=n.className,r=n.propertyName,s=`pickMetadata-${i}-${o}-${r}`,a=e.shaderCache.getDerivedShaderProgram(t,s);if(l(a))return a;let c=n.classProperty,d=lut(c),u=["0.0","0.0","0.0","0.0"],m=exe(c);if(m===1)u[0]="float(value)";else{let x=["x","y","z","w"];for(let _=0;_<m;_++){let V=`value.${x[_]}`;u[_]=`float(${V})`}}if(!c.normalized)for(let x=0;x<m;x++)u[x]+=" / 255.0";let p=t.fragmentShaderSource.defines.slice();p.push(_d.METADATA_PICKING_ENABLED),zV(p,_d.METADATA_PICKING_VALUE_TYPE,d),zV(p,_d.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),zV(p,_d.METADATA_PICKING_VALUE_COMPONENT_X,u[0]),zV(p,_d.METADATA_PICKING_VALUE_COMPONENT_Y,u[1]),zV(p,_d.METADATA_PICKING_VALUE_COMPONENT_Z,u[2]),zV(p,_d.METADATA_PICKING_VALUE_COMPONENT_W,u[3]);let g=new De({sources:t.fragmentShaderSource.sources,defines:p});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:g,attributeLocations:t._attributeLocations})}KV.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=tt.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=dut(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=$ye(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function uut(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(l(n))return n;let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();return o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}KV.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=tt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=uut(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var Yf=KV;var X2i=T(S(),1);function aB(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let o=i.alpha;if(!l(o)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=W.toRadians(o),t._beta=W.toRadians(i.beta),t._gamma=W.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var mut=new we,txe=new we,hut=new $;function fut(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=we.fromAxisAngle(o,n,txe),c=we.fromAxisAngle(r,i,mut),d=we.multiply(c,a,c),u=we.fromAxisAngle(s,t,txe);we.multiply(u,d,d);let m=$.fromQuaternion(d,hut);$.multiplyByVector(m,r,r),$.multiplyByVector(m,s,s),$.multiplyByVector(m,o,o)}aB.prototype.update=function(){if(!l(this._alpha))return;l(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;fut(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};aB.prototype.isDestroyed=function(){return!1};aB.prototype.destroy=function(){return this._removeListener(),me(this)};var uF=aB;var A2i=T(S(),1);function Lj(){this.enabled=!0,this.renderable=!0,this.density=6e-4,this.heightScalar=.001,this._heightFalloff=.59,this.maxHeight=8e5,this.visualDensityScalar=.15,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}Object.defineProperties(Lj.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var put=new h;Lj.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>this.maxHeight||e.mode!==oe.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let o=i.height,r=this.density*this.heightScalar*Math.pow(Math.max(o/this.maxHeight,W.EPSILON4),-Math.max(this._heightFalloff,0)),s=h.normalize(n.positionWC,put),a=Math.abs(h.dot(n.directionWC,s));r*=1-a,e.fog.density=r,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var mF=Lj;var k2i=T(S(),1);function but(e,t,n){this.context=e,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=oe.SCENE3D,this.morphTime=oe.getMorphTime(oe.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,pickVoxel:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,renderable:!1,density:void 0,visualDensityScalar:void 0,sse:void 0,minimumBrightness:void 0},this.atmosphere=void 0,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0,this.pickingMetadata=!1,this.pickedMetadataInfo=void 0}var hF=but;var ePi=T(S(),1);var ya={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},GT=ya.DERIVED_COMMANDS_MAXIMUM_LENGTH,uxe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function ET(){this._frontFaceAlphaByDistance=new Ut(0,1,0,1),this._backFaceAlphaByDistance=new Ut(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=ae.clone(ae.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(GT),this._derivedBlendCommandTypes=new Array(GT),this._derivedPickCommandTypes=new Array(GT),this._derivedCommandTypesToUpdate=new Array(GT),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(ET.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});ET.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=nxe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=nxe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=ixe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=ixe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=_ut(this,e,t),this._sunVisibleThroughGlobe=gut(this,e),this._environmentVisible=yut(this,e),this._useDepthPlane=xut(this,e),this._numberOfTextureUniforms=Tut(this),this._rectangle=ae.clone(t.translucency.rectangle,this._rectangle),Sut(this,e)};function nxe(e,t,n,i){return e?l(n)?(Ut.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function ixe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function gut(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function yut(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function xut(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function _ut(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==oe.SCENE2D&&t.context.depthTexture}function Tut(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function Sut(e,t){e._derivedCommandsLength=Rj(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=Rj(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=Rj(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let o=0;for(n=0;n<GT;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[o++]=n);e._derivedCommandsToUpdateLength=o;let r=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=r,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=Aut())}function Rj(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let c=t.cameraUnderground,d=e._requiresManualDepthTest,u=i?ya.PICK_FRONT_FACE:d?ya.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:ya.TRANSLUCENT_FRONT_FACE,m=i?ya.PICK_BACK_FACE:d?ya.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:ya.TRANSLUCENT_BACK_FACE;return t.mode===oe.SCENE2D?(o[r++]=ya.DEPTH_ONLY_FRONT_FACE,o[r++]=u,r):(a?(n||(o[r++]=ya.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=u,o[r++]=m):(o[r++]=m,o[r++]=u)):c?(n||(o[r++]=ya.DEPTH_ONLY_BACK_FACE),o[r++]=ya.OPAQUE_FRONT_FACE,o[r++]=m):(n||(o[r++]=ya.DEPTH_ONLY_FRONT_FACE),o[r++]=ya.OPAQUE_BACK_FACE,o[r++]=u),r)}function sm(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function oxe(e,t){return e.indexOf(t)>-1}function Cut(e,t){sm(e.defines,"TRANSLUCENT"),sm(t.defines,"TRANSLUCENT")}function Vut(e,t){sm(e.defines,"GROUND_ATMOSPHERE"),sm(t.defines,"GROUND_ATMOSPHERE"),sm(e.defines,"FOG"),sm(t.defines,"FOG"),sm(e.defines,"TRANSLUCENT"),sm(t.defines,"TRANSLUCENT")}function Zj(e,t){if(oxe(t.defines,"TILE_LIMIT_RECTANGLE")||oxe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main()
  9819. {
  9820. out_FragColor = vec4(1.0);
  9821. }
  9822. `;t.sources=[n]}function Gj(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=De.replaceMain(n[r],"czm_globe_translucency_main");n.push(`
  9823. uniform sampler2D u_classificationTexture;
  9824. void main()
  9825. {
  9826. vec2 st = gl_FragCoord.xy / czm_viewport.zw;
  9827. #ifdef MANUAL_DEPTH_TEST
  9828. float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st));
  9829. if (logDepthOrDepth != 0.0)
  9830. {
  9831. vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
  9832. float depthEC = eyeCoordinate.z / eyeCoordinate.w;
  9833. if (v_positionEC.z < depthEC)
  9834. {
  9835. discard;
  9836. }
  9837. }
  9838. #endif
  9839. czm_globe_translucency_main();
  9840. vec4 classificationColor = texture(u_classificationTexture, st);
  9841. if (classificationColor.a > 0.0)
  9842. {
  9843. // Reverse premultiplication process to get the correct composited result of the classification primitives
  9844. classificationColor.rgb /= classificationColor.a;
  9845. }
  9846. out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a);
  9847. }
  9848. `)}function mxe(e,t){Gj(e,t),sm(e.defines,"GROUND_ATMOSPHERE"),sm(t.defines,"GROUND_ATMOSPHERE"),sm(e.defines,"FOG"),sm(t.defines,"FOG")}function Lut(e,t){Gj(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Rut(e,t){mxe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function rxe(e,t){let n=`uniform sampler2D u_classificationTexture;
  9849. void main()
  9850. {
  9851. vec2 st = gl_FragCoord.xy / czm_viewport.zw;
  9852. vec4 pickColor = texture(u_classificationTexture, st);
  9853. if (pickColor == vec4(0.0))
  9854. {
  9855. discard;
  9856. }
  9857. out_FragColor = pickColor;
  9858. }
  9859. `;t.sources=[n]}function Zut(e,t,n,i,o,r){if(!l(o))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),d=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],d.defines=l(d.defines)?d.defines.slice(0):[],o(c,d),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:a})}return s}function Gut(e){e.cull.face=yi.BACK,e.cull.enabled=!0}function Eut(e){e.cull.face=yi.FRONT,e.cull.enabled=!0}function Iut(e){e.cull.face=yi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Xut(e){e.cull.face=yi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Wut(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function sxe(e){e.cull.face=yi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=un.ALPHA_BLEND}function axe(e){e.cull.face=yi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=un.ALPHA_BLEND}function Put(e){e.cull.face=yi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function vut(e){e.cull.face=yi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function wut(e,t,n,i,o){if(!l(i))return e;if(!n&&l(t))return t;let r=o[e.id];if(!l(r)){let s=Ue.getState(e);i(s),r=Ue.fromCache(s),o[e.id]=r}return r}function JV(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function Fut(e,t,n,i,o){return l(o)?!i&&l(n)?n:Tt(t,o(e),!1):t}function Zh(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function Aut(){return[new Zh({pass:Ge.GLOBE,pickOnly:!1,getShaderProgramFunction:Cut,getRenderStateFunction:Gut,getUniformMapFunction:void 0}),new Zh({pass:Ge.GLOBE,pickOnly:!1,getShaderProgramFunction:Vut,getRenderStateFunction:Eut,getUniformMapFunction:void 0}),new Zh({pass:Ge.GLOBE,pickOnly:!1,getShaderProgramFunction:Zj,getRenderStateFunction:Iut,getUniformMapFunction:void 0}),new Zh({pass:Ge.GLOBE,pickOnly:!1,getShaderProgramFunction:Zj,getRenderStateFunction:Xut,getUniformMapFunction:void 0}),new Zh({pass:Ge.GLOBE,pickOnly:!1,getShaderProgramFunction:Zj,getRenderStateFunction:Wut,getUniformMapFunction:void 0}),new Zh({pass:Ge.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Gj,getRenderStateFunction:sxe,getUniformMapFunction:JV}),new Zh({pass:Ge.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:mxe,getRenderStateFunction:axe,getUniformMapFunction:JV}),new Zh({pass:Ge.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Lut,getRenderStateFunction:sxe,getUniformMapFunction:JV}),new Zh({pass:Ge.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Rut,getRenderStateFunction:axe,getUniformMapFunction:JV}),new Zh({pass:Ge.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:rxe,getRenderStateFunction:Put,getUniformMapFunction:JV}),new Zh({pass:Ge.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:rxe,getRenderStateFunction:vut,getUniformMapFunction:JV})]}var cxe=new Array(GT),lxe=new Array(GT);ET.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)lxe[o]=this._derivedCommandPacks[n[o]],cxe[o]=uxe[n[o]];Mut(this,e,i,n,cxe,lxe,t)}};function Mut(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let d=s.frameNumber,u=y(a.uniformMapDirtyFrame,0),m=y(a.shaderProgramDirtyFrame,0),p=y(a.renderStateDirtyFrame,0),g=a.uniformMap!==t.uniformMap,f=a.shaderProgramId!==t.shaderProgram.id,x=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=d),f&&(a.shaderProgramDirtyFrame=d),x&&(a.renderStateDirtyFrame=d),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let _=0;_<n;++_){let C=r[_],V=i[_],L=o[_],Z=a[L],G,I,v;l(Z)?(G=Z.uniformMap,I=Z.shaderProgram,v=Z.renderState):(G=void 0,I=void 0,v=void 0),Z=tt.shallowClone(t,Z),a[L]=Z;let P=y(Z.derivedCommands.uniformMapDirtyFrame,0),w=y(Z.derivedCommands.shaderProgramDirtyFrame,0),F=y(Z.derivedCommands.renderStateDirtyFrame,0),b=g||P<u,R=f||w<m,E=x||F<p;b&&(Z.derivedCommands.uniformMapDirtyFrame=d),R&&(Z.derivedCommands.shaderProgramDirtyFrame=d),E&&(Z.derivedCommands.renderStateDirtyFrame=d),Z.derivedCommands.type=V,Z.pass=C.pass,Z.pickOnly=C.pickOnly,Z.uniformMap=Fut(e,t.uniformMap,G,b,C.getUniformMapFunction),Z.shaderProgram=Zut(s.context,t.shaderProgram,I,R,C.getShaderProgramFunction,L),Z.renderState=wut(t.renderState,v,E,C.getRenderStateFunction,C.renderStateCache)}}}ET.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick||n.passes.pickVoxel;if(i&&t)return;let o=this._derivedCommandTypes,r=this._derivedCommandsLength;if(i?(o=this._derivedPickCommandTypes,r=this._derivedPickCommandsLength):t&&(o=this._derivedBlendCommandTypes,r=this._derivedBlendCommandsLength),r===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<r;++a){let c=uxe[o[a]];n.commandList.push(s[c])}};function hxe(e,t,n,i,o,r){for(let s=0;s<t;++s){let a=e[s],c=a.derivedCommands.type;(!l(r)||r.indexOf(c)>-1)&&n(a,i,o)}}function dxe(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var Nut=[ya.OPAQUE_FRONT_FACE,ya.OPAQUE_BACK_FACE],kut=[ya.DEPTH_ONLY_FRONT_FACE,ya.DEPTH_ONLY_BACK_FACE,ya.DEPTH_ONLY_FRONT_AND_BACK_FACE];ET.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Ge.GLOBE],a=e.indices[Ge.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),hxe(s,a,t,i,o,Nut))};ET.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:s}=r,a=e.commands[Ge.GLOBE],c=e.indices[Ge.GLOBE],d=e.commands[Ge.TERRAIN_CLASSIFICATION],u=e.indices[Ge.TERRAIN_CLASSIFICATION];if(c===0||u===0)return;let m=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!m||!p)&&dxe(d,u,t,i,o),!m&&!p)return;this._globeTranslucencyFramebuffer=n;let g=s.globeDepthTexture,f=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,hxe(a,c,t,i,o,kut),r.depthTexture){let x=n.packDepth(r,o);s.globeDepthTexture=x}dxe(d,u,t,i,o),s.globeDepthTexture=g,o.framebuffer=f};var fF=ET;var TPi=T(S(),1);var nPi=T(S(),1),jl=`uniform sampler2D colorTexture;
  9860. in vec2 v_textureCoordinates;
  9861. void main()
  9862. {
  9863. out_FragColor = texture(colorTexture, v_textureCoordinates);
  9864. }
  9865. `;function Hf(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new fi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new fi({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new ei({color:new B(0,0,0,0),owner:this}),this._clearCommand=new ei({color:new B(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(Hf.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});Hf.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var Uut={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Un.EQUAL,frontOperation:{fail:bt.KEEP,zFail:bt.KEEP,zPass:bt.KEEP},backFunction:Un.NEVER,reference:0,mask:Ot.CLASSIFICATION_MASK},blending:un.ALPHA_BLEND},Dut={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Un.NOT_EQUAL,frontOperation:{fail:bt.KEEP,zFail:bt.KEEP,zPass:bt.KEEP},backFunction:Un.NEVER,reference:0,mask:Ot.CLASSIFICATION_MASK},blending:un.ALPHA_BLEND},But={depthMask:!0,depthTest:{enabled:!0},stencilTest:Ot.setCesium3DTileBit(),stencilMask:Ot.CESIUM_3D_TILE_MASK,blending:un.ALPHA_BLEND},Out=`uniform sampler2D colorTexture;
  9866. uniform sampler2D depthTexture;
  9867. uniform sampler2D classifiedTexture;
  9868. in vec2 v_textureCoordinates;
  9869. void main()
  9870. {
  9871. vec4 color = texture(colorTexture, v_textureCoordinates);
  9872. if (color.a == 0.0)
  9873. {
  9874. discard;
  9875. }
  9876. bool isClassified = all(equal(texture(classifiedTexture, v_textureCoordinates), vec4(0.0)));
  9877. #ifdef UNCLASSIFIED
  9878. vec4 highlightColor = czm_invertClassificationColor;
  9879. if (isClassified)
  9880. {
  9881. discard;
  9882. }
  9883. #else
  9884. vec4 highlightColor = vec4(1.0);
  9885. if (!isClassified)
  9886. {
  9887. discard;
  9888. }
  9889. #endif
  9890. out_FragColor = color * highlightColor;
  9891. gl_FragDepth = texture(depthTexture, v_textureCoordinates).r;
  9892. }
  9893. `,Yut=`uniform sampler2D colorTexture;
  9894. in vec2 v_textureCoordinates;
  9895. void main()
  9896. {
  9897. vec4 color = texture(colorTexture, v_textureCoordinates);
  9898. if (color.a == 0.0)
  9899. {
  9900. discard;
  9901. }
  9902. #ifdef UNCLASSIFIED
  9903. out_FragColor = color * czm_invertClassificationColor;
  9904. #else
  9905. out_FragColor = color;
  9906. #endif
  9907. }
  9908. `;Hf.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),o=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let r=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new Pt({context:e,width:s,height:a,pixelFormat:ot.DEPTH_STENCIL,pixelDatatype:qe.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new cd({context:e,width:s,height:a,format:vc.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||o||r){this._fbo.destroy(),this._fboClassified.destroy();let d,u;l(this._previousFramebuffer)?(d=n.getDepthStencilTexture(),u=n.getDepthStencilRenderbuffer()):(d=this._depthStencilTexture,u=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(d),l(u)&&this._fbo.setDepthStencilRenderbuffer(u),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(d),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=Ue.fromCache(Uut),this._rsClassified=Ue.fromCache(Dut),this._rsDefault=Ue.fromCache(But)),!l(this._unclassifiedCommand)||o||r){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let d=l(this._previousFramebuffer)?Yut:Out,u=new De({defines:["UNCLASSIFIED"],sources:[d]}),m=new De({sources:[d]});this._unclassifiedCommand=e.createViewportQuadCommand(u,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(m,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(jl,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};Hf.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};Hf.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};Hf.prototype.executeClassified=function(e,t){if(!l(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};Hf.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};Hf.prototype.isDestroyed=function(){return!1};Hf.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),me(this)};var QV=Hf;var RPi=T(S(),1);function cB(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(cB.prototype,{total:{get:function(){return this._total}}});function Ty(e){let t=new Array(Wa.NUMBER_OF_JOB_TYPES);t[Wa.TEXTURE]=new cB(l(e)?e[Wa.TEXTURE]:10),t[Wa.PROGRAM]=new cB(l(e)?e[Wa.PROGRAM]:10),t[Wa.BUFFER]=new cB(l(e)?e[Wa.BUFFER]:30);let n=t.length,i,o=0;for(i=0;i<n;++i)o+=t[i].total;let r=new Array(n);for(i=0;i<n;++i)r[i]=!1;this._totalBudget=o,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=r}Ty.getTimestamp=_i;Object.defineProperties(Ty.prototype,{totalBudget:{get:function(){return this._totalBudget}}});Ty.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};Ty.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};Ty.prototype.execute=function(e,t){let n=this._budgets,i=n[t],o=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&o)return i.starvedThisFrame=!0,!1;let r;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,d;for(d=0;d<c&&(r=n[d],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++d);if(d===c&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=Ty.getTimestamp();e.execute();let a=Ty.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var pF=Ty;var WPi=T(S(),1);function lB(e){e=y(e,y.EMPTY_OBJECT);let t=Xn(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let o=document.createElement("div");o.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),o.appendChild(this._msText),n.appendChild(o),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=_i(),this._lastMsSampleTime=_i(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let r=document.createElement("div");r.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),r.appendChild(this._throttledText),n.appendChild(r)}Object.defineProperties(lB.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});lB.prototype.update=function(e){let t=_i(),n=y(e,!0);this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let r="N/A";n&&(r=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${r} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let o=t-this._lastMsSampleTime;if(o>200){let r="N/A";n&&(r=(o/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${r} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};lB.prototype.destroy=function(){return me(this)};var r0=lB;var kAi=T(S(),1);var OPi=T(S(),1);var al={};al.decodeRawMetadataValue=function(e,t,n){switch(e){case Ht.INT8:return t.getInt8(n);case Ht.UINT8:return t.getUint8(n);case Ht.INT16:return t.getInt16(n);case Ht.UINT16:return t.getUint16(n);case Ht.INT32:return t.getInt32(n);case Ht.UINT32:return t.getUint32(n);case Ht.INT64:return t.getBigInt64(n);case Ht.UINT64:return t.getBigUint64(n);case Ht.FLOAT32:return t.getFloat32(n);case Ht.FLOAT64:return t.getFloat64(n)}throw new de(`Invalid component type: ${e}`)};al.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=al.decodeRawMetadataValue(i,t,n);return e.normalized?Ht.normalize(o,i):o};al.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=Ht.getSizeInBytes(i),r=e.type,s=Rt.getComponentCount(r),a=o*s;if(s>1){let u=Array(s);for(let m=0;m<s;m++){let p=n*a+m*o,g=al.decodeRawMetadataValueComponent(e,t,p);u[m]=g}return u}let c=n*a;return al.decodeRawMetadataValueComponent(e,t,c)};al.decodeRawMetadataValues=function(e,t){let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.isArray){let o=e.arrayLength,r=Array(o);for(let s=0;s<o;s++){let a=al.decodeRawMetadataValueElement(e,n,s);r[s]=a}return r}return al.decodeRawMetadataValueElement(e,n,0)};al.convertToObjectType=function(e,t){if(!l(t)||e===Rt.SCALAR||e===Rt.STRING||e===Rt.BOOLEAN||e===Rt.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case Rt.VEC2:return D.unpack(n,0,new D);case Rt.VEC3:return h.unpack(n,0,new h);case Rt.VEC4:return se.unpack(n,0,new h);case Rt.MAT2:return wi.unpack(n,0,new wi);case Rt.MAT3:return $.unpack(n,0,new $);case Rt.MAT4:return M.unpack(n,0,new M)}return t};al.decodeMetadataValues=function(e,t){let n=al.decodeRawMetadataValues(e,t);if(e.isArray){let o=e.arrayLength,r=Array(o);for(let s=0;s<o;s++){let a=n[s],c=al.convertToObjectType(e.type,a);r[s]=c}return r}return al.convertToObjectType(e.type,n)};var bF=Object.freeze(al);var jPi=T(S(),1);function IT(){this._framebuffer=new fi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(IT.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Hut(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function zut(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture;
  9909. in vec2 v_textureCoordinates;
  9910. void main()
  9911. {
  9912. vec4 globeDepthPacked = texture(czm_globeDepthTexture, v_textureCoordinates);
  9913. float globeDepth = czm_unpackDepth(globeDepthPacked);
  9914. float depth = texture(colorTexture, v_textureCoordinates).r;
  9915. out_FragColor = czm_branchFreeTernary(globeDepth <= 0.0 || globeDepth >= 1.0 || depth < globeDepth && depth > 0.0 && depth < 1.0,
  9916. czm_packDepth(depth), globeDepthPacked);
  9917. }
  9918. `,{renderState:Ue.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}IT.prototype.update=function(e,t){Hut(this,e,t),zut(this,e,t)};var Kut=new se,Jut=new se(1,1/255,1/65025,1/16581375);IT.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=se.unpack(i,0,Kut);return se.divideByScalar(o,255,o),se.dot(o,Jut)};IT.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};IT.prototype.isDestroyed=function(){return!1};IT.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),me(this)};var gF=IT;var hAi=T(S(),1);var tvi=T(S(),1);function Qut(e,t){this.near=y(e,0),this.far=y(t,0);let n=Ge.NUMBER_OF_PASSES,i=new Array(n),o=new Array(n);for(let r=0;r<n;++r)i[r]=[],o[r]=0;this.commands=i,this.indices=o}var yF=Qut;var xvi=T(S(),1);var ivi=T(S(),1),Sy=`uniform highp sampler2D u_depthTexture;
  9919. in vec2 v_textureCoordinates;
  9920. void main()
  9921. {
  9922. out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r);
  9923. }
  9924. `;function zf(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new fi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new fi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new fi,this._tempCopyDepthFramebuffer=new fi,this._updateDepthFramebuffer=new fi({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new Ke,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(zf.prototype,{colorFramebufferManager:{get:function(){return this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}}});function fxe(e,t,n,i,o){let r=e._viewport;r.width=n,r.height=i;let s=!Ke.equals(r,o.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,Ke.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Ke.clone(o.viewport,e._scissorRectangle),a=!0),(!l(e._rs)||!Ke.equals(r,e._rs.viewport)||a)&&(e._rs=Ue.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ue.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:un.ALPHA_BLEND}),e._rsUpdate=Ue.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Un.EQUAL,frontOperation:{fail:bt.KEEP,zFail:bt.KEEP,zPass:bt.KEEP},backFunction:Un.NEVER,reference:Ot.CESIUM_3D_TILE_MASK,mask:Ot.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(Sy,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(jl,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(Sy,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(jl,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ei({color:new B(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}zf.prototype.update=function(e,t,n,i,o,r){let{width:s,height:a}=n,c=o?e.halfFloatingPointTexture?qe.HALF_FLOAT:qe.FLOAT:qe.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),fxe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};zf.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};zf.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};zf.prototype.executeUpdateDepth=function(e,t,n){let i=l(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!l(this._updateDepthCommand))return;let o=this._updateDepthFramebuffer;if(!l(o.framebuffer)||o.getDepthStencilTexture()!==i||o.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let r=this._copyDepthFramebuffer.getColorTexture(),{width:s,height:a}=r;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,s,a),o.setColorTexture(r,0),o.setDepthStencilTexture(i),o.update(e,s,a),fxe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};zf.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};zf.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(B.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};zf.prototype.isDestroyed=function(){return!1};zf.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),me(this)};var xF=zf;var Ivi=T(S(),1);function XT(){this._framebuffer=new fi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new fi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new Ke,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(XT.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function jut(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function qut(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?qe.HALF_FLOAT:qe.FLOAT:qe.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function $ut(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!Ke.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,Ke.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Ke.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!Ke.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(Sy,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new ei({color:new B(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}XT.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;qut(this,n,o,r,e),$ut(this,n,o,r,i),this._useHdr=e};XT.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};XT.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};XT.prototype.isDestroyed=function(){return!1};XT.prototype.destroy=function(){return jut(this),me(this)};var _F=XT;var $vi=T(S(),1);var Wvi=T(S(),1),jV=`#ifdef MRT
  9925. layout (location = 0) out vec4 out_FragData_0;
  9926. layout (location = 1) out vec4 out_FragData_1;
  9927. #else
  9928. layout (location = 0) out vec4 out_FragColor;
  9929. #endif
  9930. uniform vec4 u_bgColor;
  9931. uniform sampler2D u_depthTexture;
  9932. in vec2 v_textureCoordinates;
  9933. void main()
  9934. {
  9935. if (texture(u_depthTexture, v_textureCoordinates).r < 1.0)
  9936. {
  9937. #ifdef MRT
  9938. out_FragData_0 = u_bgColor;
  9939. out_FragData_1 = vec4(u_bgColor.a);
  9940. #else
  9941. out_FragColor = u_bgColor;
  9942. #endif
  9943. return;
  9944. }
  9945. discard;
  9946. }
  9947. `;var vvi=T(S(),1),TF=`/**
  9948. * Compositing for Weighted Blended Order-Independent Transparency. See:
  9949. * - http://jcgt.org/published/0002/02/09/
  9950. * - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html
  9951. */
  9952. uniform sampler2D u_opaque;
  9953. uniform sampler2D u_accumulation;
  9954. uniform sampler2D u_revealage;
  9955. in vec2 v_textureCoordinates;
  9956. void main()
  9957. {
  9958. vec4 opaque = texture(u_opaque, v_textureCoordinates);
  9959. vec4 accum = texture(u_accumulation, v_textureCoordinates);
  9960. float r = texture(u_revealage, v_textureCoordinates).r;
  9961. #ifdef MRT
  9962. vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);
  9963. #else
  9964. vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);
  9965. #endif
  9966. out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;
  9967. if (opaque != czm_backgroundColor)
  9968. {
  9969. out_FragColor.a = 1.0;
  9970. }
  9971. }
  9972. `;function s0(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new fi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new fi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new fi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new fi({createColorAttachments:!1}),this._opaqueClearCommand=new ei({color:new B(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ei({color:new B(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ei({color:new B(0,0,0,0),owner:this}),this._alphaClearCommand=new ei({color:new B(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new Ke,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function pxe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function Ej(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function bxe(e){pxe(e),Ej(e)}function emt(e,t,n,i){pxe(e),e._accumulationTexture=new Pt({context:t,width:n,height:i,pixelFormat:ot.RGBA,pixelDatatype:qe.FLOAT}),e._revealageTexture=new Pt({context:t,pixelFormat:ot.RGBA,pixelDatatype:qe.FLOAT,width:n,height:i,flipY:!1})}function tmt(e,t){Ej(e);let n=ie.FRAMEBUFFER_COMPLETE,i=!0,{width:o,height:r}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,o,r),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(Ej(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,o,r),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,o,r);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,d=e._adjustAlphaFBO.status===n;(!s||!a||!c||!d)&&(bxe(e),e._translucentMultipassSupport=!1,i=!1)}return i}s0.prototype.update=function(e,t,n,i,o){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:r,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==r||a.height!==s||i!==this._useHDR,d=this._numSamples!==o;if((c||d)&&(this._numSamples=o,emt(this,e,r,s)),(!l(this._translucentFBO.framebuffer)||c||d)&&!tmt(this,e))return;this._useHDR=i;let u=this,m,p;l(this._compositeCommand)||(m=new De({sources:[TF]}),this._translucentMRTSupport&&m.defines.push("MRT"),p={u_opaque:function(){return u._opaqueTexture},u_accumulation:function(){return u._accumulationTexture},u_revealage:function(){return u._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(m=new De({defines:["MRT"],sources:[jV]}),p={u_bgColor:function(){return u._translucentMRTClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(m=new De({sources:[jV]}),p={u_bgColor:function(){return u._translucentMultipassClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this}),p={u_bgColor:function(){return u._alphaClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=s;let g=!Ke.equals(this._viewport,t.viewport),f=g!==this._useScissorTest;this._useScissorTest=g,Ke.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=Ke.clone(t.viewport,this._scissorRectangle),f=!0),(!l(this._rs)||!Ke.equals(this._viewport,this._rs.viewport)||f)&&(this._rs=Ue.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var nmt={enabled:!0,color:new B(0,0,0,0),equationRgb:Ga.ADD,equationAlpha:Ga.ADD,functionSourceRgb:Co.ONE,functionDestinationRgb:Co.ONE,functionSourceAlpha:Co.ZERO,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA},imt={enabled:!0,color:new B(0,0,0,0),equationRgb:Ga.ADD,equationAlpha:Ga.ADD,functionSourceRgb:Co.ONE,functionDestinationRgb:Co.ONE,functionSourceAlpha:Co.ONE,functionDestinationAlpha:Co.ONE},omt={enabled:!0,color:new B(0,0,0,0),equationRgb:Ga.ADD,equationAlpha:Ga.ADD,functionSourceRgb:Co.ZERO,functionDestinationRgb:Co.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Co.ZERO,functionDestinationAlpha:Co.ONE_MINUS_SOURCE_ALPHA};function Ij(e,t,n,i){let o=n[i.id];if(!l(o)){let r=Ue.getState(i);r.depthMask=!1,r.blending=t,o=Ue.fromCache(r),n[i.id]=o}return o}function rmt(e,t,n){return Ij(t,nmt,e._translucentRenderStateCache,n)}function smt(e,t,n){return Ij(t,imt,e._translucentRenderStateCache,n)}function amt(e,t,n){return Ij(t,omt,e._alphaRenderStateCache,n)}var cmt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a;
  9973. float ai = czm_out_FragColor.a;
  9974. float wzi = czm_alphaWeight(ai);
  9975. out_FragData_0 = vec4(Ci * wzi, ai);
  9976. out_FragData_1 = vec4(ai * wzi);
  9977. `,lmt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a;
  9978. float ai = czm_out_FragColor.a;
  9979. float wzi = czm_alphaWeight(ai);
  9980. out_FragColor = vec4(Ci, ai) * wzi;
  9981. `,dmt=` float ai = czm_out_FragColor.a;
  9982. out_FragColor = vec4(ai);
  9983. `;function Xj(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(l(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(u){return De.replaceMain(u,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`vec4 czm_out_FragColor;
  9984. bool czm_discard = false;
  9985. `);let c=[...i.matchAll(/out_FragData_(\d+)/g)],d="";for(let u=0;u<c.length;u++){let m=c[u];d=`layout (location = ${m[1]}) out vec4 ${m[0]};
  9986. ${d}`}return a.sources.push(d),a.sources.push(`void main()
  9987. {
  9988. czm_translucent_main();
  9989. if (czm_discard)
  9990. {
  9991. discard;
  9992. }
  9993. ${i}}
  9994. `),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function umt(e,t){return Xj(e,t,"translucentMRT",cmt)}function mmt(e,t){return Xj(e,t,"translucentMultipass",lmt)}function hmt(e,t){return Xj(e,t,"alphaMultipass",dmt)}s0.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let a,c;return l(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=tt.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=umt(t,e.shaderProgram),n.translucentCommand.renderState=rmt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,o,r,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=tt.shallowClone(e,n.translucentCommand),n.alphaCommand=tt.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=mmt(t,e.shaderProgram),n.translucentCommand.renderState=smt(this,t,e.renderState),n.alphaCommand.shaderProgram=hmt(t,e.shaderProgram),n.alphaCommand.renderState=amt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=o,n.alphaCommand.shaderProgram=r,n.alphaCommand.renderState=s),n};function fmt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:d}=a,u=t._hdr,m=i.framebuffer,p=d.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let f=0;f<o.length;++f){let x=o[f];x=c?x.derivedCommands.logDepth.command:x,x=u?x.derivedCommands.hdr.command:x;let _=p&&x.receiveShadows?x.derivedCommands.oit.shadows.translucentCommand:x.derivedCommands.oit.translucentCommand;n(_,t,i,g)}if(l(r)){let f=r.unclassifiedCommand,x=p&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand;n(x,t,i,g)}i.framebuffer=e._alphaFBO.framebuffer;for(let f=0;f<o.length;++f){let x=o[f];x=c?x.derivedCommands.logDepth.command:x,x=u?x.derivedCommands.hdr.command:x;let _=p&&x.receiveShadows?x.derivedCommands.oit.shadows.alphaCommand:x.derivedCommands.oit.alphaCommand;n(_,t,i,g)}if(l(r)){let f=r.unclassifiedCommand,x=p&&f.receiveShadows?f.derivedCommands.oit.shadows.alphaCommand:f.derivedCommands.oit.alphaCommand;n(x,t,i,g)}i.framebuffer=m}function pmt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:d}=a,u=t._hdr,m=i.framebuffer,p=d.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let f=0;f<o.length;++f){let x=o[f];x=c?x.derivedCommands.logDepth.command:x,x=u?x.derivedCommands.hdr.command:x;let _=p&&x.receiveShadows?x.derivedCommands.oit.shadows.translucentCommand:x.derivedCommands.oit.translucentCommand;n(_,t,i,g)}if(l(r)){let f=r.unclassifiedCommand,x=p&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand;n(x,t,i,g)}i.framebuffer=m}s0.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){pmt(this,e,t,n,i,o);return}fmt(this,e,t,n,i,o)};s0.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};s0.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,B.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};s0.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};s0.prototype.isDestroyed=function(){return!1};s0.prototype.destroy=function(){return bxe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),me(this)};var SF=s0;var rwi=T(S(),1);function CF(){this._framebuffer=new fi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(CF.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function bmt(e){e._framebuffer.destroy()}function gmt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new ec(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new Ke},o.viewport=new Ke,e._passState=o}CF.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&gmt(this,e);let r=this.framebuffer,s=this._passState;return s.framebuffer=r,s.viewport.width=i,s.viewport.height=o,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=o-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};CF.prototype.isDestroyed=function(){return!1};CF.prototype.destroy=function(){return bmt(this),me(this)};var VF=CF;var fwi=T(S(),1);function qV(e){let t=new ec(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new Ke},t.viewport=new Ke,this._context=e,this._fb=new fi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}qV.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return Ke.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=o,this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};var LF=new B;qV.prototype.end=function(e){let t=y(e.width,1),n=y(e.height,1),i=this._context,o=i.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.max(t,n),s=r*r,a=Math.floor(t*.5),c=Math.floor(n*.5),d=0,u=0,m=0,p=-1;for(let g=0;g<s;++g){if(-a<=d&&d<=a&&-c<=u&&u<=c){let f=4*((c-u)*t+d+a);LF.red=B.byteToFloat(o[f]),LF.green=B.byteToFloat(o[f+1]),LF.blue=B.byteToFloat(o[f+2]),LF.alpha=B.byteToFloat(o[f+3]);let x=i.getObjectByPickColor(LF);if(l(x))return x}if(d===u||d<0&&-d===u||d>0&&d===1-u){let f=m;m=-p,p=f}d+=m,u+=p}};qV.prototype.readCenterPixel=function(e){let t=y(e.width,1),n=y(e.height,1),o=this._context.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.floor(t*.5),a=4*(Math.floor(n*.5)*t+r);return o.slice(a,a+4)};qV.prototype.isDestroyed=function(){return!1};qV.prototype.destroy=function(){return this._fb.destroy(),me(this)};var RF=qV;var Twi=T(S(),1);function a0(){this._numSamples=1,this._colorFramebuffer=new fi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new fi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new B(0,0,0,0),this._clearCommand=new ei({color:new B(0,0,0,0),depth:1,owner:this})}function ymt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(a0.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});a0.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?qe.HALF_FLOAT:qe.FLOAT:qe.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};a0.prototype.clear=function(e,t,n){B.clone(n,this._clearCommand.color),B.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};a0.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};a0.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};a0.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};a0.prototype.isDestroyed=function(){return!1};a0.prototype.destroy=function(){return ymt(this),me(this)};var WT=a0;var yFi=T(S(),1);var Lwi=T(S(),1);function PT(){}PT.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};PT.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let r=De.findPositionVarying(e),s=l(r);if(t&&!s){let a=o.length;for(let d=0;d<a;++d)o[d]=De.replaceMain(o[d],"czm_shadow_cast_main");o.push(`out vec3 v_positionEC;
  9995. void main()
  9996. {
  9997. czm_shadow_cast_main();
  9998. v_positionEC = (czm_inverseProjection * gl_Position).xyz;
  9999. }`)}return new De({defines:i,sources:o})};PT.createShadowCastFragmentShader=function(e,t,n,i){let o=e.defines.slice(0),r=e.sources.slice(0);o.push("SHADOW_MAP");let s=De.findPositionVarying(e),a=l(s);a||(s="v_positionEC");let c=r.length;for(let u=0;u<c;++u)r[u]=De.replaceMain(r[u],"czm_shadow_cast_main");let d="";return t&&(a||(d+=`in vec3 v_positionEC;
  10000. `),d+=`uniform vec4 shadowMap_lightPositionEC;
  10001. `),i?d+=`void main()
  10002. {
  10003. `:d+=`void main()
  10004. {
  10005. czm_shadow_cast_main();
  10006. if (out_FragColor.a == 0.0)
  10007. {
  10008. discard;
  10009. }
  10010. `,t?d+=` float distance = length(${s});
  10011. if (distance >= shadowMap_lightPositionEC.w)
  10012. {
  10013. discard;
  10014. }
  10015. distance /= shadowMap_lightPositionEC.w; // radius
  10016. out_FragColor = czm_packDepth(distance);
  10017. `:n?d+=` out_FragColor = vec4(1.0);
  10018. `:d+=` out_FragColor = czm_packDepth(gl_FragCoord.z);
  10019. `,d+=`}
  10020. `,r.push(d),new De({defines:o,sources:r})};PT.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,d=e.debugCascadeColors,u=e.softShadows;return`receiveShadow ${o}${r}${s}${a}${c}${d}${u}${t}${n}${i}`};PT.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new De({defines:i,sources:o})};PT.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=De.findNormalVarying(e),s=!i&&l(r)||i&&o,a=De.findPositionVarying(e),c=l(a),d=t._usesDepthTexture,u=t._polygonOffsetSupported,m=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,f=t.debugCascadeColors,x=t.softShadows,_=m?t._pointBias:i?t._terrainBias:t._primitiveBias,C=e.defines.slice(0),V=e.sources.slice(0),L=V.length;for(let I=0;I<L;++I)V[I]=De.replaceMain(V[I],"czm_shadow_receive_main");m?C.push("USE_CUBE_MAP_SHADOW"):d&&C.push("USE_SHADOW_DEPTH_TEXTURE"),x&&!m&&C.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?C.push("ENABLE_VERTEX_LIGHTING"):C.push("ENABLE_DAYNIGHT_SHADING")),n&&_.normalShading&&s&&(C.push("USE_NORMAL_SHADING"),_.normalShadingSmooth>0&&C.push("USE_NORMAL_SHADING_SMOOTH"));let Z="";m?Z+=`uniform samplerCube shadowMap_textureCube;
  10021. `:Z+=`uniform sampler2D shadowMap_texture;
  10022. `;let G;return c?G=` return vec4(${a}, 1.0);
  10023. `:G=`#ifndef LOG_DEPTH
  10024. return czm_windowToEyeCoordinates(gl_FragCoord);
  10025. #else
  10026. return vec4(v_logPositionEC, 1.0);
  10027. #endif
  10028. `,Z+=`uniform mat4 shadowMap_matrix;
  10029. uniform vec3 shadowMap_lightDirectionEC;
  10030. uniform vec4 shadowMap_lightPositionEC;
  10031. uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness;
  10032. uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth;
  10033. #ifdef LOG_DEPTH
  10034. in vec3 v_logPositionEC;
  10035. #endif
  10036. vec4 getPositionEC()
  10037. {
  10038. ${G}}
  10039. vec3 getNormalEC()
  10040. {
  10041. ${s?` return normalize(${r});
  10042. `:` return vec3(1.0);
  10043. `}}
  10044. void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL)
  10045. {
  10046. ${_.normalOffset&&s?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x;
  10047. float normalOffsetScale = 1.0 - nDotL;
  10048. vec3 offset = normalOffset * normalOffsetScale * normalEC;
  10049. positionEC.xyz += offset;
  10050. `:""}}
  10051. `,Z+=`void main()
  10052. {
  10053. czm_shadow_receive_main();
  10054. vec4 positionEC = getPositionEC();
  10055. vec3 normalEC = getNormalEC();
  10056. float depth = -positionEC.z;
  10057. `,Z+=` czm_shadowParameters shadowParameters;
  10058. shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy;
  10059. shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z;
  10060. shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w;
  10061. shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w;
  10062. `,i?Z+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0);
  10063. `:u||(Z+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015);
  10064. `),m?Z+=` vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz;
  10065. float distance = length(directionEC);
  10066. directionEC = normalize(directionEC);
  10067. float radius = shadowMap_lightPositionEC.w;
  10068. // Stop early if the fragment is beyond the point light radius
  10069. if (distance > radius)
  10070. {
  10071. return;
  10072. }
  10073. vec3 directionWC = czm_inverseViewRotation * directionEC;
  10074. shadowParameters.depth = distance / radius;
  10075. shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0);
  10076. shadowParameters.texCoords = directionWC;
  10077. float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters);
  10078. `:p?Z+=` vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz);
  10079. float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0);
  10080. applyNormalOffset(positionEC, normalEC, nDotL);
  10081. vec4 shadowPosition = shadowMap_matrix * positionEC;
  10082. // Spot light uses a perspective projection, so perform the perspective divide
  10083. shadowPosition /= shadowPosition.w;
  10084. // Stop early if the fragment is not in the shadow bounds
  10085. if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0))))
  10086. {
  10087. return;
  10088. }
  10089. shadowParameters.texCoords = shadowPosition.xy;
  10090. shadowParameters.depth = shadowPosition.z;
  10091. shadowParameters.nDotL = nDotL;
  10092. float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters);
  10093. `:g?Z+=` float maxDepth = shadowMap_cascadeSplits[1].w;
  10094. // Stop early if the eye depth exceeds the last cascade
  10095. if (depth > maxDepth)
  10096. {
  10097. return;
  10098. }
  10099. // Get the cascade based on the eye-space depth
  10100. vec4 weights = czm_cascadeWeights(depth);
  10101. // Apply normal offset
  10102. float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0);
  10103. applyNormalOffset(positionEC, normalEC, nDotL);
  10104. // Transform position into the cascade
  10105. vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC;
  10106. // Get visibility
  10107. shadowParameters.texCoords = shadowPosition.xy;
  10108. shadowParameters.depth = shadowPosition.z;
  10109. shadowParameters.nDotL = nDotL;
  10110. float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters);
  10111. // Fade out shadows that are far away
  10112. float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z;
  10113. float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0);
  10114. visibility = mix(visibility, 1.0, fade);
  10115. ${f?` // Draw cascade colors for debugging
  10116. out_FragColor *= czm_cascadeColor(weights);
  10117. `:""}`:Z+=` float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0);
  10118. applyNormalOffset(positionEC, normalEC, nDotL);
  10119. vec4 shadowPosition = shadowMap_matrix * positionEC;
  10120. // Stop early if the fragment is not in the shadow bounds
  10121. if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0))))
  10122. {
  10123. return;
  10124. }
  10125. shadowParameters.texCoords = shadowPosition.xy;
  10126. shadowParameters.depth = shadowPosition.z;
  10127. shadowParameters.nDotL = nDotL;
  10128. float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters);
  10129. `,Z+=` out_FragColor.rgb *= visibility;
  10130. }
  10131. `,V.push(Z),new De({defines:C,sources:V})};var Kf=PT;function Jf(e){e=y(e,y.EMPTY_OBJECT);let t=e.context;this._enabled=y(e.enabled,!0),this._softShadows=y(e.softShadows,!1),this._normalOffset=y(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=y(e.fromLightSource,!0),this.darkness=y(e.darkness,.3),this._darkness=this.darkness,this.fadingEnabled=y(e.fadingEnabled,!0),this.maximumDistance=y(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(zt.isInternetExplorer()||zt.isEdge()||(zt.isChrome()||zt.isFirefox())&&zt.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new M,this._shadowMapTexture=void 0,this._lightDirectionEC=new h,this._lightPositionEC=new se,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new dB,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ce,this._isPointLight=y(e.isPointLight,!1),this._pointLightRadius=y(e.pointLightRadius,100),this._cascadesEnabled=this._isPointLight?!1:y(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?y(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new D,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Pr:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new se,new se],this._cascadeMatrices=[new M,new M,new M,new M],this._cascadeDistances=new se;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let o=0;o<i;++o)this._passes[o]=new xmt(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,Pj(this),this._clearCommand=new ei({depth:1,color:new B}),this._clearPassState=new ec(t),this._size=y(e.size,2048),this.size=this._size}Jf.MAXIMUM_DISTANCE=2e4;function xmt(e){this.camera=new dB,this.passState=new ec(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function Wj(e,t){return Ue.fromCache({cull:{enabled:!0,face:yi.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function Pj(e){let t=!e._usesDepthTexture;e._primitiveRenderState=Wj(t,e._primitiveBias),e._terrainRenderState=Wj(t,e._terrainBias),e._pointRenderState=Wj(t,e._pointBias)}Jf.prototype.debugCreateRenderStates=function(){Pj(this)};Object.defineProperties(Jf.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){Lmt(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function vj(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],o=i.framebuffer;l(o)&&!o.isDestroyed()&&o.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function _mt(e,t){let n=new cd({context:t,width:e._textureSize.x,height:e._textureSize.y,format:vc.DEPTH_COMPONENT16}),i=new Pt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ot.RGBA,pixelDatatype:qe.UNSIGNED_BYTE,sampler:en.NEAREST}),o=new Wr({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),r=e._passes.length;for(let s=0;s<r;++s){let a=e._passes[s];a.framebuffer=o,a.passState.framebuffer=o}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function Tmt(e,t){let n=new Pt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ot.DEPTH_STENCIL,pixelDatatype:qe.UNSIGNED_INT_24_8,sampler:en.NEAREST}),i=new Wr({context:t,depthStencilTexture:n,destroyAttachments:!1}),o=e._passes.length;for(let r=0;r<o;++r){let s=e._passes[r];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function Smt(e,t){let n=new cd({context:t,width:e._textureSize.x,height:e._textureSize.y,format:vc.DEPTH_COMPONENT16}),i=new yr({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ot.RGBA,pixelDatatype:qe.UNSIGNED_BYTE,sampler:en.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new Wr({context:t,depthRenderbuffer:n,colorTextures:[o[r]],destroyAttachments:!1}),a=e._passes[r];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function xxe(e,t){e._isPointLight?Smt(e,t):e._usesDepthTexture?Tmt(e,t):_mt(e,t)}function Cmt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ie.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,Pj(e),vj(e),xxe(e,t))}function Vmt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(vj(e),xxe(e,t),Cmt(e,t),_xe(e,t))}function _xe(e,t,n){n=y(n,0),(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function Lmt(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=Bt.maximumCubeMapSize>=t?t:Bt.maximumCubeMapSize,o.x=t,o.y=t;let r=new Ke(0,0,t,t);n[0].passState.viewport=r,n[1].passState.viewport=r,n[2].passState.viewport=r,n[3].passState.viewport=r,n[4].passState.viewport=r,n[5].passState.viewport=r}else i===1?(t=Bt.maximumTextureSize>=t?t:Bt.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new Ke(0,0,t,t)):i===4&&(t=Bt.maximumTextureSize>=t*2?t:Bt.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new Ke(0,0,t,t),n[1].passState.viewport=new Ke(t,0,t,t),n[2].passState.viewport=new Ke(0,t,t,t),n[3].passState.viewport=new Ke(t,t,t,t));e._clearPassState.viewport=new Ke(0,0,o.x,o.y);for(let r=0;r<i;++r){let s=n[r],a=s.passState.viewport,c=a.x/o.x,d=a.y/o.y,u=a.width/o.x,m=a.height/o.y;s.textureOffsets=new M(u,0,0,c,0,m,0,d,0,0,1,0,0,0,0,1)}}var Rmt=new Ke;function Zmt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube;
  10132. in vec2 v_textureCoordinates;
  10133. void main()
  10134. {
  10135. vec2 uv = v_textureCoordinates;
  10136. vec3 dir;
  10137. if (uv.y < 0.5)
  10138. {
  10139. if (uv.x < 0.333)
  10140. {
  10141. dir.x = -1.0;
  10142. dir.y = uv.x * 6.0 - 1.0;
  10143. dir.z = uv.y * 4.0 - 1.0;
  10144. }
  10145. else if (uv.x < 0.666)
  10146. {
  10147. dir.y = -1.0;
  10148. dir.x = uv.x * 6.0 - 3.0;
  10149. dir.z = uv.y * 4.0 - 1.0;
  10150. }
  10151. else
  10152. {
  10153. dir.z = -1.0;
  10154. dir.x = uv.x * 6.0 - 5.0;
  10155. dir.y = uv.y * 4.0 - 1.0;
  10156. }
  10157. }
  10158. else
  10159. {
  10160. if (uv.x < 0.333)
  10161. {
  10162. dir.x = 1.0;
  10163. dir.y = uv.x * 6.0 - 1.0;
  10164. dir.z = uv.y * 4.0 - 3.0;
  10165. }
  10166. else if (uv.x < 0.666)
  10167. {
  10168. dir.y = 1.0;
  10169. dir.x = uv.x * 6.0 - 3.0;
  10170. dir.z = uv.y * 4.0 - 3.0;
  10171. }
  10172. else
  10173. {
  10174. dir.z = 1.0;
  10175. dir.x = uv.x * 6.0 - 5.0;
  10176. dir.y = uv.y * 4.0 - 3.0;
  10177. }
  10178. }
  10179. float shadow = czm_unpackDepth(czm_textureCube(shadowMap_textureCube, dir));
  10180. out_FragColor = vec4(vec3(shadow), 1.0);
  10181. }
  10182. `:n=`uniform sampler2D shadowMap_texture;
  10183. in vec2 v_textureCoordinates;
  10184. void main()
  10185. {
  10186. ${e._usesDepthTexture?` float shadow = texture(shadowMap_texture, v_textureCoordinates).r;
  10187. `:` float shadow = czm_unpackDepth(texture(shadowMap_texture, v_textureCoordinates));
  10188. `} out_FragColor = vec4(vec3(shadow), 1.0);
  10189. }
  10190. `;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Ge.OVERLAY,i}function Gmt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=Rmt;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;l(a)||(a=Zmt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!Ke.equals(a.renderState.viewport,s))&&(a.renderState=Ue.fromCache({viewport:Ke.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var Qf=new Array(8);Qf[0]=new se(-1,-1,-1,1);Qf[1]=new se(1,-1,-1,1);Qf[2]=new se(1,1,-1,1);Qf[3]=new se(-1,1,-1,1);Qf[4]=new se(-1,-1,1,1);Qf[5]=new se(1,-1,1,1);Qf[6]=new se(1,1,1,1);Qf[7]=new se(-1,1,1,1);var Cy=new M,wj=new Array(8);for(let e=0;e<8;++e)wj[e]=new se;function Emt(e,t){let n=new Gt({geometry:new Lm({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:Kt.fromColor(t)}}),i=new Gt({geometry:new Tb({radius:.5}),attributes:{color:Kt.fromColor(t)}});return new In({geometryInstances:[n,i],appearance:new dn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var Imt=[B.RED,B.GREEN,B.BLUE,B.MAGENTA],Xmt=new h;function Wmt(e,t){Gmt(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new Of({camera:e._sceneCamera,color:B.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new Of({camera:e._shadowMapCamera,color:B.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new Of({camera:e._passes[i].camera,color:Imt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=we.IDENTITY,r=e._pointLightRadius*2,s=h.fromElements(r,r,r,Xmt),a=M.fromTranslationQuaternionRotationScale(i,o,s,Cy);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=Emt(a,B.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new Of({camera:e._shadowMapCamera,color:B.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function dB(){this.viewMatrix=new M,this.inverseViewMatrix=new M,this.frustum=void 0,this.positionCartographic=new he,this.positionWC=new h,this.directionWC=h.clone(h.UNIT_Z),this.upWC=h.clone(h.UNIT_Y),this.rightWC=h.clone(h.UNIT_X),this.viewProjectionMatrix=new M}dB.prototype.clone=function(e){M.clone(e.viewMatrix,this.viewMatrix),M.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),he.clone(e.positionCartographic,this.positionCartographic),h.clone(e.positionWC,this.positionWC),h.clone(e.directionWC,this.directionWC),h.clone(e.upWC,this.upWC),h.clone(e.rightWC,this.rightWC)};var Pmt=new M(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);dB.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return M.multiply(t,e,this.viewProjectionMatrix),M.multiply(Pmt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var vmt=new Array(5),wmt=new Li,Fmt=new Array(4),Txe=new h,Sxe=new h;function Amt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,c=r-o,d=r/o,u=.9,m=!1;t.shadowState.closestObjectSize<200&&(m=!0,u=.9);let p=Fmt,g=vmt;for(g[0]=o,g[s]=r,a=0;a<s;++a){let F=(a+1)/s,b=o*Math.pow(d,F),R=o+c*F,E=W.lerp(R,b,u);g[a+1]=E,p[a]=E-g[a]}if(m){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let F=g[0];for(a=0;a<s-1;++a)F+=p[a],g[a+1]=F}se.unpack(g,0,e._cascadeSplits[0]),se.unpack(g,1,e._cascadeSplits[1]),se.unpack(p,0,e._cascadeDistances);let f=n.frustum,x=f.left,_=f.right,C=f.bottom,V=f.top,L=f.near,Z=f.far,G=n.positionWC,I=n.directionWC,v=n.upWC,P=i.frustum.clone(wmt),w=n.getViewProjection();for(a=0;a<s;++a){P.near=g[a],P.far=g[a+1];let F=M.multiply(P.projectionMatrix,i.viewMatrix,Cy),b=M.inverse(F,Cy),R=M.multiply(w,b,Cy),E=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Txe),X=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Sxe);for(let Y=0;Y<8;++Y){let k=se.clone(Qf[Y],wj[Y]);M.multiplyByVector(R,k,k),h.divideByScalar(k,k.w,k),h.minimumByComponent(k,E,E),h.maximumByComponent(k,X,X)}E.x=Math.max(E.x,0),E.y=Math.max(E.y,0),E.z=0,X.x=Math.min(X.x,1),X.y=Math.min(X.y,1),X.z=Math.min(X.z,1);let A=e._passes[a],N=A.camera;N.clone(n);let O=N.frustum;O.left=x+E.x*(_-x),O.right=x+X.x*(_-x),O.bottom=C+E.y*(V-C),O.top=C+X.y*(V-C),O.near=L+E.z*(Z-L),O.far=L+X.z*(Z-L),A.cullingVolume=N.frustum.computeCullingVolume(G,I,v);let U=e._cascadeMatrices[a];M.multiply(N.getViewProjection(),i.inverseViewMatrix,U),M.multiply(A.textureOffsets,U,U)}}var Mmt=new M,Nmt=new h,kmt=new h,gxe=new h;function Umt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=M.multiply(i.frustum.projectionMatrix,i.viewMatrix,Cy),r=M.inverse(o,Cy),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,W.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,Nmt);a=h.cross(c,s,kmt),h.normalize(a,a),h.normalize(c,c);let d=h.fromElements(0,0,0,gxe),u=M.computeView(d,s,a,c,Mmt),m=M.multiply(u,r,Cy),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Txe),g=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Sxe);for(let Z=0;Z<8;++Z){let G=se.clone(Qf[Z],wj[Z]);M.multiplyByVector(m,G,G),h.divideByScalar(G,G.w,G),h.minimumByComponent(G,p,p),h.maximumByComponent(G,g,g)}g.z+=1e3,p.z-=10;let f=gxe;f.x=-(.5*(p.x+g.x)),f.y=-(.5*(p.y+g.y)),f.z=-g.z;let x=M.fromTranslation(f,Cy);u=M.multiply(x,u,u);let _=.5*(g.x-p.x),C=.5*(g.y-p.y),V=g.z-p.z,L=n.frustum;L.left=-_,L.right=_,L.bottom=-C,L.top=C,L.near=.01,L.far=V,M.clone(u,n.viewMatrix),M.inverse(u,n.inverseViewMatrix),M.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),h.clone(s,n.directionWC),h.clone(a,n.upWC),h.clone(c,n.rightWC)}var Dmt=[new h(-1,0,0),new h(0,-1,0),new h(0,0,-1),new h(1,0,0),new h(0,1,0),new h(0,0,1)],Bmt=[new h(0,-1,0),new h(0,0,-1),new h(0,-1,0),new h(0,-1,0),new h(0,0,1),new h(0,-1,0)],Omt=[new h(0,0,1),new h(1,0,0),new h(-1,0,0),new h(0,0,-1),new h(1,0,0),new h(1,0,0)];function Ymt(e,t){let n=new Li;n.fov=W.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let o=e._passes[i].camera;o.positionWC=e._shadowMapCamera.positionWC,o.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(o.positionWC,o.positionCartographic),o.directionWC=Dmt[i],o.upWC=Bmt[i],o.rightWC=Omt[i],M.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),M.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var Hmt=new h,zmt=new h,Cxe=new ce,yxe=Cxe.center;function Kmt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=Cxe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,Hmt),s=h.negate(i.directionWC,zmt),a=h.dot(r,s);if(e.fadingEnabled){let c=W.clamp(a/.1,0,1);e._darkness=W.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)o.center=i.positionWC,o.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(o)===Jt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ce.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,r,yxe),yxe);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===Jt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),ce.clone(o,e._boundingSphere)}}function Jmt(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?h.clone(i.directionWC,r.directionWC):e._isPointLight?h.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;M.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),h.normalize(s,s),h.negate(s,s),M.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=io.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,Kmt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}Jf.prototype.update=function(e){if(Jmt(this,e),this._needsUpdate)if(Vmt(this,e.context),this._isPointLight&&Ymt(this,e),this._cascadesEnabled&&(Umt(this,e),this._numberOfCascades>1&&Amt(this,e)),this._isPointLight)this._shadowMapCullingVolume=ms.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,o=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,o),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;M.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&Wmt(this,e)};Jf.prototype.updatePass=function(e,t){_xe(this,e,t)};var Qmt=new D;function Vxe(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,o={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let r=Qmt;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,se.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return se.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new se,combinedUniforms2:new se};return Tt(t,o,!1)}function jmt(e,t,n,i,o,r){let s,a,c;if(l(r)&&(s=r.shaderProgram,a=r.renderState,c=r.uniformMap),r=tt.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(s)||o!==n.shaderProgram.id||t){let d=n.shaderProgram,u=n.pass===Ge.GLOBE,m=n.pass!==Ge.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,f=Kf.getShadowCastShaderKeyword(p,u,g,m);if(s=i.shaderCache.getDerivedShaderProgram(d,f),!l(s)){let _=d.vertexShaderSource,C=d.fragmentShaderSource,V=Kf.createShadowCastVertexShader(_,p,u),L=Kf.createShadowCastFragmentShader(C,p,g,m);s=i.shaderCache.createDerivedShaderProgram(d,f,{vertexShaderSource:V,fragmentShaderSource:L,attributeLocations:d._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:u&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Ye(a,!1),a.cull=Ye(a.cull,!1),a.cull.enabled=!1,a=Ue.fromCache(a)),c=Vxe(e,n.uniformMap,u)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=c,r}Jf.createReceiveDerivedCommand=function(e,t,n,i,o){l(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,d=t.pass===Ge.GLOBE,u=!1;if(d&&(u=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let m,p;l(o.receiveCommand)&&(m=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=tt.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let g=o.receiveShaderCastShadows!==t.castShadows,f=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(m)||f||n||g){let x=Kf.getShadowReceiveShaderKeyword(e[0],t.castShadows,d,u);if(m=i.shaderCache.getDerivedShaderProgram(s,x),!l(m)){let _=Kf.createShadowReceiveVertexShader(a,d,u),C=Kf.createShadowReceiveFragmentShader(c,e[0],t.castShadows,d,u);m=i.shaderCache.createDerivedShaderProgram(s,x,{vertexShaderSource:_,fragmentShaderSource:C,attributeLocations:s._attributeLocations})}p=Vxe(e[0],t.uniformMap,d)}o.receiveCommand.shaderProgram=m,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};Jf.createCastDerivedCommand=function(e,t,n,i,o){if(l(o)||(o={}),t.castShadows){let r=o.castCommands;l(r)||(r=o.castCommands=[]);let s=o.castShaderProgramId,a=e.length;r.length=a;for(let c=0;c<a;++c)r[c]=jmt(e[c],n,t,i,s,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};Jf.prototype.isDestroyed=function(){return!1};Jf.prototype.destroy=function(){vj(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return me(this)};var c0=Jf;var BFi=T(S(),1);var _Fi=T(S(),1),ZF=`uniform sampler2D u_opaqueDepthTexture;
  10191. uniform sampler2D u_translucentDepthTexture;
  10192. in vec2 v_textureCoordinates;
  10193. void main()
  10194. {
  10195. float opaqueDepth = texture(u_opaqueDepthTexture, v_textureCoordinates).r;
  10196. float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates).r;
  10197. translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth);
  10198. out_FragColor = czm_packDepth(translucentDepth);
  10199. }
  10200. `;var SFi=T(S(),1),vT=`uniform sampler2D colorTexture;
  10201. #ifdef DEBUG_SHOW_DEPTH
  10202. uniform sampler2D u_packedTranslucentDepth;
  10203. #endif
  10204. in vec2 v_textureCoordinates;
  10205. void main()
  10206. {
  10207. #ifdef DEBUG_SHOW_DEPTH
  10208. if (v_textureCoordinates.x < 0.5)
  10209. {
  10210. out_FragColor.rgb = vec3(czm_unpackDepth(texture(u_packedTranslucentDepth, v_textureCoordinates)));
  10211. out_FragColor.a = 1.0;
  10212. }
  10213. #else
  10214. vec4 color = texture(colorTexture, v_textureCoordinates);
  10215. #ifdef PICK
  10216. if (color == vec4(0.0))
  10217. {
  10218. discard;
  10219. }
  10220. #else
  10221. // Reverse premultiplication process to get the correct composited result of the classification primitives
  10222. color.rgb /= color.a;
  10223. #endif
  10224. out_FragColor = color;
  10225. #endif
  10226. }
  10227. `;var qmt=!1;function Vy(e){this._drawClassificationFBO=new fi({createDepthAttachments:!1}),this._accumulationFBO=new fi({createDepthAttachments:!1}),this._packFBO=new fi,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new ei({color:new B(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ei({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new Ke,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(Vy.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function Lxe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function Rxe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function $mt(e,t,n,i){Lxe(e),e._translucentDepthStencilTexture=new Pt({context:t,width:n,height:i,pixelFormat:ot.DEPTH_STENCIL,pixelDatatype:qe.UNSIGNED_INT_24_8,sampler:en.NEAREST})}function eht(e,t,n,i){Rxe(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function tht(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let o=e._opaqueDepthStencilTexture.width,r=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(o,r)&&($mt(e,t,o,r),eht(e,t,o,r));let s,a;if(l(e._packDepthCommand)||(s=new De({sources:[ZF]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!l(e._compositeCommand)){s=new De({sources:[vT]}),a={colorTexture:function(){return e._textureToComposite}},qmt&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let u=e._compositeCommand,m=u.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(m,"pick",{vertexShaderSource:m.vertexShaderSource,fragmentShaderSource:new De({sources:s.sources,defines:["PICK"]}),attributeLocations:m._attributeLocations}),g=tt.shallowClone(u);g.shaderProgram=p,u.derivedCommands.pick=g}l(e._copyCommand)||(s=new De({sources:[vT]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new De({sources:[vT]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=o,e._viewport.height=r;let c=!Ke.equals(e._viewport,n.viewport),d=c!==e._useScissorTest;e._useScissorTest=c,Ke.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=Ke.clone(n.viewport,e._scissorRectangle),d=!0),(!l(e._rsDepth)||!Ke.equals(e._viewport,e._rsDepth.viewport)||d)&&(e._rsDepth=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!Ke.equals(e._viewport,e._rsAccumulate.viewport)||d)&&(e._rsAccumulate=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Un.EQUAL,reference:Ot.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!Ke.equals(e._viewport,e._rsComp.viewport)||d)&&(e._rsComp=Ue.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:un.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}Vy.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let c=0;c<i.length;++c){let d=i[c];if(d=r?d.derivedCommands.logDepth.command:d,d.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){tht(this,s,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let c=0;c<i.length;++c){let d=i[c];if(d=r?d.derivedCommands.logDepth.command:d,!d.depthForTranslucentClassification)continue;let u=d.derivedCommands.depth.depthOnlyCommand;t(u,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};Vy.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let o=e.context,r=o.uniformState,s=n.framebuffer;n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(o,n),r.updatePass(Ge.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Ge.CESIUM_3D_TILE_CLASSIFICATION],d=i.indices[Ge.CESIUM_3D_TILE_CLASSIFICATION];for(let u=0;u<d;++u)t(c[u],e,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};Vy.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),nht(this,e,t)};function nht(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}Vy.prototype.isSupported=function(){return this._supported};Vy.prototype.isDestroyed=function(){return!1};Vy.prototype.destroy=function(){return Lxe(this),Rxe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),me(this)};var GF=Vy;function iht(){this.command=void 0,this.near=void 0,this.far=void 0}function uB(e,t,n){let i=e.context,o;i.depthTexture&&(o=new xF);let r;e._useOIT&&i.depthTexture&&(r=new SF(i));let s=new ec(i);s.viewport=Ke.clone(n),this.camera=t,this._cameraClone=io.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new RF(i),this.pickDepthFramebuffer=new VF,this.sceneFramebuffer=new WT,this.globeDepth=o,this.globeTranslucencyFramebuffer=new _F,this.oit=r,this.translucentTileClassification=new GF(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var Fj=new h,Aj=new h;function oht(e,t,n){let i=Math.max(h.maximumComponent(h.abs(e.position,Fj)),h.maximumComponent(h.abs(t.position,Aj))),o=1/Math.max(1,i);return h.multiplyByScalar(e.position,o,Fj),h.multiplyByScalar(t.position,o,Aj),h.equalsEpsilon(Fj,Aj,n)&&h.equalsEpsilon(e.direction,t.direction,n)&&h.equalsEpsilon(e.up,t.up,n)&&h.equalsEpsilon(e.right,t.right,n)&&M.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}uB.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return oht(t,n,W.EPSILON15)?(this._cameraStartFired&&_i()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=_i(),io.clone(t,n),!0)};function rht(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:s}=o,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===oe.SCENE2D,d=t.nearToFarDistance2D;i*=1+W.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n);let u;c?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),u=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):u=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:m}=e;m.length=u;for(let p=0;p<u;++p){let g,f;c?(g=Math.min(i-d,n+p*d),f=Math.min(i,g+d)):(g=Math.max(n,Math.pow(a,p)*n),f=Math.min(i,a*g));let x=m[p];l(x)?(x.near=g,x.far=f):x=m[p]=new yF(g,f)}}function sht(e,t,n){let{command:i,near:o,far:r}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:s}=e;for(let a=0;a<s.length;++a){let c=s[a];if(o>c.far)continue;if(r<c.near)break;let d=i.pass,u=c.indices[d]++;if(c.commands[d][u]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:c}=i,d=a.commandsInFrustums;d[c]=l(d[c])?d[c]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var Zxe=new ms,aht=new La;uB.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:o}=t,{positionWC:r,directionWC:s,frustum:a}=n,c=e._computeCommandList,d=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let u=this.frustumCommandsList;for(let w=0;w<u.length;++w)for(let F=0;F<Ge.NUMBER_OF_PASSES;++F)u[w].indices[F]=0;c.length=0,d.length=0;let m=this._commandExtents,p=m.length,g=0,f=+Number.MAX_VALUE,x=-Number.MAX_VALUE,{shadowsEnabled:_}=o,C=+Number.MAX_VALUE,V=-Number.MAX_VALUE,L=Number.MAX_VALUE,Z=t.mode===oe.SCENE3D?t.occluder:void 0,{cullingVolume:G}=t,I=Zxe.planes;for(let w=0;w<5;++w)I[w]=G.planes[w];G=Zxe;for(let w=0;w<i.length;++w){let F=i[w],{pass:b,boundingVolume:R}=F;if(b===Ge.COMPUTE)c.push(F);else if(b===Ge.OVERLAY)d.push(F);else{let E,X;if(l(R)){if(!e.isVisible(G,F,Z))continue;let N=R.computePlaneDistances(r,s,aht);if(E=N.start,X=N.stop,f=Math.min(f,E),x=Math.max(x,X),_&&F.receiveShadows&&E<c0.MAXIMUM_DISTANCE&&!(b===Ge.GLOBE&&E<-100&&X>100)){let O=X-E;b!==Ge.GLOBE&&E<100&&(L=Math.min(L,O)),C=Math.min(C,E),V=Math.max(V,X)}}else F instanceof ei?(E=a.near,X=a.far):(E=a.near,X=a.far,f=Math.min(f,E),x=Math.max(x,X));let A=m[g];l(A)||(A=m[g]=new iht),A.command=F,A.near=E,A.far=X,g++}}_&&(C=Math.min(Math.max(C,a.near),a.far),V=Math.max(Math.min(V,a.far),C),o.nearPlane=C,o.farPlane=V,o.closestObjectSize=L),rht(this,e,f,x);for(let w=0;w<g;w++)sht(this,e,m[w]);if(g<p)for(let w=g;w<p;w++){let F=m[w];if(!l(F.command))break;F.command=void 0}let v=u.length,{frustumSplits:P}=t;P.length=v+1;for(let w=0;w<v;++w)P[w]=u[w].near,w===v-1&&(P[w+1]=u[w].far)};uB.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e=this.pickDepths;for(let t=0;t<e.length;++t)e[t].destroy()};var wT=uB;var Exe=.1,cht=new rm({pass:wo.MOST_DETAILED_PRELOAD}),lht=new rm({pass:wo.MOST_DETAILED_PICK}),EF=new rm({pass:wo.PICK});function $s(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new Ke(0,0,1,1),n=new io(e);n.frustum=new an({width:Exe,aspectRatio:1,near:.1}),this._pickOffscreenView=new wT(e,n,t)}$s.prototype.update=function(){this._pickPositionCacheDirty=!0};$s.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new gF,n[t]=i),i};var dht=new Pr,uht=new h,mB=new h,mht=new D,hht=new M;function fht(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-o.x)/o.width-1;c*=(s.right-s.left)*.5;let d=2*(o.height-t.y-o.y)/o.height-1;d*=(s.top-s.bottom)*.5;let u=M.clone(r.transform,hht);r._setTransform(M.IDENTITY);let m=h.clone(r.position,uht);h.multiplyByScalar(r.right,c,mB),h.add(mB,m,m),h.multiplyByScalar(r.up,d,mB),h.add(mB,m,m),r._setTransform(u),e.mode===oe.SCENE2D&&h.fromElements(m.z,m.x,m.y,m);let p=s.getPixelDimensions(o.width,o.height,1,1,mht),g=dht;return g.right=p.x*.5,g.left=-g.right,g.top=p.y*.5,g.bottom=-g.top,g.near=s.near,g.far=s.far,g.computeCullingVolume(m,r.directionWC,r.upWC)}var pht=new sl,bht=new D;function ght(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,c=Math.tan(s.fovy*.5),d=s.aspectRatio*c,u=2*(t.x-o.x)/o.width-1,m=2*(o.height-t.y-o.y)/o.height-1,p=u*a*d,g=m*a*c,f=s.getPixelDimensions(o.width,o.height,1,1,bht),x=f.x*n*.5,_=f.y*i*.5,C=pht;return C.top=g+_,C.bottom=g-_,C.right=p+x,C.left=p-x,C.near=a,C.far=s.far,C.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function hB(e,t,n,i,o){let r=e.camera.frustum;return r instanceof an||r instanceof Pr?fht(e,t,n,i,o):ght(e,t,n,i,o)}var fB=new Ke(0,0,3,3),pB=new D,IF=new B(0,0,0,0);function Mj(e,t,n,i,o){return o.width=y(n,3),o.height=y(i,o.width),o.x=t.x-(o.width-1)*.5,o.y=e-t.y-(o.height-1)*.5,o}$s.prototype.pick=function(e,t,n,i){let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let d=s.passState;d.viewport=Ke.clone(a,d.viewport);let u=Mi.transformWindowToDrawingBuffer(e,t,pB),m=Mj(o.drawingBufferHeight,u,n,i,fB);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=hB(e,u,m.width,m.height,a),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=EF,o.uniformState.update(r),e.updateEnvironment(),d=c.begin(m,a),e.updateAndExecuteCommands(d,IF),e.resolveFramebuffers(d);let p=c.end(m);return o.endFrame(),p};$s.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let d=s.passState;d.viewport=Ke.clone(a,d.viewport);let u=Mi.transformWindowToDrawingBuffer(e,t,pB),m=Mj(o.drawingBufferHeight,u,n,i,fB);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=hB(e,u,m.width,m.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=EF,o.uniformState.update(r),e.updateEnvironment(),d=c.begin(m,a),e.updateAndExecuteCommands(d,IF),e.resolveFramebuffers(d);let p=c.readCenterPixel(m);return o.endFrame(),p};$s.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:o,defaultView:r}=e,{viewport:s,pickFramebuffer:a}=r;e.view=r,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=r.passState;c.viewport=Ke.clone(s,c.viewport);let d=Mi.transformWindowToDrawingBuffer(e,t,pB),u=Mj(i.drawingBufferHeight,d,1,1,fB);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=hB(e,d,u.width,u.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=EF,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),c=a.begin(u,s),e.updateAndExecuteCommands(c,IF);let m=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=m;let p=a.readCenterPixel(u);return i.endFrame(),o.pickingMetadata=!1,bF.decodeMetadataValues(n.classProperty,p)};function yht(e,t){let{defaultView:n,context:i,frameState:o,environmentState:r}=e,{viewport:s,pickDepthFramebuffer:a}=n;e.view=n,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=n.passState;c.viewport=Ke.clone(s,c.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=hB(e,t,1,1,s),o.tilesetPassState=EF,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,IF),e.resolveFramebuffers(c),i.endFrame()}var xht=new Li,_ht=new sl,Tht=new an,Sht=new Pr;$s.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return h.clone(this._pickPositionCache[i],n);let{context:o,frameState:r,camera:s,defaultView:a}=e,{uniformState:c}=o;e.view=a;let d=Mi.transformWindowToDrawingBuffer(e,t,pB);e.pickTranslucentDepth?yht(e,d):(e.updateFrameState(),c.update(r),e.updateEnvironment()),d.y=e.drawingBufferHeight-d.y;let u;l(s.frustum.fov)?u=s.frustum.clone(xht):l(s.frustum.infiniteProjectionMatrix)?u=s.frustum.clone(_ht):l(s.frustum.width)?u=s.frustum.clone(Tht):u=s.frustum.clone(Sht);let{frustumCommandsList:m}=a,p=m.length;for(let g=0;g<p;++g){let x=this.getPickDepth(e,g).getDepth(o,d.x,d.y);if(l(x)&&x>0&&x<1){let _=m[g],C;return e.mode===oe.SCENE2D?(C=s.position.z,s.position.z=C-_.near+1,u.far=Math.max(1,_.far-_.near),u.near=1,c.update(r),c.updateFrustum(u)):(u.near=_.near*(g!==0?e.opaqueFrustumNearOffset:1),u.far=_.far,c.updateFrustum(u)),n=Mi.drawingBufferToWorldCoordinates(e,d,x,n),e.mode===oe.SCENE2D&&(s.position.z=C,c.update(r)),this._pickPositionCache[i]=h.clone(n),n}}this._pickPositionCache[i]=void 0};var Cht=new he;$s.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==oe.SCENE3D){h.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,Cht);o.cartographicToCartesian(r,n)}return n};function Ixe(e,t){let n,i,o=[],r=[],s=[],a=[];l(e)||(e=Number.MAX_VALUE);let c=t();for(;l(c);){let d=c.object,u=c.position,m=c.exclude;if(l(u)&&!l(d)){o.push(c);break}if(!l(d)||!l(d.primitive)||!m&&(o.push(c),0>=--e))break;let p=d.primitive,g=!1;typeof p.getGeometryInstanceAttributes=="function"&&l(d.id)&&(i=p.getGeometryInstanceAttributes(d.id),l(i)&&l(i.show)&&(g=!0,i.show=xn.toValue(!1,i.show),s.push(i))),d instanceof Ns&&(g=!0,d.show=!1,a.push(d)),g||(p.show=!1,r.push(p)),c=t()}for(n=0;n<r.length;++n)r[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=xn.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return o}$s.prototype.drillPick=function(e,t,n,i,o){let r=this;return Ixe(n,function(){let c=r.pick(e,t,i,o);if(l(c))return{object:c,position:void 0,exclude:!1}}).map(function(c){return c.object})};var Gxe=new h,Vht=new h;function Lht(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(o=>{i._completePick=()=>{o()}})}function Xxe(e,t,n,i){let o=t.direction,r=h.mostOrthogonalAxis(o,Gxe),s=h.cross(o,r,Gxe),a=h.cross(o,s,Vht);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=y(n,Exe),i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function Rht(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,c=Xxe(e,o,r,a),d=cht;d.camera=a,d.cullingVolume=c;let u=!0,m=s.length;for(let p=0;p<m;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,d),u=u&&d.ready)}return u&&n._completePick(),u}$s.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)Rht(this,e,t[n])&&t.splice(n--,1)};function Wxe(e,t,n){for(let i=0;i<e.length;++i){let o=e.get(i);o.show&&(l(o.isCesium3DTileset)?(!l(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof kl&&Wxe(o,t,n))}}function bB(e,t,n,i,o,r){let s=[];if(Wxe(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new Lht(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function Zht(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function Ght(e,t,n,i,o,r,s){let{context:a,frameState:c}=t,d=a.uniformState,u=e._pickOffscreenView;t.view=u,Xxe(e,n,o,u.camera);let m=Ke.clone(u.viewport,fB),p=u.pickFramebuffer.begin(m,u.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=lht:c.tilesetPassState=EF,d.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,IF),t.resolveFramebuffers(p);let g,f=u.pickFramebuffer.end(m);if(t.context.depthTexture){let{frustumCommandsList:x}=u,_=x.length;for(let C=0;C<_;++C){let L=e.getPickDepth(t,C).getDepth(a,0,0);if(l(L)&&L>0&&L<1){let Z=x[C],G=Z.near*(C!==0?t.opaqueFrustumNearOffset:1),I=Z.far,v=G+L*(I-G);g=pn.getPoint(n,v);break}}}if(t.view=t.defaultView,a.endFrame(),l(f)||l(g))return{object:f,position:g,exclude:!l(g)&&r||Zht(f,i)}}function Pxe(e,t,n,i,o,r,s,a){return Ixe(i,function(){return Ght(e,t,n,o,r,s,a)})}function $V(e,t,n,i,o,r,s){let a=Pxe(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function vxe(e,t,n,i,o,r,s,a){return Pxe(e,t,n,i,o,r,s,a)}function gB(e,t){return new Promise((n,i)=>{t.then(function(o){let r=e.postRender.addEventListener(function(){r(),n(o)});e.requestRender()}).catch(function(o){i(o)})})}$s.prototype.pickFromRay=function(e,t,n,i){return $V(this,e,t,n,i,!1,!1)};$s.prototype.drillPickFromRay=function(e,t,n,i,o){return vxe(this,e,t,n,i,o,!1,!1)};$s.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=pn.clone(t),n=l(n)?n.slice():n,gB(e,bB(o,e,t,n,i,function(){return $V(o,e,t,n,i,!1,!0)}))};$s.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=pn.clone(t),i=l(i)?i.slice():i,gB(e,bB(r,e,t,i,o,function(){return vxe(r,e,t,n,i,o,!1,!0)}))};var Eht=new h,Iht=new h,Xht=new pn,wxe=new he;function Nj(e,t){let n=e.ellipsoid,i=li._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,Iht),r=he.toCartesian(t,n,Eht),s=Xht;s.origin=r,s.direction=o;let a=new pn;return pn.getPoint(s,i,a.origin),h.negate(o,a.direction),a}function Fxe(e,t){let n=e.ellipsoid,i=he.fromCartesian(t,n,wxe);return Nj(e,i)}function Axe(e,t){let n=e.ellipsoid;return he.fromCartesian(t,n,wxe).height}function Wht(e,t,n,i,o){let r=Nj(t,n);return bB(e,t,r,i,o,function(){let s=$V(e,t,r,i,o,!0,!0);if(l(s))return Axe(t,s.position)})}function Pht(e,t,n,i,o,r){let s=Fxe(t,n);return bB(e,t,s,i,o,function(){let a=$V(e,t,s,i,o,!0,!0);if(l(a))return h.clone(a.position,r)})}$s.prototype.sampleHeight=function(e,t,n,i){let o=Nj(e,t),r=$V(this,e,o,n,i,!0,!1);if(l(r))return Axe(e,r.position)};$s.prototype.clampToHeight=function(e,t,n,i,o){let r=Fxe(e,t),s=$V(this,e,r,n,i,!0,!1);if(l(s))return h.clone(s.position,o)};$s.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=Wht(this,e,t[s],n,i);return gB(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};$s.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=Pht(this,e,t[s],n,i,t[s]);return gB(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};$s.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var XF=$s;var hNi=T(S(),1);var U9i=T(S(),1);var DAi=T(S(),1),WF=`uniform sampler2D colorTexture;
  10228. in vec2 v_textureCoordinates;
  10229. #ifdef AUTO_EXPOSURE
  10230. uniform sampler2D autoExposure;
  10231. #else
  10232. uniform float exposure;
  10233. #endif
  10234. void main()
  10235. {
  10236. vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
  10237. vec3 color = fragmentColor.rgb;
  10238. #ifdef AUTO_EXPOSURE
  10239. color /= texture(autoExposure, vec2(0.5)).r;
  10240. #else
  10241. color *= vec3(exposure);
  10242. #endif
  10243. color = czm_acesTonemapping(color);
  10244. color = czm_inverseGamma(color);
  10245. out_FragColor = vec4(color, fragmentColor.a);
  10246. }
  10247. `;var OAi=T(S(),1),PF=`precision highp float;
  10248. uniform sampler2D randomTexture;
  10249. uniform sampler2D depthTexture;
  10250. uniform float intensity;
  10251. uniform float bias;
  10252. uniform float lengthCap;
  10253. uniform float stepSize;
  10254. uniform float frustumLength;
  10255. vec3 pixelToEye(vec2 screenCoordinate)
  10256. {
  10257. vec2 uv = screenCoordinate / czm_viewport.zw;
  10258. float depth = czm_readDepth(depthTexture, uv);
  10259. vec2 xy = 2.0 * uv - vec2(1.0);
  10260. vec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0);
  10261. return posEC.xyz / posEC.w;
  10262. }
  10263. // Reconstruct surface normal in eye coordinates, avoiding edges
  10264. vec3 getNormalXEdge(vec3 positionEC)
  10265. {
  10266. // Find the 3D surface positions at adjacent screen pixels
  10267. vec2 centerCoord = gl_FragCoord.xy;
  10268. vec3 positionLeft = pixelToEye(centerCoord + vec2(-1.0, 0.0));
  10269. vec3 positionRight = pixelToEye(centerCoord + vec2(1.0, 0.0));
  10270. vec3 positionUp = pixelToEye(centerCoord + vec2(0.0, 1.0));
  10271. vec3 positionDown = pixelToEye(centerCoord + vec2(0.0, -1.0));
  10272. // Compute potential tangent vectors
  10273. vec3 dx0 = positionEC - positionLeft;
  10274. vec3 dx1 = positionRight - positionEC;
  10275. vec3 dy0 = positionEC - positionDown;
  10276. vec3 dy1 = positionUp - positionEC;
  10277. // The shorter tangent is more likely to be on the same surface
  10278. vec3 dx = length(dx0) < length(dx1) ? dx0 : dx1;
  10279. vec3 dy = length(dy0) < length(dy1) ? dy0 : dy1;
  10280. return normalize(cross(dx, dy));
  10281. }
  10282. void main(void)
  10283. {
  10284. vec3 positionEC = pixelToEye(gl_FragCoord.xy);
  10285. if (positionEC.z > frustumLength)
  10286. {
  10287. out_FragColor = vec4(1.0);
  10288. return;
  10289. }
  10290. vec3 normalEC = getNormalXEdge(positionEC);
  10291. float ao = 0.0;
  10292. const int ANGLE_STEPS = 4;
  10293. float angleStepScale = 1.0 / float(ANGLE_STEPS);
  10294. float angleStep = angleStepScale * czm_twoPi;
  10295. float cosStep = cos(angleStep);
  10296. float sinStep = sin(angleStep);
  10297. mat2 rotateStep = mat2(cosStep, sinStep, -sinStep, cosStep);
  10298. // Initial sampling direction (different for each pixel)
  10299. const float randomTextureSize = 255.0;
  10300. vec2 randomTexCoord = fract(gl_FragCoord.xy / randomTextureSize);
  10301. float randomVal = texture(randomTexture, randomTexCoord).x;
  10302. vec2 sampleDirection = vec2(cos(angleStep * randomVal), sin(angleStep * randomVal));
  10303. // Loop over sampling directions
  10304. for (int i = 0; i < ANGLE_STEPS; i++)
  10305. {
  10306. sampleDirection = rotateStep * sampleDirection;
  10307. float localAO = 0.0;
  10308. vec2 radialStep = stepSize * sampleDirection;
  10309. for (int j = 0; j < 6; j++)
  10310. {
  10311. // Step along sampling direction, away from output pixel
  10312. vec2 newCoords = floor(gl_FragCoord.xy + float(j + 1) * radialStep) + vec2(0.5);
  10313. // Exit if we stepped off the screen
  10314. if (clamp(newCoords, vec2(0.0), czm_viewport.zw) != newCoords)
  10315. {
  10316. break;
  10317. }
  10318. vec3 stepPositionEC = pixelToEye(newCoords);
  10319. vec3 stepVector = stepPositionEC - positionEC;
  10320. float stepLength = length(stepVector);
  10321. if (stepLength > lengthCap)
  10322. {
  10323. break;
  10324. }
  10325. float dotVal = clamp(dot(normalEC, normalize(stepVector)), 0.0, 1.0);
  10326. if (dotVal < bias)
  10327. {
  10328. dotVal = 0.0;
  10329. }
  10330. float weight = stepLength / lengthCap;
  10331. weight = 1.0 - weight * weight;
  10332. localAO = max(localAO, dotVal * weight);
  10333. }
  10334. ao += localAO;
  10335. }
  10336. ao *= angleStepScale;
  10337. ao = 1.0 - clamp(ao, 0.0, 1.0);
  10338. ao = pow(ao, intensity);
  10339. out_FragColor = vec4(vec3(ao), 1.0);
  10340. }
  10341. `;var HAi=T(S(),1),vF=`uniform sampler2D colorTexture;
  10342. uniform sampler2D ambientOcclusionTexture;
  10343. uniform bool ambientOcclusionOnly;
  10344. in vec2 v_textureCoordinates;
  10345. void main(void)
  10346. {
  10347. vec4 color = texture(colorTexture, v_textureCoordinates);
  10348. vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates);
  10349. out_FragColor = ambientOcclusionOnly ? ao : ao * color;
  10350. }
  10351. `;var KAi=T(S(),1),wF=`uniform sampler2D colorTexture;
  10352. uniform float gradations;
  10353. in vec2 v_textureCoordinates;
  10354. void main(void)
  10355. {
  10356. vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;
  10357. #ifdef CZM_SELECTED_FEATURE
  10358. if (czm_selected()) {
  10359. out_FragColor = vec4(rgb, 1.0);
  10360. return;
  10361. }
  10362. #endif
  10363. float luminance = czm_luminance(rgb);
  10364. float darkness = luminance * gradations;
  10365. darkness = (darkness - fract(darkness)) / gradations;
  10366. out_FragColor = vec4(vec3(darkness), 1.0);
  10367. }
  10368. `;var QAi=T(S(),1),FF=`uniform sampler2D colorTexture;
  10369. uniform sampler2D bloomTexture;
  10370. uniform bool glowOnly;
  10371. in vec2 v_textureCoordinates;
  10372. void main(void)
  10373. {
  10374. vec4 color = texture(colorTexture, v_textureCoordinates);
  10375. #ifdef CZM_SELECTED_FEATURE
  10376. if (czm_selected()) {
  10377. out_FragColor = color;
  10378. return;
  10379. }
  10380. #endif
  10381. vec4 bloom = texture(bloomTexture, v_textureCoordinates);
  10382. out_FragColor = glowOnly ? bloom : bloom + color;
  10383. }
  10384. `;var qAi=T(S(),1),AF=`uniform sampler2D colorTexture;
  10385. uniform float brightness;
  10386. in vec2 v_textureCoordinates;
  10387. void main(void)
  10388. {
  10389. vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;
  10390. vec3 target = vec3(0.0);
  10391. out_FragColor = vec4(mix(target, rgb, brightness), 1.0);
  10392. }
  10393. `;var eMi=T(S(),1),MF=`uniform sampler2D colorTexture;
  10394. uniform float contrast;
  10395. uniform float brightness;
  10396. in vec2 v_textureCoordinates;
  10397. void main(void)
  10398. {
  10399. vec3 sceneColor = texture(colorTexture, v_textureCoordinates).xyz;
  10400. sceneColor = czm_RGBToHSB(sceneColor);
  10401. sceneColor.z += brightness;
  10402. sceneColor = czm_HSBToRGB(sceneColor);
  10403. float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast));
  10404. sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5);
  10405. out_FragColor = vec4(sceneColor, 1.0);
  10406. }
  10407. `;var nMi=T(S(),1),NF=`uniform sampler2D colorTexture;
  10408. uniform sampler2D blurTexture;
  10409. uniform sampler2D depthTexture;
  10410. uniform float focalDistance;
  10411. in vec2 v_textureCoordinates;
  10412. vec4 toEye(vec2 uv, float depth)
  10413. {
  10414. vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));
  10415. vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);
  10416. posInCamera = posInCamera / posInCamera.w;
  10417. return posInCamera;
  10418. }
  10419. float computeDepthBlur(float depth)
  10420. {
  10421. float f;
  10422. if (depth < focalDistance)
  10423. {
  10424. f = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x);
  10425. }
  10426. else
  10427. {
  10428. f = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance);
  10429. f = pow(f, 0.1);
  10430. }
  10431. f *= f;
  10432. f = clamp(f, 0.0, 1.0);
  10433. return pow(f, 0.5);
  10434. }
  10435. void main(void)
  10436. {
  10437. float depth = czm_readDepth(depthTexture, v_textureCoordinates);
  10438. vec4 posInCamera = toEye(v_textureCoordinates, depth);
  10439. float d = computeDepthBlur(-posInCamera.z);
  10440. out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d);
  10441. }
  10442. `;var oMi=T(S(),1),kF=`uniform sampler2D depthTexture;
  10443. in vec2 v_textureCoordinates;
  10444. void main(void)
  10445. {
  10446. float depth = czm_readDepth(depthTexture, v_textureCoordinates);
  10447. out_FragColor = vec4(vec3(depth), 1.0);
  10448. }
  10449. `;var sMi=T(S(),1),UF=`uniform sampler2D depthTexture;
  10450. uniform float length;
  10451. uniform vec4 color;
  10452. in vec2 v_textureCoordinates;
  10453. void main(void)
  10454. {
  10455. float directions[3];
  10456. directions[0] = -1.0;
  10457. directions[1] = 0.0;
  10458. directions[2] = 1.0;
  10459. float scalars[3];
  10460. scalars[0] = 3.0;
  10461. scalars[1] = 10.0;
  10462. scalars[2] = 3.0;
  10463. float padx = czm_pixelRatio / czm_viewport.z;
  10464. float pady = czm_pixelRatio / czm_viewport.w;
  10465. #ifdef CZM_SELECTED_FEATURE
  10466. bool selected = false;
  10467. for (int i = 0; i < 3; ++i)
  10468. {
  10469. float dir = directions[i];
  10470. selected = selected || czm_selected(vec2(-padx, dir * pady));
  10471. selected = selected || czm_selected(vec2(padx, dir * pady));
  10472. selected = selected || czm_selected(vec2(dir * padx, -pady));
  10473. selected = selected || czm_selected(vec2(dir * padx, pady));
  10474. if (selected)
  10475. {
  10476. break;
  10477. }
  10478. }
  10479. if (!selected)
  10480. {
  10481. out_FragColor = vec4(color.rgb, 0.0);
  10482. return;
  10483. }
  10484. #endif
  10485. float horizEdge = 0.0;
  10486. float vertEdge = 0.0;
  10487. for (int i = 0; i < 3; ++i)
  10488. {
  10489. float dir = directions[i];
  10490. float scale = scalars[i];
  10491. horizEdge -= texture(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale;
  10492. horizEdge += texture(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale;
  10493. vertEdge -= texture(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale;
  10494. vertEdge += texture(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale;
  10495. }
  10496. float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge);
  10497. out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0);
  10498. }
  10499. `;var cMi=T(S(),1),DF=`uniform sampler2D colorTexture;
  10500. in vec2 v_textureCoordinates;
  10501. #ifdef AUTO_EXPOSURE
  10502. uniform sampler2D autoExposure;
  10503. #else
  10504. uniform float exposure;
  10505. #endif
  10506. // See slides 142 and 143:
  10507. // http://www.gdcvault.com/play/1012459/Uncharted_2__HDR_Lighting
  10508. void main()
  10509. {
  10510. vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
  10511. vec3 color = fragmentColor.rgb;
  10512. #ifdef AUTO_EXPOSURE
  10513. float exposure = texture(autoExposure, vec2(0.5)).r;
  10514. color /= exposure;
  10515. #else
  10516. color *= vec3(exposure);
  10517. #endif
  10518. const float A = 0.22; // shoulder strength
  10519. const float B = 0.30; // linear strength
  10520. const float C = 0.10; // linear angle
  10521. const float D = 0.20; // toe strength
  10522. const float E = 0.01; // toe numerator
  10523. const float F = 0.30; // toe denominator
  10524. const float white = 11.2; // linear white point value
  10525. vec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F;
  10526. float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F;
  10527. c = czm_inverseGamma(c / w);
  10528. out_FragColor = vec4(c, fragmentColor.a);
  10529. }
  10530. `;var dMi=T(S(),1),BF=`uniform sampler2D colorTexture;
  10531. in vec2 v_textureCoordinates;
  10532. #ifdef AUTO_EXPOSURE
  10533. uniform sampler2D autoExposure;
  10534. #else
  10535. uniform float exposure;
  10536. #endif
  10537. void main()
  10538. {
  10539. vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
  10540. vec3 color = fragmentColor.rgb;
  10541. #ifdef AUTO_EXPOSURE
  10542. color /= texture(autoExposure, vec2(0.5)).r;
  10543. #else
  10544. color *= vec3(exposure);
  10545. #endif
  10546. color = czm_pbrNeutralTonemapping(color);
  10547. color = czm_inverseGamma(color);
  10548. out_FragColor = vec4(color, fragmentColor.a);
  10549. }
  10550. `;var mMi=T(S(),1),OF=`in vec2 v_textureCoordinates;
  10551. uniform sampler2D colorTexture;
  10552. const float fxaaQualitySubpix = 0.5;
  10553. const float fxaaQualityEdgeThreshold = 0.125;
  10554. const float fxaaQualityEdgeThresholdMin = 0.0833;
  10555. void main()
  10556. {
  10557. vec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw;
  10558. vec4 color = FxaaPixelShader(
  10559. v_textureCoordinates,
  10560. colorTexture,
  10561. fxaaQualityRcpFrame,
  10562. fxaaQualitySubpix,
  10563. fxaaQualityEdgeThreshold,
  10564. fxaaQualityEdgeThresholdMin);
  10565. float alpha = texture(colorTexture, v_textureCoordinates).a;
  10566. out_FragColor = vec4(color.rgb, alpha);
  10567. }
  10568. `;var fMi=T(S(),1),Ly=`#define SAMPLES 8
  10569. uniform float delta;
  10570. uniform float sigma;
  10571. uniform float direction; // 0.0 for x direction, 1.0 for y direction
  10572. uniform sampler2D colorTexture;
  10573. #ifdef USE_STEP_SIZE
  10574. uniform float stepSize;
  10575. #else
  10576. uniform vec2 step;
  10577. #endif
  10578. in vec2 v_textureCoordinates;
  10579. // Incremental Computation of the Gaussian:
  10580. // https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch40.html
  10581. void main()
  10582. {
  10583. vec2 st = v_textureCoordinates;
  10584. vec2 dir = vec2(1.0 - direction, direction);
  10585. #ifdef USE_STEP_SIZE
  10586. vec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw));
  10587. #else
  10588. vec2 step = step;
  10589. #endif
  10590. vec3 g;
  10591. g.x = 1.0 / (sqrt(czm_twoPi) * sigma);
  10592. g.y = exp((-0.5 * delta * delta) / (sigma * sigma));
  10593. g.z = g.y * g.y;
  10594. vec4 result = texture(colorTexture, st) * g.x;
  10595. for (int i = 1; i < SAMPLES; ++i)
  10596. {
  10597. g.xy *= g.yz;
  10598. vec2 offset = float(i) * dir * step;
  10599. result += texture(colorTexture, st - offset) * g.x;
  10600. result += texture(colorTexture, st + offset) * g.x;
  10601. }
  10602. out_FragColor = result;
  10603. }
  10604. `;var bMi=T(S(),1),YF=`uniform sampler2D colorTexture;
  10605. uniform sampler2D dirtTexture;
  10606. uniform sampler2D starTexture;
  10607. uniform vec2 dirtTextureDimensions;
  10608. uniform float distortion;
  10609. uniform float ghostDispersal;
  10610. uniform float haloWidth;
  10611. uniform float dirtAmount;
  10612. uniform float earthRadius;
  10613. uniform float intensity;
  10614. in vec2 v_textureCoordinates;
  10615. // whether it is in space or not
  10616. // 6500000.0 is empirical value
  10617. #define DISTANCE_TO_SPACE 6500000.0
  10618. // return ndc from world coordinate biased earthRadius
  10619. vec4 getNDCFromWC(vec3 WC, float earthRadius)
  10620. {
  10621. vec4 positionEC = czm_view * vec4(WC, 1.0);
  10622. positionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0);
  10623. vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
  10624. return czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);
  10625. }
  10626. // Check if current pixel is included Earth
  10627. // if then mask it gradually
  10628. float isInEarth(vec2 texcoord, vec2 sceneSize)
  10629. {
  10630. vec2 NDC = texcoord * 2.0 - 1.0;
  10631. vec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0);
  10632. vec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5);
  10633. NDC.xy -= earthPosSC.xy;
  10634. float X = abs(NDC.x) * sceneSize.x;
  10635. float Y = abs(NDC.y) * sceneSize.y;
  10636. return clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0));
  10637. }
  10638. // For Chromatic effect
  10639. vec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace)
  10640. {
  10641. vec2 sceneSize = czm_viewport.zw;
  10642. vec3 color;
  10643. if(isSpace)
  10644. {
  10645. color.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture(tex, texcoord + direction * distortion.r).r;
  10646. color.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture(tex, texcoord + direction * distortion.g).g;
  10647. color.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture(tex, texcoord + direction * distortion.b).b;
  10648. }
  10649. else
  10650. {
  10651. color.r = texture(tex, texcoord + direction * distortion.r).r;
  10652. color.g = texture(tex, texcoord + direction * distortion.g).g;
  10653. color.b = texture(tex, texcoord + direction * distortion.b).b;
  10654. }
  10655. return vec4(clamp(color, 0.0, 1.0), 0.0);
  10656. }
  10657. void main(void)
  10658. {
  10659. vec4 originalColor = texture(colorTexture, v_textureCoordinates);
  10660. vec3 rgb = originalColor.rgb;
  10661. bool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE;
  10662. // Sun position
  10663. vec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0);
  10664. vec4 sunPositionEC = czm_view * sunPos;
  10665. vec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC);
  10666. sunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0);
  10667. // If sun is not in the screen space, use original color.
  10668. if(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1)))
  10669. {
  10670. // Lens flare is disabled when not in space until #5932 is fixed.
  10671. // https://github.com/CesiumGS/cesium/issues/5932
  10672. out_FragColor = originalColor;
  10673. return;
  10674. }
  10675. vec2 texcoord = vec2(1.0) - v_textureCoordinates;
  10676. vec2 pixelSize = czm_pixelRatio / czm_viewport.zw;
  10677. vec2 invPixelSize = 1.0 / pixelSize;
  10678. vec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion);
  10679. // ghost vector to image centre:
  10680. vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal;
  10681. vec3 direction = normalize(vec3(ghostVec, 0.0));
  10682. // sample ghosts:
  10683. vec4 result = vec4(0.0);
  10684. vec4 ghost = vec4(0.0);
  10685. for (int i = 0; i < 4; ++i)
  10686. {
  10687. vec2 offset = fract(texcoord + ghostVec * float(i));
  10688. // Only bright spots from the centre of the source image
  10689. ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace);
  10690. }
  10691. result += ghost;
  10692. // sample halo
  10693. vec2 haloVec = normalize(ghostVec) * haloWidth;
  10694. float weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));
  10695. weightForHalo = pow(1.0 - weightForHalo, 5.0);
  10696. result += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5;
  10697. // dirt on lens
  10698. vec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions;
  10699. if (dirtTexCoords.x > 1.0)
  10700. {
  10701. dirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) : fract(dirtTexCoords.x);
  10702. }
  10703. if (dirtTexCoords.y > 1.0)
  10704. {
  10705. dirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) : fract(dirtTexCoords.y);
  10706. }
  10707. result += dirtAmount * texture(dirtTexture, dirtTexCoords);
  10708. // Rotating starburst texture's coordinate
  10709. // dot(czm_view[0].xyz, vec3(0.0, 0.0, 1.0)) + dot(czm_view[1].xyz, vec3(0.0, 1.0, 0.0))
  10710. float camrot = czm_view[0].z + czm_view[1].y;
  10711. float cosValue = cos(camrot);
  10712. float sinValue = sin(camrot);
  10713. mat3 rotation = mat3(
  10714. cosValue, -sinValue, 0.0,
  10715. sinValue, cosValue, 0.0,
  10716. 0.0, 0.0, 1.0
  10717. );
  10718. vec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0);
  10719. vec3 st2 = vec3((rotation * st1).xy, 1.0);
  10720. vec3 st3 = st2 * 0.5 + vec3(0.5);
  10721. vec2 lensStarTexcoord = st3.xy;
  10722. float weightForLensFlare = length(vec3(sunPos.xy, 0.0));
  10723. float oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0);
  10724. if (!isSpace)
  10725. {
  10726. result *= oneMinusWeightForLensFlare * intensity * 0.2;
  10727. }
  10728. else
  10729. {
  10730. result *= oneMinusWeightForLensFlare * intensity;
  10731. result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0;
  10732. }
  10733. result += texture(colorTexture, v_textureCoordinates);
  10734. out_FragColor = result;
  10735. }
  10736. `;var yMi=T(S(),1),HF=`uniform sampler2D colorTexture;
  10737. uniform vec3 white;
  10738. in vec2 v_textureCoordinates;
  10739. #ifdef AUTO_EXPOSURE
  10740. uniform sampler2D autoExposure;
  10741. #else
  10742. uniform float exposure;
  10743. #endif
  10744. // See equation 4:
  10745. // http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf
  10746. void main()
  10747. {
  10748. vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
  10749. vec3 color = fragmentColor.rgb;
  10750. #ifdef AUTO_EXPOSURE
  10751. float exposure = texture(autoExposure, vec2(0.5)).r;
  10752. color /= exposure;
  10753. #else
  10754. color *= vec3(exposure);
  10755. #endif
  10756. color = (color * (1.0 + color / white)) / (1.0 + color);
  10757. color = czm_inverseGamma(color);
  10758. out_FragColor = vec4(color, fragmentColor.a);
  10759. }
  10760. `;var _Mi=T(S(),1),zF=`uniform sampler2D colorTexture;
  10761. in vec2 v_textureCoordinates;
  10762. float rand(vec2 co)
  10763. {
  10764. return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);
  10765. }
  10766. void main(void)
  10767. {
  10768. float noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1;
  10769. vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;
  10770. vec3 green = vec3(0.0, 1.0, 0.0);
  10771. out_FragColor = vec4((noiseValue + rgb) * green, 1.0);
  10772. }
  10773. `;var SMi=T(S(),1),KF=`uniform sampler2D colorTexture;
  10774. in vec2 v_textureCoordinates;
  10775. #ifdef AUTO_EXPOSURE
  10776. uniform sampler2D autoExposure;
  10777. #else
  10778. uniform float exposure;
  10779. #endif
  10780. // See equation 3:
  10781. // http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf
  10782. void main()
  10783. {
  10784. vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
  10785. vec3 color = fragmentColor.rgb;
  10786. #ifdef AUTO_EXPOSURE
  10787. float exposure = texture(autoExposure, vec2(0.5)).r;
  10788. color /= exposure;
  10789. #else
  10790. color *= vec3(exposure);
  10791. #endif
  10792. color = color / (1.0 + color);
  10793. color = czm_inverseGamma(color);
  10794. out_FragColor = vec4(color, fragmentColor.a);
  10795. }
  10796. `;var VMi=T(S(),1),JF=`uniform sampler2D colorTexture;
  10797. uniform sampler2D silhouetteTexture;
  10798. in vec2 v_textureCoordinates;
  10799. void main(void)
  10800. {
  10801. vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates);
  10802. vec4 color = texture(colorTexture, v_textureCoordinates);
  10803. out_FragColor = mix(color, silhouetteColor, silhouetteColor.a);
  10804. }
  10805. `;var RMi=T(S(),1);/**
  10806. * @license
  10807. * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
  10808. *
  10809. * Redistribution and use in source and binary forms, with or without
  10810. * modification, are permitted provided that the following conditions
  10811. * are met:
  10812. * * Redistributions of source code must retain the above copyright
  10813. * notice, this list of conditions and the following disclaimer.
  10814. * * Redistributions in binary form must reproduce the above copyright
  10815. * notice, this list of conditions and the following disclaimer in the
  10816. * documentation and/or other materials provided with the distribution.
  10817. * * Neither the name of NVIDIA CORPORATION nor the names of its
  10818. * contributors may be used to endorse or promote products derived
  10819. * from this software without specific prior written permission.
  10820. *
  10821. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
  10822. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  10823. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  10824. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  10825. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  10826. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  10827. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  10828. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  10829. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  10830. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  10831. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  10832. */var QF=`/**
  10833. * @license
  10834. * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
  10835. *
  10836. * Redistribution and use in source and binary forms, with or without
  10837. * modification, are permitted provided that the following conditions
  10838. * are met:
  10839. * * Redistributions of source code must retain the above copyright
  10840. * notice, this list of conditions and the following disclaimer.
  10841. * * Redistributions in binary form must reproduce the above copyright
  10842. * notice, this list of conditions and the following disclaimer in the
  10843. * documentation and/or other materials provided with the distribution.
  10844. * * Neither the name of NVIDIA CORPORATION nor the names of its
  10845. * contributors may be used to endorse or promote products derived
  10846. * from this software without specific prior written permission.
  10847. *
  10848. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS \`\`AS IS'' AND ANY
  10849. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  10850. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  10851. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  10852. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  10853. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  10854. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  10855. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  10856. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  10857. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  10858. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  10859. */
  10860. // NVIDIA GameWorks Graphics Samples GitHub link: https://github.com/NVIDIAGameWorks/GraphicsSamples
  10861. // Original FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/samples/es3-kepler/FXAA/FXAA3_11.h
  10862. // Steps used to integrate into Cesium:
  10863. // * The following defines are set:
  10864. // #define FXAA_PC 1
  10865. // #define FXAA_WEBGL_1 1
  10866. // #define FXAA_GREEN_AS_LUMA 1
  10867. // #define FXAA_EARLY_EXIT 1
  10868. // #define FXAA_GLSL_120 1
  10869. // * All other preprocessor directives besides the FXAA_QUALITY__P* directives were removed.
  10870. // * Double underscores are invalid for preprocessor directives so replace them with a single underscore. Replace
  10871. // /FXAA_QUALITY__P(.*)/g with /FXAA_QUALITY__P$1/.
  10872. // * There are no implicit conversions from ivec* to vec* so replace:
  10873. // #define FxaaInt2 ivec2
  10874. // with
  10875. // #define FxaaInt2 vec2
  10876. // * The texture2DLod function is only available in vertex shaders so replace:
  10877. // #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)
  10878. // #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)
  10879. // with
  10880. // #define FxaaTexTop(t, p) texture(t, p)
  10881. // #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r))
  10882. // * FXAA_QUALITY_PRESET is prepended in the javascript code. We may want to expose that setting in the future.
  10883. // * The following parameters to FxaaPixelShader are unused and can be removed:
  10884. // fxaaConsolePosPos
  10885. // fxaaConsoleRcpFrameOpt
  10886. // fxaaConsoleRcpFrameOpt2
  10887. // fxaaConsole360RcpFrameOpt2
  10888. // fxaaConsoleEdgeSharpness
  10889. // fxaaConsoleEdgeThreshold
  10890. // fxaaConsoleEdgeThresholdMi
  10891. // fxaaConsole360ConstDir
  10892. //
  10893. // Choose the quality preset.
  10894. // This needs to be compiled into the shader as it effects code.
  10895. // Best option to include multiple presets is to
  10896. // in each shader define the preset, then include this file.
  10897. //
  10898. // OPTIONS
  10899. // -----------------------------------------------------------------------
  10900. // 10 to 15 - default medium dither (10=fastest, 15=highest quality)
  10901. // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)
  10902. // 39 - no dither, very expensive
  10903. //
  10904. // NOTES
  10905. // -----------------------------------------------------------------------
  10906. // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)
  10907. // 13 = about same speed as FXAA 3.9 and better than 12
  10908. // 23 = closest to FXAA 3.9 visually and performance wise
  10909. // _ = the lowest digit is directly related to performance
  10910. // _ = the highest digit is directly related to style
  10911. //
  10912. //#define FXAA_QUALITY_PRESET 12
  10913. #if (FXAA_QUALITY_PRESET == 10)
  10914. #define FXAA_QUALITY_PS 3
  10915. #define FXAA_QUALITY_P0 1.5
  10916. #define FXAA_QUALITY_P1 3.0
  10917. #define FXAA_QUALITY_P2 12.0
  10918. #endif
  10919. #if (FXAA_QUALITY_PRESET == 11)
  10920. #define FXAA_QUALITY_PS 4
  10921. #define FXAA_QUALITY_P0 1.0
  10922. #define FXAA_QUALITY_P1 1.5
  10923. #define FXAA_QUALITY_P2 3.0
  10924. #define FXAA_QUALITY_P3 12.0
  10925. #endif
  10926. #if (FXAA_QUALITY_PRESET == 12)
  10927. #define FXAA_QUALITY_PS 5
  10928. #define FXAA_QUALITY_P0 1.0
  10929. #define FXAA_QUALITY_P1 1.5
  10930. #define FXAA_QUALITY_P2 2.0
  10931. #define FXAA_QUALITY_P3 4.0
  10932. #define FXAA_QUALITY_P4 12.0
  10933. #endif
  10934. #if (FXAA_QUALITY_PRESET == 13)
  10935. #define FXAA_QUALITY_PS 6
  10936. #define FXAA_QUALITY_P0 1.0
  10937. #define FXAA_QUALITY_P1 1.5
  10938. #define FXAA_QUALITY_P2 2.0
  10939. #define FXAA_QUALITY_P3 2.0
  10940. #define FXAA_QUALITY_P4 4.0
  10941. #define FXAA_QUALITY_P5 12.0
  10942. #endif
  10943. #if (FXAA_QUALITY_PRESET == 14)
  10944. #define FXAA_QUALITY_PS 7
  10945. #define FXAA_QUALITY_P0 1.0
  10946. #define FXAA_QUALITY_P1 1.5
  10947. #define FXAA_QUALITY_P2 2.0
  10948. #define FXAA_QUALITY_P3 2.0
  10949. #define FXAA_QUALITY_P4 2.0
  10950. #define FXAA_QUALITY_P5 4.0
  10951. #define FXAA_QUALITY_P6 12.0
  10952. #endif
  10953. #if (FXAA_QUALITY_PRESET == 15)
  10954. #define FXAA_QUALITY_PS 8
  10955. #define FXAA_QUALITY_P0 1.0
  10956. #define FXAA_QUALITY_P1 1.5
  10957. #define FXAA_QUALITY_P2 2.0
  10958. #define FXAA_QUALITY_P3 2.0
  10959. #define FXAA_QUALITY_P4 2.0
  10960. #define FXAA_QUALITY_P5 2.0
  10961. #define FXAA_QUALITY_P6 4.0
  10962. #define FXAA_QUALITY_P7 12.0
  10963. #endif
  10964. #if (FXAA_QUALITY_PRESET == 20)
  10965. #define FXAA_QUALITY_PS 3
  10966. #define FXAA_QUALITY_P0 1.5
  10967. #define FXAA_QUALITY_P1 2.0
  10968. #define FXAA_QUALITY_P2 8.0
  10969. #endif
  10970. #if (FXAA_QUALITY_PRESET == 21)
  10971. #define FXAA_QUALITY_PS 4
  10972. #define FXAA_QUALITY_P0 1.0
  10973. #define FXAA_QUALITY_P1 1.5
  10974. #define FXAA_QUALITY_P2 2.0
  10975. #define FXAA_QUALITY_P3 8.0
  10976. #endif
  10977. #if (FXAA_QUALITY_PRESET == 22)
  10978. #define FXAA_QUALITY_PS 5
  10979. #define FXAA_QUALITY_P0 1.0
  10980. #define FXAA_QUALITY_P1 1.5
  10981. #define FXAA_QUALITY_P2 2.0
  10982. #define FXAA_QUALITY_P3 2.0
  10983. #define FXAA_QUALITY_P4 8.0
  10984. #endif
  10985. #if (FXAA_QUALITY_PRESET == 23)
  10986. #define FXAA_QUALITY_PS 6
  10987. #define FXAA_QUALITY_P0 1.0
  10988. #define FXAA_QUALITY_P1 1.5
  10989. #define FXAA_QUALITY_P2 2.0
  10990. #define FXAA_QUALITY_P3 2.0
  10991. #define FXAA_QUALITY_P4 2.0
  10992. #define FXAA_QUALITY_P5 8.0
  10993. #endif
  10994. #if (FXAA_QUALITY_PRESET == 24)
  10995. #define FXAA_QUALITY_PS 7
  10996. #define FXAA_QUALITY_P0 1.0
  10997. #define FXAA_QUALITY_P1 1.5
  10998. #define FXAA_QUALITY_P2 2.0
  10999. #define FXAA_QUALITY_P3 2.0
  11000. #define FXAA_QUALITY_P4 2.0
  11001. #define FXAA_QUALITY_P5 3.0
  11002. #define FXAA_QUALITY_P6 8.0
  11003. #endif
  11004. #if (FXAA_QUALITY_PRESET == 25)
  11005. #define FXAA_QUALITY_PS 8
  11006. #define FXAA_QUALITY_P0 1.0
  11007. #define FXAA_QUALITY_P1 1.5
  11008. #define FXAA_QUALITY_P2 2.0
  11009. #define FXAA_QUALITY_P3 2.0
  11010. #define FXAA_QUALITY_P4 2.0
  11011. #define FXAA_QUALITY_P5 2.0
  11012. #define FXAA_QUALITY_P6 4.0
  11013. #define FXAA_QUALITY_P7 8.0
  11014. #endif
  11015. #if (FXAA_QUALITY_PRESET == 26)
  11016. #define FXAA_QUALITY_PS 9
  11017. #define FXAA_QUALITY_P0 1.0
  11018. #define FXAA_QUALITY_P1 1.5
  11019. #define FXAA_QUALITY_P2 2.0
  11020. #define FXAA_QUALITY_P3 2.0
  11021. #define FXAA_QUALITY_P4 2.0
  11022. #define FXAA_QUALITY_P5 2.0
  11023. #define FXAA_QUALITY_P6 2.0
  11024. #define FXAA_QUALITY_P7 4.0
  11025. #define FXAA_QUALITY_P8 8.0
  11026. #endif
  11027. #if (FXAA_QUALITY_PRESET == 27)
  11028. #define FXAA_QUALITY_PS 10
  11029. #define FXAA_QUALITY_P0 1.0
  11030. #define FXAA_QUALITY_P1 1.5
  11031. #define FXAA_QUALITY_P2 2.0
  11032. #define FXAA_QUALITY_P3 2.0
  11033. #define FXAA_QUALITY_P4 2.0
  11034. #define FXAA_QUALITY_P5 2.0
  11035. #define FXAA_QUALITY_P6 2.0
  11036. #define FXAA_QUALITY_P7 2.0
  11037. #define FXAA_QUALITY_P8 4.0
  11038. #define FXAA_QUALITY_P9 8.0
  11039. #endif
  11040. #if (FXAA_QUALITY_PRESET == 28)
  11041. #define FXAA_QUALITY_PS 11
  11042. #define FXAA_QUALITY_P0 1.0
  11043. #define FXAA_QUALITY_P1 1.5
  11044. #define FXAA_QUALITY_P2 2.0
  11045. #define FXAA_QUALITY_P3 2.0
  11046. #define FXAA_QUALITY_P4 2.0
  11047. #define FXAA_QUALITY_P5 2.0
  11048. #define FXAA_QUALITY_P6 2.0
  11049. #define FXAA_QUALITY_P7 2.0
  11050. #define FXAA_QUALITY_P8 2.0
  11051. #define FXAA_QUALITY_P9 4.0
  11052. #define FXAA_QUALITY_P10 8.0
  11053. #endif
  11054. #if (FXAA_QUALITY_PRESET == 29)
  11055. #define FXAA_QUALITY_PS 12
  11056. #define FXAA_QUALITY_P0 1.0
  11057. #define FXAA_QUALITY_P1 1.5
  11058. #define FXAA_QUALITY_P2 2.0
  11059. #define FXAA_QUALITY_P3 2.0
  11060. #define FXAA_QUALITY_P4 2.0
  11061. #define FXAA_QUALITY_P5 2.0
  11062. #define FXAA_QUALITY_P6 2.0
  11063. #define FXAA_QUALITY_P7 2.0
  11064. #define FXAA_QUALITY_P8 2.0
  11065. #define FXAA_QUALITY_P9 2.0
  11066. #define FXAA_QUALITY_P10 4.0
  11067. #define FXAA_QUALITY_P11 8.0
  11068. #endif
  11069. #if (FXAA_QUALITY_PRESET == 39)
  11070. #define FXAA_QUALITY_PS 12
  11071. #define FXAA_QUALITY_P0 1.0
  11072. #define FXAA_QUALITY_P1 1.0
  11073. #define FXAA_QUALITY_P2 1.0
  11074. #define FXAA_QUALITY_P3 1.0
  11075. #define FXAA_QUALITY_P4 1.0
  11076. #define FXAA_QUALITY_P5 1.5
  11077. #define FXAA_QUALITY_P6 2.0
  11078. #define FXAA_QUALITY_P7 2.0
  11079. #define FXAA_QUALITY_P8 2.0
  11080. #define FXAA_QUALITY_P9 2.0
  11081. #define FXAA_QUALITY_P10 4.0
  11082. #define FXAA_QUALITY_P11 8.0
  11083. #endif
  11084. #define FxaaBool bool
  11085. #define FxaaFloat float
  11086. #define FxaaFloat2 vec2
  11087. #define FxaaFloat3 vec3
  11088. #define FxaaFloat4 vec4
  11089. #define FxaaHalf float
  11090. #define FxaaHalf2 vec2
  11091. #define FxaaHalf3 vec3
  11092. #define FxaaHalf4 vec4
  11093. #define FxaaInt2 vec2
  11094. #define FxaaTex sampler2D
  11095. #define FxaaSat(x) clamp(x, 0.0, 1.0)
  11096. #define FxaaTexTop(t, p) texture(t, p)
  11097. #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r))
  11098. FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }
  11099. FxaaFloat4 FxaaPixelShader(
  11100. //
  11101. // Use noperspective interpolation here (turn off perspective interpolation).
  11102. // {xy} = center of pixel
  11103. FxaaFloat2 pos,
  11104. //
  11105. // Input color texture.
  11106. // {rgb_} = color in linear or perceptual color space
  11107. // if (FXAA_GREEN_AS_LUMA == 0)
  11108. // {___a} = luma in perceptual color space (not linear)
  11109. FxaaTex tex,
  11110. //
  11111. // Only used on FXAA Quality.
  11112. // This must be from a constant/uniform.
  11113. // {x_} = 1.0/screenWidthInPixels
  11114. // {_y} = 1.0/screenHeightInPixels
  11115. FxaaFloat2 fxaaQualityRcpFrame,
  11116. //
  11117. // Only used on FXAA Quality.
  11118. // This used to be the FXAA_QUALITY_SUBPIX define.
  11119. // It is here now to allow easier tuning.
  11120. // Choose the amount of sub-pixel aliasing removal.
  11121. // This can effect sharpness.
  11122. // 1.00 - upper limit (softer)
  11123. // 0.75 - default amount of filtering
  11124. // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)
  11125. // 0.25 - almost off
  11126. // 0.00 - completely off
  11127. FxaaFloat fxaaQualitySubpix,
  11128. //
  11129. // Only used on FXAA Quality.
  11130. // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define.
  11131. // It is here now to allow easier tuning.
  11132. // The minimum amount of local contrast required to apply algorithm.
  11133. // 0.333 - too little (faster)
  11134. // 0.250 - low quality
  11135. // 0.166 - default
  11136. // 0.125 - high quality
  11137. // 0.063 - overkill (slower)
  11138. FxaaFloat fxaaQualityEdgeThreshold,
  11139. //
  11140. // Only used on FXAA Quality.
  11141. // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define.
  11142. // It is here now to allow easier tuning.
  11143. // Trims the algorithm from processing darks.
  11144. // 0.0833 - upper limit (default, the start of visible unfiltered edges)
  11145. // 0.0625 - high quality (faster)
  11146. // 0.0312 - visible limit (slower)
  11147. // Special notes when using FXAA_GREEN_AS_LUMA,
  11148. // Likely want to set this to zero.
  11149. // As colors that are mostly not-green
  11150. // will appear very dark in the green channel!
  11151. // Tune by looking at mostly non-green content,
  11152. // then start at zero and increase until aliasing is a problem.
  11153. FxaaFloat fxaaQualityEdgeThresholdMin
  11154. ) {
  11155. /*--------------------------------------------------------------------------*/
  11156. FxaaFloat2 posM;
  11157. posM.x = pos.x;
  11158. posM.y = pos.y;
  11159. FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
  11160. #define lumaM rgbyM.y
  11161. FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));
  11162. FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));
  11163. FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));
  11164. FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));
  11165. /*--------------------------------------------------------------------------*/
  11166. FxaaFloat maxSM = max(lumaS, lumaM);
  11167. FxaaFloat minSM = min(lumaS, lumaM);
  11168. FxaaFloat maxESM = max(lumaE, maxSM);
  11169. FxaaFloat minESM = min(lumaE, minSM);
  11170. FxaaFloat maxWN = max(lumaN, lumaW);
  11171. FxaaFloat minWN = min(lumaN, lumaW);
  11172. FxaaFloat rangeMax = max(maxWN, maxESM);
  11173. FxaaFloat rangeMin = min(minWN, minESM);
  11174. FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;
  11175. FxaaFloat range = rangeMax - rangeMin;
  11176. FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);
  11177. FxaaBool earlyExit = range < rangeMaxClamped;
  11178. /*--------------------------------------------------------------------------*/
  11179. if(earlyExit)
  11180. return rgbyM;
  11181. /*--------------------------------------------------------------------------*/
  11182. FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));
  11183. FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));
  11184. FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));
  11185. FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
  11186. /*--------------------------------------------------------------------------*/
  11187. FxaaFloat lumaNS = lumaN + lumaS;
  11188. FxaaFloat lumaWE = lumaW + lumaE;
  11189. FxaaFloat subpixRcpRange = 1.0/range;
  11190. FxaaFloat subpixNSWE = lumaNS + lumaWE;
  11191. FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;
  11192. FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;
  11193. /*--------------------------------------------------------------------------*/
  11194. FxaaFloat lumaNESE = lumaNE + lumaSE;
  11195. FxaaFloat lumaNWNE = lumaNW + lumaNE;
  11196. FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;
  11197. FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;
  11198. /*--------------------------------------------------------------------------*/
  11199. FxaaFloat lumaNWSW = lumaNW + lumaSW;
  11200. FxaaFloat lumaSWSE = lumaSW + lumaSE;
  11201. FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);
  11202. FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);
  11203. FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;
  11204. FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;
  11205. FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;
  11206. FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;
  11207. /*--------------------------------------------------------------------------*/
  11208. FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;
  11209. FxaaFloat lengthSign = fxaaQualityRcpFrame.x;
  11210. FxaaBool horzSpan = edgeHorz >= edgeVert;
  11211. FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;
  11212. /*--------------------------------------------------------------------------*/
  11213. if(!horzSpan) lumaN = lumaW;
  11214. if(!horzSpan) lumaS = lumaE;
  11215. if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;
  11216. FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;
  11217. /*--------------------------------------------------------------------------*/
  11218. FxaaFloat gradientN = lumaN - lumaM;
  11219. FxaaFloat gradientS = lumaS - lumaM;
  11220. FxaaFloat lumaNN = lumaN + lumaM;
  11221. FxaaFloat lumaSS = lumaS + lumaM;
  11222. FxaaBool pairN = abs(gradientN) >= abs(gradientS);
  11223. FxaaFloat gradient = max(abs(gradientN), abs(gradientS));
  11224. if(pairN) lengthSign = -lengthSign;
  11225. FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);
  11226. /*--------------------------------------------------------------------------*/
  11227. FxaaFloat2 posB;
  11228. posB.x = posM.x;
  11229. posB.y = posM.y;
  11230. FxaaFloat2 offNP;
  11231. offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;
  11232. offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;
  11233. if(!horzSpan) posB.x += lengthSign * 0.5;
  11234. if( horzSpan) posB.y += lengthSign * 0.5;
  11235. /*--------------------------------------------------------------------------*/
  11236. FxaaFloat2 posN;
  11237. posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;
  11238. posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;
  11239. FxaaFloat2 posP;
  11240. posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;
  11241. posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;
  11242. FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;
  11243. FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));
  11244. FxaaFloat subpixE = subpixC * subpixC;
  11245. FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));
  11246. /*--------------------------------------------------------------------------*/
  11247. if(!pairN) lumaNN = lumaSS;
  11248. FxaaFloat gradientScaled = gradient * 1.0/4.0;
  11249. FxaaFloat lumaMM = lumaM - lumaNN * 0.5;
  11250. FxaaFloat subpixF = subpixD * subpixE;
  11251. FxaaBool lumaMLTZero = lumaMM < 0.0;
  11252. /*--------------------------------------------------------------------------*/
  11253. lumaEndN -= lumaNN * 0.5;
  11254. lumaEndP -= lumaNN * 0.5;
  11255. FxaaBool doneN = abs(lumaEndN) >= gradientScaled;
  11256. FxaaBool doneP = abs(lumaEndP) >= gradientScaled;
  11257. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;
  11258. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;
  11259. FxaaBool doneNP = (!doneN) || (!doneP);
  11260. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;
  11261. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;
  11262. /*--------------------------------------------------------------------------*/
  11263. if(doneNP) {
  11264. if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
  11265. if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
  11266. if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
  11267. if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
  11268. doneN = abs(lumaEndN) >= gradientScaled;
  11269. doneP = abs(lumaEndP) >= gradientScaled;
  11270. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;
  11271. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;
  11272. doneNP = (!doneN) || (!doneP);
  11273. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;
  11274. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;
  11275. /*--------------------------------------------------------------------------*/
  11276. #if (FXAA_QUALITY_PS > 3)
  11277. if(doneNP) {
  11278. if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
  11279. if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
  11280. if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
  11281. if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
  11282. doneN = abs(lumaEndN) >= gradientScaled;
  11283. doneP = abs(lumaEndP) >= gradientScaled;
  11284. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;
  11285. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;
  11286. doneNP = (!doneN) || (!doneP);
  11287. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;
  11288. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;
  11289. /*--------------------------------------------------------------------------*/
  11290. #if (FXAA_QUALITY_PS > 4)
  11291. if(doneNP) {
  11292. if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
  11293. if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
  11294. if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
  11295. if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
  11296. doneN = abs(lumaEndN) >= gradientScaled;
  11297. doneP = abs(lumaEndP) >= gradientScaled;
  11298. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;
  11299. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;
  11300. doneNP = (!doneN) || (!doneP);
  11301. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;
  11302. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;
  11303. /*--------------------------------------------------------------------------*/
  11304. #if (FXAA_QUALITY_PS > 5)
  11305. if(doneNP) {
  11306. if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
  11307. if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
  11308. if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
  11309. if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
  11310. doneN = abs(lumaEndN) >= gradientScaled;
  11311. doneP = abs(lumaEndP) >= gradientScaled;
  11312. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;
  11313. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;
  11314. doneNP = (!doneN) || (!doneP);
  11315. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;
  11316. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;
  11317. /*--------------------------------------------------------------------------*/
  11318. #if (FXAA_QUALITY_PS > 6)
  11319. if(doneNP) {
  11320. if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
  11321. if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
  11322. if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
  11323. if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
  11324. doneN = abs(lumaEndN) >= gradientScaled;
  11325. doneP = abs(lumaEndP) >= gradientScaled;
  11326. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;
  11327. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;
  11328. doneNP = (!doneN) || (!doneP);
  11329. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;
  11330. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;
  11331. /*--------------------------------------------------------------------------*/
  11332. #if (FXAA_QUALITY_PS > 7)
  11333. if(doneNP) {
  11334. if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
  11335. if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
  11336. if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
  11337. if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
  11338. doneN = abs(lumaEndN) >= gradientScaled;
  11339. doneP = abs(lumaEndP) >= gradientScaled;
  11340. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;
  11341. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;
  11342. doneNP = (!doneN) || (!doneP);
  11343. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;
  11344. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;
  11345. /*--------------------------------------------------------------------------*/
  11346. #if (FXAA_QUALITY_PS > 8)
  11347. if(doneNP) {
  11348. if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
  11349. if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
  11350. if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
  11351. if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
  11352. doneN = abs(lumaEndN) >= gradientScaled;
  11353. doneP = abs(lumaEndP) >= gradientScaled;
  11354. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;
  11355. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;
  11356. doneNP = (!doneN) || (!doneP);
  11357. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;
  11358. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;
  11359. /*--------------------------------------------------------------------------*/
  11360. #if (FXAA_QUALITY_PS > 9)
  11361. if(doneNP) {
  11362. if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
  11363. if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
  11364. if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
  11365. if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
  11366. doneN = abs(lumaEndN) >= gradientScaled;
  11367. doneP = abs(lumaEndP) >= gradientScaled;
  11368. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;
  11369. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;
  11370. doneNP = (!doneN) || (!doneP);
  11371. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;
  11372. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;
  11373. /*--------------------------------------------------------------------------*/
  11374. #if (FXAA_QUALITY_PS > 10)
  11375. if(doneNP) {
  11376. if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
  11377. if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
  11378. if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
  11379. if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
  11380. doneN = abs(lumaEndN) >= gradientScaled;
  11381. doneP = abs(lumaEndP) >= gradientScaled;
  11382. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;
  11383. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;
  11384. doneNP = (!doneN) || (!doneP);
  11385. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;
  11386. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;
  11387. /*--------------------------------------------------------------------------*/
  11388. #if (FXAA_QUALITY_PS > 11)
  11389. if(doneNP) {
  11390. if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
  11391. if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
  11392. if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
  11393. if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
  11394. doneN = abs(lumaEndN) >= gradientScaled;
  11395. doneP = abs(lumaEndP) >= gradientScaled;
  11396. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;
  11397. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;
  11398. doneNP = (!doneN) || (!doneP);
  11399. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;
  11400. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;
  11401. /*--------------------------------------------------------------------------*/
  11402. #if (FXAA_QUALITY_PS > 12)
  11403. if(doneNP) {
  11404. if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
  11405. if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
  11406. if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
  11407. if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
  11408. doneN = abs(lumaEndN) >= gradientScaled;
  11409. doneP = abs(lumaEndP) >= gradientScaled;
  11410. if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;
  11411. if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;
  11412. doneNP = (!doneN) || (!doneP);
  11413. if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;
  11414. if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;
  11415. /*--------------------------------------------------------------------------*/
  11416. }
  11417. #endif
  11418. /*--------------------------------------------------------------------------*/
  11419. }
  11420. #endif
  11421. /*--------------------------------------------------------------------------*/
  11422. }
  11423. #endif
  11424. /*--------------------------------------------------------------------------*/
  11425. }
  11426. #endif
  11427. /*--------------------------------------------------------------------------*/
  11428. }
  11429. #endif
  11430. /*--------------------------------------------------------------------------*/
  11431. }
  11432. #endif
  11433. /*--------------------------------------------------------------------------*/
  11434. }
  11435. #endif
  11436. /*--------------------------------------------------------------------------*/
  11437. }
  11438. #endif
  11439. /*--------------------------------------------------------------------------*/
  11440. }
  11441. #endif
  11442. /*--------------------------------------------------------------------------*/
  11443. }
  11444. #endif
  11445. /*--------------------------------------------------------------------------*/
  11446. }
  11447. /*--------------------------------------------------------------------------*/
  11448. FxaaFloat dstN = posM.x - posN.x;
  11449. FxaaFloat dstP = posP.x - posM.x;
  11450. if(!horzSpan) dstN = posM.y - posN.y;
  11451. if(!horzSpan) dstP = posP.y - posM.y;
  11452. /*--------------------------------------------------------------------------*/
  11453. FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;
  11454. FxaaFloat spanLength = (dstP + dstN);
  11455. FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;
  11456. FxaaFloat spanLengthRcp = 1.0/spanLength;
  11457. /*--------------------------------------------------------------------------*/
  11458. FxaaBool directionN = dstN < dstP;
  11459. FxaaFloat dst = min(dstN, dstP);
  11460. FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;
  11461. FxaaFloat subpixG = subpixF * subpixF;
  11462. FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;
  11463. FxaaFloat subpixH = subpixG * fxaaQualitySubpix;
  11464. /*--------------------------------------------------------------------------*/
  11465. FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;
  11466. FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);
  11467. if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;
  11468. if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;
  11469. return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);
  11470. }
  11471. `;var wMi=T(S(),1);function FT(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new fi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new D,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(FT.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(l(e))return e[e.length-1].getColorTexture(0)}}});function Mxe(e){let t=e._framebuffers;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function vht(e,t){Mxe(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?qe.HALF_FLOAT:qe.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(r);for(let c=0;c<r;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new fi,s[c].update(t,n,i,1,o);let a=s[r-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,o),e._framebuffers=s}function Nxe(e){let t=e._commands;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function wht(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function Fht(e,t){let n=`uniform sampler2D colorTexture;
  11472. in vec2 v_textureCoordinates;
  11473. float sampleTexture(vec2 offset) {
  11474. `;return e===0?n+=` vec4 color = texture(colorTexture, v_textureCoordinates + offset);
  11475. return czm_luminance(color.rgb);
  11476. `:n+=` return texture(colorTexture, v_textureCoordinates + offset).r;
  11477. `,n+=`}
  11478. `,n+=`uniform vec2 colorTextureDimensions;
  11479. uniform vec2 minMaxLuminance;
  11480. uniform sampler2D previousLuminance;
  11481. void main() {
  11482. float color = 0.0;
  11483. float xStep = 1.0 / colorTextureDimensions.x;
  11484. float yStep = 1.0 / colorTextureDimensions.y;
  11485. int count = 0;
  11486. for (int i = 0; i < 3; ++i) {
  11487. for (int j = 0; j < 3; ++j) {
  11488. vec2 offset;
  11489. offset.x = -xStep + float(i) * xStep;
  11490. offset.y = -yStep + float(j) * yStep;
  11491. if (offset.x < 0.0 || offset.x > 1.0 || offset.y < 0.0 || offset.y > 1.0) {
  11492. continue;
  11493. }
  11494. color += sampleTexture(offset);
  11495. ++count;
  11496. }
  11497. }
  11498. if (count > 0) {
  11499. color /= float(count);
  11500. }
  11501. `,e===t-1&&(n+=` float previous = texture(previousLuminance, vec2(0.5)).r;
  11502. color = clamp(color, minMaxLuminance.x, minMaxLuminance.y);
  11503. color = previous + (color - previous) / (60.0 * 1.5);
  11504. color = clamp(color, minMaxLuminance.x, minMaxLuminance.y);
  11505. `),n+=` out_FragColor = vec4(color);
  11506. }
  11507. `,n}function Aht(e,t){Nxe(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(Fht(r,i),{framebuffer:n[r].framebuffer,uniformMap:wht(e,r)});e._commands=o}FT.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new ei({color:new B(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};FT.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,vht(this,e),Aht(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,o=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=o};FT.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o)n[o].execute(e)};FT.prototype.isDestroyed=function(){return!1};FT.prototype.destroy=function(){return Mxe(this),Nxe(this),me(this)};var jF=FT;var o9i=T(S(),1);var AMi=T(S(),1),Mht={NEAREST:0,LINEAR:1},zd=Mht;function AT(e){e=y(e,y.EMPTY_OBJECT);let{fragmentShader:t,textureScale:n=1,pixelFormat:i=ot.RGBA}=e;this._fragmentShader=t,this._uniforms=e.uniforms,this._textureScale=n,this._forcePowerOfTwo=y(e.forcePowerOfTwo,!1),this._sampleMode=y(e.sampleMode,zd.NEAREST),this._pixelFormat=i,this._pixelDatatype=y(e.pixelDatatype,qe.UNSIGNED_BYTE),this._clearColor=y(e.clearColor,B.BLACK),this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let o=new ec;o.scissorTest={enabled:!0,rectangle:l(e.scissorRectangle)?Ke.clone(e.scissorRectangle):new Ke},this._passState=o,this._ready=!1;let r=e.name;l(r)||(r=Bn()),this._name=r,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(AT.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var Nht=/uniform\s+sampler2D\s+depthTexture/g;AT.prototype._isSupported=function(e){return!Nht.test(this._fragmentShader)||e.depthTexture};function kht(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(o){let r=t[n];t[n]=o;let s=e._actualUniforms,a=s[n];l(a)&&a!==r&&a instanceof Pt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof Pt&&e._texturesToRelease.push(r),typeof o=="string"||o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof HTMLVideoElement||o instanceof ImageData?e._dirtyUniforms.push(n):s[n]=o}}}function Uht(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function Dht(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function Bht(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,o=e._actualUniforms;for(let r in i){if(!i.hasOwnProperty(r))continue;typeof i[r]!="function"?(t[r]=Uht(e,r),n[r]=kht(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof Pt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=Dht(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=Tt(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function Oht(e,t){return e=e.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),`#define CZM_SELECTED_FEATURE
  11508. uniform sampler2D czm_idTexture;
  11509. uniform sampler2D czm_selectedIdTexture;
  11510. uniform float czm_selectedIdTextureStep;
  11511. in vec2 v_textureCoordinates;
  11512. bool czm_selected(vec2 offset)
  11513. {
  11514. bool selected = false;
  11515. vec4 id = texture(czm_idTexture, v_textureCoordinates + offset);
  11516. for (int i = 0; i < ${t}; ++i)
  11517. {
  11518. vec4 selectedId = texture(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5));
  11519. if (all(equal(id, selectedId)))
  11520. {
  11521. return true;
  11522. }
  11523. }
  11524. return false;
  11525. }
  11526. bool czm_selected()
  11527. {
  11528. return czm_selected(vec2(0.0));
  11529. }
  11530. ${e}`}function Yht(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let o=e._selectedIdTexture.width;n=Oht(n,o)}let i=new De({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function Hht(e){let t=e._sampleMode,n,i;t===zd.LINEAR?(n=$t.LINEAR,i=hi.LINEAR):(n=$t.NEAREST,i=hi.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new en({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function zht(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function Kht(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function Jht(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let c=n[a];c=c&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:c,source:d}=i[a];e._actualUniforms[c]=new Pt({context:t,source:d})}i.length=0;let o=e._dirtyUniforms;if(o.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(o.length===0||l(e._texturePromise))return;let r=e._uniforms,s=[];for(let a=0;a<o.length;++a){let c=o[a],d=r[c],u=e._textureCache.getStageByName(d);if(l(u))e._actualUniforms[c]=Kht(e,d);else if(typeof d=="string"){let m=new Ee({url:d});s.push(m.fetchImage().then(zht(e,c)))}else e._texturesToCreate.push({name:c,source:d})}o.length=0,s.length>0?(e._ready=!1,e._texturePromise=Promise.all(s).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function kxe(e){l(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let o in i){if(!i.hasOwnProperty(o))continue;let r=i[o];r instanceof Pt&&(l(t.getStageByName(n[o]))||r.destroy(),e._dirtyUniforms.push(o))}}function Qht(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;for(let o=0;o<e._combinedSelected.length;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}function jht(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i=0;for(let s=0;s<n.length;++s){let a=n[s];l(a.pickIds)?i+=a.pickIds.length:l(a.pickId)&&++i}if(n.length===0||i===0){let s=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new Pt({context:t,pixelFormat:ot.RGBA,pixelDatatype:qe.UNSIGNED_BYTE,source:{arrayBufferView:s,width:1,height:1},sampler:en.NEAREST});return}let o=0,r=new Uint8Array(i*4);for(let s=0;s<n.length;++s){let a=n[s];if(l(a.pickIds)){let c=a.pickIds,d=c.length;for(let u=0;u<d;++u){let m=c[u].color;r[o]=B.floatToByte(m.red),r[o+1]=B.floatToByte(m.green),r[o+2]=B.floatToByte(m.blue),r[o+3]=B.floatToByte(m.alpha),o+=4}}else if(l(a.pickId)){let c=a.pickId.color;r[o]=B.floatToByte(c.red),r[o+1]=B.floatToByte(c.green),r[o+2]=B.floatToByte(c.blue),r[o+3]=B.floatToByte(c.alpha),o+=4}}e._selectedIdTexture=new Pt({context:t,pixelFormat:ot.RGBA,pixelDatatype:qe.UNSIGNED_BYTE,source:{arrayBufferView:r,width:i,height:1},sampler:en.NEAREST})}AT.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&kxe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=Qht(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,jht(this,e),Bht(this),Jht(this,e),Yht(this,e),Hht(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!l(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=Ue.fromCache({viewport:new Ke(0,0,i.width,i.height)}))),this._command.renderState=o};AT.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,en.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let o=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(o)&&(o.context=e),this._command.execute(e,o)};AT.prototype.isDestroyed=function(){return!1};AT.prototype.destroy=function(){return kxe(this),me(this)};var lo=AT;var d9i=T(S(),1);function MT(e){e=y(e,y.EMPTY_OBJECT),this._stages=e.stages,this._inputPreviousStageTexture=y(e.inputPreviousStageTexture,!0);let t=e.name;l(t)||(t=Bn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(MT.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});MT.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};MT.prototype.get=function(e){return this._stages[e]};function qht(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let o=0;o<t;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}MT.prototype.update=function(e,t){this._selectedDirty=qht(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let o=0;o<i;++o){let r=n[o];this._selectedDirty&&(r.parentSelected=this._combinedSelected),r.update(e,t)}};MT.prototype.isDestroyed=function(){return!1};MT.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return me(this)};var cl=MT;var Rr={};function yB(e){let o=`#define USE_STEP_SIZE
  11531. ${Ly}`,r=new lo({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:zd.LINEAR}),s=new lo({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:zd.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(c){let d=r.uniforms,u=s.uniforms;d.delta=u.delta=c}},sigma:{get:function(){return r.uniforms.sigma},set:function(c){let d=r.uniforms,u=s.uniforms;d.sigma=u.sigma=c}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(c){let d=r.uniforms,u=s.uniforms;d.stepSize=u.stepSize=c}}}),new cl({name:e,stages:[r,s],uniforms:a})}Rr.createBlurStage=function(){return yB("czm_blur")};Rr.createDepthOfFieldStage=function(){let e=yB("czm_depth_of_field_blur"),t=new lo({name:"czm_depth_of_field_composite",fragmentShader:NF,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new cl({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Rr.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Rr.createEdgeDetectionStage=function(){let e=Bn();return new lo({name:`czm_edge_detection_${e}`,fragmentShader:UF,uniforms:{length:.25,color:B.clone(B.BLACK)}})};Rr.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function $ht(e){if(!l(e))return Rr.createEdgeDetectionStage();let t=new cl({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",o="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a};
  11532. `,o+=` vec4 edge${a} = texture(edgeTexture${a}, v_textureCoordinates);
  11533. if (edge${a}.a > 0.0)
  11534. {
  11535. color = edge${a};
  11536. break;
  11537. }
  11538. `,n[`edgeTexture${a}`]=e[a].name;let r=`${i}in vec2 v_textureCoordinates;
  11539. void main() {
  11540. vec4 color = vec4(0.0);
  11541. for (int i = 0; i < ${e.length}; i++)
  11542. {
  11543. ${o} }
  11544. out_FragColor = color;
  11545. }
  11546. `,s=new lo({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new cl({name:"czm_edge_detection_composite",stages:[t,s]})}Rr.createSilhouetteStage=function(e){let t=$ht(e),n=new lo({name:"czm_silhouette_color_edges",fragmentShader:JF,uniforms:{silhouetteTexture:t.name}});return new cl({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Rr.isSilhouetteSupported=function(e){return e.context.depthTexture};Rr.createBloomStage=function(){let e=new lo({name:"czm_bloom_contrast_bias",fragmentShader:MF,uniforms:{contrast:128,brightness:-.3}}),t=yB("czm_bloom_blur"),n=new cl({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new lo({name:"czm_bloom_generate_composite",fragmentShader:FF,uniforms:{glowOnly:!1,bloomTexture:n.name}}),o={};return Object.defineProperties(o,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(r){i.uniforms.glowOnly=r}},contrast:{get:function(){return e.uniforms.contrast},set:function(r){e.uniforms.contrast=r}},brightness:{get:function(){return e.uniforms.brightness},set:function(r){e.uniforms.brightness=r}},delta:{get:function(){return t.uniforms.delta},set:function(r){t.uniforms.delta=r}},sigma:{get:function(){return t.uniforms.sigma},set:function(r){t.uniforms.sigma=r}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(r){t.uniforms.stepSize=r}}}),new cl({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Rr.createAmbientOcclusionStage=function(){let e=new lo({name:"czm_ambient_occlusion_generate",fragmentShader:PF,uniforms:{intensity:3,bias:.1,lengthCap:.26,stepSize:1.95,frustumLength:1e3,randomTexture:void 0}}),t=yB("czm_ambient_occlusion_blur");t.uniforms.stepSize=.86;let n=new cl({name:"czm_ambient_occlusion_generate_blur",stages:[e,t]}),i=new lo({name:"czm_ambient_occlusion_composite",fragmentShader:vF,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:n.name}}),o={};return Object.defineProperties(o,{intensity:{get:function(){return e.uniforms.intensity},set:function(r){e.uniforms.intensity=r}},bias:{get:function(){return e.uniforms.bias},set:function(r){e.uniforms.bias=r}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(r){e.uniforms.lengthCap=r}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(r){e.uniforms.stepSize=r}},frustumLength:{get:function(){return e.uniforms.frustumLength},set:function(r){e.uniforms.frustumLength=r}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(r){e.uniforms.randomTexture=r}},delta:{get:function(){return t.uniforms.delta},set:function(r){t.uniforms.delta=r}},sigma:{get:function(){return t.uniforms.sigma},set:function(r){t.uniforms.sigma=r}},blurStepSize:{get:function(){return t.uniforms.stepSize},set:function(r){t.uniforms.stepSize=r}},ambientOcclusionOnly:{get:function(){return i.uniforms.ambientOcclusionOnly},set:function(r){i.uniforms.ambientOcclusionOnly=r}}}),new cl({name:"czm_ambient_occlusion",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Rr.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var eft=`#define FXAA_QUALITY_PRESET 39
  11547. ${QF}
  11548. ${OF}`;Rr.createFXAAStage=function(){return new lo({name:"czm_FXAA",fragmentShader:eft,sampleMode:zd.LINEAR})};Rr.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
  11549. `:"";return t+=WF,new lo({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Rr.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
  11550. `:"";return t+=DF,new lo({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Rr.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
  11551. `:"";return t+=BF,new lo({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Rr.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
  11552. `:"";return t+=KF,new lo({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Rr.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
  11553. `:"";return t+=HF,new lo({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:B.WHITE,autoExposure:void 0,exposure:1}})};Rr.createAutoExposureStage=function(){return new jF};Rr.createBlackAndWhiteStage=function(){return new lo({name:"czm_black_and_white",fragmentShader:wF,uniforms:{gradations:5}})};Rr.createBrightnessStage=function(){return new lo({name:"czm_brightness",fragmentShader:AF,uniforms:{brightness:.5}})};Rr.createNightVisionStage=function(){return new lo({name:"czm_night_vision",fragmentShader:zF})};Rr.createDepthViewStage=function(){return new lo({name:"czm_depth_view",fragmentShader:kF})};Rr.createLensFlareStage=function(){return new lo({name:"czm_lens_flare",fragmentShader:YF,uniforms:{dirtTexture:rn("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:rn("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ne.WGS84.maximumRadius}})};var Kd=Rr;var J9i=T(S(),1);function l0(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function $F(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function kj(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(l(o)){let a=e.getStageByName(o);r[$F(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let d=0;d<c;++d){let u=s[a[d]];if(typeof u=="string"){let m=e.getStageByName(u);l(m)&&(r[$F(m)]=!0)}}}return i.name}function qF(e,t,n,i,o){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return o;let r=o,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=o,c=i.length;for(let m=0;m<c;++m){let p=i.get(m);l(p.length)?a=qF(e,t,n,p,o):a=kj(e,t,n,p,o),s&&(o=a)}let d,u;if(s)for(d=1;d<c;++d)u=$F(i.get(d)),l(n[u])||(n[u]={}),n[u][r]=!0;else for(d=1;d<c;++d){u=$F(i.get(d));let m=n[u];for(let p=0;p<d;++p)m[$F(i.get(p))]=!0}return a}function tft(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=qF(e,t,n,i,void 0);a=qF(e,t,n,o,a),a=kj(e,t,n,r,a),a=qF(e,t,n,e,a),kj(e,t,n,s,a)}else qF(e,t,n,e,void 0);return n}function nft(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,c=o._pixelDatatype,d=o._clearColor,u,m,p=e._framebuffers,g=p.length;for(u=0;u<g;++u){if(m=p[u],r!==m.textureScale||s!==m.forcePowerOfTwo||a!==m.pixelFormat||c!==m.pixelDatatype||!B.equals(d,m.clearColor))continue;let f=m.stages,x=f.length,_=!1;for(let C=0;C<x;++C)if(n[f[C]]){_=!0;break}if(!_)break}return l(m)&&u<g?(m.stages.push(t),m):(m={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:d,stages:[t],buffer:new fi({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(m),m)}function ift(e,t){let n=tft(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=nft(e,i,n[i]))}function Uj(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function oft(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let s=0;s<r;++s){let a=o[s],c=a.textureScale,d=Math.ceil(n*c),u=Math.ceil(i*c),m=Math.min(d,u);a.forcePowerOfTwo&&(W.isPowerOfTwo(m)||(m=W.nextPowerOfTwo(m)),d=m,u=m),a.buffer.update(t,d,u),a.clear=new ei({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}l0.prototype.updateDependencies=function(){this._updateDependencies=!0};l0.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),o=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),r=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!l(t._activeStages)||t._activeStages.length>0||i||o||r||s;if((n||!a&&this._framebuffers.length>0)&&(Uj(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&ift(this,e);let c=e.drawingBufferWidth,d=e.drawingBufferHeight,u=this._width!==c||this._height!==d;!n&&!u||(this._width=c,this._height=d,this._updateDependencies=!1,Uj(this),oft(this,e))};l0.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};l0.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};l0.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};l0.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};l0.prototype.isDestroyed=function(){return!1};l0.prototype.destroy=function(){return Uj(this),me(this)};var NT=l0;var j9i=T(S(),1),rft={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};var d0=Object.freeze(rft);var Dj=[];function ll(){let e=Kd.createFXAAStage(),t=Kd.createAmbientOcclusionStage(),n=Kd.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=Kd.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=d0.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new NT(this),r={},s=Dj;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();r[c.name]=c,c._textureCache=o;let d=c.length;if(l(d))for(let u=0;u<d;++u)s.push(c.get(u))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=r,this._textureCache=o}Object.defineProperties(ll.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,o=this._ao,r=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||o.ready&&o.enabled,e=e||r.ready&&r.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return Bj(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(l(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let o=this._bloom;if(o.enabled&&o.ready)return this.getOutputTexture(o.name);let r=this._ao;if(r.enabled&&r.ready)return this.getOutputTexture(r.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case d0.REINHARD:n=Kd.createReinhardTonemappingStage(t);break;case d0.MODIFIED_REINHARD:n=Kd.createModifiedReinhardTonemappingStage(t);break;case d0.FILMIC:n=Kd.createFilmicTonemappingStage(t);break;case d0.PBR_NEUTRAL:n=Kd.createPbrNeutralTonemappingStage(t);break;default:n=Kd.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}else n.uniforms.exposure=this._exposure;this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}},exposure:{get:function(){return this._exposure},set:function(e){this._tonemapping.uniforms.exposure=e,this._exposure=e}}});function Bj(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages;for(let i=0,o=0;i<n.length;++i){let r=n[i];r&&(r._index=o++,t.push(r))}e._stages=t}ll.prototype.add=function(e){let t=this._stageNames,n=Dj;for(n.push(e);n.length>0;){let o=n.pop();t[o.name]=o,o._textureCache=this._textureCache;let r=o.length;if(l(r))for(let s=0;s<r;++s)n.push(o.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};ll.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=Dj;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let o=i.length;if(l(o))for(let r=0;r<o;++r)n.push(i.get(r))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};ll.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};ll.prototype.get=function(e){return Bj(this),this._stages[e]};ll.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};ll.prototype.getStageByName=function(e){return this._stageNames[e]};ll.prototype.update=function(e,t,n){Bj(this);let i=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let r=this._stages;o.length=r.length;let s=0;for(let C=0;C<r.length;++C){let V=r[C];V.ready&&V.enabled&&V._isSupported(e)&&(o[s++]=V)}o.length=s;let a=s!==i.length;if(!a){for(let C=0;C<s;++C)if(o[C]!==i[C]){a=!0;break}}let c=this._ao,d=this._bloom,u=this._autoExposure,m=this._tonemapping,p=this._fxaa;m.enabled=n;let g=c.enabled&&c._isSupported(e),f=d.enabled&&d._isSupported(e),x=m.enabled&&m._isSupported(e),_=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||g!==this._aoEnabled||f!==this._bloomEnabled||x!==this._tonemappingEnabled||_!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=g,this._bloomEnabled=f,this._tonemappingEnabled=x,this._fxaaEnabled=_,this._textureCacheDirty=!1),l(this._randomTexture)&&!g&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&g){let V=new Uint8Array(196608);for(let L=0;L<196608;L+=3)V[L]=Math.floor(Math.random()*255);this._randomTexture=new Pt({context:e,pixelFormat:ot.RGB,pixelDatatype:qe.UNSIGNED_BYTE,source:{arrayBufferView:V,width:256,height:256},sampler:new en({wrapS:Cn.REPEAT,wrapT:Cn.REPEAT,minificationFilter:$t.NEAREST,magnificationFilter:hi.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),d.update(e,t),m.update(e,t),this._autoExposureEnabled&&u.update(e,t);for(let C=0;C<r.length;++C)r[C].update(e,t);s=0;for(let C=0;C<r.length;++C){let V=r[C];V.ready&&V.enabled&&V._isSupported(e)&&s++}a=s!==o.length,a&&this.update(e,t,n)};ll.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function kT(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}ll.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return kT(t)};function jf(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){jf(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)jf(e.get(r),t,kT(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)jf(e.get(r),t,n,i,o)}ll.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,c=this._bloom,d=this._autoExposure,u=this._tonemapping,m=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,f=u.enabled&&u._isSupported(e),x=s.enabled&&s._isSupported(e);if(!x&&!m&&!p&&!f&&r===0)return;let _=t;m&&a.ready&&(jf(a,e,_,n,i),_=kT(a)),p&&c.ready&&(jf(c,e,_,n,i),_=kT(c)),g&&d.ready&&jf(d,e,_,n,i),f&&u.ready&&(jf(u,e,_,n,i),_=kT(u));let C=_;if(r>0){jf(o[0],e,_,n,i);for(let V=1;V<r;++V)jf(o[V],e,kT(o[V-1]),n,i);C=kT(o[r-1])}x&&s.ready&&jf(s,e,C,n,i)};ll.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(jl,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};ll.prototype.isDestroyed=function(){return!1};ll.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),me(this)};var eA=ll;var HNi=T(S(),1);var GNi=T(S(),1);var pNi=T(S(),1),sft={SHIFT:0,CTRL:1,ALT:2},ea=Object.freeze(sft);var gNi=T(S(),1),aft={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19},Sn=Object.freeze(aft);function Ry(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let o=i.getBoundingClientRect();return n.x=t.clientX-o.left,n.y=t.clientY-o.top,n}function Jj(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function UT(e){if(e.shiftKey)return ea.SHIFT;if(e.ctrlKey)return ea.CTRL;if(e.altKey)return ea.ALT}var Ps={LEFT:0,MIDDLE:1,RIGHT:2};function Jd(e,t,n,i){function o(r){i(e,r)}zt.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function cft(e){let t=e._element,n=l(t.disableRootEvents)?t:document;zt.supportsPointerEvents()?(Jd(e,"pointerdown",t,fft),Jd(e,"pointerup",t,Qxe),Jd(e,"pointermove",t,pft),Jd(e,"pointercancel",t,Qxe)):(Jd(e,"mousedown",t,jxe),Jd(e,"mouseup",n,qxe),Jd(e,"mousemove",n,$xe),Jd(e,"touchstart",t,mft),Jd(e,"touchend",n,Yxe),Jd(e,"touchmove",n,hft),Jd(e,"touchcancel",n,Yxe)),Jd(e,"dblclick",t,dft);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Jd(e,i,t,uft)}function lft(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var Uxe={position:new D};function Qj(e){e._lastSeenTouchEvent=_i()}function jj(e){return _i()-e._lastSeenTouchEvent>Gh.mouseEmulationIgnoreMilliseconds}function Kj(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function jxe(e,t){if(!jj(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===Ps.LEFT)i=Sn.LEFT_DOWN;else if(n===Ps.MIDDLE)i=Sn.MIDDLE_DOWN;else if(n===Ps.RIGHT)i=Sn.RIGHT_DOWN;else return;let o=Ry(e,t,e._primaryPosition);D.clone(o,e._primaryStartPosition),D.clone(o,e._primaryPreviousPosition);let r=UT(t),s=e.getInputAction(i,r);l(s)&&(D.clone(o,Uxe.position),s(Uxe),t.preventDefault())}var Dxe={position:new D},Bxe={position:new D};function Oj(e,t,n,i){let o=UT(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(l(r)||l(s)){let a=Ry(e,i,e._primaryPosition);if(l(r)&&(D.clone(a,Dxe.position),r(Dxe)),l(s)){let c=e._primaryStartPosition;Kj(c,a,e._clickPixelTolerance)&&(D.clone(a,Bxe.position),s(Bxe))}}}function qxe(e,t){if(!jj(e))return;let n=t.button;n!==Ps.LEFT&&n!==Ps.MIDDLE&&n!==Ps.RIGHT||(e._buttonDown[Ps.LEFT]&&(Oj(e,Sn.LEFT_UP,Sn.LEFT_CLICK,t),e._buttonDown[Ps.LEFT]=!1),e._buttonDown[Ps.MIDDLE]&&(Oj(e,Sn.MIDDLE_UP,Sn.MIDDLE_CLICK,t),e._buttonDown[Ps.MIDDLE]=!1),e._buttonDown[Ps.RIGHT]&&(Oj(e,Sn.RIGHT_UP,Sn.RIGHT_CLICK,t),e._buttonDown[Ps.RIGHT]=!1))}var Yj={startPosition:new D,endPosition:new D};function $xe(e,t){if(!jj(e))return;let n=UT(t),i=Ry(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(Sn.MOUSE_MOVE,n);l(r)&&(D.clone(o,Yj.startPosition),D.clone(i,Yj.endPosition),r(Yj)),D.clone(i,o),(e._buttonDown[Ps.LEFT]||e._buttonDown[Ps.MIDDLE]||e._buttonDown[Ps.RIGHT])&&t.preventDefault()}var Oxe={position:new D};function dft(e,t){let n=t.button,i;if(n===Ps.LEFT)i=Sn.LEFT_DOUBLE_CLICK;else return;let o=UT(t),r=e.getInputAction(i,o);l(r)&&(Ry(e,t,Oxe.position),r(Oxe))}function uft(e,t){let n;if(l(t.deltaY)){let r=t.deltaMode;r===t.DOM_DELTA_PIXEL?n=-t.deltaY:r===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=UT(t),o=e.getInputAction(Sn.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function mft(e,t){Qj(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.set(s,Ry(e,r,new D));xB(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.set(s,D.clone(a.get(s)))}function Yxe(e,t){Qj(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.remove(s);xB(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.remove(s)}var Hxe={position:new D},Hj={position1:new D,position2:new D},zxe={position:new D},Kxe={position:new D},Jxe={position:new D};function xB(e,t){let n=UT(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[Ps.LEFT]){if(e._buttonDown[Ps.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(Sn.LEFT_UP,n),l(r)&&(D.clone(e._primaryPosition,zxe.position),r(zxe)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(Sn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,d=e._previousPositions.values[0];Kj(c,d,e._clickPixelTolerance)&&(D.clone(e._primaryPosition,Kxe.position),s(Kxe))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(Sn.PINCH_END,n),l(r)&&r()),o===1&&!a){let c=i.values[0];D.clone(c,e._primaryPosition),D.clone(c,e._primaryStartPosition),D.clone(c,e._primaryPreviousPosition),e._buttonDown[Ps.LEFT]=!0,r=e.getInputAction(Sn.LEFT_DOWN,n),l(r)&&(D.clone(c,Hxe.position),r(Hxe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(Sn.RIGHT_CLICK,n),l(s))){let d=e._primaryStartPosition,u=e._previousPositions.values[0];Kj(d,u,e._holdPixelTolerance)&&(D.clone(e._primaryPosition,Jxe.position),s(Jxe))}},Gh.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(Sn.PINCH_START,n),l(r)&&(D.clone(i.values[0],Hj.position1),D.clone(i.values[1],Hj.position2),r(Hj),t.preventDefault()))}function hft(e,t){Qj(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i){r=n[i],s=r.identifier;let d=a.get(s);l(d)&&Ry(e,r,d)}e_e(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,D.clone(a.get(s),c.get(s))}var zj={startPosition:new D,endPosition:new D},tA={distance:{startPosition:new D,endPosition:new D},angleAndHeight:{startPosition:new D,endPosition:new D}};function e_e(e,t){let n=UT(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[Ps.LEFT]){let a=i.values[0];D.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(Sn.MOUSE_MOVE,n),l(s)&&(D.clone(c,zj.startPosition),D.clone(a,zj.endPosition),s(zj)),D.clone(a,c),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(Sn.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],d=o.values[0],u=o.values[1],m=c.x-a.x,p=c.y-a.y,g=Math.sqrt(m*m+p*p)*.25,f=u.x-d.x,x=u.y-d.y,_=Math.sqrt(f*f+x*x)*.25,C=(c.y+a.y)*.125,V=(u.y+d.y)*.125,L=Math.atan2(p,m),Z=Math.atan2(x,f);D.fromElements(0,_,tA.distance.startPosition),D.fromElements(0,g,tA.distance.endPosition),D.fromElements(Z,V,tA.angleAndHeight.startPosition),D.fromElements(L,C,tA.angleAndHeight.endPosition),s(tA)}}function fft(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,Ry(e,t,new D)),xB(e,t),e._previousPositions.set(i,D.clone(n.get(i)))}else jxe(e,t)}function Qxe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),xB(e,t),e._previousPositions.remove(i)}else qxe(e,t)}function pft(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!l(o))return;Ry(e,t,o),e_e(e,t);let r=e._previousPositions;D.clone(n.get(i),r.get(i))}else $xe(e,t)}function Gh(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-Gh.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new D,this._primaryPosition=new D,this._primaryPreviousPosition=new D,this._positions=new Zt,this._previousPositions=new Zt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=y(e,document),cft(this)}Gh.prototype.setInputAction=function(e,t,n){let i=Jj(t,n);this._inputEvents[i]=e};Gh.prototype.getInputAction=function(e,t){let n=Jj(e,t);return this._inputEvents[n]};Gh.prototype.removeInputAction=function(e,t){let n=Jj(e,t);delete this._inputEvents[n]};Gh.prototype.isDestroyed=function(){return!1};Gh.prototype.destroy=function(){return lft(this),me(this)};Gh.mouseEmulationIgnoreMilliseconds=800;Gh.touchHoldDelayMilliseconds=1500;var Qd=Gh;function DT(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}DT.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};DT.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof an,!(this._previousMode===oe.SCENE2D||this._previousMode===oe.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,oe.SCENE2D,!0),n._mode=oe.MORPHING,n.camera._setTransform(M.IDENTITY),this._previousMode===oe.COLUMBUS_VIEW?Kft(this,e):tpt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var bft=new h,gft=new h,yft=new h,xft=new h,_ft=new h,Tft=new h,Sft=new h,Cft=new he,Vft=new M,Lft=new Li,Rft=new an,Zft={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};DT.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===oe.COLUMBUS_VIEW||this._previousMode===oe.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,oe.COLUMBUS_VIEW,!0),n.camera._setTransform(M.IDENTITY);let i=bft,o=gft,r=yft;if(e>0)i.x=0,i.y=-1,i.z=1,i=h.multiplyByScalar(h.normalize(i,i),5*t.maximumRadius,i),h.negate(h.normalize(i,o),o),h.cross(h.UNIT_X,o,r);else{let d=n.camera;if(this._previousMode===oe.SCENE2D)h.clone(d.position,i),i.z=d.frustum.right-d.frustum.left,h.negate(h.UNIT_Z,o),h.clone(h.UNIT_Y,r);else{h.clone(d.positionWC,i),h.clone(d.directionWC,o),h.clone(d.upWC,r);let u=t.scaleToGeodeticSurface(i,Sft),m=Ft.eastNorthUpToFixedFrame(u,t,Vft);M.inverseTransformation(m,m),n.mapProjection.project(t.cartesianToCartographic(i,Cft),i),M.multiplyByPointAsVector(m,o,o),M.multiplyByPointAsVector(m,r,r)}}let s;this._morphToOrthographic?(s=Rft,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=Lft,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=W.toRadians(60));let a=Zft;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=ipt(a);nA(this,c),this._previousMode===oe.SCENE2D?npt(this,e,a,c):(a.position2D=M.multiplyByPoint(io.TRANSFORM_2D,i,xft),a.direction2D=M.multiplyByPointAsVector(io.TRANSFORM_2D,o,_ft),a.up2D=M.multiplyByPointAsVector(io.TRANSFORM_2D,r,Tft),n._mode=oe.MORPHING,u_e(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var e8={position:new h,direction:new h,up:new h,frustum:void 0},n_e=new Li;DT.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===oe.SCENE3D||this._previousMode===oe.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,oe.SCENE3D,!0),n._mode=oe.MORPHING,n.camera._setTransform(M.IDENTITY),this._previousMode===oe.SCENE2D)Mft(this,e,t);else{let i;e>0?(i=e8,h.fromDegrees(0,0,5*t.maximumRadius,t,i.position),h.negate(i.position,i.direction),h.normalize(i.direction,i.direction),h.clone(h.UNIT_Z,i.up)):i=i_e(this,t);let o,r=n.camera;r.frustum instanceof an?o=r.frustum.clone():(o=n_e,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=W.toRadians(60)),i.frustum=o;let s=h_e(i);nA(this,s),$j(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};DT.prototype.isDestroyed=function(){return!1};DT.prototype.destroy=function(){return _B(this),me(this)};function nA(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new Qd(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Sn.LEFT_DOWN),e._morphHandler.setInputAction(n,Sn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Sn.RIGHT_DOWN),e._morphHandler.setInputAction(n,Sn.WHEEL)}}function _B(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var Gft=new he,Eft=new h,Ift=new M;function i_e(e,t){let n=e._scene,i=n.camera,o=e8,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,Gft);t.cartographicToCartesian(c,r);let d=t.scaleToGeodeticSurface(r,Eft),u=Ft.eastNorthUpToFixedFrame(d,t,Ift);return M.multiplyByPointAsVector(u,i.direction,s),M.multiplyByPointAsVector(u,i.up,a),o}var Xft=new h,Wft=new h,Pft=new h,vft=new h,wft=new h,Fft=new h;function $j(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(r.position,Xft),a=h.clone(r.direction,Wft),c=h.clone(r.up,Pft),d=M.multiplyByPoint(io.TRANSFORM_2D_INVERSE,n.position,vft),u=M.multiplyByPointAsVector(io.TRANSFORM_2D_INVERSE,n.direction,wft),m=M.multiplyByPointAsVector(io.TRANSFORM_2D_INVERSE,n.up,Fft);function p(f){am(s,d,f.time,r.position),am(a,u,f.time,r.direction),am(c,m,f.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right)}let g=o.tweens.add({duration:t,easingFunction:Yr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){m_e(e,o,0,1,t,i)}});e._currentTweens.push(g)}var Aft=new an,o_e=new h,r_e=new h,s_e=new h,t8=new h,a_e=new h,c_e=new h;function Mft(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=e8,h.fromDegrees(0,0,5*n.maximumRadius,n,r.position),h.negate(r.position,r.direction),h.normalize(r.direction,r.direction),h.clone(h.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=i_e(e,n));let s;e._morphToOrthographic?(s=Aft,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=n_e,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=W.toRadians(60)),r.frustum=s;let a=h_e(r);nA(e,a);let c;e._morphToOrthographic?c=function(){$j(e,t,r,a)}:c=function(){d_e(e,t,r,function(){$j(e,t,r,a)})},t>0?(i._mode=oe.SCENE2D,o.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,t8),complete:function(){i._mode=oe.MORPHING,c()}})):c()}function am(e,t,n,i){return h.lerp(e,t,n,i)}function l_e(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof an)return;let a=s.frustum.fov,c=W.RADIANS_PER_DEGREE*.5,d=n.position.z*Math.tan(a*.5);s.frustum.far=d/Math.tan(c*.5)+1e7;function u(p){s.frustum.fov=W.lerp(a,c,p.time);let g=d/Math.tan(s.frustum.fov*.5);i(s,g)}let m=r.tweens.add({duration:t,easingFunction:Yr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(m)}var Nft=new h,kft=new h,Uft=new h,qj=new h,Dft=new h,Bft=new h,Oft=new Pr,Yft=new pn,Hft=new h,zft={position:void 0,direction:void 0,up:void 0,frustum:void 0};function Kft(e,t){t*=.5;let n=e._scene,i=n.camera,o=h.clone(i.position,Nft),r=h.clone(i.direction,kft),s=h.clone(i.up,Uft),a=h.negate(h.UNIT_Z,Dft),c=h.clone(h.UNIT_Y,Bft),d=qj;if(t>0)h.clone(h.ZERO,qj),d.z=5*n.ellipsoid.maximumRadius;else{h.clone(o,qj);let _=Yft;M.multiplyByPoint(io.TRANSFORM_2D,o,_.origin),M.multiplyByPointAsVector(io.TRANSFORM_2D,r,_.direction);let C=n.globe;if(l(C)){let V=C.pickWorldCoordinates(_,n,!0,Hft);l(V)&&(M.multiplyByPoint(io.TRANSFORM_2D_INVERSE,V,d),d.z+=h.distance(o,d))}}let u=Oft;u.right=d.z*.5,u.left=-u.right,u.top=u.right*(n.drawingBufferHeight/n.drawingBufferWidth),u.bottom=-u.top;let m=zft;m.position=d,m.direction=a,m.up=c,m.frustum=u;let p=f_e(m);nA(e,p);function g(_){am(o,d,_.time,i.position),am(r,a,_.time,i.direction),am(s,c,_.time,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function f(_,C){_.position.z=C}let x=n.tweens.add({duration:t,easingFunction:Yr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){l_e(e,t,m,f,p)}});e._currentTweens.push(x)}var t_e=new he,Jft={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new Pr},Qft={position:new h,direction:new h,up:new h,frustum:void 0},jft=new h,qft=new pn,$ft=new M,ept=new h;function tpt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=Jft;if(t>0)h.clone(h.ZERO,r.position),r.position.z=5*n.maximumRadius,h.negate(h.UNIT_Z,r.direction),h.clone(h.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,t_e),i.mapProjection.project(t_e,r.position),h.negate(h.UNIT_Z,r.direction),h.clone(h.UNIT_Y,r.up);let m=qft;h.clone(r.position2D,m.origin);let p=h.clone(o.directionWC,m.direction),g=n.scaleToGeodeticSurface(o.positionWC,ept),f=Ft.eastNorthUpToFixedFrame(g,n,$ft);M.inverseTransformation(f,f),M.multiplyByPointAsVector(f,p,p),M.multiplyByPointAsVector(io.TRANSFORM_2D,p,p);let x=i.globe;if(l(x)){let _=x.pickWorldCoordinates(m,i,!0,jft);if(l(_)){let C=h.distance(r.position2D,_);_.x+=C,h.clone(_,r.position2D)}}}function s(m,p){m.position.x=p}M.multiplyByPoint(io.TRANSFORM_2D,r.position,r.position2D),M.multiplyByPointAsVector(io.TRANSFORM_2D,r.direction,r.direction2D),M.multiplyByPointAsVector(io.TRANSFORM_2D,r.up,r.up2D);let a=r.frustum;a.right=r.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=Qft;M.multiplyByPoint(io.TRANSFORM_2D_INVERSE,r.position2D,c.position),h.clone(r.direction,c.direction),h.clone(r.up,c.up),c.frustum=a;let d=f_e(c);nA(e,d);function u(){l_e(e,t,r,s,d)}u_e(e,t,r,u)}function d_e(e,t,n,i){let o=e._scene,r=o.camera,s=r.frustum.right-r.frustum.left;r.frustum=n.frustum.clone();let a=r.frustum.fov,c=W.RADIANS_PER_DEGREE*.5,d=s*Math.tan(a*.5);r.frustum.far=d/Math.tan(c*.5)+1e7,r.frustum.fov=c;function u(p){r.frustum.fov=W.lerp(c,a,p.time),r.position.z=d/Math.tan(r.frustum.fov*.5)}let m=o.tweens.add({duration:t,easingFunction:Yr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){i(e)}});e._currentTweens.push(m)}function npt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(n.position,t8),a=h.clone(n.direction,a_e),c=h.clone(n.up,c_e);o._mode=oe.MORPHING;function d(){r.frustum=n.frustum.clone();let u=h.clone(r.position,o_e),m=h.clone(r.direction,r_e),p=h.clone(r.up,s_e);u.z=s.z;function g(x){am(u,s,x.time,r.position),am(m,a,x.time,r.direction),am(p,c,x.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right)}let f=o.tweens.add({duration:t,easingFunction:Yr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(f)}e._morphToOrthographic?d():d_e(e,0,n,d)}function u_e(e,t,n,i){let o=e._scene,r=o.camera,s=h.clone(r.position,o_e),a=h.clone(r.direction,r_e),c=h.clone(r.up,s_e),d=h.clone(n.position2D,t8),u=h.clone(n.direction2D,a_e),m=h.clone(n.up2D,c_e);function p(f){am(s,d,f.time,r.position),am(a,u,f.time,r.direction),am(c,m,f.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let g=o.tweens.add({duration:t,easingFunction:Yr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){m_e(e,o,1,0,t,i)}});e._currentTweens.push(g)}function m_e(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:Yr.QUARTIC_OUT};l(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function h_e(e){return function(t){let n=t._scene;n._mode=oe.SCENE3D,n.morphTime=oe.getMorphTime(oe.SCENE3D),_B(t);let i=n.camera;(t._previousMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone());let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.SCENE3D,r)}}function f_e(e){return function(t){let n=t._scene;n._mode=oe.SCENE2D,n.morphTime=oe.getMorphTime(oe.SCENE2D),_B(t);let i=n.camera;h.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone();let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.SCENE2D,o)}}function ipt(e){return function(t){let n=t._scene;n._mode=oe.COLUMBUS_VIEW,n.morphTime=oe.getMorphTime(oe.COLUMBUS_VIEW),_B(t);let i=n.camera;(t._previousModeMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right));let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.COLUMBUS_VIEW,r)}}var iA=DT;var U5i=T(S(),1);var o5i=T(S(),1);var KNi=T(S(),1),opt={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Pi=Object.freeze(opt);function ta(e,t){let n=`${e}`;return l(t)&&(n+=`+${t}`),n}function rpt(e,t){D.clone(e.distance.startPosition,t.distance.startPosition),D.clone(e.distance.endPosition,t.distance.endPosition),D.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),D.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function p_e(e,t,n){let i=ta(Pi.PINCH,t),o=e._update,r=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;o[i]=!0,r[i]=!1,s[i]=new D;let d=e._movement[i];l(d)||(d=e._movement[i]={}),d.distance={startPosition:new D,endPosition:new D},d.angleAndHeight={startPosition:new D,endPosition:new D},d.prevAngle=0,e._eventHandler.setInputAction(function(u){e._buttonsDown++,r[i]=!0,a[i]=new Date,D.lerp(u.position1,u.position2,.5,s[i])},Sn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},Sn.PINCH_END,t),e._eventHandler.setInputAction(function(u){if(r[i]){o[i]?(rpt(u,d),o[i]=!1,d.prevAngle=d.angleAndHeight.startPosition.x):(D.clone(u.distance.endPosition,d.distance.endPosition),D.clone(u.angleAndHeight.endPosition,d.angleAndHeight.endPosition));let m=d.angleAndHeight.endPosition.x,p=d.prevAngle,g=Math.PI*2;for(;m>=p+Math.PI;)m-=g;for(;m<p-Math.PI;)m+=g;d.angleAndHeight.endPosition.x=-m*n.clientWidth/12,d.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},Sn.PINCH_MOVE,t)}function b_e(e,t){let n=ta(Pi.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let s=e._movement[n];l(s)||(s=e._movement[n]={});let a=e._lastMovement[n];l(a)||(a=e._lastMovement[n]={startPosition:new D,endPosition:new D,valid:!1}),s.startPosition=new D,D.clone(D.ZERO,s.startPosition),s.endPosition=new D,e._eventHandler.setInputAction(function(c){let d=7.5*W.toRadians(c);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=d,D.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},Sn.WHEEL,t)}function eL(e,t,n){let i=ta(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime;o[i]=!1,r[i]=new D;let a=e._lastMovement[i];l(a)||(a=e._lastMovement[i]={startPosition:new D,endPosition:new D,valid:!1});let c,d;n===Pi.LEFT_DRAG?(c=Sn.LEFT_DOWN,d=Sn.LEFT_UP):n===Pi.RIGHT_DRAG?(c=Sn.RIGHT_DOWN,d=Sn.RIGHT_UP):n===Pi.MIDDLE_DRAG&&(c=Sn.MIDDLE_DOWN,d=Sn.MIDDLE_UP),e._eventHandler.setInputAction(function(u){e._buttonsDown++,a.valid=!1,o[i]=!0,s[i]=new Date,D.clone(u.position,r[i])},c,t),e._eventHandler.setInputAction(function(){n8(ta(n,void 0),e);for(let u of Object.values(ea)){let m=ta(n,u);n8(m,e)}},d,t)}function n8(e,t){let n=t._releaseTime,i=t._isDown;i[e]&&(t._buttonsDown=Math.max(t._buttonsDown-1,0)),i[e]=!1,n[e]=new Date}function g_e(e,t){D.clone(e.startPosition,t.startPosition),D.clone(e.endPosition,t.endPosition)}function spt(e,t,n){let i=n._isDown,o=!1,r=ta(e,t);for(let[c,d]of Object.entries(i))c.startsWith(e)&&d&&c!==r&&(o=!0,n8(c,n));if(!o)return;let s=n._pressTime,a=n._lastMovement[r];l(a)||(a=n._lastMovement[r]={startPosition:new D,endPosition:new D,valid:!1}),n._buttonsDown++,a.valid=!1,i[r]=!0,s[r]=new Date}function y_e(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in Pi)if(Pi.hasOwnProperty(s)){let a=Pi[s];if(l(a)){let c=ta(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new D,endPosition:new D,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new D,endPosition:new D})}}e._eventHandler.setInputAction(function(s){for(let a in Pi)if(Pi.hasOwnProperty(a)){let c=Pi[a];if(l(c)){let d=ta(c,t);spt(c,t,e),r[d]&&(n[d]?(g_e(i[d],o[d]),o[d].valid=!0,g_e(s,i[d]),n[d]=!1):D.clone(s.endPosition,i[d].endPosition))}}D.clone(s.endPosition,e._currentMousePosition)},Sn.MOUSE_MOVE,t)}function cm(e){this._eventHandler=new Qd(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new D,b_e(this,void 0),p_e(this,void 0,e),eL(this,void 0,Pi.LEFT_DRAG),eL(this,void 0,Pi.RIGHT_DRAG),eL(this,void 0,Pi.MIDDLE_DRAG),y_e(this,void 0);for(let t in ea)if(ea.hasOwnProperty(t)){let n=ea[t];l(n)&&(b_e(this,n),p_e(this,n,e),eL(this,n,Pi.LEFT_DRAG),eL(this,n,Pi.RIGHT_DRAG),eL(this,n,Pi.MIDDLE_DRAG),y_e(this,n))}}Object.defineProperties(cm.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[ta(Pi.WHEEL)]||!this._update[ta(Pi.WHEEL,ea.SHIFT)]||!this._update[ta(Pi.WHEEL,ea.CTRL)]||!this._update[ta(Pi.WHEEL,ea.ALT)];return this._buttonsDown>0||e}}});cm.prototype.isMoving=function(e,t){let n=ta(e,t);return!this._update[n]};cm.prototype.getMovement=function(e,t){let n=ta(e,t);return this._movement[n]};cm.prototype.getLastMovement=function(e,t){let n=ta(e,t),i=this._lastMovement[n];if(i.valid)return i};cm.prototype.isButtonDown=function(e,t){let n=ta(e,t);return this._isDown[n]};cm.prototype.getStartMousePosition=function(e,t){if(e===Pi.WHEEL)return this._currentMousePosition;let n=ta(e,t);return this._eventStartPosition[n]};cm.prototype.getButtonPressTime=function(e,t){let n=ta(e,t);return this._pressTime[n]};cm.prototype.getButtonReleaseTime=function(e,t){let n=ta(e,t);return this._releaseTime[n]};cm.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};cm.prototype.isDestroyed=function(){return!1};cm.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),me(this)};var oA=cm;var h5i=T(S(),1);function TB(e,t,n,i,o,r,s,a,c,d){this._tweens=e,this._tweenjs=t,this._startObject=Ye(n),this._stopObject=Ye(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=d,this.needsStart=!0}Object.defineProperties(TB.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});TB.prototype.cancelTween=function(){this._tweens.remove(this)};function Eh(){this._tweens=[]}Object.defineProperties(Eh.prototype,{length:{get:function(){return this._tweens.length}}});Eh.prototype.add=function(e){if(e=y(e,y.EMPTY_OBJECT),e.duration===0)return l(e.complete)&&e.complete(),new TB(this);let t=e.duration/zn.SECONDS_PER_MILLISECOND,n=y(e.delay,0),i=n/zn.SECONDS_PER_MILLISECOND,o=y(e.easingFunction,Yr.LINEAR_NONE),r=e.startObject,s=new s0e(r);s.to(Ye(e.stopObject),t),s.delay(i),s.easing(o),l(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(y(e.complete,null)),s.repeat(y(e._repeat,0));let a=new TB(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Eh.prototype.addProperty=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;function r(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:o},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};Eh.prototype.addAlpha=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.material,n=[];for(let o in t.uniforms)t.uniforms.hasOwnProperty(o)&&l(t.uniforms[o])&&l(t.uniforms[o].alpha)&&n.push(o);function i(o){let r=n.length;for(let s=0;s<r;++s)t.uniforms[n[s]].alpha=o.alpha}return this.add({startObject:{alpha:y(e.startValue,0)},stopObject:{alpha:y(e.stopValue,1)},duration:y(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};Eh.prototype.addOffsetIncrement=function(e){e=y(e,y.EMPTY_OBJECT);let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};Eh.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};Eh.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};Eh.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Eh.prototype.get=function(e){return this._tweens[e]};Eh.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/zn.SECONDS_PER_MILLISECOND:_i();n<t.length;){let i=t[n],o=i.tweenjs;i.needsStart?(i.needsStart=!1,o.start(e)):o.update(e)?n++:(o.stop(),t.splice(n,1))}};var BT=Eh;function sA(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.zoomFactor=5,this.translateEventTypes=Pi.LEFT_DRAG,this.zoomEventTypes=[Pi.RIGHT_DRAG,Pi.WHEEL,Pi.PINCH],this.rotateEventTypes=Pi.LEFT_DRAG,this.tiltEventTypes=[Pi.MIDDLE_DRAG,Pi.PINCH,{eventType:Pi.LEFT_DRAG,modifier:ea.CTRL},{eventType:Pi.RIGHT_DRAG,modifier:ea.CTRL}],this.lookEventTypes={eventType:Pi.LEFT_DRAG,modifier:ea.SHIFT};let t=y(e.ellipsoid,ne.default);this.minimumPickingTerrainHeight=ne.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ne.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ne.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ne.WGS84.equals(t)?75e5:t.minimumRadius*1.175,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this.maximumTiltAngle=void 0,this._scene=e,this._globe=void 0,this._ellipsoid=t,this._lastGlobeHeight=0,this._aggregator=new oA(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new BT,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new D(-1,-1),this._tiltCenter=new h,this._rotateMousePosition=new D(-1,-1),this._rotateStartPosition=new h,this._strafeStartPosition=new h,this._strafeMousePosition=new D,this._strafeEndMousePosition=new D,this._zoomMouseStart=new D(-1,-1),this._zoomWorldPosition=new h,this._useZoomWorldPosition=!1,this._panLastMousePosition=new D,this._panLastWorldPosition=new h,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let n=e.mapProjection;this._maxCoord=n.project(new he(Math.PI,W.PI_OVER_TWO)),this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function apt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function cpt(e){return D.equalsEpsilon(e.startPosition,e.endPosition,W.EPSILON14)}var lpt=.4;function dpt(e,t,n,i,o,r,s){let a=r[s];l(a)||(a=r[s]={startPosition:new D,endPosition:new D,motion:new D,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),d=e.getButtonReleaseTime(t,n),u=c&&d&&(d.getTime()-c.getTime())/1e3,p=d&&(new Date().getTime()-d.getTime())/1e3;if(c&&d&&u<lpt){let g=apt(p,i),f=e.getLastMovement(t,n);if(!l(f)||cpt(f)||!a.inertiaEnabled||(a.motion.x=(f.endPosition.x-f.startPosition.x)*.5,a.motion.y=(f.endPosition.y-f.startPosition.y)*.5,a.startPosition=D.clone(f.startPosition,a.startPosition),a.endPosition=D.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=D.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||D.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let x=e.getStartMousePosition(t,n);o(r,x,a)}}}function upt(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let o=i.length;for(let r=0;r<o;++r)n=e[i[r]],l(n)&&(n.inertiaEnabled=!1)}}}var x_e=[];function dl(e,t,n,i,o,r){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(x_e[0]=n,n=x_e);let a=n.length;for(let c=0;c<a;++c){let d=n[c],u=l(d.eventType)?d.eventType:d,m=d.modifier,p=s.isMoving(u,m)&&s.getMovement(u,m),g=s.getStartMousePosition(u,m);e.enableInputs&&t&&(p?(i(e,g,p),upt(e,r)):o<1&&dpt(s,u,m,o,i,e,r))}}var SB=new pn,mpt=new h,hpt=new D,fpt=new h,ppt=new D,bpt=new h,gpt=new h,ypt=new h,xpt=new h,X_e=new h,_pt=new h,Tpt=new h,Spt=new h,Cpt=new h,Vpt=new h,Lpt=new h,Rpt=new h,Zpt=new h,Gpt=new h,Ept=new h,OT=new h,__e=new h,T_e=new h,i8={orientation:new Ca};function u8(e,t,n,i,o,r){let s=1;l(r)&&(s=W.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,d=a>0?e.minimumZoomDistance*s:0,u=e.maximumZoomDistance,m=o-d,p=i*m;p=W.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let f=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(f>0&&Math.abs(o-d)<1||f<0&&Math.abs(o-u)<1)return;o-f<d?f=o-d-1:o-f>u&&(f=o-u)}let x=e._scene,_=x.camera,C=x.mode,V=i8.orientation;if(V.heading=_.heading,V.pitch=_.pitch,V.roll=_.roll,_.frustum instanceof an){Math.abs(f)>0&&(_.zoomIn(f),_._adjustOrthographicFrustum(!0));return}let L=y(n.inertiaEnabled,D.equals(t,e._zoomMouseStart)),Z=e._zoomingOnVector,G=e._rotatingZoom,I;if(L||(e._zoomMouseStart=D.clone(t,e._zoomMouseStart),l(e._globe)&&C===oe.SCENE2D?(I=_.getPickRay(t,SB).origin,I=h.fromElements(I.y,I.z,I.x)):l(e._globe)&&(I=u0(e,t,mpt)),l(I)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=h.clone(I,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,Z=e._zoomingOnVector=!1,G=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){_.zoomIn(f);return}let v=C===oe.COLUMBUS_VIEW;if(_.positionCartographic.height<2e6&&(G=!0),!L||G){if(C===oe.SCENE2D){let P=e._zoomWorldPosition,w=_.position;if(!h.equals(P,w)&&_.positionCartographic.height<e._maxCoord.x*2){let F=_.position.x,b=h.subtract(P,w,fpt);h.normalize(b,b);let R=h.distance(P,w)*f/(_.getMagnitude()*.5);_.move(b,R*.5),(_.position.x<0&&F>0||_.position.x>0&&F<0)&&(I=_.getPickRay(t,SB).origin,I=h.fromElements(I.y,I.z,I.x),e._zoomWorldPosition=h.clone(I,e._zoomWorldPosition))}}else if(C===oe.SCENE3D){let P=h.normalize(_.position,X_e);if(e._cameraUnderground||e._zoomingUnderground||_.positionCartographic.height<3e3&&Math.abs(h.dot(_.direction,P))<.6)v=!0;else{let w=x.canvas,F=ppt;F.x=w.clientWidth/2,F.y=w.clientHeight/2;let b=u0(e,F,bpt);if(!l(b))v=!0;else if(_.positionCartographic.height<1e6)if(h.dot(_.direction,P)>=-.5)v=!0;else{let R=Tpt;h.clone(_.position,R);let E=e._zoomWorldPosition,X=_pt;if(X=h.normalize(E,X),h.dot(X,P)<0)return;let A=Ept,N=Vpt;h.clone(_.direction,N),h.add(R,h.multiplyByScalar(N,1e3,OT),A);let O=Lpt,U=Rpt;h.subtract(E,R,O),h.normalize(O,U);let Y=h.dot(P,U);if(Y>=0){e._zoomMouseStart.x=-1;return}let k=Math.acos(-Y),H=h.magnitude(R),J=h.magnitude(E),te=H-f,z=h.magnitude(O),q=Math.asin(W.clamp(z/J*Math.sin(k),-1,1)),ee=Math.asin(W.clamp(te/J*Math.sin(k),-1,1)),fe=q-ee+k,_e=Spt;h.normalize(R,_e);let le=Cpt;le=h.cross(U,_e,le),le=h.normalize(le,le),h.normalize(h.cross(_e,le,OT),N),h.multiplyByScalar(h.normalize(A,OT),h.magnitude(A)-f,A),h.normalize(R,R),h.multiplyByScalar(R,te,R);let ye=Zpt;h.multiplyByScalar(h.add(h.multiplyByScalar(_e,Math.cos(fe)-1,__e),h.multiplyByScalar(N,Math.sin(fe),T_e),OT),te,ye),h.add(R,ye,R),h.normalize(A,_e),h.normalize(h.cross(_e,le,OT),N);let Te=Gpt;h.multiplyByScalar(h.add(h.multiplyByScalar(_e,Math.cos(fe)-1,__e),h.multiplyByScalar(N,Math.sin(fe),T_e),OT),h.magnitude(A),Te),h.add(A,Te,A),h.clone(R,_.position),h.normalize(h.subtract(A,R,OT),_.direction),h.clone(_.direction,_.direction),h.cross(_.direction,_.up,_.right),h.cross(_.right,_.direction,_.up),_.setView(i8);return}else{let R=h.normalize(b,gpt),E=h.normalize(e._zoomWorldPosition,ypt),X=h.dot(E,R);if(X>0&&X<1){let A=W.acosClamped(X),N=h.cross(E,R,xpt),O=Math.abs(A)>W.toRadians(20)?_.positionCartographic.height*.75:_.positionCartographic.height-f,U=f/O;_.rotate(N,A*U)}}}}e._rotatingZoom=!v}if(!L&&v||Z){let P,w=Mi.worldToWindowCoordinates(x,e._zoomWorldPosition,hpt);C!==oe.COLUMBUS_VIEW&&D.equals(t,e._zoomMouseStart)&&l(w)?P=_.getPickRay(w,SB):P=_.getPickRay(t,SB);let F=P.direction;(C===oe.COLUMBUS_VIEW||C===oe.SCENE2D)&&h.fromElements(F.y,F.z,F.x,F),_.move(F,f),e._zoomingOnVector=!0}else _.zoomIn(f);e._cameraUnderground||_.setView(i8)}var Ipt=new pn,Xpt=new pn,Wpt=new h;function Ppt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,Ipt).origin,s=o.getPickRay(n.endPosition,Xpt).origin;r=h.fromElements(r.y,r.z,r.x,r),s=h.fromElements(s.y,s.z,s.x,s);let a=h.subtract(r,s,Wpt),c=h.magnitude(a);c>0&&(h.normalize(a,a),o.move(a,c))}function S_e(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;u8(e,t,n,e.zoomFactor,o.getMagnitude())}var vpt=new D,wpt=new D;function C_e(e,t,n){if(l(n.angleAndHeight)){Fpt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=vpt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=D.normalize(c,c);let d=wpt;d.x=2/s*n.endPosition.x-1,d.y=2/a*(a-n.endPosition.y)-1,d=D.normalize(d,d);let u=W.acosClamped(c.x);c.y<0&&(u=W.TWO_PI-u);let m=W.acosClamped(d.x);d.y<0&&(m=W.TWO_PI-m);let p=m-u;o.twistRight(p)}function Fpt(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let o=e._scene,r=o.camera,s=o.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;r.twistRight(c)}function Apt(e){let t=e._scene.mapMode2D===Ql.ROTATE;M.equals(M.IDENTITY,e._scene.camera.transform)?(dl(e,e.enableTranslate,e.translateEventTypes,Ppt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),dl(e,e.enableZoom,e.zoomEventTypes,S_e,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&dl(e,e.enableRotate,e.tiltEventTypes,C_e,e.inertiaSpin,"_lastInertiaTiltMovement")):(dl(e,e.enableZoom,e.zoomEventTypes,S_e,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&dl(e,e.enableRotate,e.translateEventTypes,C_e,e.inertiaSpin,"_lastInertiaSpinMovement"))}var W_e=new pn,Mpt=new h,Npt=new h;function u0(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,Mpt)),!l(o))return h.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,W_e),d=o.pickWorldCoordinates(c,i,a,Npt),u=l(s)?h.distance(s,r.positionWC):Number.POSITIVE_INFINITY,m=l(d)?h.distance(d,r.positionWC):Number.POSITIVE_INFINITY;return u<m?h.clone(s,n):h.clone(d,n)}var kpt=new he;function EB(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===oe.SCENE3D){let c=t.cartesianToCartographic(i.position,kpt);l(c)&&(r=c.height)}else r=i.position.z;let s=y(e._scene.globeHeight,0);return Math.abs(s-r)}var Upt=new h;function P_e(e,t){let n=t.origin,i=t.direction,o=EB(e),r=h.normalize(n,Upt),s=Math.abs(h.dot(r,i));return s=Math.max(s,.5)*2,o*s}function v_e(e,t,n,i){let o=h.distance(t.origin,n),r=EB(e),s=W.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),pn.getPoint(t,o,i)}function w_e(e,t,n,i){let o;return l(n)?(o=h.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=EB(e))):o=EB(e),pn.getPoint(t,o,i)}var Dpt=new D;function F_e(e,t){let n=t.endPosition,i=D.subtract(t.endPosition,t.startPosition,Dpt),o=e._strafeEndMousePosition;D.add(o,i,o),t.endPosition=o,m8(e,t,e._strafeStartPosition),t.endPosition=n}var V_e=new pn,Bpt=new pn,o8=new h,Opt=new h,Ypt=new h,Hpt=new h,zpt=new ln(h.UNIT_X,0),Kpt=new D,Jpt=new D;function Qpt(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){qd(e,t,n);return}if(e._strafing){F_e(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=D.clone(n.startPosition,Kpt),a=D.clone(n.endPosition,Jpt),c=o.getPickRay(s,V_e),d=h.clone(h.ZERO,Hpt),u=h.UNIT_X,m;if(o.position.z<e._minimumPickingTerrainHeight&&(m=u0(e,s,o8),l(m)&&(d.x=m.x)),r||d.x>o.position.z&&l(m)){let L=m;r&&(L=w_e(e,c,m,o8)),D.clone(t,e._strafeMousePosition),D.clone(t,e._strafeEndMousePosition),h.clone(L,e._strafeStartPosition),e._strafing=!0,m8(e,n,e._strafeStartPosition);return}let p=ln.fromPointNormal(d,u,zpt);c=o.getPickRay(s,V_e);let g=qn.rayPlane(c,p,o8),f=o.getPickRay(a,Bpt),x=qn.rayPlane(f,p,Opt);if(!l(g)||!l(x)){e._looking=!0,qd(e,t,n),D.clone(t,e._translateMousePosition);return}let _=h.subtract(g,x,Ypt),C=_.x;_.x=_.y,_.y=_.z,_.z=C;let V=h.magnitude(_);V>W.EPSILON6&&(h.normalize(_,_),o.move(_,V))}var A_e=new D,LB=new pn,RB=new h,jpt=new h,M_e=new M,qpt=new M,$pt=new h,ebt=new ln(h.UNIT_X,0),r8=new h,c8=new he,N_e=new M,tbt=new we,nbt=new $,ZB=new h;function ibt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),D.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){qd(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,obt(e,t,n)):rbt(e,t,n)}function obt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=A_e;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,LB),c=h.UNIT_X,d=a.origin,u=a.direction,m,p=h.dot(c,u);if(Math.abs(p)>W.EPSILON6&&(m=-h.dot(c,d)/p),!l(m)||m<=0){e._looking=!0,qd(e,t,n),D.clone(t,e._tiltCenterMousePosition);return}let g=h.multiplyByScalar(u,m,RB);h.add(d,g,g);let f=i.mapProjection,x=f.ellipsoid;h.fromElements(g.y,g.z,g.x,g);let _=f.unproject(g,c8);x.cartographicToCartesian(_,g);let C=Ft.eastNorthUpToFixedFrame(g,x,M_e),V=e._globe,L=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let Z=M.clone(o.transform,N_e);o._setTransform(C),jd(e,t,n,h.UNIT_Z),o._setTransform(Z),e._globe=V,e._ellipsoid=L;let G=L.maximumRadius;e._rotateFactor=1/G,e._rotateRateRangeAdjustment=G}function rbt(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,c=h.UNIT_X;if(D.equals(t,e._tiltCenterMousePosition))s=h.clone(e._tiltCenter,RB);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=u0(e,t,RB)),!l(s)){a=o.getPickRay(t,LB);let b=a.origin,R=a.direction,E,X=h.dot(c,R);if(Math.abs(X)>W.EPSILON6&&(E=-h.dot(c,b)/X),!l(E)||E<=0){e._looking=!0,qd(e,t,n),D.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(R,E,RB),h.add(b,s,s)}r&&(l(a)||(a=o.getPickRay(t,LB)),v_e(e,a,s,s)),D.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let d=i.canvas,u=A_e;u.x=d.clientWidth/2,u.y=e._tiltCenterMousePosition.y,a=o.getPickRay(u,LB);let m=h.clone(h.ZERO,$pt);m.x=s.x;let p=ln.fromPointNormal(m,c,ebt),g=qn.rayPlane(a,p,jpt),f=o._projection,x=f.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let _=f.unproject(s,c8);x.cartographicToCartesian(_,s);let C=Ft.eastNorthUpToFixedFrame(s,x,M_e),V;l(g)?(h.fromElements(g.y,g.z,g.x,g),_=f.unproject(g,c8),x.cartographicToCartesian(_,g),V=Ft.eastNorthUpToFixedFrame(g,x,qpt)):V=C;let L=e._globe,Z=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let G=h.UNIT_Z,I=M.clone(o.transform,N_e);o._setTransform(C);let v=h.cross(h.UNIT_Z,h.normalize(o.position,r8),r8),P=h.dot(o.right,v);if(jd(e,t,n,G,!1,!0),o._setTransform(V),P<0){let b=n.startPosition.y-n.endPosition.y;(r&&b<0||!r&&b>0)&&(G=void 0);let R=o.constrainedAxis;o.constrainedAxis=void 0,jd(e,t,n,G,!0,!1),o.constrainedAxis=R}else jd(e,t,n,G,!0,!1);if(l(o.constrainedAxis)){let b=h.cross(o.direction,o.constrainedAxis,ZB);h.equalsEpsilon(b,h.ZERO,W.EPSILON6)||(h.dot(b,o.right)<0&&h.negate(b,b),h.cross(b,o.direction,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.up,o.up),h.normalize(o.right,o.right))}o._setTransform(I),e._globe=L,e._ellipsoid=Z;let w=Z.maximumRadius;e._rotateFactor=1/w,e._rotateRateRangeAdjustment=w;let F=h.clone(o.positionWC,r8);if(e.enableCollisionDetection&&p8(e,!0),!h.equals(o.positionWC,F)){o._setTransform(V),o.worldToCameraCoordinatesPoint(F,F);let b=h.magnitudeSquared(F);h.magnitudeSquared(o.position)>b&&(h.normalize(o.position,o.position),h.multiplyByScalar(o.position,Math.sqrt(b),o.position));let R=h.angleBetween(F,o.position),E=h.cross(F,o.position,F);h.normalize(E,E);let X=we.fromAxisAngle(E,R,tbt),A=$.fromQuaternion(X,nbt);$.multiplyByVector(A,o.direction,o.direction),$.multiplyByVector(A,o.up,o.up),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up),o._setTransform(I)}}var k_e=new D,U_e=new pn,D_e=new h;function sbt(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=k_e,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,U_e),d=c.origin,u=c.direction,m=o.position.z,p;m<e._minimumPickingTerrainHeight&&(p=u0(e,a,D_e));let g;if(l(p)&&(g=h.distance(d,p)),s){let f=P_e(e,c,m);l(g)?g=Math.min(g,f):g=f}if(!l(g)){let f=h.UNIT_X;g=-h.dot(f,d)/h.dot(f,u)}u8(e,t,n,e.zoomFactor,g)}function abt(e){let n=e._scene.camera;if(!M.equals(M.IDENTITY,n.transform))dl(e,e.enableRotate,e.rotateEventTypes,jd,e.inertiaSpin,"_lastInertiaSpinMovement"),dl(e,e.enableZoom,e.zoomEventTypes,O_e,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),dl(e,e.enableTilt,e.tiltEventTypes,ibt,e.inertiaSpin,"_lastInertiaTiltMovement"),dl(e,e.enableTranslate,e.translateEventTypes,Qpt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),dl(e,e.enableZoom,e.zoomEventTypes,sbt,e.inertiaZoom,"_lastInertiaZoomMovement"),dl(e,e.enableLook,e.lookEventTypes,qd),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var cbt=new pn,lbt=new ln(h.UNIT_X,0),dbt=new h,ubt=new h;function m8(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,cbt),s=h.clone(o.direction,ubt);i.mode===oe.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=ln.fromPointNormal(n,s,lbt),c=qn.rayPlane(r,a,dbt);l(c)&&(s=h.subtract(n,c,s),i.mode===oe.COLUMBUS_VIEW&&h.fromElements(s.y,s.z,s.x,s),h.add(o.position,s,o.position))}var L_e=new h,B_e=new he,l8=new h,d8=new ne,mbt=new h,hbt=new h,fbt=new h;function pbt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!M.equals(o.transform,M.IDENTITY)){jd(e,t,n);return}let a,c,d=s.geodeticSurfaceNormal(o.position,mbt);if(D.equals(t,e._rotateMousePosition)){if(e._looking)qd(e,t,n,d);else if(e._rotating)jd(e,t,n);else if(e._strafing)F_e(e,n);else{if(h.magnitude(o.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=l8,c.x=c.y=c.z=a,s=ne.fromCartesian3(c,d8),a8(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let u=s.cartesianToCartographic(o.positionWC,B_e).height,m=e._globe;if(l(m)&&u<e._minimumPickingTerrainHeight){let p=u0(e,n.startPosition,fbt);if(l(p)){let g=!1,f=o.getPickRay(n.startPosition,W_e);if(r)g=!0,w_e(e,f,p,p);else{let x=s.geodeticSurfaceNormal(p,hbt);Math.abs(h.dot(f.direction,x))<.05?g=!0:g=h.magnitude(o.position)<h.magnitude(p)}g?(D.clone(t,e._strafeEndMousePosition),h.clone(p,e._strafeStartPosition),e._strafing=!0,m8(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=l8,c.x=c.y=c.z=a,s=ne.fromCartesian3(c,d8),a8(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,qd(e,t,n,d)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,L_e))?(a8(e,t,n,e._ellipsoid),h.clone(L_e,e._rotateStartPosition)):u>e._minimumTrackBallHeight?(e._rotating=!0,jd(e,t,n)):(e._looking=!0,qd(e,t,n,d));D.clone(t,e._rotateMousePosition)}function jd(e,t,n,i,o,r){o=y(o,!1),r=y(r,!1);let s=e._scene,a=s.camera,c=s.canvas,d=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let u=h.magnitude(a.position),m=e._rotateFactor*(u-e._rotateRateRangeAdjustment);m>e._maximumRotateRate&&(m=e._maximumRotateRate),m<e._minimumRotateRate&&(m=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,g=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let f=m*p*Math.PI*2,x=m*g*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let _=e.maximumTiltAngle,C=h.dot(a.direction,i),V=Math.PI-Math.acos(C)+x;V>_&&(x-=V-_)}o||a.rotateRight(f),r||a.rotateUp(x),a.constrainedAxis=d}var s8=se.clone(se.UNIT_W),R_e=se.clone(se.UNIT_W),CB=new h,tL=new h,VB=new h,Z_e=new h,bbt=new D,gbt=new D,ybt=new D,xbt=new D,_bt=new pn;function a8(e,t,n,i){let o=e._scene,r=o.camera,s=D.clone(n.startPosition,bbt),a=D.clone(n.endPosition,gbt),c=i.cartesianToCartographic(r.positionWC,B_e).height,d,u;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(d=h.clone(e._panLastWorldPosition,s8),!l(e._globe)&&!D.equalsEpsilon(s,e._panLastMousePosition)&&(d=u0(e,s,s8)),!l(e._globe)&&l(d))){let m=h.subtract(d,r.positionWC,tL),p=h.multiplyByScalar(r.directionWC,h.dot(r.directionWC,m),tL),g=h.magnitude(p),f=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,g,o.pixelRatio,xbt),x=D.subtract(a,s,ybt),_=h.multiplyByScalar(r.rightWC,x.x*f.x,tL),C=h.normalize(r.positionWC,X_e),V=r.getPickRay(a,_bt).direction,L=h.subtract(V,h.projectVector(V,r.rightWC,VB),VB),Z=h.angleBetween(L,r.directionWC),G=1;l(r.frustum.fov)&&(G=Math.max(Math.tan(Z),.1));let I=Math.abs(h.dot(r.directionWC,C)),v=-x.y*f.y*2/Math.sqrt(G)*(1-I),P=h.multiplyByScalar(V,v,VB);I=Math.abs(h.dot(r.upWC,C));let w=h.multiplyByScalar(r.upWC,-x.y*(1-I)*f.y,Z_e);u=h.add(d,_,R_e),u=h.add(u,P,u),u=h.add(u,w,u),h.clone(u,e._panLastWorldPosition),D.clone(a,e._panLastMousePosition)}if((!l(d)||!l(u))&&(d=r.pickEllipsoid(s,i,s8),u=r.pickEllipsoid(a,i,R_e)),!l(d)||!l(u)){e._rotating=!0,jd(e,t,n);return}if(d=r.worldToCameraCoordinates(d,d),u=r.worldToCameraCoordinates(u,u),l(r.constrainedAxis)){let m=r.constrainedAxis,p=h.mostOrthogonalAxis(m,CB);h.cross(p,m,p),h.normalize(p,p);let g=h.cross(m,p,tL),f=h.magnitude(d),x=h.dot(m,d),_=Math.acos(x/f),C=h.multiplyByScalar(m,x,VB);h.subtract(d,C,C),h.normalize(C,C);let V=h.magnitude(u),L=h.dot(m,u),Z=Math.acos(L/V),G=h.multiplyByScalar(m,L,Z_e);h.subtract(u,G,G),h.normalize(G,G);let I=Math.acos(h.dot(C,p));h.dot(C,g)<0&&(I=W.TWO_PI-I);let v=Math.acos(h.dot(G,p));h.dot(G,g)<0&&(v=W.TWO_PI-v);let P=I-v,w;h.equalsEpsilon(m,r.position,W.EPSILON2)?w=r.right:w=h.cross(m,r.position,CB);let F=h.cross(m,w,CB),b=h.dot(F,h.subtract(d,m,tL)),R=h.dot(F,h.subtract(u,m,tL)),E;b>0&&R>0?E=Z-_:b>0&&R<=0?h.dot(r.position,m)>0?E=-_-Z:E=_+Z:E=_-Z,r.rotateRight(P),r.rotateUp(E)}else{h.normalize(d,d),h.normalize(u,u);let m=h.dot(d,u),p=h.cross(d,u,CB);if(m<1&&!h.equalsEpsilon(p,h.ZERO,W.EPSILON14)){let g=Math.acos(m);r.rotate(p,g)}}}var Tbt=new h,Sbt=new he,G_e=0;function O_e(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,c=e._cameraUnderground,d;c?d=t:(d=k_e,d.x=a.clientWidth/2,d.y=a.clientHeight/2);let u=s.getPickRay(d,U_e),m,p=o.cartesianToCartographic(s.position,Sbt).height,g=Math.abs(G_e)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(m=u0(e,d,D_e));let x;if(l(m)&&(x=h.distance(u.origin,m),G_e=x),c){let C=P_e(e,u,p);l(x)?x=Math.min(x,C):x=C}l(x)||(x=p);let _=h.normalize(s.position,Tbt);u8(e,t,n,e.zoomFactor,x,h.dot(_,s.direction))}var Y_e=new D,GB=new pn,rA=new h,Cbt=new h,H_e=new M,Vbt=new M,z_e=new M,Lbt=new we,Rbt=new $,h8=new he,f8=new h;function Zbt(e,t,n){let o=e._scene.camera;if(!M.equals(o.transform,M.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),D.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,f8);qd(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,h8);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,Ebt(e,t,n)):Ibt(e,t,n)}var Gbt=new he;function Ebt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,Gbt).height;if(a-s-1<W.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,d=Y_e;d.x=c.clientWidth/2,d.y=c.clientHeight/2;let u=r.getPickRay(d,GB),m,p=qn.rayEllipsoid(u,i);if(l(p))m=pn.getPoint(u,p.start,rA);else if(a>e._minimumTrackBallHeight){let V=qn.grazingAltitudeLocation(u,i);if(!l(V))return;let L=i.cartesianToCartographic(V,h8);L.height=0,m=i.cartographicToCartesian(L,rA)}else{e._looking=!0;let V=e._ellipsoid.geodeticSurfaceNormal(r.position,f8);qd(e,t,n,V),D.clone(t,e._tiltCenterMousePosition);return}let g=Ft.eastNorthUpToFixedFrame(m,i,H_e),f=e._globe,x=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let _=M.clone(r.transform,z_e);r._setTransform(g),jd(e,t,n,h.UNIT_Z),r._setTransform(_),e._globe=f,e._ellipsoid=x;let C=x.maximumRadius;e._rotateFactor=1/C,e._rotateRateRangeAdjustment=C}function Ibt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,c,d;if(D.equals(t,e._tiltCenterMousePosition))a=h.clone(e._tiltCenter,rA);else{if(a=u0(e,t,rA),!l(a)){if(c=r.getPickRay(t,GB),d=qn.rayEllipsoid(c,i),!l(d)){if(i.cartesianToCartographic(r.position,h8).height<=e._minimumTrackBallHeight){e._looking=!0;let R=e._ellipsoid.geodeticSurfaceNormal(r.position,f8);qd(e,t,n,R),D.clone(t,e._tiltCenterMousePosition)}return}a=pn.getPoint(c,d.start,rA)}s&&(l(c)||(c=r.getPickRay(t,GB)),v_e(e,c,a,a)),D.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let u=o.canvas,m=Y_e;m.x=u.clientWidth/2,m.y=e._tiltCenterMousePosition.y,c=r.getPickRay(m,GB);let p=h.magnitude(a),g=h.fromElements(p,p,p,l8),f=ne.fromCartesian3(g,d8);if(d=qn.rayEllipsoid(c,f),!l(d))return;let x=h.magnitude(c.origin)>p?d.start:d.stop,_=pn.getPoint(c,x,Cbt),C=Ft.eastNorthUpToFixedFrame(a,i,H_e),V=Ft.eastNorthUpToFixedFrame(_,f,Vbt),L=e._globe,Z=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let G=h.UNIT_Z,I=M.clone(r.transform,z_e);r._setTransform(V);let v=h.cross(_,r.positionWC,ZB);if(h.dot(r.rightWC,v)<0){let b=n.startPosition.y-n.endPosition.y;(s&&b<0||!s&&b>0)&&(G=void 0);let R=r.constrainedAxis;r.constrainedAxis=void 0,jd(e,t,n,G,!0,!1),r.constrainedAxis=R}else jd(e,t,n,G,!0,!1);if(r._setTransform(C),jd(e,t,n,G,!1,!0),l(r.constrainedAxis)){let b=h.cross(r.direction,r.constrainedAxis,ZB);h.equalsEpsilon(b,h.ZERO,W.EPSILON6)||(h.dot(b,r.right)<0&&h.negate(b,b),h.cross(b,r.direction,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.up,r.up),h.normalize(r.right,r.right))}r._setTransform(I),e._globe=L,e._ellipsoid=Z;let w=Z.maximumRadius;e._rotateFactor=1/w,e._rotateRateRangeAdjustment=w;let F=h.clone(r.positionWC,ZB);if(e.enableCollisionDetection&&p8(e,!0),!h.equals(r.positionWC,F)){r._setTransform(V),r.worldToCameraCoordinatesPoint(F,F);let b=h.magnitudeSquared(F);h.magnitudeSquared(r.position)>b&&(h.normalize(r.position,r.position),h.multiplyByScalar(r.position,Math.sqrt(b),r.position));let R=h.angleBetween(F,r.position),E=h.cross(F,r.position,F);h.normalize(E,E);let X=we.fromAxisAngle(E,R,Lbt),A=$.fromQuaternion(X,Rbt);$.multiplyByVector(A,r.direction,r.direction),$.multiplyByVector(A,r.up,r.up),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up),r._setTransform(I)}}var Xbt=new D,Wbt=new D,E_e=new pn,I_e=new pn,Pbt=new h,vbt=new h;function qd(e,t,n,i){let r=e._scene.camera,s=Xbt;s.x=n.startPosition.x,s.y=0;let a=Wbt;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,E_e),d=r.getPickRay(a,I_e),u=0,m,p;r.frustum instanceof an?(m=c.origin,p=d.origin,h.add(r.direction,m,m),h.add(r.direction,p,p),h.subtract(m,r.position,m),h.subtract(p,r.position,p),h.normalize(m,m),h.normalize(p,p)):(m=c.direction,p=d.direction);let g=h.dot(m,p);g<1&&(u=Math.acos(g)),u=n.startPosition.x>n.endPosition.x?-u:u;let f=e._horizontalRotationAxis;if(l(i)?r.look(i,-u):l(f)?r.look(f,-u):r.lookLeft(u),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=r.getPickRay(s,E_e),d=r.getPickRay(a,I_e),u=0,r.frustum instanceof an?(m=c.origin,p=d.origin,h.add(r.direction,m,m),h.add(r.direction,p,p),h.subtract(m,r.position,m),h.subtract(p,r.position,p),h.normalize(m,m),h.normalize(p,p)):(m=c.direction,p=d.direction),g=h.dot(m,p),g<1&&(u=Math.acos(g)),u=n.startPosition.y>n.endPosition.y?-u:u,i=y(i,f),l(i)){let x=r.direction,_=h.negate(i,Pbt),C=h.equalsEpsilon(x,i,W.EPSILON2),V=h.equalsEpsilon(x,_,W.EPSILON2);if(!C&&!V){g=h.dot(x,i);let L=W.acosClamped(g);u>0&&u>L&&(u=L-W.EPSILON4),g=h.dot(x,_),L=W.acosClamped(g),u<0&&-u>L&&(u=-L+W.EPSILON4);let Z=h.cross(i,x,vbt);r.look(Z,u)}else(C&&u<0||V&&u>0)&&r.look(r.right,-u)}else r.lookUp(u)}function wbt(e){dl(e,e.enableRotate,e.rotateEventTypes,pbt,e.inertiaSpin,"_lastInertiaSpinMovement"),dl(e,e.enableZoom,e.zoomEventTypes,O_e,e.inertiaZoom,"_lastInertiaZoomMovement"),dl(e,e.enableTilt,e.tiltEventTypes,Zbt,e.inertiaSpin,"_lastInertiaTiltMovement"),dl(e,e.enableLook,e.lookEventTypes,qd)}var Fbt=new M,Abt=new he;function p8(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===oe.SCENE2D||i===oe.MORPHING)return;let o=n.camera,r=y(n.ellipsoid,ne.WGS84),s=n.mapProjection,a,c;M.equals(o.transform,M.IDENTITY)||(a=M.clone(o.transform,Fbt),c=h.magnitude(o.position),o._setTransform(M.IDENTITY));let d=Abt;i===oe.SCENE3D?r.cartesianToCartographic(o.position,d):s.unproject(o.position,d);let u=!1;if(d.height<e._minimumCollisionTerrainHeight){let m=e._scene.globeHeight;if(l(m)){let p=m+e.minimumZoomDistance,g=m-e._lastGlobeHeight,f=g/e._lastGlobeHeight;d.height<p&&(t||Math.abs(f)<=.1)&&(d.height=p,i===oe.SCENE3D?r.cartographicToCartesian(d,o.position):s.project(d,o.position),u=!0),t||Math.abs(f)<=.1?e._lastGlobeHeight=m:e._lastGlobeHeight+=g*.1}}l(a)&&(o._setTransform(a),u&&(h.normalize(o.position,o.position),h.negate(o.position,o.direction),h.multiplyByScalar(o.position,Math.max(c,e.minimumZoomDistance),o.position),h.normalize(o.direction,o.direction),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up)))}sA.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===oe.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var Mbt=new h,Nbt=new h;sA.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;M.equals(t.transform,M.IDENTITY)?(this._globe=n,this._ellipsoid=y(e.ellipsoid,ne.default)):(this._globe=void 0,this._ellipsoid=ne.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=_r.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=_r.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=_r.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=h.clone(t.positionWC,Mbt),c=h.clone(t.directionWC,Nbt);if(i===oe.SCENE2D?Apt(this):i===oe.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,abt(this)):i===oe.SCENE3D&&(this._horizontalRotationAxis=void 0,wbt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let d=!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC);p8(this,d)}this._aggregator.reset()};sA.prototype.isDestroyed=function(){return!1};sA.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),me(this)};var aA=sA;var dki=T(S(),1);var B5i=T(S(),1),cA=`uniform sampler2D colorTexture;
  11554. uniform sampler2D colorTexture2;
  11555. uniform vec2 center;
  11556. uniform float radius;
  11557. in vec2 v_textureCoordinates;
  11558. void main()
  11559. {
  11560. vec4 color0 = texture(colorTexture, v_textureCoordinates);
  11561. vec4 color1 = texture(colorTexture2, v_textureCoordinates);
  11562. float x = length(gl_FragCoord.xy - center) / radius;
  11563. float t = smoothstep(0.5, 0.8, x);
  11564. out_FragColor = mix(color0 + color1, color1, t);
  11565. }
  11566. `;var Y5i=T(S(),1),lA=`uniform sampler2D colorTexture;
  11567. uniform float avgLuminance;
  11568. uniform float threshold;
  11569. uniform float offset;
  11570. in vec2 v_textureCoordinates;
  11571. float key(float avg)
  11572. {
  11573. float guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));
  11574. return max(0.0, guess) + 0.1;
  11575. }
  11576. // See section 9. "The bright-pass filter" of Realtime HDR Rendering
  11577. // http://www.cg.tuwien.ac.at/research/publications/2007/Luksch_2007_RHR/Luksch_2007_RHR-RealtimeHDR%20.pdf
  11578. void main()
  11579. {
  11580. vec4 color = texture(colorTexture, v_textureCoordinates);
  11581. vec3 xyz = czm_RGBToXYZ(color.rgb);
  11582. float luminance = xyz.r;
  11583. float scaledLum = key(avgLuminance) * luminance / avgLuminance;
  11584. float brightLum = max(scaledLum - threshold, 0.0);
  11585. float brightness = brightLum / (offset + brightLum);
  11586. xyz.r = brightness;
  11587. out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);
  11588. }
  11589. `;function m0(){this._sceneFramebuffer=new WT;let e=.125,t=new Array(6);t[0]=new lo({fragmentShader:jl,textureScale:e,forcePowerOfTwo:!0,sampleMode:zd.LINEAR});let n=t[1]=new lo({fragmentShader:lA,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new D,t[2]=new lo({fragmentShader:Ly,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new lo({fragmentShader:Ly,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new lo({fragmentShader:jl,sampleMode:zd.LINEAR}),this._uCenter=new D,this._uRadius=void 0,t[5]=new lo({fragmentShader:cA,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new cl({stages:t});let o=new NT(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}m0.prototype.get=function(e){return this._stages.get(e)};m0.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var kbt=new se,K_e=new D,Ubt=new D,J_e=new M;function Dbt(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,c=M.computeViewportTransformation(n,0,1,J_e),d=M.multiplyByPoint(r,o,kbt),u=Ft.pointToGLWindowCoordinates(s,c,o,K_e);d.x+=W.SOLAR_RADIUS;let m=Ft.pointToGLWindowCoordinates(a,c,d,d),p=D.magnitude(D.subtract(m,u,m))*30*2,g=Ubt;g.x=p,g.y=p,e._uCenter=D.clone(u,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let f=t.drawingBufferWidth,x=t.drawingBufferHeight,_=e._stages,C=_.get(0),V=C.outputTexture.width,L=C.outputTexture.height,Z=new Ke;Z.width=V,Z.height=L,c=M.computeViewportTransformation(Z,0,1,J_e),u=Ft.pointToGLWindowCoordinates(s,c,o,K_e),g.x*=V/f,g.y*=L/x;let G=C.scissorRectangle;G.x=Math.max(u.x-g.x*.5,0),G.y=Math.max(u.y-g.y*.5,0),G.width=Math.min(g.x,f),G.height=Math.min(g.y,x);for(let I=1;I<4;++I)Ke.clone(G,_.get(I).scissorRectangle)}m0.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};m0.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let o=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),Dbt(this,t,n),o};m0.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let o=1;o<i;++o)n.get(o).execute(e,n.get(o-1).outputTexture)};m0.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(jl,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};m0.prototype.isDestroyed=function(){return!1};m0.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),me(this)};var dA=m0;var gki=T(S(),1);function Q_e(){this._cachedShowFrustumsShaders={}}function Bbt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function Obt(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(u){u=De.replaceMain(u,"czm_Debug_main");let m=/out_FragData_(\d+)/g,p;for(;(p=m.exec(u))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return u});let s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor;
  11590. `,a+=`uniform vec3 debugShowFrustumsColor;
  11591. `,a+=`void main()
  11592. {
  11593. czm_Debug_main();
  11594. `;let c;if(s>0)for(c=0;c<s;++c)a+=` out_FragData_${r[c]}.rgb *= debugShowCommandsColor;
  11595. `,a+=` out_FragData_${r[c]}.rgb *= debugShowFrustumsColor;
  11596. `;else a+=` out_FragColor.rgb *= debugShowCommandsColor;
  11597. `,a+=` out_FragColor.rgb *= debugShowFrustumsColor;
  11598. `;a+="}",o.sources.push(a);let d=Bbt(i);return tn.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:d})}var uA=new B;function Ybt(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=B.fromRandom()),t._debugColor):B.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(uA.red=t.debugOverlappingFrustums&1?1:0,uA.green=t.debugOverlappingFrustums&2?1:0,uA.blue=t.debugOverlappingFrustums&4?1:0,uA.alpha=1,uA):B.WHITE}),n}var Hbt=new tt;Q_e.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=Obt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=tt.shallowClone(t,Hbt);r.shaderProgram=o,r.uniformMap=Ybt(e,t),r.execute(e.context,n)};var mA=Q_e;var Cki=T(S(),1);function YT(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new En}YT.fromKeyframeNode=function(e,t,n,i){let o=new YT(e,t,n),{spatialNode:r,metadata:s}=i;return o._metadata=zbt(e,s,n),o._orientedBoundingBox=Jbt(e,r,n,o._orientedBoundingBox),o};function zbt(e,t,n){if(!l(t))return;let{names:i,types:o}=e.provider,r={};for(let s=0;s<i.length;s++){let a=i[s],c=Rt.getComponentCount(o[s]),d=t[s].slice(n*c,(n+1)*c);r[a]=d}return r}var j_e=new h,Kbt=new h;function Jbt(e,t,n,i){let o=t.dimensions,r=o.x*o.y,s=Math.floor(n/r),a=n-s*r,c=Math.floor(a/o.x),d=a-c*o.x,u=h.fromElements(d,c,s,j_e),m=h.divideComponents(h.subtract(u,e._paddingBefore,j_e),e.dimensions,Kbt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,m,i)}Object.defineProperties(YT.prototype,{metadata:{get:function(){return this._metadata}},primitive:{get:function(){return this._primitive}},sampleIndex:{get:function(){return this._sampleIndex}},tileIndex:{get:function(){return this._tileIndex}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox.clone()}}});YT.prototype.hasProperty=function(e){return l(this._metadata[e])};YT.prototype.getNames=function(){return Object.keys(this._metadata)};YT.prototype.getProperty=function(e){return this._metadata[e]};var hA=YT;var V3i=T(S(),1);var DUi=T(S(),1);var VUi=T(S(),1);var Lki=T(S(),1),fA=`struct Ray {
  11599. vec3 pos;
  11600. vec3 dir;
  11601. vec3 rawDir;
  11602. };
  11603. #if defined(JITTER)
  11604. /**
  11605. * Generate a pseudo-random value for a given 2D screen coordinate.
  11606. * Similar to https://www.shadertoy.com/view/4djSRW with a modified hashscale.
  11607. */
  11608. float hash(vec2 p)
  11609. {
  11610. vec3 p3 = fract(vec3(p.xyx) * 50.0);
  11611. p3 += dot(p3, p3.yzx + 19.19);
  11612. return fract((p3.x + p3.y) * p3.z);
  11613. }
  11614. #endif
  11615. float minComponent(in vec3 v) {
  11616. return min(min(v.x, v.y), v.z);
  11617. }
  11618. float maxComponent(in vec3 v) {
  11619. return max(max(v.x, v.y), v.z);
  11620. }
  11621. struct PointJacobianT {
  11622. vec3 point;
  11623. mat3 jacobianT;
  11624. };
  11625. `;var Zki=T(S(),1),pA=`// See Intersection.glsl for the definition of intersectScene
  11626. // See IntersectionUtils.glsl for the definition of nextIntersection
  11627. // See convertUvToBox.glsl, convertUvToCylinder.glsl, or convertUvToEllipsoid.glsl
  11628. // for the definition of convertUvToShapeUvSpace. The appropriate function is
  11629. // selected based on the VoxelPrimitive shape type, and added to the shader in
  11630. // Scene/VoxelRenderResources.js.
  11631. // See Octree.glsl for the definitions of TraversalData, SampleData,
  11632. // traverseOctreeFromBeginning, and traverseOctreeFromExisting
  11633. // See Megatexture.glsl for the definition of accumulatePropertiesFromMegatexture
  11634. #define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops
  11635. #if defined(PICKING_VOXEL)
  11636. #define ALPHA_ACCUM_MAX 0.1
  11637. #else
  11638. #define ALPHA_ACCUM_MAX 0.98 // Must be > 0.0 and <= 1.0
  11639. #endif
  11640. uniform mat3 u_transformDirectionViewToLocal;
  11641. uniform vec3 u_cameraPositionUv;
  11642. uniform float u_stepSize;
  11643. #if defined(PICKING)
  11644. uniform vec4 u_pickColor;
  11645. #endif
  11646. vec3 getSampleSize(in int level) {
  11647. vec3 sampleCount = exp2(float(level)) * vec3(u_dimensions);
  11648. vec3 sampleSizeUv = 1.0 / sampleCount;
  11649. return scaleShapeUvToShapeSpace(sampleSizeUv);
  11650. }
  11651. #define MINIMUM_STEP_SCALAR (0.02)
  11652. #define SHIFT_FRACTION (0.001)
  11653. /**
  11654. * Given a coordinate within a tile, and sample spacings along a ray through
  11655. * the coordinate, find the distance to the points where the ray entered and
  11656. * exited the voxel cell, along with the surface normals at those points.
  11657. * The surface normals are returned in shape space coordinates.
  11658. */
  11659. RayShapeIntersection getVoxelIntersection(in vec3 tileUv, in vec3 sampleSizeAlongRay) {
  11660. vec3 voxelCoord = tileUv * vec3(u_dimensions);
  11661. vec3 directions = sign(sampleSizeAlongRay);
  11662. vec3 positiveDirections = max(directions, 0.0);
  11663. vec3 entryCoord = mix(ceil(voxelCoord), floor(voxelCoord), positiveDirections);
  11664. vec3 exitCoord = entryCoord + directions;
  11665. vec3 distanceFromEntry = -abs((entryCoord - voxelCoord) * sampleSizeAlongRay);
  11666. float lastEntry = maxComponent(distanceFromEntry);
  11667. bvec3 isLastEntry = equal(distanceFromEntry, vec3(lastEntry));
  11668. vec3 entryNormal = -1.0 * vec3(isLastEntry) * directions;
  11669. vec4 entry = vec4(entryNormal, lastEntry);
  11670. vec3 distanceToExit = abs((exitCoord - voxelCoord) * sampleSizeAlongRay);
  11671. float firstExit = minComponent(distanceToExit);
  11672. bvec3 isFirstExit = equal(distanceToExit, vec3(firstExit));
  11673. vec3 exitNormal = vec3(isFirstExit) * directions;
  11674. vec4 exit = vec4(exitNormal, firstExit);
  11675. return RayShapeIntersection(entry, exit);
  11676. }
  11677. vec4 getStepSize(in SampleData sampleData, in Ray viewRay, in RayShapeIntersection shapeIntersection, in mat3 jacobianT, in float currentT) {
  11678. // The Jacobian is computed in a space where the shape spans [-1, 1].
  11679. // But the ray is marched in a space where the shape fills [0, 1].
  11680. // So we need to scale the Jacobian by 2.
  11681. vec3 gradient = 2.0 * viewRay.rawDir * jacobianT;
  11682. vec3 sampleSizeAlongRay = getSampleSize(sampleData.tileCoords.w) / gradient;
  11683. RayShapeIntersection voxelIntersection = getVoxelIntersection(sampleData.tileUv, sampleSizeAlongRay);
  11684. // Transform normal from shape space to Cartesian space
  11685. vec3 voxelNormal = normalize(jacobianT * voxelIntersection.entry.xyz);
  11686. // Compare with the shape intersection, to choose the appropriate normal
  11687. vec4 voxelEntry = vec4(voxelNormal, currentT + voxelIntersection.entry.w);
  11688. vec4 entry = intersectionMax(shapeIntersection.entry, voxelEntry);
  11689. float fixedStep = minComponent(abs(sampleSizeAlongRay)) * u_stepSize;
  11690. float shift = fixedStep * SHIFT_FRACTION;
  11691. float dt = voxelIntersection.exit.w + shift;
  11692. if ((currentT + dt) > shapeIntersection.exit.w) {
  11693. // Stop at end of shape
  11694. dt = shapeIntersection.exit.w - currentT + shift;
  11695. }
  11696. float stepSize = clamp(dt, fixedStep * MINIMUM_STEP_SCALAR, fixedStep + shift);
  11697. return vec4(entry.xyz, stepSize);
  11698. }
  11699. vec2 packIntToVec2(int value) {
  11700. float shifted = float(value) / 255.0;
  11701. float lowBits = fract(shifted);
  11702. float highBits = floor(shifted) / 255.0;
  11703. return vec2(highBits, lowBits);
  11704. }
  11705. vec2 packFloatToVec2(float value) {
  11706. float lowBits = fract(value);
  11707. float highBits = floor(value) / 255.0;
  11708. return vec2(highBits, lowBits);
  11709. }
  11710. int getSampleIndex(in vec3 tileUv) {
  11711. ivec3 voxelDimensions = u_dimensions;
  11712. vec3 sampleCoordinate = tileUv * vec3(voxelDimensions);
  11713. // tileUv = 1.0 is a valid coordinate but sampleIndex = voxelDimensions is not.
  11714. // (tileUv = 1.0 corresponds to the last sample, at index = voxelDimensions - 1).
  11715. // Clamp to [0, voxelDimensions - 0.5) to avoid numerical error before flooring
  11716. vec3 maxCoordinate = vec3(voxelDimensions) - vec3(0.5);
  11717. sampleCoordinate = clamp(sampleCoordinate, vec3(0.0), maxCoordinate);
  11718. ivec3 sampleIndex = ivec3(floor(sampleCoordinate));
  11719. #if defined(PADDING)
  11720. voxelDimensions += u_paddingBefore + u_paddingAfter;
  11721. sampleIndex += u_paddingBefore;
  11722. #endif
  11723. // Convert to a 1D index for lookup in a 1D data array
  11724. return sampleIndex.x + voxelDimensions.x * (sampleIndex.y + voxelDimensions.y * sampleIndex.z);
  11725. }
  11726. void main()
  11727. {
  11728. vec4 fragCoord = gl_FragCoord;
  11729. vec2 screenCoord = (fragCoord.xy - czm_viewport.xy) / czm_viewport.zw; // [0,1]
  11730. vec3 eyeDirection = normalize(czm_windowToEyeCoordinates(fragCoord).xyz);
  11731. vec3 viewDirWorld = normalize(czm_inverseViewRotation * eyeDirection); // normalize again just in case
  11732. vec3 viewDirUv = normalize(u_transformDirectionViewToLocal * eyeDirection); // normalize again just in case
  11733. vec3 viewPosUv = u_cameraPositionUv;
  11734. #if defined(SHAPE_ELLIPSOID)
  11735. // viewDirUv has been scaled to a space where the ellipsoid is a sphere.
  11736. // Undo this scaling to get the raw direction.
  11737. vec3 rawDir = viewDirUv * u_ellipsoidRadiiUv;
  11738. Ray viewRayUv = Ray(viewPosUv, viewDirUv, rawDir);
  11739. #else
  11740. Ray viewRayUv = Ray(viewPosUv, viewDirUv, viewDirUv);
  11741. #endif
  11742. Intersections ix;
  11743. RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayUv, ix);
  11744. // Exit early if the scene was completely missed.
  11745. if (shapeIntersection.entry.w == NO_HIT) {
  11746. discard;
  11747. }
  11748. float currentT = shapeIntersection.entry.w;
  11749. float endT = shapeIntersection.exit.w;
  11750. vec3 positionUv = viewPosUv + currentT * viewDirUv;
  11751. PointJacobianT pointJacobian = convertUvToShapeUvSpaceDerivative(positionUv);
  11752. // Traverse the tree from the start position
  11753. TraversalData traversalData;
  11754. SampleData sampleDatas[SAMPLE_COUNT];
  11755. traverseOctreeFromBeginning(pointJacobian.point, traversalData, sampleDatas);
  11756. vec4 step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection, pointJacobian.jacobianT, currentT);
  11757. #if defined(JITTER)
  11758. float noise = hash(screenCoord); // [0,1]
  11759. currentT += noise * step.w;
  11760. positionUv += noise * step.w * viewDirUv;
  11761. #endif
  11762. FragmentInput fragmentInput;
  11763. #if defined(STATISTICS)
  11764. setStatistics(fragmentInput.metadata.statistics);
  11765. #endif
  11766. vec4 colorAccum = vec4(0.0);
  11767. for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) {
  11768. // Read properties from the megatexture based on the traversal state
  11769. Properties properties = accumulatePropertiesFromMegatexture(sampleDatas);
  11770. // Prepare the custom shader inputs
  11771. copyPropertiesToMetadata(properties, fragmentInput.metadata);
  11772. fragmentInput.voxel.positionUv = positionUv;
  11773. fragmentInput.voxel.positionShapeUv = pointJacobian.point;
  11774. fragmentInput.voxel.positionUvLocal = sampleDatas[0].tileUv;
  11775. fragmentInput.voxel.viewDirUv = viewDirUv;
  11776. fragmentInput.voxel.viewDirWorld = viewDirWorld;
  11777. fragmentInput.voxel.surfaceNormal = step.xyz;
  11778. fragmentInput.voxel.travelDistance = step.w;
  11779. fragmentInput.voxel.stepCount = stepCount;
  11780. fragmentInput.voxel.tileIndex = sampleDatas[0].megatextureIndex;
  11781. fragmentInput.voxel.sampleIndex = getSampleIndex(sampleDatas[0].tileUv);
  11782. // Run the custom shader
  11783. czm_modelMaterial materialOutput;
  11784. fragmentMain(fragmentInput, materialOutput);
  11785. // Sanitize the custom shader output
  11786. vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha);
  11787. color.rgb = max(color.rgb, vec3(0.0));
  11788. color.a = clamp(color.a, 0.0, 1.0);
  11789. // Pre-multiplied alpha blend
  11790. colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a);
  11791. // Stop traversing if the alpha has been fully saturated
  11792. if (colorAccum.a > ALPHA_ACCUM_MAX) {
  11793. colorAccum.a = ALPHA_ACCUM_MAX;
  11794. break;
  11795. }
  11796. if (step.w == 0.0) {
  11797. // Shape is infinitely thin. The ray may have hit the edge of a
  11798. // foreground voxel. Step ahead slightly to check for more voxels
  11799. step.w == 0.00001;
  11800. }
  11801. // Keep raymarching
  11802. currentT += step.w;
  11803. positionUv = viewPosUv + currentT * viewDirUv;
  11804. // Check if there's more intersections.
  11805. if (currentT > endT) {
  11806. #if (INTERSECTION_COUNT == 1)
  11807. break;
  11808. #else
  11809. shapeIntersection = nextIntersection(ix);
  11810. if (shapeIntersection.entry.w == NO_HIT) {
  11811. break;
  11812. } else {
  11813. // Found another intersection. Resume raymarching there
  11814. currentT = shapeIntersection.entry.w;
  11815. endT = shapeIntersection.exit.w;
  11816. positionUv = viewPosUv + currentT * viewDirUv;
  11817. }
  11818. #endif
  11819. }
  11820. // Traverse the tree from the current ray position.
  11821. // This is similar to traverseOctreeFromBeginning but is faster when the ray is in the same tile as the previous step.
  11822. pointJacobian = convertUvToShapeUvSpaceDerivative(positionUv);
  11823. traverseOctreeFromExisting(pointJacobian.point, traversalData, sampleDatas);
  11824. step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection, pointJacobian.jacobianT, currentT);
  11825. }
  11826. // Convert the alpha from [0,ALPHA_ACCUM_MAX] to [0,1]
  11827. colorAccum.a /= ALPHA_ACCUM_MAX;
  11828. #if defined(PICKING)
  11829. // If alpha is 0.0 there is nothing to pick
  11830. if (colorAccum.a == 0.0) {
  11831. discard;
  11832. }
  11833. out_FragColor = u_pickColor;
  11834. #elif defined(PICKING_VOXEL)
  11835. // If alpha is 0.0 there is nothing to pick
  11836. if (colorAccum.a == 0.0) {
  11837. discard;
  11838. }
  11839. vec2 megatextureId = packIntToVec2(sampleDatas[0].megatextureIndex);
  11840. vec2 sampleIndex = packIntToVec2(getSampleIndex(sampleDatas[0].tileUv));
  11841. out_FragColor = vec4(megatextureId, sampleIndex);
  11842. #else
  11843. out_FragColor = colorAccum;
  11844. #endif
  11845. }
  11846. `;var Eki=T(S(),1),bA=`in vec2 position;
  11847. uniform vec4 u_ndcSpaceAxisAlignedBoundingBox;
  11848. void main() {
  11849. vec2 aabbMin = u_ndcSpaceAxisAlignedBoundingBox.xy;
  11850. vec2 aabbMax = u_ndcSpaceAxisAlignedBoundingBox.zw;
  11851. vec2 translation = 0.5 * (aabbMax + aabbMin);
  11852. vec2 scale = 0.5 * (aabbMax - aabbMin);
  11853. gl_Position = vec4(position * scale + translation, 0.0, 1.0);
  11854. }
  11855. `;var Xki=T(S(),1),gA=`/* Intersection defines
  11856. #define INTERSECTION_COUNT ###
  11857. */
  11858. #define NO_HIT (-czm_infinity)
  11859. #define INF_HIT (czm_infinity * 0.5)
  11860. struct RayShapeIntersection {
  11861. vec4 entry;
  11862. vec4 exit;
  11863. };
  11864. vec4 intersectionMin(in vec4 intersect0, in vec4 intersect1)
  11865. {
  11866. if (intersect0.w == NO_HIT) {
  11867. return intersect1;
  11868. } else if (intersect1.w == NO_HIT) {
  11869. return intersect0;
  11870. }
  11871. return (intersect0.w <= intersect1.w) ? intersect0 : intersect1;
  11872. }
  11873. vec4 intersectionMax(in vec4 intersect0, in vec4 intersect1)
  11874. {
  11875. return (intersect0.w >= intersect1.w) ? intersect0 : intersect1;
  11876. }
  11877. RayShapeIntersection intersectIntersections(in Ray ray, in RayShapeIntersection intersect0, in RayShapeIntersection intersect1)
  11878. {
  11879. bool missed = (intersect0.entry.w == NO_HIT) ||
  11880. (intersect1.entry.w == NO_HIT) ||
  11881. (intersect0.exit.w < intersect1.entry.w) ||
  11882. (intersect0.entry.w > intersect1.exit.w);
  11883. if (missed) {
  11884. vec4 miss = vec4(normalize(ray.dir), NO_HIT);
  11885. return RayShapeIntersection(miss, miss);
  11886. }
  11887. vec4 entry = intersectionMax(intersect0.entry, intersect1.entry);
  11888. vec4 exit = intersectionMin(intersect0.exit, intersect1.exit);
  11889. return RayShapeIntersection(entry, exit);
  11890. }
  11891. struct Intersections {
  11892. // Don't access these member variables directly - call the functions instead.
  11893. // Store an array of ray-surface intersections. Each intersection is composed of:
  11894. // .xyz for the surface normal at the intersection point
  11895. // .w for the T value
  11896. // The scale of the normal encodes the shape intersection type:
  11897. // length(intersection.xyz) = 1: positive shape entry
  11898. // length(intersection.xyz) = 2: positive shape exit
  11899. // length(intersection.xyz) = 3: negative shape entry
  11900. // length(intersection.xyz) = 4: negative shape exit
  11901. // INTERSECTION_COUNT is the number of ray-*shape* (volume) intersections,
  11902. // so we need twice as many to track ray-*surface* intersections
  11903. vec4 intersections[INTERSECTION_COUNT * 2];
  11904. #if (INTERSECTION_COUNT > 1)
  11905. // Maintain state for future nextIntersection calls
  11906. int index;
  11907. int surroundCount;
  11908. bool surroundIsPositive;
  11909. #endif
  11910. };
  11911. RayShapeIntersection getFirstIntersection(in Intersections ix)
  11912. {
  11913. return RayShapeIntersection(ix.intersections[0], ix.intersections[1]);
  11914. }
  11915. vec4 encodeIntersectionType(vec4 intersection, int index, bool entry)
  11916. {
  11917. float scale = float(index > 0) * 2.0 + float(!entry) + 1.0;
  11918. return vec4(intersection.xyz * scale, intersection.w);
  11919. }
  11920. // Use defines instead of real functions because WebGL1 cannot access array with non-constant index.
  11921. #define setIntersection(/*inout Intersections*/ ix, /*int*/ index, /*float*/ t, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = vec4(0.0, float(!positive) * 2.0 + float(!enter) + 1.0, 0.0, (t))
  11922. #define setIntersectionPair(/*inout Intersections*/ ix, /*int*/ index, /*vec2*/ entryExit) (ix).intersections[(index) * 2 + 0] = vec4(0.0, float((index) > 0) * 2.0 + 1.0, 0.0, (entryExit).x); (ix).intersections[(index) * 2 + 1] = vec4(0.0, float((index) > 0) * 2.0 + 2.0, 0.0, (entryExit).y)
  11923. #define setSurfaceIntersection(/*inout Intersections*/ ix, /*int*/ index, /*vec4*/ intersection, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = encodeIntersectionType((intersection), int(!positive), (enter))
  11924. #define setShapeIntersection(/*inout Intersections*/ ix, /*int*/ index, /*RayShapeIntersection*/ intersection) (ix).intersections[(index) * 2 + 0] = encodeIntersectionType((intersection).entry, (index), true); (ix).intersections[(index) * 2 + 1] = encodeIntersectionType((intersection).exit, (index), false)
  11925. #if (INTERSECTION_COUNT > 1)
  11926. void initializeIntersections(inout Intersections ix) {
  11927. // Sort the intersections from min T to max T with bubble sort.
  11928. // Note: If this sorting function changes, some of the intersection test may
  11929. // need to be updated. Search for "bubble sort" to find those areas.
  11930. const int sortPasses = INTERSECTION_COUNT * 2 - 1;
  11931. for (int n = sortPasses; n > 0; --n) {
  11932. for (int i = 0; i < sortPasses; ++i) {
  11933. // The loop should be: for (i = 0; i < n; ++i) {...} but WebGL1 cannot
  11934. // loop with non-constant condition, so it has to break early instead
  11935. if (i >= n) { break; }
  11936. vec4 intersect0 = ix.intersections[i + 0];
  11937. vec4 intersect1 = ix.intersections[i + 1];
  11938. bool inOrder = intersect0.w <= intersect1.w;
  11939. ix.intersections[i + 0] = inOrder ? intersect0 : intersect1;
  11940. ix.intersections[i + 1] = inOrder ? intersect1 : intersect0;
  11941. }
  11942. }
  11943. // Prepare initial state for nextIntersection
  11944. ix.index = 0;
  11945. ix.surroundCount = 0;
  11946. ix.surroundIsPositive = false;
  11947. }
  11948. #endif
  11949. #if (INTERSECTION_COUNT > 1)
  11950. RayShapeIntersection nextIntersection(inout Intersections ix) {
  11951. vec4 surfaceIntersection = vec4(0.0, 0.0, 0.0, NO_HIT);
  11952. RayShapeIntersection shapeIntersection = RayShapeIntersection(surfaceIntersection, surfaceIntersection);
  11953. const int passCount = INTERSECTION_COUNT * 2;
  11954. if (ix.index == passCount) {
  11955. return shapeIntersection;
  11956. }
  11957. for (int i = 0; i < passCount; ++i) {
  11958. // The loop should be: for (i = ix.index; i < passCount; ++i) {...} but WebGL1 cannot
  11959. // loop with non-constant condition, so it has to continue instead.
  11960. if (i < ix.index) {
  11961. continue;
  11962. }
  11963. ix.index = i + 1;
  11964. surfaceIntersection = ix.intersections[i];
  11965. int intersectionType = int(length(surfaceIntersection.xyz) - 0.5);
  11966. bool currShapeIsPositive = intersectionType < 2;
  11967. bool enter = intMod(intersectionType, 2) == 0;
  11968. ix.surroundCount += enter ? +1 : -1;
  11969. ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive;
  11970. // entering positive or exiting negative
  11971. if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) {
  11972. shapeIntersection.entry = surfaceIntersection;
  11973. }
  11974. // exiting positive or entering negative after being inside positive
  11975. bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0;
  11976. bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive;
  11977. if (exitPositive || enterNegativeFromPositive) {
  11978. shapeIntersection.exit = surfaceIntersection;
  11979. // entry and exit have been found, so the loop can stop
  11980. if (exitPositive) {
  11981. // After exiting positive shape there is nothing left to intersect, so jump to the end index.
  11982. ix.index = passCount;
  11983. }
  11984. break;
  11985. }
  11986. }
  11987. return shapeIntersection;
  11988. }
  11989. #endif
  11990. // NOTE: initializeIntersections, nextIntersection aren't even declared unless INTERSECTION_COUNT > 1
  11991. `;var Pki=T(S(),1),yA=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections,
  11992. // setIntersectionPair, INF_HIT, NO_HIT
  11993. /* intersectDepth defines (set in Scene/VoxelRenderResources.js)
  11994. #define DEPTH_INTERSECTION_INDEX ###
  11995. */
  11996. uniform mat4 u_transformPositionViewToUv;
  11997. void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) {
  11998. float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord));
  11999. if (logDepthOrDepth != 0.0) {
  12000. // Calculate how far the ray must travel before it hits the depth buffer.
  12001. vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth);
  12002. eyeCoordinateDepth /= eyeCoordinateDepth.w;
  12003. vec3 depthPositionUv = vec3(u_transformPositionViewToUv * eyeCoordinateDepth);
  12004. float t = dot(depthPositionUv - ray.pos, ray.dir);
  12005. setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(t, +INF_HIT));
  12006. } else {
  12007. // There's no depth at this location.
  12008. setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT));
  12009. }
  12010. }
  12011. `;var wki=T(S(),1),xA=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT,
  12012. // NO_HIT, setShapeIntersection
  12013. /* Clipping plane defines (set in Scene/VoxelRenderResources.js)
  12014. #define CLIPPING_PLANES_UNION
  12015. #define CLIPPING_PLANES_COUNT
  12016. #define CLIPPING_PLANES_INTERSECTION_INDEX
  12017. */
  12018. uniform sampler2D u_clippingPlanesTexture;
  12019. uniform mat4 u_clippingPlanesMatrix;
  12020. // Plane is in Hessian Normal Form
  12021. vec4 intersectPlane(in Ray ray, in vec4 plane) {
  12022. vec3 n = plane.xyz; // normal
  12023. float w = plane.w; // -dot(pointOnPlane, normal)
  12024. float a = dot(ray.pos, n);
  12025. float b = dot(ray.dir, n);
  12026. float t = -(w + a) / b;
  12027. return vec4(n, t);
  12028. }
  12029. void intersectClippingPlanes(in Ray ray, inout Intersections ix) {
  12030. vec4 backSide = vec4(-ray.dir, -INF_HIT);
  12031. vec4 farSide = vec4(ray.dir, +INF_HIT);
  12032. RayShapeIntersection clippingVolume;
  12033. #if (CLIPPING_PLANES_COUNT == 1)
  12034. // Union and intersection are the same when there's one clipping plane, and the code
  12035. // is more simplified.
  12036. vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0, u_clippingPlanesMatrix);
  12037. vec4 intersection = intersectPlane(ray, planeUv);
  12038. bool reflects = dot(ray.dir, intersection.xyz) < 0.0;
  12039. clippingVolume.entry = reflects ? backSide : intersection;
  12040. clippingVolume.exit = reflects ? intersection : farSide;
  12041. setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume);
  12042. #elif defined(CLIPPING_PLANES_UNION)
  12043. vec4 firstTransmission = vec4(ray.dir, +INF_HIT);
  12044. vec4 lastReflection = vec4(-ray.dir, -INF_HIT);
  12045. for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) {
  12046. vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix);
  12047. vec4 intersection = intersectPlane(ray, planeUv);
  12048. if (dot(ray.dir, planeUv.xyz) > 0.0) {
  12049. firstTransmission = intersection.w <= firstTransmission.w ? intersection : firstTransmission;
  12050. } else {
  12051. lastReflection = intersection.w >= lastReflection.w ? intersection : lastReflection;
  12052. }
  12053. }
  12054. clippingVolume.entry = backSide;
  12055. clippingVolume.exit = lastReflection;
  12056. setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 0, clippingVolume);
  12057. clippingVolume.entry = firstTransmission;
  12058. clippingVolume.exit = farSide;
  12059. setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 1, clippingVolume);
  12060. #else // intersection
  12061. vec4 lastTransmission = vec4(ray.dir, -INF_HIT);
  12062. vec4 firstReflection = vec4(-ray.dir, +INF_HIT);
  12063. for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) {
  12064. vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix);
  12065. vec4 intersection = intersectPlane(ray, planeUv);
  12066. if (dot(ray.dir, planeUv.xyz) > 0.0) {
  12067. lastTransmission = intersection.w > lastTransmission.w ? intersection : lastTransmission;
  12068. } else {
  12069. firstReflection = intersection.w < firstReflection.w ? intersection: firstReflection;
  12070. }
  12071. }
  12072. if (lastTransmission.w < firstReflection.w) {
  12073. clippingVolume.entry = lastTransmission;
  12074. clippingVolume.exit = firstReflection;
  12075. } else {
  12076. clippingVolume.entry = vec4(-ray.dir, NO_HIT);
  12077. clippingVolume.exit = vec4(ray.dir, NO_HIT);
  12078. }
  12079. setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume);
  12080. #endif
  12081. }
  12082. `;var Aki=T(S(),1),nL=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT,
  12083. // RayShapeIntersection
  12084. vec4 intersectLongitude(in Ray ray, in float angle, in bool positiveNormal) {
  12085. float normalSign = positiveNormal ? 1.0 : -1.0;
  12086. vec2 planeNormal = vec2(-sin(angle), cos(angle)) * normalSign;
  12087. vec2 position = ray.pos.xy;
  12088. vec2 direction = ray.dir.xy;
  12089. float approachRate = dot(direction, planeNormal);
  12090. float distance = -dot(position, planeNormal);
  12091. float t = (approachRate == 0.0)
  12092. ? NO_HIT
  12093. : distance / approachRate;
  12094. return vec4(planeNormal, 0.0, t);
  12095. }
  12096. RayShapeIntersection intersectHalfSpace(in Ray ray, in float angle, in bool positiveNormal)
  12097. {
  12098. vec4 intersection = intersectLongitude(ray, angle, positiveNormal);
  12099. vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
  12100. bool hitFront = (intersection.w > 0.0) == (dot(ray.pos.xy, intersection.xy) > 0.0);
  12101. if (!hitFront) {
  12102. return RayShapeIntersection(intersection, farSide);
  12103. } else {
  12104. return RayShapeIntersection(-1.0 * farSide, intersection);
  12105. }
  12106. }
  12107. void intersectFlippedWedge(in Ray ray, in vec2 minMaxAngle, out RayShapeIntersection intersections[2])
  12108. {
  12109. intersections[0] = intersectHalfSpace(ray, minMaxAngle.x, false);
  12110. intersections[1] = intersectHalfSpace(ray, minMaxAngle.y, true);
  12111. }
  12112. bool hitPositiveHalfPlane(in Ray ray, in vec4 intersection, in bool positiveNormal) {
  12113. float normalSign = positiveNormal ? 1.0 : -1.0;
  12114. vec2 planeDirection = vec2(intersection.y, -intersection.x) * normalSign;
  12115. vec2 hit = ray.pos.xy + intersection.w * ray.dir.xy;
  12116. return dot(hit, planeDirection) > 0.0;
  12117. }
  12118. void intersectHalfPlane(in Ray ray, in float angle, out RayShapeIntersection intersections[2]) {
  12119. vec4 intersection = intersectLongitude(ray, angle, true);
  12120. vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
  12121. if (hitPositiveHalfPlane(ray, intersection, true)) {
  12122. intersections[0].entry = -1.0 * farSide;
  12123. intersections[0].exit = vec4(-1.0 * intersection.xy, 0.0, intersection.w);
  12124. intersections[1].entry = intersection;
  12125. intersections[1].exit = farSide;
  12126. } else {
  12127. vec4 miss = vec4(normalize(ray.dir), NO_HIT);
  12128. intersections[0].entry = -1.0 * farSide;
  12129. intersections[0].exit = farSide;
  12130. intersections[1].entry = miss;
  12131. intersections[1].exit = miss;
  12132. }
  12133. }
  12134. RayShapeIntersection intersectRegularWedge(in Ray ray, in vec2 minMaxAngle)
  12135. {
  12136. // Note: works for maxAngle > minAngle + pi, where the "regular wedge"
  12137. // is actually a negative volume.
  12138. // Compute intersections with the two planes.
  12139. // Normals will point toward the "outside" (negative space)
  12140. vec4 intersect1 = intersectLongitude(ray, minMaxAngle.x, false);
  12141. vec4 intersect2 = intersectLongitude(ray, minMaxAngle.y, true);
  12142. // Choose intersection with smallest T as the "first", the other as "last"
  12143. // Note: first or last could be in the "shadow" wedge, beyond the tip
  12144. bool inOrder = intersect1.w <= intersect2.w;
  12145. vec4 first = inOrder ? intersect1 : intersect2;
  12146. vec4 last = inOrder ? intersect2 : intersect1;
  12147. bool firstIsAhead = first.w >= 0.0;
  12148. bool startedInsideFirst = dot(ray.pos.xy, first.xy) < 0.0;
  12149. bool exitFromInside = firstIsAhead == startedInsideFirst;
  12150. bool lastIsAhead = last.w > 0.0;
  12151. bool startedOutsideLast = dot(ray.pos.xy, last.xy) >= 0.0;
  12152. bool enterFromOutside = lastIsAhead == startedOutsideLast;
  12153. vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
  12154. vec4 miss = vec4(normalize(ray.dir), NO_HIT);
  12155. if (exitFromInside && enterFromOutside) {
  12156. // Ray crosses both faces of negative wedge, exiting then entering the positive shape
  12157. return RayShapeIntersection(first, last);
  12158. } else if (!exitFromInside && enterFromOutside) {
  12159. // Ray starts inside wedge. last is in shadow wedge, and first is actually the entry
  12160. return RayShapeIntersection(-1.0 * farSide, first);
  12161. } else if (exitFromInside && !enterFromOutside) {
  12162. // First intersection was in the shadow wedge, so last is actually the exit
  12163. return RayShapeIntersection(last, farSide);
  12164. } else { // !exitFromInside && !enterFromOutside
  12165. // Both intersections were in the shadow wedge
  12166. return RayShapeIntersection(miss, miss);
  12167. }
  12168. }
  12169. `;var Nki=T(S(),1),_A=`// See IntersectionUtils.glsl for the definitions of Ray, RayShapeIntersection,
  12170. // NO_HIT, Intersections
  12171. /* Box defines (set in Scene/VoxelBoxShape.js)
  12172. #define BOX_INTERSECTION_INDEX ### // always 0
  12173. */
  12174. uniform vec3 u_renderMinBounds;
  12175. uniform vec3 u_renderMaxBounds;
  12176. RayShapeIntersection intersectBox(in Ray ray, in vec3 minBound, in vec3 maxBound)
  12177. {
  12178. // Consider the box as the intersection of the space between 3 pairs of parallel planes
  12179. // Compute the distance along the ray to each plane
  12180. vec3 t0 = (minBound - ray.pos) / ray.dir;
  12181. vec3 t1 = (maxBound - ray.pos) / ray.dir;
  12182. // Identify candidate entries/exits based on distance from ray.pos
  12183. vec3 entries = min(t0, t1);
  12184. vec3 exits = max(t0, t1);
  12185. vec3 directions = sign(ray.dir);
  12186. // The actual intersection points are the furthest entry and the closest exit
  12187. float lastEntry = maxComponent(entries);
  12188. bvec3 isLastEntry = equal(entries, vec3(lastEntry));
  12189. vec3 entryNormal = -1.0 * vec3(isLastEntry) * directions;
  12190. vec4 entry = vec4(entryNormal, lastEntry);
  12191. float firstExit = minComponent(exits);
  12192. bvec3 isFirstExit = equal(exits, vec3(firstExit));
  12193. vec3 exitNormal = vec3(isLastEntry) * directions;
  12194. vec4 exit = vec4(exitNormal, firstExit);
  12195. if (entry.w > exit.w) {
  12196. entry.w = NO_HIT;
  12197. exit.w = NO_HIT;
  12198. }
  12199. return RayShapeIntersection(entry, exit);
  12200. }
  12201. void intersectShape(in Ray ray, inout Intersections ix)
  12202. {
  12203. RayShapeIntersection intersection = intersectBox(ray, u_renderMinBounds, u_renderMaxBounds);
  12204. setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection);
  12205. }
  12206. `;var Uki=T(S(),1),TA=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, Intersections,
  12207. // RayShapeIntersection, setSurfaceIntersection, setShapeIntersection,
  12208. // intersectIntersections
  12209. // See IntersectLongitude.glsl for the definitions of intersectHalfPlane,
  12210. // intersectFlippedWedge, intersectRegularWedge
  12211. /* Cylinder defines (set in Scene/VoxelCylinderShape.js)
  12212. #define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN
  12213. #define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT
  12214. #define CYLINDER_HAS_RENDER_BOUNDS_ANGLE
  12215. #define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF
  12216. #define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF
  12217. #define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO
  12218. #define CYLINDER_INTERSECTION_INDEX_RADIUS_MAX
  12219. #define CYLINDER_INTERSECTION_INDEX_RADIUS_MIN
  12220. #define CYLINDER_INTERSECTION_INDEX_ANGLE
  12221. */
  12222. // Cylinder uniforms
  12223. uniform vec2 u_cylinderRenderRadiusMinMax;
  12224. uniform vec2 u_cylinderRenderHeightMinMax;
  12225. #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE)
  12226. uniform vec2 u_cylinderRenderAngleMinMax;
  12227. #endif
  12228. /**
  12229. * Find the intersection of a ray with the volume defined by two planes of constant z
  12230. */
  12231. RayShapeIntersection intersectHeightBounds(in Ray ray, in vec2 minMaxHeight, in bool convex)
  12232. {
  12233. float zPosition = ray.pos.z;
  12234. float zDirection = ray.dir.z;
  12235. float tmin = (minMaxHeight.x - zPosition) / zDirection;
  12236. float tmax = (minMaxHeight.y - zPosition) / zDirection;
  12237. // Normals point outside the volume
  12238. float signFlip = convex ? 1.0 : -1.0;
  12239. vec4 intersectMin = vec4(0.0, 0.0, -1.0 * signFlip, tmin);
  12240. vec4 intersectMax = vec4(0.0, 0.0, 1.0 * signFlip, tmax);
  12241. bool topEntry = zDirection < 0.0;
  12242. vec4 entry = topEntry ? intersectMax : intersectMin;
  12243. vec4 exit = topEntry ? intersectMin : intersectMax;
  12244. return RayShapeIntersection(entry, exit);
  12245. }
  12246. /**
  12247. * Find the intersection of a ray with a right cylindrical surface of a given radius
  12248. * about the z-axis.
  12249. */
  12250. RayShapeIntersection intersectCylinder(in Ray ray, in float radius, in bool convex)
  12251. {
  12252. vec2 position = ray.pos.xy;
  12253. vec2 direction = ray.dir.xy;
  12254. float a = dot(direction, direction);
  12255. float b = dot(position, direction);
  12256. float c = dot(position, position) - radius * radius;
  12257. float determinant = b * b - a * c;
  12258. if (determinant < 0.0) {
  12259. vec4 miss = vec4(normalize(ray.dir), NO_HIT);
  12260. return RayShapeIntersection(miss, miss);
  12261. }
  12262. determinant = sqrt(determinant);
  12263. float t1 = (-b - determinant) / a;
  12264. float t2 = (-b + determinant) / a;
  12265. float signFlip = convex ? 1.0 : -1.0;
  12266. vec4 intersect1 = vec4(normalize(position + t1 * direction) * signFlip, 0.0, t1);
  12267. vec4 intersect2 = vec4(normalize(position + t2 * direction) * signFlip, 0.0, t2);
  12268. return RayShapeIntersection(intersect1, intersect2);
  12269. }
  12270. /**
  12271. * Find the intersection of a ray with a right cylindrical solid of given
  12272. * radius and height bounds. NOTE: The shape is assumed to be convex.
  12273. */
  12274. RayShapeIntersection intersectBoundedCylinder(in Ray ray, in float radius, in vec2 minMaxHeight)
  12275. {
  12276. RayShapeIntersection cylinderIntersection = intersectCylinder(ray, radius, true);
  12277. RayShapeIntersection heightBoundsIntersection = intersectHeightBounds(ray, minMaxHeight, true);
  12278. return intersectIntersections(ray, cylinderIntersection, heightBoundsIntersection);
  12279. }
  12280. void intersectShape(Ray ray, inout Intersections ix)
  12281. {
  12282. // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1].
  12283. // Direction is scaled as well to be in sync with position.
  12284. ray.pos = ray.pos * 2.0 - 1.0;
  12285. ray.dir *= 2.0;
  12286. RayShapeIntersection outerIntersect = intersectBoundedCylinder(ray, u_cylinderRenderRadiusMinMax.y, u_cylinderRenderHeightMinMax);
  12287. setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect);
  12288. if (outerIntersect.entry.w == NO_HIT) {
  12289. return;
  12290. }
  12291. #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT)
  12292. // When the cylinder is perfectly thin it's necessary to sandwich the
  12293. // inner cylinder intersection inside the outer cylinder intersection.
  12294. // Without this special case,
  12295. // [outerMin, outerMax, innerMin, innerMax] will bubble sort to
  12296. // [outerMin, innerMin, outerMax, innerMax] which will cause the back
  12297. // side of the cylinder to be invisible because it will think the ray
  12298. // is still inside the inner (negative) cylinder after exiting the
  12299. // outer (positive) cylinder.
  12300. // With this special case,
  12301. // [outerMin, innerMin, innerMax, outerMax] will bubble sort to
  12302. // [outerMin, innerMin, innerMax, outerMax] which will work correctly.
  12303. // Note: If initializeIntersections() changes its sorting function
  12304. // from bubble sort to something else, this code may need to change.
  12305. RayShapeIntersection innerIntersect = intersectCylinder(ray, 1.0, false);
  12306. setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true); // positive, enter
  12307. setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); // negative, enter
  12308. setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); // negative, exit
  12309. setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); // positive, exit
  12310. #elif defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN)
  12311. RayShapeIntersection innerIntersect = intersectCylinder(ray, u_cylinderRenderRadiusMinMax.x, false);
  12312. setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MIN, innerIntersect);
  12313. #endif
  12314. #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF)
  12315. RayShapeIntersection wedgeIntersect = intersectRegularWedge(ray, u_cylinderRenderAngleMinMax);
  12316. setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect);
  12317. #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF)
  12318. RayShapeIntersection wedgeIntersects[2];
  12319. intersectFlippedWedge(ray, u_cylinderRenderAngleMinMax, wedgeIntersects);
  12320. setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersects[0]);
  12321. setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]);
  12322. #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO)
  12323. RayShapeIntersection wedgeIntersects[2];
  12324. intersectHalfPlane(ray, u_cylinderRenderAngleMinMax.x, wedgeIntersects);
  12325. setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersects[0]);
  12326. setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]);
  12327. #endif
  12328. }
  12329. `;var Bki=T(S(),1),SA=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT, Intersections,
  12330. // RayShapeIntersection, setSurfaceIntersection, setShapeIntersection
  12331. // See IntersectLongitude.glsl for the definitions of intersectHalfPlane,
  12332. // intersectFlippedWedge, intersectRegularWedge
  12333. /* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js)
  12334. #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE
  12335. #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO
  12336. #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF
  12337. #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF
  12338. #define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF
  12339. #define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF
  12340. #define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF
  12341. #define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF
  12342. #define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF
  12343. #define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF
  12344. #define ELLIPSOID_INTERSECTION_INDEX_LONGITUDE
  12345. #define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX
  12346. #define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN
  12347. #define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX
  12348. #define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN
  12349. */
  12350. #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE)
  12351. uniform vec2 u_ellipsoidRenderLongitudeMinMax;
  12352. #endif
  12353. uniform float u_eccentricitySquared;
  12354. uniform vec2 u_ellipsoidRenderLatitudeSinMinMax;
  12355. uniform vec2 u_clipMinMaxHeight;
  12356. RayShapeIntersection intersectZPlane(in Ray ray, in float z) {
  12357. float t = -ray.pos.z / ray.dir.z;
  12358. bool startsOutside = sign(ray.pos.z) == sign(z);
  12359. bool entry = (t >= 0.0) != startsOutside;
  12360. vec4 intersect = vec4(0.0, 0.0, z, t);
  12361. vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
  12362. if (entry) {
  12363. return RayShapeIntersection(intersect, farSide);
  12364. } else {
  12365. return RayShapeIntersection(-1.0 * farSide, intersect);
  12366. }
  12367. }
  12368. RayShapeIntersection intersectHeight(in Ray ray, in float relativeHeight, in bool convex)
  12369. {
  12370. // Scale the ray by the ellipsoid axes to make it a unit sphere
  12371. // Note: approximating ellipsoid + height as an ellipsoid
  12372. vec3 radiiCorrection = u_ellipsoidRadiiUv / (u_ellipsoidRadiiUv + relativeHeight);
  12373. vec3 position = ray.pos * radiiCorrection;
  12374. vec3 direction = ray.dir * radiiCorrection;
  12375. float a = dot(direction, direction); // ~ 1.0 (or maybe 4.0 if ray is scaled)
  12376. float b = dot(direction, position); // roughly inside [-1.0, 1.0] when zoomed in
  12377. float c = dot(position, position) - 1.0; // ~ 0.0 when zoomed in.
  12378. float determinant = b * b - a * c; // ~ b * b when zoomed in
  12379. if (determinant < 0.0) {
  12380. vec4 miss = vec4(normalize(direction), NO_HIT);
  12381. return RayShapeIntersection(miss, miss);
  12382. }
  12383. determinant = sqrt(determinant);
  12384. // Compute larger root using standard formula
  12385. float signB = b < 0.0 ? -1.0 : 1.0;
  12386. // The other root may suffer from subtractive cancellation in the standard formula.
  12387. // Compute it from the first root instead.
  12388. float t1 = (-b - signB * determinant) / a;
  12389. float t2 = c / (a * t1);
  12390. float tmin = min(t1, t2);
  12391. float tmax = max(t1, t2);
  12392. float directionScale = convex ? 1.0 : -1.0;
  12393. vec3 d1 = directionScale * normalize(position + tmin * direction);
  12394. vec3 d2 = directionScale * normalize(position + tmax * direction);
  12395. return RayShapeIntersection(vec4(d1, tmin), vec4(d2, tmax));
  12396. }
  12397. /**
  12398. * Given a circular cone around the z-axis, with apex at the origin,
  12399. * find the parametric distance(s) along a ray where that ray intersects
  12400. * the cone.
  12401. * The cone opening angle is described by the squared cosine of
  12402. * its half-angle (the angle between the Z-axis and the surface)
  12403. */
  12404. vec2 intersectDoubleEndedCone(in Ray ray, in float cosSqrHalfAngle)
  12405. {
  12406. vec3 o = ray.pos;
  12407. vec3 d = ray.dir;
  12408. float sinSqrHalfAngle = 1.0 - cosSqrHalfAngle;
  12409. float aSin = d.z * d.z * sinSqrHalfAngle;
  12410. float aCos = -dot(d.xy, d.xy) * cosSqrHalfAngle;
  12411. float a = aSin + aCos;
  12412. float bSin = d.z * o.z * sinSqrHalfAngle;
  12413. float bCos = -dot(o.xy, d.xy) * cosSqrHalfAngle;
  12414. float b = bSin + bCos;
  12415. float cSin = o.z * o.z * sinSqrHalfAngle;
  12416. float cCos = -dot(o.xy, o.xy) * cosSqrHalfAngle;
  12417. float c = cSin + cCos;
  12418. // determinant = b * b - a * c. But bSin * bSin = aSin * cSin.
  12419. // Avoid subtractive cancellation by expanding to eliminate these terms
  12420. float determinant = 2.0 * bSin * bCos + bCos * bCos - aSin * cCos - aCos * cSin - aCos * cCos;
  12421. if (determinant < 0.0) {
  12422. return vec2(NO_HIT);
  12423. } else if (a == 0.0) {
  12424. // Ray is parallel to cone surface
  12425. return (b == 0.0)
  12426. ? vec2(NO_HIT) // Ray is on cone surface
  12427. : vec2(-0.5 * c / b, NO_HIT);
  12428. }
  12429. determinant = sqrt(determinant);
  12430. // Compute larger root using standard formula
  12431. float signB = b < 0.0 ? -1.0 : 1.0;
  12432. float t1 = (-b - signB * determinant) / a;
  12433. // The other root may suffer from subtractive cancellation in the standard formula.
  12434. // Compute it from the first root instead.
  12435. float t2 = c / (a * t1);
  12436. float tmin = min(t1, t2);
  12437. float tmax = max(t1, t2);
  12438. return vec2(tmin, tmax);
  12439. }
  12440. /**
  12441. * Given a point on a conical surface, find the surface normal at that point.
  12442. */
  12443. vec3 getConeNormal(in vec3 p, in bool convex) {
  12444. // Start with radial component pointing toward z-axis
  12445. vec2 radial = -abs(p.z) * normalize(p.xy);
  12446. // Z component points toward opening of cone
  12447. float zSign = (p.z < 0.0) ? -1.0 : 1.0;
  12448. float z = length(p.xy) * zSign;
  12449. // Flip normal if shape is convex
  12450. float flip = (convex) ? -1.0 : 1.0;
  12451. return normalize(vec3(radial, z) * flip);
  12452. }
  12453. /**
  12454. * Compute the shift between the ellipsoid origin and the apex of a cone of latitude
  12455. */
  12456. float getLatitudeConeShift(in float sinLatitude) {
  12457. // Find prime vertical radius of curvature:
  12458. // the distance along the ellipsoid normal to the intersection with the z-axis
  12459. float x2 = u_eccentricitySquared * sinLatitude * sinLatitude;
  12460. float primeVerticalRadius = inversesqrt(1.0 - x2);
  12461. // Compute a shift from the origin to the intersection of the cone with the z-axis
  12462. return primeVerticalRadius * u_eccentricitySquared * sinLatitude;
  12463. }
  12464. void intersectFlippedCone(in Ray ray, in float cosHalfAngle, out RayShapeIntersection intersections[2]) {
  12465. // Undo the scaling from ellipsoid to sphere
  12466. ray.pos = ray.pos * u_ellipsoidRadiiUv;
  12467. ray.dir = ray.dir * u_ellipsoidRadiiUv;
  12468. // Shift the ray to account for the latitude cone not being centered at the Earth center
  12469. ray.pos.z += getLatitudeConeShift(cosHalfAngle);
  12470. float cosSqrHalfAngle = cosHalfAngle * cosHalfAngle;
  12471. vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);
  12472. vec4 miss = vec4(normalize(ray.dir), NO_HIT);
  12473. vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
  12474. // Initialize output with no intersections
  12475. intersections[0].entry = -1.0 * farSide;
  12476. intersections[0].exit = farSide;
  12477. intersections[1].entry = miss;
  12478. intersections[1].exit = miss;
  12479. if (intersect.x == NO_HIT) {
  12480. return;
  12481. }
  12482. // Find the points of intersection
  12483. float tmin = intersect.x;
  12484. float tmax = intersect.y;
  12485. vec3 p0 = ray.pos + tmin * ray.dir;
  12486. vec3 p1 = ray.pos + tmax * ray.dir;
  12487. vec4 intersect0 = vec4(getConeNormal(p0, true), tmin);
  12488. vec4 intersect1 = vec4(getConeNormal(p1, true), tmax);
  12489. bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle);
  12490. bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle);
  12491. if (p0InShadowCone && p1InShadowCone) {
  12492. // no valid intersections
  12493. } else if (p0InShadowCone) {
  12494. intersections[0].exit = intersect1;
  12495. } else if (p1InShadowCone) {
  12496. intersections[0].entry = intersect0;
  12497. } else {
  12498. intersections[0].exit = intersect0;
  12499. intersections[1].entry = intersect1;
  12500. intersections[1].exit = farSide;
  12501. }
  12502. }
  12503. RayShapeIntersection intersectRegularCone(in Ray ray, in float cosHalfAngle, in bool convex) {
  12504. // Undo the scaling from ellipsoid to sphere
  12505. ray.pos = ray.pos * u_ellipsoidRadiiUv;
  12506. ray.dir = ray.dir * u_ellipsoidRadiiUv;
  12507. // Shift the ray to account for the latitude cone not being centered at the Earth center
  12508. ray.pos.z += getLatitudeConeShift(cosHalfAngle);
  12509. float cosSqrHalfAngle = cosHalfAngle * cosHalfAngle;
  12510. vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);
  12511. vec4 miss = vec4(normalize(ray.dir), NO_HIT);
  12512. vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
  12513. if (intersect.x == NO_HIT) {
  12514. return RayShapeIntersection(miss, miss);
  12515. }
  12516. // Find the points of intersection
  12517. float tmin = intersect.x;
  12518. float tmax = intersect.y;
  12519. vec3 p0 = ray.pos + tmin * ray.dir;
  12520. vec3 p1 = ray.pos + tmax * ray.dir;
  12521. vec4 intersect0 = vec4(getConeNormal(p0, convex), tmin);
  12522. vec4 intersect1 = vec4(getConeNormal(p1, convex), tmax);
  12523. bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle);
  12524. bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle);
  12525. if (p0InShadowCone && p1InShadowCone) {
  12526. return RayShapeIntersection(miss, miss);
  12527. } else if (p0InShadowCone) {
  12528. return RayShapeIntersection(intersect1, farSide);
  12529. } else if (p1InShadowCone) {
  12530. return RayShapeIntersection(-1.0 * farSide, intersect0);
  12531. } else {
  12532. return RayShapeIntersection(intersect0, intersect1);
  12533. }
  12534. }
  12535. void intersectShape(in Ray ray, inout Intersections ix) {
  12536. // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1].
  12537. // Direction is scaled as well to be in sync with position.
  12538. ray.pos = ray.pos * 2.0 - 1.0;
  12539. ray.dir *= 2.0;
  12540. // Outer ellipsoid
  12541. RayShapeIntersection outerIntersect = intersectHeight(ray, u_clipMinMaxHeight.y, true);
  12542. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect);
  12543. // Exit early if the outer ellipsoid was missed.
  12544. if (outerIntersect.entry.w == NO_HIT) {
  12545. return;
  12546. }
  12547. // Inner ellipsoid
  12548. RayShapeIntersection innerIntersect = intersectHeight(ray, u_clipMinMaxHeight.x, false);
  12549. if (innerIntersect.entry.w == NO_HIT) {
  12550. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect);
  12551. } else {
  12552. // When the ellipsoid is large and thin it's possible for floating point math
  12553. // to cause the ray to intersect the inner ellipsoid before the outer ellipsoid.
  12554. // To prevent this from happening, clamp innerIntersect to outerIntersect and
  12555. // sandwich the inner ellipsoid intersection inside the outer ellipsoid intersection.
  12556. // Without this special case,
  12557. // [outerMin, outerMax, innerMin, innerMax] will bubble sort to
  12558. // [outerMin, innerMin, outerMax, innerMax] which will cause the back
  12559. // side of the ellipsoid to be invisible because it will think the ray
  12560. // is still inside the inner (negative) ellipsoid after exiting the
  12561. // outer (positive) ellipsoid.
  12562. // With this special case,
  12563. // [outerMin, innerMin, innerMax, outerMax] will bubble sort to
  12564. // [outerMin, innerMin, innerMax, outerMax] which will work correctly.
  12565. // Note: If initializeIntersections() changes its sorting function
  12566. // from bubble sort to something else, this code may need to change.
  12567. innerIntersect.entry.w = max(innerIntersect.entry.w, outerIntersect.entry.w);
  12568. innerIntersect.exit.w = min(innerIntersect.exit.w, outerIntersect.exit.w);
  12569. setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true); // positive, enter
  12570. setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); // negative, enter
  12571. setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); // negative, exit
  12572. setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); // positive, exit
  12573. }
  12574. // Bottom cone
  12575. #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF)
  12576. RayShapeIntersection bottomConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeSinMinMax.x, false);
  12577. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);
  12578. #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF)
  12579. RayShapeIntersection bottomConeIntersection = intersectZPlane(ray, -1.0);
  12580. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);
  12581. #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF)
  12582. RayShapeIntersection bottomConeIntersections[2];
  12583. intersectFlippedCone(ray, u_ellipsoidRenderLatitudeSinMinMax.x, bottomConeIntersections);
  12584. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 0, bottomConeIntersections[0]);
  12585. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 1, bottomConeIntersections[1]);
  12586. #endif
  12587. // Top cone
  12588. #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF)
  12589. RayShapeIntersection topConeIntersections[2];
  12590. intersectFlippedCone(ray, u_ellipsoidRenderLatitudeSinMinMax.y, topConeIntersections);
  12591. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 0, topConeIntersections[0]);
  12592. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 1, topConeIntersections[1]);
  12593. #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF)
  12594. RayShapeIntersection topConeIntersection = intersectZPlane(ray, 1.0);
  12595. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);
  12596. #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF)
  12597. RayShapeIntersection topConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeSinMinMax.y, false);
  12598. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);
  12599. #endif
  12600. // Wedge
  12601. #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO)
  12602. RayShapeIntersection wedgeIntersects[2];
  12603. intersectHalfPlane(ray, u_ellipsoidRenderLongitudeMinMax.x, wedgeIntersects);
  12604. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersects[0]);
  12605. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]);
  12606. #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF)
  12607. RayShapeIntersection wedgeIntersect = intersectRegularWedge(ray, u_ellipsoidRenderLongitudeMinMax);
  12608. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect);
  12609. #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF)
  12610. RayShapeIntersection wedgeIntersects[2];
  12611. intersectFlippedWedge(ray, u_ellipsoidRenderLongitudeMinMax, wedgeIntersects);
  12612. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersects[0]);
  12613. setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]);
  12614. #endif
  12615. }
  12616. `;var Yki=T(S(),1),HT=`// Main intersection function for Voxel scenes.
  12617. // See IntersectBox.glsl, IntersectCylinder.glsl, or IntersectEllipsoid.glsl
  12618. // for the definition of intersectShape. The appropriate function is selected
  12619. // based on the VoxelPrimitive shape type, and added to the shader in
  12620. // Scene/VoxelRenderResources.js.
  12621. // See also IntersectClippingPlane.glsl and IntersectDepth.glsl.
  12622. // See IntersectionUtils.glsl for the definitions of Ray, NO_HIT,
  12623. // getFirstIntersection, initializeIntersections, nextIntersection.
  12624. /* Intersection defines (set in Scene/VoxelRenderResources.js)
  12625. #define INTERSECTION_COUNT ###
  12626. */
  12627. RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Intersections ix) {
  12628. // Do a ray-shape intersection to find the exact starting and ending points.
  12629. intersectShape(ray, ix);
  12630. // Exit early if the positive shape was completely missed or behind the ray.
  12631. RayShapeIntersection intersection = getFirstIntersection(ix);
  12632. if (intersection.entry.w == NO_HIT) {
  12633. // Positive shape was completely missed - so exit early.
  12634. return intersection;
  12635. }
  12636. // Clipping planes
  12637. #if defined(CLIPPING_PLANES)
  12638. intersectClippingPlanes(ray, ix);
  12639. #endif
  12640. // Depth
  12641. #if defined(DEPTH_TEST)
  12642. intersectDepth(screenCoord, ray, ix);
  12643. #endif
  12644. // Find the first intersection that's in front of the ray
  12645. #if (INTERSECTION_COUNT > 1)
  12646. initializeIntersections(ix);
  12647. for (int i = 0; i < INTERSECTION_COUNT; ++i) {
  12648. intersection = nextIntersection(ix);
  12649. if (intersection.exit.w > 0.0) {
  12650. // Set start to 0.0 when ray is inside the shape.
  12651. intersection.entry.w = max(intersection.entry.w, 0.0);
  12652. break;
  12653. }
  12654. }
  12655. #else
  12656. // Set start to 0.0 when ray is inside the shape.
  12657. intersection.entry.w = max(intersection.entry.w, 0.0);
  12658. #endif
  12659. return intersection;
  12660. }
  12661. `;var zki=T(S(),1),CA=`/* Box defines (set in Scene/VoxelBoxShape.js)
  12662. #define BOX_HAS_SHAPE_BOUNDS
  12663. */
  12664. #if defined(BOX_HAS_SHAPE_BOUNDS)
  12665. uniform vec3 u_boxUvToShapeUvScale;
  12666. uniform vec3 u_boxUvToShapeUvTranslate;
  12667. #endif
  12668. PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) {
  12669. // For BOX, UV space = shape space, so we can use positionUv as-is,
  12670. // and the Jacobian is the identity matrix, except that a step of 1
  12671. // only spans half the shape space [-1, 1], so the identity is scaled.
  12672. return PointJacobianT(positionUv, mat3(0.5));
  12673. }
  12674. vec3 convertShapeToShapeUvSpace(in vec3 positionShape) {
  12675. #if defined(BOX_HAS_SHAPE_BOUNDS)
  12676. return positionShape * u_boxUvToShapeUvScale + u_boxUvToShapeUvTranslate;
  12677. #else
  12678. return positionShape;
  12679. #endif
  12680. }
  12681. PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) {
  12682. PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv);
  12683. pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point);
  12684. return pointJacobian;
  12685. }
  12686. vec3 convertShapeUvToUvSpace(in vec3 shapeUv) {
  12687. #if defined(BOX_HAS_SHAPE_BOUNDS)
  12688. return (shapeUv - u_boxUvToShapeUvTranslate) / u_boxUvToShapeUvScale;
  12689. #else
  12690. return shapeUv;
  12691. #endif
  12692. }
  12693. vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
  12694. #if defined(BOX_HAS_SHAPE_BOUNDS)
  12695. return shapeUv / u_boxUvToShapeUvScale;
  12696. #else
  12697. return shapeUv;
  12698. #endif
  12699. }`;var Jki=T(S(),1),VA=`/* Cylinder defines (set in Scene/VoxelCylinderShape.js)
  12700. #define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS
  12701. #define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT
  12702. #define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE
  12703. #define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY
  12704. #define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY
  12705. #define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED
  12706. */
  12707. #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)
  12708. uniform vec2 u_cylinderUvToShapeUvRadius; // x = scale, y = offset
  12709. #endif
  12710. #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)
  12711. uniform vec2 u_cylinderUvToShapeUvHeight; // x = scale, y = offset
  12712. #endif
  12713. #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
  12714. uniform vec2 u_cylinderUvToShapeUvAngle; // x = scale, y = offset
  12715. #endif
  12716. #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY)
  12717. uniform vec2 u_cylinderShapeUvAngleMinMax;
  12718. #endif
  12719. #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED)
  12720. uniform float u_cylinderShapeUvAngleRangeZeroMid;
  12721. #endif
  12722. PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) {
  12723. // Convert from Cartesian UV space [0, 1] to Cartesian local space [-1, 1]
  12724. vec3 position = positionUv * 2.0 - 1.0;
  12725. float radius = length(position.xy); // [0, 1]
  12726. vec3 radial = normalize(vec3(position.xy, 0.0));
  12727. // Shape space height is defined within [0, 1]
  12728. float height = positionUv.z; // [0, 1]
  12729. vec3 z = vec3(0.0, 0.0, 1.0);
  12730. float angle = atan(position.y, position.x);
  12731. vec3 east = normalize(vec3(-position.y, position.x, 0.0));
  12732. vec3 point = vec3(radius, height, angle);
  12733. mat3 jacobianT = mat3(radial, z, east / length(position.xy));
  12734. return PointJacobianT(point, jacobianT);
  12735. }
  12736. vec3 convertShapeToShapeUvSpace(in vec3 positionShape) {
  12737. float radius = positionShape.x;
  12738. #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)
  12739. radius = radius * u_cylinderUvToShapeUvRadius.x + u_cylinderUvToShapeUvRadius.y;
  12740. #endif
  12741. float height = positionShape.y;
  12742. #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)
  12743. height = height * u_cylinderUvToShapeUvHeight.x + u_cylinderUvToShapeUvHeight.y;
  12744. #endif
  12745. float angle = (positionShape.z + czm_pi) / czm_twoPi;
  12746. #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
  12747. #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED)
  12748. // Comparing against u_cylinderShapeUvAngleMinMax has precision problems. u_cylinderShapeUvAngleRangeZeroMid is more conservative.
  12749. angle += float(angle < u_cylinderShapeUvAngleRangeZeroMid);
  12750. #endif
  12751. // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity.
  12752. #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY)
  12753. angle = angle > u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.x : angle;
  12754. #elif defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY)
  12755. angle = angle < u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.y : angle;
  12756. #endif
  12757. angle = angle * u_cylinderUvToShapeUvAngle.x + u_cylinderUvToShapeUvAngle.y;
  12758. #endif
  12759. return vec3(radius, height, angle);
  12760. }
  12761. PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) {
  12762. PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv);
  12763. pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point);
  12764. return pointJacobian;
  12765. }
  12766. vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
  12767. float radius = shapeUv.x;
  12768. #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)
  12769. radius /= u_cylinderUvToShapeUvRadius.x;
  12770. #endif
  12771. float height = shapeUv.y;
  12772. #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)
  12773. height /= u_cylinderUvToShapeUvHeight.x;
  12774. #endif
  12775. float angle = shapeUv.z * czm_twoPi;
  12776. #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
  12777. angle /= u_cylinderUvToShapeUvAngle.x;
  12778. #endif
  12779. return vec3(radius, height, angle);
  12780. }
  12781. `;var jki=T(S(),1),LA=`/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js)
  12782. #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY
  12783. #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY
  12784. #define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE
  12785. #define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED
  12786. #define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE
  12787. */
  12788. uniform vec3 u_ellipsoidRadiiUv; // [0,1]
  12789. uniform vec2 u_evoluteScale; // (radiiUv.x ^ 2 - radiiUv.z ^ 2) * vec2(1.0, -1.0) / radiiUv;
  12790. uniform vec3 u_ellipsoidInverseRadiiSquaredUv;
  12791. #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) || defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED)
  12792. uniform vec3 u_ellipsoidShapeUvLongitudeMinMaxMid;
  12793. #endif
  12794. #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
  12795. uniform vec2 u_ellipsoidUvToShapeUvLongitude; // x = scale, y = offset
  12796. #endif
  12797. #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
  12798. uniform vec2 u_ellipsoidUvToShapeUvLatitude; // x = scale, y = offset
  12799. #endif
  12800. uniform float u_ellipsoidInverseHeightDifferenceUv;
  12801. // robust iterative solution without trig functions
  12802. // https://github.com/0xfaded/ellipse_demo/issues/1
  12803. // https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse
  12804. // Extended to return radius of curvature along with the point
  12805. vec3 nearestPointAndRadiusOnEllipse(vec2 pos, vec2 radii) {
  12806. vec2 p = abs(pos);
  12807. vec2 inverseRadii = 1.0 / radii;
  12808. // We describe the ellipse parametrically: v = radii * vec2(cos(t), sin(t))
  12809. // but store the cos and sin of t in a vec2 for efficiency.
  12810. // Initial guess: t = pi/4
  12811. vec2 tTrigs = vec2(0.7071067811865476);
  12812. // Initial guess of point on ellipsoid
  12813. vec2 v = radii * tTrigs;
  12814. // Center of curvature of the ellipse at v
  12815. vec2 evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs;
  12816. const int iterations = 3;
  12817. for (int i = 0; i < iterations; ++i) {
  12818. // Find the (approximate) intersection of p - evolute with the ellipsoid.
  12819. vec2 q = normalize(p - evolute) * length(v - evolute);
  12820. // Update the estimate of t.
  12821. tTrigs = (q + evolute) * inverseRadii;
  12822. tTrigs = normalize(clamp(tTrigs, 0.0, 1.0));
  12823. v = radii * tTrigs;
  12824. evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs;
  12825. }
  12826. return vec3(v * sign(pos), length(v - evolute));
  12827. }
  12828. PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) {
  12829. // Convert from UV space [0, 1] to local space [-1, 1]
  12830. vec3 position = positionUv * 2.0 - 1.0;
  12831. // Undo the scaling from ellipsoid to sphere
  12832. position = position * u_ellipsoidRadiiUv;
  12833. float longitude = atan(position.y, position.x);
  12834. vec3 east = normalize(vec3(-position.y, position.x, 0.0));
  12835. // Convert the 3D position to a 2D position relative to the ellipse (radii.x, radii.z)
  12836. // (assume radii.y == radii.x) and find the nearest point on the ellipse and its normal
  12837. float distanceFromZAxis = length(position.xy);
  12838. vec2 posEllipse = vec2(distanceFromZAxis, position.z);
  12839. vec3 surfacePointAndRadius = nearestPointAndRadiusOnEllipse(posEllipse, u_ellipsoidRadiiUv.xz);
  12840. vec2 surfacePoint = surfacePointAndRadius.xy;
  12841. vec2 normal2d = normalize(surfacePoint * u_ellipsoidInverseRadiiSquaredUv.xz);
  12842. float latitude = atan(normal2d.y, normal2d.x);
  12843. vec3 north = vec3(-normal2d.y * normalize(position.xy), abs(normal2d.x));
  12844. float heightSign = length(posEllipse) < length(surfacePoint) ? -1.0 : 1.0;
  12845. float height = heightSign * length(posEllipse - surfacePoint);
  12846. vec3 up = normalize(cross(east, north));
  12847. vec3 point = vec3(longitude, latitude, height);
  12848. mat3 jacobianT = mat3(east / distanceFromZAxis, north / (surfacePointAndRadius.z + height), up);
  12849. return PointJacobianT(point, jacobianT);
  12850. }
  12851. vec3 convertShapeToShapeUvSpace(in vec3 positionShape) {
  12852. // Longitude: shift & scale to [0, 1]
  12853. float longitude = (positionShape.x + czm_pi) / czm_twoPi;
  12854. // Correct the angle when max < min
  12855. // Technically this should compare against min longitude - but it has precision problems so compare against the middle of empty space.
  12856. #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED)
  12857. longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z);
  12858. #endif
  12859. // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity.
  12860. #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY)
  12861. longitude = longitude > u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.x : longitude;
  12862. #endif
  12863. #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY)
  12864. longitude = longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.y : longitude;
  12865. #endif
  12866. #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
  12867. longitude = longitude * u_ellipsoidUvToShapeUvLongitude.x + u_ellipsoidUvToShapeUvLongitude.y;
  12868. #endif
  12869. // Latitude: shift and scale to [0, 1]
  12870. float latitude = (positionShape.y + czm_piOverTwo) / czm_pi;
  12871. #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
  12872. latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y;
  12873. #endif
  12874. // Height: scale to the range [0, 1]
  12875. float height = 1.0 + positionShape.z * u_ellipsoidInverseHeightDifferenceUv;
  12876. return vec3(longitude, latitude, height);
  12877. }
  12878. PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) {
  12879. PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv);
  12880. pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point);
  12881. return pointJacobian;
  12882. }
  12883. vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
  12884. // Convert from [0, 1] to radians [-pi, pi]
  12885. float longitude = shapeUv.x * czm_twoPi;
  12886. #if defined (ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
  12887. longitude /= u_ellipsoidUvToShapeUvLongitude.x;
  12888. #endif
  12889. // Convert from [0, 1] to radians [-pi/2, pi/2]
  12890. float latitude = shapeUv.y * czm_pi;
  12891. #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
  12892. latitude /= u_ellipsoidUvToShapeUvLatitude.x;
  12893. #endif
  12894. float height = shapeUv.z / u_ellipsoidInverseHeightDifferenceUv;
  12895. return vec3(longitude, latitude, height);
  12896. }
  12897. `;var $ki=T(S(),1),RA=`// These octree flags must be in sync with GpuOctreeFlag in VoxelTraversal.js
  12898. #define OCTREE_FLAG_INTERNAL 0
  12899. #define OCTREE_FLAG_LEAF 1
  12900. #define OCTREE_FLAG_PACKED_LEAF_FROM_PARENT 2
  12901. #define OCTREE_MAX_LEVELS 32 // Harcoded value because GLSL doesn't like variable length loops
  12902. uniform sampler2D u_octreeInternalNodeTexture;
  12903. uniform vec2 u_octreeInternalNodeTexelSizeUv;
  12904. uniform int u_octreeInternalNodeTilesPerRow;
  12905. #if (SAMPLE_COUNT > 1)
  12906. uniform sampler2D u_octreeLeafNodeTexture;
  12907. uniform vec2 u_octreeLeafNodeTexelSizeUv;
  12908. uniform int u_octreeLeafNodeTilesPerRow;
  12909. #endif
  12910. struct OctreeNodeData {
  12911. int data;
  12912. int flag;
  12913. };
  12914. struct TraversalData {
  12915. ivec4 octreeCoords;
  12916. int parentOctreeIndex;
  12917. };
  12918. struct SampleData {
  12919. int megatextureIndex;
  12920. ivec4 tileCoords;
  12921. vec3 tileUv;
  12922. #if (SAMPLE_COUNT > 1)
  12923. float weight;
  12924. #endif
  12925. };
  12926. // Integer mod: For WebGL1 only
  12927. int intMod(in int a, in int b) {
  12928. return a - (b * (a / b));
  12929. }
  12930. int normU8_toInt(in float value) {
  12931. return int(value * 255.0);
  12932. }
  12933. int normU8x2_toInt(in vec2 value) {
  12934. return int(value.x * 255.0) + 256 * int(value.y * 255.0);
  12935. }
  12936. float normU8x2_toFloat(in vec2 value) {
  12937. return float(normU8x2_toInt(value)) / 65535.0;
  12938. }
  12939. OctreeNodeData getOctreeNodeData(in vec2 octreeUv) {
  12940. vec4 texData = texture(u_octreeInternalNodeTexture, octreeUv);
  12941. OctreeNodeData data;
  12942. data.data = normU8x2_toInt(texData.xy);
  12943. data.flag = normU8x2_toInt(texData.zw);
  12944. return data;
  12945. }
  12946. OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) {
  12947. int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x;
  12948. int octreeCoordX = intMod(parentOctreeIndex, u_octreeInternalNodeTilesPerRow) * 9 + 1 + childIndex;
  12949. int octreeCoordY = parentOctreeIndex / u_octreeInternalNodeTilesPerRow;
  12950. vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5);
  12951. return getOctreeNodeData(octreeUv);
  12952. }
  12953. int getOctreeParentIndex(in int octreeIndex) {
  12954. int octreeCoordX = intMod(octreeIndex, u_octreeInternalNodeTilesPerRow) * 9;
  12955. int octreeCoordY = octreeIndex / u_octreeInternalNodeTilesPerRow;
  12956. vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5);
  12957. vec4 parentData = texture(u_octreeInternalNodeTexture, octreeUv);
  12958. int parentOctreeIndex = normU8x2_toInt(parentData.xy);
  12959. return parentOctreeIndex;
  12960. }
  12961. /**
  12962. * Convert a position in the uv-space of the tileset bounding shape
  12963. * into the uv-space of a tile within the tileset
  12964. */
  12965. vec3 getTileUv(in vec3 shapePosition, in ivec4 octreeCoords) {
  12966. // PERFORMANCE_IDEA: use bit-shifting (only in WebGL2)
  12967. float dimAtLevel = exp2(float(octreeCoords.w));
  12968. return shapePosition * dimAtLevel - vec3(octreeCoords.xyz);
  12969. }
  12970. vec3 getClampedTileUv(in vec3 shapePosition, in ivec4 octreeCoords) {
  12971. vec3 tileUv = getTileUv(shapePosition, octreeCoords);
  12972. return clamp(tileUv, vec3(0.0), vec3(1.0));
  12973. }
  12974. void getOctreeLeafSampleData(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleData) {
  12975. sampleData.megatextureIndex = data.data;
  12976. sampleData.tileCoords = (data.flag == OCTREE_FLAG_PACKED_LEAF_FROM_PARENT)
  12977. ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
  12978. : octreeCoords;
  12979. }
  12980. #if (SAMPLE_COUNT > 1)
  12981. void getOctreeLeafSampleDatas(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleDatas[SAMPLE_COUNT]) {
  12982. int leafIndex = data.data;
  12983. int leafNodeTexelCount = 2;
  12984. // Adding 0.5 moves to the center of the texel
  12985. float leafCoordXStart = float(intMod(leafIndex, u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5;
  12986. float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5;
  12987. // Get an interpolation weight and a flag to determine whether to read the parent texture
  12988. vec2 leafUv0 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 0.0, leafCoordY);
  12989. vec4 leafData0 = texture(u_octreeLeafNodeTexture, leafUv0);
  12990. float lerp = normU8x2_toFloat(leafData0.xy);
  12991. sampleDatas[0].weight = 1.0 - lerp;
  12992. sampleDatas[1].weight = lerp;
  12993. // TODO: this looks wrong? Should be comparing to OCTREE_FLAG_PACKED_LEAF_FROM_PARENT
  12994. sampleDatas[0].tileCoords = (normU8_toInt(leafData0.z) == 1)
  12995. ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
  12996. : octreeCoords;
  12997. sampleDatas[1].tileCoords = (normU8_toInt(leafData0.w) == 1)
  12998. ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
  12999. : octreeCoords;
  13000. // Get megatexture indices for both samples
  13001. vec2 leafUv1 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 1.0, leafCoordY);
  13002. vec4 leafData1 = texture(u_octreeLeafNodeTexture, leafUv1);
  13003. sampleDatas[0].megatextureIndex = normU8x2_toInt(leafData1.xy);
  13004. sampleDatas[1].megatextureIndex = normU8x2_toInt(leafData1.zw);
  13005. }
  13006. #endif
  13007. OctreeNodeData traverseOctreeDownwards(in vec3 shapePosition, inout TraversalData traversalData) {
  13008. float sizeAtLevel = exp2(-1.0 * float(traversalData.octreeCoords.w));
  13009. vec3 start = vec3(traversalData.octreeCoords.xyz) * sizeAtLevel;
  13010. vec3 end = start + vec3(sizeAtLevel);
  13011. OctreeNodeData childData;
  13012. for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
  13013. // Find out which octree child contains the position
  13014. // 0 if before center, 1 if after
  13015. vec3 center = 0.5 * (start + end);
  13016. vec3 childCoord = step(center, shapePosition);
  13017. // Get octree coords for the next level down
  13018. ivec4 octreeCoords = traversalData.octreeCoords;
  13019. traversalData.octreeCoords = ivec4(octreeCoords.xyz * 2 + ivec3(childCoord), octreeCoords.w + 1);
  13020. childData = getOctreeChildData(traversalData.parentOctreeIndex, ivec3(childCoord));
  13021. if (childData.flag != OCTREE_FLAG_INTERNAL) {
  13022. // leaf tile - stop traversing
  13023. break;
  13024. }
  13025. // interior tile - keep going deeper
  13026. start = mix(start, center, childCoord);
  13027. end = mix(center, end, childCoord);
  13028. traversalData.parentOctreeIndex = childData.data;
  13029. }
  13030. return childData;
  13031. }
  13032. /**
  13033. * Transform a given position to an octree tile coordinate and a position within that tile,
  13034. * and find the corresponding megatexture index and texture coordinates
  13035. */
  13036. void traverseOctreeFromBeginning(in vec3 shapePosition, out TraversalData traversalData, out SampleData sampleDatas[SAMPLE_COUNT]) {
  13037. traversalData.octreeCoords = ivec4(0);
  13038. traversalData.parentOctreeIndex = 0;
  13039. OctreeNodeData nodeData = getOctreeNodeData(vec2(0.0));
  13040. if (nodeData.flag != OCTREE_FLAG_LEAF) {
  13041. nodeData = traverseOctreeDownwards(shapePosition, traversalData);
  13042. }
  13043. #if (SAMPLE_COUNT == 1)
  13044. getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
  13045. sampleDatas[0].tileUv = getClampedTileUv(shapePosition, sampleDatas[0].tileCoords);
  13046. #else
  13047. getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
  13048. sampleDatas[0].tileUv = getClampedTileUv(shapePosition, sampleDatas[0].tileCoords);
  13049. sampleDatas[1].tileUv = getClampedTileUv(shapePosition, sampleDatas[1].tileCoords);
  13050. #endif
  13051. }
  13052. bool inRange(in vec3 v, in vec3 minVal, in vec3 maxVal) {
  13053. return clamp(v, minVal, maxVal) == v;
  13054. }
  13055. bool insideTile(in vec3 shapePosition, in ivec4 octreeCoords) {
  13056. vec3 tileUv = getTileUv(shapePosition, octreeCoords);
  13057. bool inside = inRange(tileUv, vec3(0.0), vec3(1.0));
  13058. // Assume (!) the position is always inside the root tile.
  13059. return inside || octreeCoords.w == 0;
  13060. }
  13061. void traverseOctreeFromExisting(in vec3 shapePosition, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) {
  13062. if (insideTile(shapePosition, traversalData.octreeCoords)) {
  13063. for (int i = 0; i < SAMPLE_COUNT; i++) {
  13064. sampleDatas[0].tileUv = getClampedTileUv(shapePosition, sampleDatas[0].tileCoords);
  13065. }
  13066. return;
  13067. }
  13068. // Go up tree until we find a parent tile containing shapePosition
  13069. for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
  13070. traversalData.octreeCoords.xyz /= 2;
  13071. traversalData.octreeCoords.w -= 1;
  13072. if (insideTile(shapePosition, traversalData.octreeCoords)) {
  13073. break;
  13074. }
  13075. traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex);
  13076. }
  13077. // Go down tree
  13078. OctreeNodeData nodeData = traverseOctreeDownwards(shapePosition, traversalData);
  13079. #if (SAMPLE_COUNT == 1)
  13080. getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
  13081. sampleDatas[0].tileUv = getClampedTileUv(shapePosition, sampleDatas[0].tileCoords);
  13082. #else
  13083. getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
  13084. sampleDatas[0].tileUv = getClampedTileUv(shapePosition, sampleDatas[0].tileCoords);
  13085. sampleDatas[1].tileUv = getClampedTileUv(shapePosition, sampleDatas[1].tileCoords);
  13086. #endif
  13087. }
  13088. `;var tUi=T(S(),1),ZA=`// See Octree.glsl for the definitions of SampleData and intMod
  13089. /* Megatexture defines (set in Scene/VoxelRenderResources.js)
  13090. #define SAMPLE_COUNT ###
  13091. #define NEAREST_SAMPLING
  13092. #define PADDING
  13093. */
  13094. uniform ivec2 u_megatextureSliceDimensions; // number of slices per tile, in two dimensions
  13095. uniform ivec2 u_megatextureTileDimensions; // number of tiles per megatexture, in two dimensions
  13096. uniform vec2 u_megatextureVoxelSizeUv;
  13097. uniform vec2 u_megatextureSliceSizeUv;
  13098. uniform vec2 u_megatextureTileSizeUv;
  13099. uniform ivec3 u_dimensions; // does not include padding
  13100. #if defined(PADDING)
  13101. uniform ivec3 u_paddingBefore;
  13102. uniform ivec3 u_paddingAfter;
  13103. #endif
  13104. // Integer min, max, clamp: For WebGL1 only
  13105. int intMin(int a, int b) {
  13106. return a <= b ? a : b;
  13107. }
  13108. int intMax(int a, int b) {
  13109. return a >= b ? a : b;
  13110. }
  13111. int intClamp(int v, int minVal, int maxVal) {
  13112. return intMin(intMax(v, minVal), maxVal);
  13113. }
  13114. vec2 index1DTo2DTexcoord(int index, ivec2 dimensions, vec2 uvScale)
  13115. {
  13116. int indexX = intMod(index, dimensions.x);
  13117. int indexY = index / dimensions.x;
  13118. return vec2(indexX, indexY) * uvScale;
  13119. }
  13120. /*
  13121. How is 3D data stored in a 2D megatexture?
  13122. In this example there is only one loaded tile and it has 2x2x2 voxels (8 voxels total).
  13123. The data is sliced by Z. The data at Z = 0 is placed in texels (0,0), (0,1), (1,0), (1,1) and
  13124. the data at Z = 1 is placed in texels (2,0), (2,1), (3,0), (3,1).
  13125. Note that there could be empty space in the megatexture because it's a power of two.
  13126. 0 1 2 3
  13127. +---+---+---+---+
  13128. | | | | | 3
  13129. +---+---+---+---+
  13130. | | | | | 2
  13131. +-------+-------+
  13132. |010|110|011|111| 1
  13133. |--- ---|--- ---|
  13134. |000|100|001|101| 0
  13135. +-------+-------+
  13136. When doing linear interpolation the megatexture needs to be sampled twice: once for
  13137. the Z slice above the voxel coordinate and once for the slice below. The two slices
  13138. are interpolated with fract(coord.z - 0.5). For example, a Z coordinate of 1.0 is
  13139. halfway between two Z slices so the interpolation factor is 0.5. Below is a side view
  13140. of the 3D voxel grid with voxel coordinates on the left side.
  13141. 2 +---+
  13142. |001|
  13143. 1 +-z-+
  13144. |000|
  13145. 0 +---+
  13146. When doing nearest neighbor the megatexture only needs to be sampled once at the closest Z slice.
  13147. */
  13148. Properties getPropertiesFromMegatexture(in SampleData sampleData) {
  13149. int tileIndex = sampleData.megatextureIndex;
  13150. vec3 voxelCoord = sampleData.tileUv * vec3(u_dimensions);
  13151. ivec3 voxelDimensions = u_dimensions;
  13152. #if defined(PADDING)
  13153. voxelDimensions += u_paddingBefore + u_paddingAfter;
  13154. voxelCoord += vec3(u_paddingBefore);
  13155. #endif
  13156. #if defined(NEAREST_SAMPLING)
  13157. // Round to the center of the nearest voxel
  13158. voxelCoord = floor(voxelCoord) + vec3(0.5);
  13159. #endif
  13160. // Tile location
  13161. vec2 tileUvOffset = index1DTo2DTexcoord(tileIndex, u_megatextureTileDimensions, u_megatextureTileSizeUv);
  13162. // Slice location
  13163. float slice = voxelCoord.z - 0.5;
  13164. int sliceIndex = int(floor(slice));
  13165. int sliceIndex0 = intClamp(sliceIndex, 0, voxelDimensions.z - 1);
  13166. vec2 sliceUvOffset0 = index1DTo2DTexcoord(sliceIndex0, u_megatextureSliceDimensions, u_megatextureSliceSizeUv);
  13167. // Voxel location
  13168. vec2 voxelUvOffset = clamp(voxelCoord.xy, vec2(0.5), vec2(voxelDimensions.xy) - vec2(0.5)) * u_megatextureVoxelSizeUv;
  13169. // Final location in the megatexture
  13170. vec2 uv0 = tileUvOffset + sliceUvOffset0 + voxelUvOffset;
  13171. #if defined(NEAREST_SAMPLING)
  13172. return getPropertiesFromMegatextureAtUv(uv0);
  13173. #else
  13174. float sliceLerp = fract(slice);
  13175. int sliceIndex1 = intMin(sliceIndex + 1, voxelDimensions.z - 1);
  13176. vec2 sliceUvOffset1 = index1DTo2DTexcoord(sliceIndex1, u_megatextureSliceDimensions, u_megatextureSliceSizeUv);
  13177. vec2 uv1 = tileUvOffset + sliceUvOffset1 + voxelUvOffset;
  13178. Properties properties0 = getPropertiesFromMegatextureAtUv(uv0);
  13179. Properties properties1 = getPropertiesFromMegatextureAtUv(uv1);
  13180. return mixProperties(properties0, properties1, sliceLerp);
  13181. #endif
  13182. }
  13183. // Convert an array of sample datas to a final weighted properties.
  13184. Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) {
  13185. #if (SAMPLE_COUNT == 1)
  13186. return getPropertiesFromMegatexture(sampleDatas[0]);
  13187. #else
  13188. // When more than one sample is taken the accumulator needs to start at 0
  13189. Properties properties = clearProperties();
  13190. for (int i = 0; i < SAMPLE_COUNT; ++i) {
  13191. float weight = sampleDatas[i].weight;
  13192. // Avoid reading the megatexture when the weight is 0 as it can be costly.
  13193. if (weight > 0.0) {
  13194. Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]);
  13195. tempProperties = scaleProperties(tempProperties, weight);
  13196. properties = sumProperties(properties, tempProperties);
  13197. }
  13198. }
  13199. return properties;
  13200. #endif
  13201. }
  13202. `;function Qbt(e){let t=new px;this.shaderBuilder=t;let n=e._customShader,i=Tt(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let p in o)if(o.hasOwnProperty(p)){let g=o[p];t.addUniform(g.type,p,ge.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",ge.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=l(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s,t.addVertexLines([bA]),t.addFragmentLines([n.fragmentShaderText,"#line 0",RA,fA,gA,ZA]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,ge.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,ge.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,ge.FRAGMENT),t.addFragmentLines([xA])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,ge.FRAGMENT),t.addFragmentLines([yA]));let a=e._provider.shape;a==="BOX"?t.addFragmentLines([CA,_A,HT]):a==="CYLINDER"?t.addFragmentLines([VA,nL,TA,HT]):a==="ELLIPSOID"&&(t.addDefine("SHAPE_ELLIPSOID",void 0,ge.FRAGMENT),t.addFragmentLines([LA,nL,SA,HT])),t.addFragmentLines([pA]);let c=e._shape,d=c.shaderDefines;for(let p in d)if(d.hasOwnProperty(p)){let g=d[p];l(g)&&(g=g===!0?void 0:g,t.addDefine(p,g,ge.FRAGMENT))}let u=c.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",u,ge.FRAGMENT),s===1?u+=1:r.unionClippingRegions?u+=2:u+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",u,ge.FRAGMENT),u+=1),t.addDefine("INTERSECTION_COUNT",u,ge.FRAGMENT),(!h.equals(e.paddingBefore,h.ZERO)||!h.equals(e.paddingAfter,h.ZERO))&&t.addDefine("PADDING",void 0,ge.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,ge.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,ge.FRAGMENT);let m=e._traversal;t.addDefine("SAMPLE_COUNT",`${m._sampleCount}`,ge.FRAGMENT)}var GA=Qbt;var EUi=T(S(),1);function jbt(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,c=o.length,d=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,ge.FRAGMENT),d&&n.addDefine("STATISTICS",void 0,ge.FRAGMENT);for(let P=0;P<c;P++){let w=i[P],F=o[P],b=`PropertyStatistics_${w}`,R=`PropertyStatistics_${w}`;n.addStruct(b,R,ge.FRAGMENT);let E=IB(F);n.addStructField(b,E,"min"),n.addStructField(b,E,"max")}let u="Statistics",m="Statistics",p="statistics";n.addStruct(u,m,ge.FRAGMENT);for(let P=0;P<c;P++){let w=i[P],F=`PropertyStatistics_${w}`,b=w;n.addStructField(u,F,b)}let g="Metadata",f="Metadata",x="metadata";n.addStruct(g,f,ge.FRAGMENT),n.addStructField(g,m,p);for(let P=0;P<c;P++){let w=i[P],F=o[P],b=IB(F);n.addStructField(g,b,w)}for(let P=0;P<c;P++){let w=i[P],F=o[P],b=$bt(F),R=`VoxelProperty_${w}`,E=`VoxelProperty_${w}`;n.addStruct(R,E,ge.FRAGMENT),n.addStructField(R,b,"partialDerivativeLocal"),n.addStructField(R,b,"partialDerivativeWorld"),n.addStructField(R,b,"partialDerivativeView"),n.addStructField(R,b,"partialDerivativeValid")}let _="Voxel",C="Voxel",V="voxel";n.addStruct(_,C,ge.FRAGMENT);for(let P=0;P<c;P++){let w=i[P],F=`VoxelProperty_${w}`;n.addStructField(_,F,w)}n.addStructField(_,"vec3","positionEC"),n.addStructField(_,"vec3","positionUv"),n.addStructField(_,"vec3","positionShapeUv"),n.addStructField(_,"vec3","positionUvLocal"),n.addStructField(_,"vec3","viewDirUv"),n.addStructField(_,"vec3","viewDirWorld"),n.addStructField(_,"vec3","surfaceNormal"),n.addStructField(_,"float","travelDistance"),n.addStructField(_,"int","stepCount"),n.addStructField(_,"int","tileIndex"),n.addStructField(_,"int","sampleIndex");let L="FragmentInput";n.addStruct(L,"FragmentInput",ge.FRAGMENT),n.addStructField(L,f,x),n.addStructField(L,C,V);let G="Properties",I="Properties",v="properties";n.addStruct(G,I,ge.FRAGMENT);for(let P=0;P<c;P++){let w=i[P],F=o[P],b=IB(F);n.addStructField(G,b,w)}{let P="clearProperties";n.addFunction(P,`${I} clearProperties()`,ge.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let w=0;w<c;w++){let F=i[w],b=o[w],R=r[w],E=IB(b,R);n.addFunctionLines(P,[`${v}.${F} = ${E}(0.0);`])}n.addFunctionLines(P,[`return ${v};`])}{let P="sumProperties";n.addFunction(P,`${I} sumProperties(${I} propertiesA, ${I} propertiesB)`,ge.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let w=0;w<c;w++){let F=i[w];n.addFunctionLines(P,[`${v}.${F} = propertiesA.${F} + propertiesB.${F};`])}n.addFunctionLines(P,[`return ${v};`])}{let P="scaleProperties";n.addFunction(P,`${I} scaleProperties(${I} ${v}, float scale)`,ge.FRAGMENT),n.addFunctionLines(P,[`${I} scaledProperties = ${v};`]);for(let w=0;w<c;w++){let F=i[w];n.addFunctionLines(P,[`scaledProperties.${F} *= scale;`])}n.addFunctionLines(P,["return scaledProperties;"])}{let P="mixProperties";n.addFunction(P,`${I} mixProperties(${I} propertiesA, ${I} propertiesB, float mixFactor)`,ge.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let w=0;w<c;w++){let F=i[w];n.addFunctionLines(P,[`${v}.${F} = mix(propertiesA.${F}, propertiesB.${F}, mixFactor);`])}n.addFunctionLines(P,[`return ${v};`])}{let P="copyPropertiesToMetadata";n.addFunction(P,`void copyPropertiesToMetadata(in ${I} ${v}, inout ${f} ${x})`,ge.FRAGMENT);for(let w=0;w<c;w++){let F=i[w];n.addFunctionLines(P,[`${x}.${F} = ${v}.${F};`])}}if(d){let P="setStatistics";n.addFunction(P,`void setStatistics(inout ${m} ${p})`,ge.FRAGMENT);for(let w=0;w<c;w++){let F=i[w],b=o[w],R=Rt.getComponentCount(b);for(let E=0;E<R;E++){let X=e0t(b,E),A=s[w][E],N=a[w][E];n.addFunctionLines(P,[`${p}.${F}.min${X} = ${q_e(A)};`,`${p}.${F}.max${X} = ${q_e(N)};`])}}}{let P="getPropertiesFromMegatextureAtUv";n.addFunction(P,`${I} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,ge.FRAGMENT),n.addFunctionLines(P,[`${I} ${v};`]);for(let w=0;w<c;w++){let F=i[w],b=o[w],R=r[w],E=qbt(b,R);n.addFunctionLines(P,[`properties.${F} = texture(u_megatextureTextures[${w}], texcoord)${E};`])}n.addFunctionLines(P,[`return ${v};`])}}function IB(e){if(e===Rt.SCALAR)return"float";if(e===Rt.VEC2)return"vec2";if(e===Rt.VEC3)return"vec3";if(e===Rt.VEC4)return"vec4"}function qbt(e){if(e===Rt.SCALAR)return".r";if(e===Rt.VEC2)return".ra";if(e===Rt.VEC3)return".rgb";if(e===Rt.VEC4)return""}function $bt(e){if(e===Rt.SCALAR)return"vec3";if(e===Rt.VEC2)return"mat2";if(e===Rt.VEC3)return"mat3";if(e===Rt.VEC4)return"mat4"}function q_e(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function e0t(e,t){return e===Rt.SCALAR?"":`[${t}]`}var EA=jbt;function t0t(e,t){let n=new GA(e);EA(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r}=n;if(r>0){let C="getClippingPlane",V=qb(o,t),L=0,Z=V.indexOf(")")+1,G=V.indexOf("{",Z)+1,I=V.indexOf("}",G),v=V.slice(L,Z),P=V.slice(G,I);i.addFunction(C,v,ge.FRAGMENT),i.addFunctionLines(C,[P])}let s=i.clone();s.addDefine("PICKING",void 0,ge.FRAGMENT);let a=i.clone();a.addDefine("PICKING_VOXEL",void 0,ge.FRAGMENT);let c=i.buildShaderProgram(t),d=s.buildShaderProgram(t),u=a.buildShaderProgram(t),m=Ue.fromCache({cull:{enabled:!0,face:yi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND}),p=t.getViewportQuadVertexArray(),g=e._depthTest,f=new tt({vertexArray:p,primitiveType:Fe.TRIANGLES,renderState:m,shaderProgram:c,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Ge.VOXELS,executeInClosestFrustum:!0,owner:this,cull:g,occlude:g}),x=tt.shallowClone(f,new tt);x.shaderProgram=d,x.pickOnly=!0;let _=tt.shallowClone(f,new tt);if(_.shaderProgram=u,_.pickOnly=!0,l(e._drawCommand)){let C=e._drawCommand;C.shaderProgram=C.shaderProgram&&C.shaderProgram.destroy()}if(l(e._drawCommandPick)){let C=e._drawCommandPick;C.shaderProgram=C.shaderProgram&&C.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let C=e._drawCommandPickVoxel;C.shaderProgram=C.shaderProgram&&C.shaderProgram.destroy()}e._drawCommand=f,e._drawCommandPick=x,e._drawCommandPickVoxel=_}var IA=t0t;var LDi=T(S(),1);var jUi=T(S(),1);function ql(){this.orientedBoundingBox=new En,this.boundingSphere=new ce,this.boundTransform=new M,this.shapeTransform=new M,this._minBounds=h.clone(ql.DefaultMinBounds,new h),this._maxBounds=h.clone(ql.DefaultMaxBounds,new h),this.shaderUniforms={renderMinBounds:new h,renderMaxBounds:new h,boxUvToShapeUvScale:new h,boxUvToShapeUvTranslate:new h},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var n0t=new h,b8=new h,i0t=new $,o0t=new h,r0t=new h,s0t=new h,a0t=new h,$_e=M.fromRotationTranslation($.fromUniformScale(.5,new $),new h(.5,.5,.5),new M);ql.prototype.update=function(e,t,n,i,o){i=y(i,ql.DefaultMinBounds),o=y(o,ql.DefaultMaxBounds);let r=ql.DefaultMinBounds,s=ql.DefaultMaxBounds;t=this._minBounds=h.clamp(t,r,s,this._minBounds),n=this._maxBounds=h.clamp(n,r,s,this._maxBounds),i=h.clamp(i,r,s,o0t),o=h.clamp(o,r,s,r0t);let a=h.clamp(t,i,o,s0t),c=h.clamp(n,i,o,a0t),d=M.getScale(e,b8);if(a.x>c.x||a.y>c.y||a.z>c.z||(a.x===c.x)+(a.y===c.y)+(a.z===c.z)>=2||i.x>o.x||i.y>o.y||i.z>o.z||d.x===0||d.y===0||d.z===0)return!1;this.shapeTransform=M.clone(e,this.shapeTransform),this.orientedBoundingBox=y8(a,c,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=M.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ce.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:u,shaderDefines:m}=this;for(let f in m)m.hasOwnProperty(f)&&(m[f]=void 0);let p=!h.equals(t,r)||!h.equals(n,s),g=0;if(m.BOX_INTERSECTION_INDEX=g,g+=1,u.renderMinBounds=M.multiplyByPoint($_e,a,u.renderMinBounds),u.renderMaxBounds=M.multiplyByPoint($_e,c,u.renderMaxBounds),p){m.BOX_HAS_SHAPE_BOUNDS=!0;let f=t,x=n;u.boxUvToShapeUvScale=h.fromElements(2/(f.x===x.x?1:x.x-f.x),2/(f.y===x.y?1:x.y-f.y),2/(f.z===x.z?1:x.z-f.z),u.boxUvToShapeUvScale),u.boxUvToShapeUvTranslate=h.fromElements(-u.boxUvToShapeUvScale.x*(f.x*.5+.5),-u.boxUvToShapeUvScale.y*(f.y*.5+.5),-u.boxUvToShapeUvScale.z*(f.z*.5+.5),u.boxUvToShapeUvTranslate)}return this.shaderMaximumIntersectionsLength=g,!0};var XB=new h,g8=new h;ql.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(W.lerp(r.x,s.x,a*t),W.lerp(r.y,s.y,a*n),W.lerp(r.z,s.z,a*i),XB),d=h.fromElements(W.lerp(r.x,s.x,a*(t+1)),W.lerp(r.y,s.y,a*(n+1)),W.lerp(r.z,s.z,a*(i+1)),g8);return y8(c,d,this.shapeTransform,o)};var eTe=new h;ql.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,eTe),s=h.multiplyByScalar(r,o,eTe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,XB),o,XB),c=h.add(a,s,g8),d=this._minBounds,u=this._maxBounds,m=h.fromElements(W.lerp(d.x,u.x,a.x),W.lerp(d.y,u.y,a.y),W.lerp(d.z,u.z,a.z),XB),p=h.fromElements(W.lerp(d.x,u.x,c.x),W.lerp(d.y,u.y,c.y),W.lerp(d.z,u.z,c.z),g8);return y8(m,p,this.shapeTransform,i)};ql.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));ql.DefaultMaxBounds=Object.freeze(new h(1,1,1));function y8(e,t,n,i){let o=ql.DefaultMinBounds,r=ql.DefaultMaxBounds;if(h.equals(e,o)&&h.equals(t,r))i.center=M.getTranslation(n,i.center),i.halfAxes=M.getMatrix3(n,i.halfAxes);else{let a=M.getScale(n,b8),c=h.midpoint(e,t,n0t);i.center=M.multiplyByPoint(n,c,i.center),a=h.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),b8);let d=M.getRotation(n,i0t);i.halfAxes=$.setScale(d,a,i.halfAxes)}return i}var qf=ql;var cDi=T(S(),1);function is(){this.orientedBoundingBox=new En,this.boundingSphere=new ce,this.boundTransform=new M,this.shapeTransform=new M,this._minimumRadius=is.DefaultMinBounds.x,this._maximumRadius=is.DefaultMaxBounds.x,this._minimumHeight=is.DefaultMinBounds.y,this._maximumHeight=is.DefaultMaxBounds.y,this._minimumAngle=is.DefaultMinBounds.z,this._maximumAngle=is.DefaultMaxBounds.z,this.shaderUniforms={cylinderRenderHeightMinMax:new D,cylinderRenderRadiusMinMax:new D,cylinderRenderAngleMinMax:new D,cylinderUvToShapeUvRadius:new D,cylinderUvToShapeUvHeight:new D,cylinderUvToShapeUvAngle:new D,cylinderShapeUvAngleMinMax:new D,cylinderShapeUvAngleRangeZeroMid:0},this.shaderDefines={CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this.shaderMaximumIntersectionsLength=0}var oTe=new h;is.prototype.update=function(e,t,n,i,o){i=y(i,is.DefaultMinBounds),o=y(o,is.DefaultMaxBounds);let r=is.DefaultMinBounds.x,s=is.DefaultMaxBounds.x,a=is.DefaultMinBounds.y,c=is.DefaultMaxBounds.y,d=is.DefaultMinBounds.z,u=is.DefaultMaxBounds.z,m=u-d,p=.5*m,g=W.EPSILON10,f=W.EPSILON3,x=W.EPSILON10,_=W.clamp(t.x,r,s),C=W.clamp(n.x,r,s),V=W.clamp(i.x,r,s),L=W.clamp(o.x,r,s),Z=Math.max(_,V),G=Math.min(C,L),I=W.clamp(t.y,a,c),v=W.clamp(n.y,a,c),P=W.clamp(i.y,a,c),w=W.clamp(o.y,a,c),F=Math.max(I,P),b=Math.min(v,w),R=W.negativePiToPi(t.z),E=W.negativePiToPi(n.z),X=W.negativePiToPi(i.z),A=W.negativePiToPi(o.z),N=Math.max(R,X),O=Math.min(E,A),U=M.getScale(e,oTe);if(G===0||Z>G||F>b||W.equalsEpsilon(U.x,0,void 0,g)||W.equalsEpsilon(U.y,0,void 0,g)||W.equalsEpsilon(U.z,0,void 0,g))return!1;this._minimumRadius=_,this._maximumRadius=C,this._minimumHeight=I,this._maximumHeight=v,this._minimumAngle=R,this._maximumAngle=E,this.shapeTransform=M.clone(e,this.shapeTransform),this.orientedBoundingBox=_8(Z,G,F,b,N,O,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=M.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ce.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let H=_===r&&C===s,J=I===a&&v===c,te=E<R,z=E-R+te*m,q=z>p+x&&z<m-x,ee=z<p-x,fe=z>=p-x&&z<=p+x,_e=q||ee||fe,le=W.equalsEpsilon(R,d,void 0,f),ye=W.equalsEpsilon(E,u,void 0,f),Te=Z===r,Xe=O<N,Le=O-N+Xe*m,ke=Le>=p-x&&Le<m-x,Oe=Le>x&&Le<p-x,at=Le<=x,Mt=ke||Oe||at,{shaderUniforms:Lt,shaderDefines:Ie}=this;for(let et in Ie)Ie.hasOwnProperty(et)&&(Ie[et]=void 0);let je=0;if(Ie.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=je,je+=1,Te||(Ie.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,Ie.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=je,je+=1),Lt.cylinderRenderRadiusMinMax=D.fromElements(Z,G,Lt.cylinderRenderRadiusMinMax),Z===G&&(Ie.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),!H){Ie.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let et=C-_,He=0,Dt=1;et!==0&&(He=1/et,Dt=-_/et),Lt.cylinderUvToShapeUvRadius=D.fromElements(He,Dt,Lt.cylinderUvToShapeUvRadius)}if(!J){Ie.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let et=v-I,He=0,Dt=1;et!==0&&(He=2/et,Dt=-(I+1)/et),Lt.cylinderUvToShapeUvHeight=D.fromElements(He,Dt,Lt.cylinderUvToShapeUvHeight)}if(Lt.cylinderRenderHeightMinMax=D.fromElements(F,b,Lt.cylinderRenderHeightMinMax),te&&(Ie.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),Mt&&(Ie.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,Ie.CYLINDER_INTERSECTION_INDEX_ANGLE=je,ke?(Ie.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,je+=1):Oe?(Ie.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,je+=2):at&&(Ie.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,je+=2),Lt.cylinderRenderAngleMinMax=D.fromElements(N,O,Lt.cylinderRenderAngleMinMax)),_e){Ie.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,le&&(Ie.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),ye&&(Ie.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let et=(R-d)/m,He=(E-d)/m,Dt=1-z/m;if(Lt.cylinderShapeUvAngleMinMax=D.fromElements(et,He,Lt.cylinderShapeUvAngleMinMax),Lt.cylinderShapeUvAngleRangeZeroMid=(He+.5*Dt)%1,z<=x)Lt.cylinderUvToShapeUvAngle=D.fromElements(0,1,Lt.cylinderUvToShapeUvAngle);else{let Ce=m/z,Ve=-(R-d)/z;Lt.cylinderUvToShapeUvAngle=D.fromElements(Ce,Ve,Lt.cylinderUvToShapeUvAngle)}}return this.shaderMaximumIntersectionsLength=je,!0};is.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minimumRadius,s=this._maximumRadius,a=this._minimumHeight,c=this._maximumHeight,d=this._minimumAngle,u=this._maximumAngle,m=1/Math.pow(2,e),p=W.lerp(r,s,t*m),g=W.lerp(r,s,(t+1)*m),f=W.lerp(a,c,n*m),x=W.lerp(a,c,(n+1)*m),_=W.lerp(d,u,i*m),C=W.lerp(d,u,(i+1)*m);return _8(p,g,f,x,_,C,this.shapeTransform,o)};var tTe=new h,nTe=new h,c0t=new h;is.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,tTe),s=h.multiplyByScalar(r,o,tTe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,nTe),o,nTe),c=h.add(a,s,c0t),d=this._minimumRadius,u=this._maximumRadius,m=this._minimumHeight,p=this._maximumHeight,g=this._minimumAngle,f=this._maximumAngle,x=W.lerp(d,u,a.x),_=W.lerp(d,u,c.x),C=W.lerp(m,p,a.y),V=W.lerp(m,p,c.y),L=W.lerp(g,f,a.z),Z=W.lerp(g,f,c.z);return _8(x,_,C,V,L,Z,this.shapeTransform,i)};is.DefaultMinBounds=Object.freeze(new h(0,-1,-W.PI));is.DefaultMaxBounds=Object.freeze(new h(1,1,+W.PI));var l0t=5,d0t=new Array(l0t),u0t=new h,m0t=new $,h0t=new M,f0t=new M,p0t=new M,x8=new M,b0t=new h,g0t=new h,y0t=new h,rTe=new Array(8);for(let e=0;e<8;e++)rTe[e]=new h;function iTe(e,t,n){return Math.abs(se.dot(e,t))<n}function x0t(e){let t=M.getColumn(e,0,b0t),n=M.getColumn(e,1,g0t),i=M.getColumn(e,2,y0t),o=W.EPSILON4;return iTe(t,n,o)&&iTe(n,i,o)}function _0t(e,t){let n=rTe;h.fromElements(-.5,-.5,-.5,n[0]),h.fromElements(-.5,-.5,.5,n[1]),h.fromElements(-.5,.5,-.5,n[2]),h.fromElements(-.5,.5,.5,n[3]),h.fromElements(.5,-.5,-.5,n[4]),h.fromElements(.5,-.5,.5,n[5]),h.fromElements(.5,.5,-.5,n[6]),h.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)M.multiplyByPoint(e,n[i],n[i]);return En.fromPoints(n,t)}function _8(e,t,n,i,o,r,s,a){let c=is.DefaultMinBounds,d=is.DefaultMaxBounds,u=c.x,m=d.x,p=c.y,g=d.y,f=c.z,x=d.z;if(e===u&&t===m&&n===p&&i===g&&o===f&&r===x)return a.center=M.getTranslation(s,a.center),a.halfAxes=M.getMatrix3(s,a.halfAxes),a;r<o&&(r+=W.TWO_PI);let C=r-o,V=o+C*.5,L=d0t,Z=0;L[Z++]=o,L[Z++]=r,L[Z++]=V,C>W.PI&&(L[Z++]=V-W.PI_OVER_TWO,L[Z++]=V+W.PI_OVER_TWO);let G=1,I=1,v=-1,P=-1;for(let te=0;te<Z;++te){let z=L[te]-V,q=Math.cos(z),ee=Math.sin(z),fe=q*e,_e=ee*e,le=q*t,ye=ee*t;G=Math.min(G,fe),I=Math.min(I,_e),G=Math.min(G,le),I=Math.min(I,ye),v=Math.max(v,fe),P=Math.max(P,_e),v=Math.max(v,le),P=Math.max(P,ye)}let w=v-G,F=P-I,b=i-n,R=(G+v)*.5,E=(I+P)*.5,X=(n+i)*.5,A=h.fromElements(R,E,X,u0t),N=$.fromRotationZ(V,m0t),O=h.fromElements(w,F,b,oTe),U=M.fromScale(O,p0t),Y=M.fromRotation(N,f0t),k=M.fromTranslation(A,h0t),H=M.multiplyTransformation(Y,M.multiplyTransformation(k,U,x8),x8),J=M.multiplyTransformation(s,H,x8);return x0t(J)?En.fromTransformation(J,a):_0t(J,a)}var $f=is;var _Di=T(S(),1);function h0(){this.orientedBoundingBox=new En,this.boundingSphere=new ce,this.boundTransform=new M,this.shapeTransform=new M,this._rectangle=new ae,this._minimumHeight=h0.DefaultMinBounds.z,this._maximumHeight=h0.DefaultMaxBounds.z,this._ellipsoid=new ne,this._translation=new h,this._rotation=new $,this.shaderUniforms={ellipsoidRadiiUv:new h,eccentricitySquared:0,evoluteScale:new D,ellipsoidInverseRadiiSquaredUv:new h,ellipsoidRenderLongitudeMinMax:new D,ellipsoidShapeUvLongitudeMinMaxMid:new h,ellipsoidUvToShapeUvLongitude:new D,ellipsoidUvToShapeUvLatitude:new D,ellipsoidRenderLatitudeSinMinMax:new D,ellipsoidInverseHeightDifferenceUv:0,clipMinMaxHeight:new D},this.shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this.shaderMaximumIntersectionsLength=0}var T0t=new h,S0t=new h,C0t=new h,V0t=new h,L0t=new h,R0t=new h,Z0t=new h,G0t=new h,E0t=new $,sTe=new h,aTe=new h,I0t=new ae;h0.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=h0;i=y(i,r),o=y(o,s);let a=W.EPSILON10,c=W.EPSILON3,d=W.EPSILON10,u=W.EPSILON10,m=W.EPSILON3,p=M.getScale(e,G0t),g=h.clone(r,T0t);g.z=-h.minimumComponent(p);let f=h.clamp(t,g,s,S0t),x=h.clamp(n,g,s,C0t),_=h.clamp(i,g,s,V0t),C=h.clamp(o,g,s,L0t),V=h.maximumByComponent(f,_,R0t),L=h.minimumByComponent(x,C,Z0t),Z=h.add(p,h.fromElements(x.z,x.z,x.z,sTe),sTe),G=h.maximumComponent(Z),I=h.add(p,h.fromElements(L.z,L.z,L.z,aTe),aTe);if(V.y>L.y||V.y===s.y||L.y===r.y||V.z>L.z||W.equalsEpsilon(I,h.ZERO,void 0,a))return!1;this._rectangle=ae.fromRadians(f.x,f.y,x.x,x.y),this._translation=M.getTranslation(e,this._translation),this._rotation=M.getRotation(e,this._rotation),this._ellipsoid=ne.fromCartesian3(p,this._ellipsoid),this._minimumHeight=f.z,this._maximumHeight=x.z;let v=ae.fromRadians(V.x,V.y,L.x,L.y,I0t);this.orientedBoundingBox=T8(v,V.z,L.z,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=M.fromRotationTranslation($.setScale(this._rotation,Z,E0t),this._translation,this.shapeTransform),this.boundTransform=M.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=ce.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let P=s.x-r.x,w=.5*P,F=L.x<V.x,b=L.x-V.x+F*P,R=b<=d,E=b>=w-d&&b<P-d,X=b>d&&b<w-d,A=R||E||X,N=x.x<f.x,O=x.x-f.x+N*P,U=O>w+d&&O<P-d,Y=O>=w-d&&O<=w+d,k=O<w-d,H=U||Y||k,J=L.y<-m,te=L.y>=-m&&L.y<=+m,z=L.y>+m&&L.y<s.y-u,q=J||te||z,ee=V.y>r.y+u&&V.y<-m,fe=V.y>=-m&&V.y<=+m,_e=V.y>+m,le=ee||fe||_e,ye=q||le,Te=x.y-f.y,Xe=x.y<-m,Le=x.y>=-m&&x.y<=+m,ke=x.y>+m&&x.y<s.y-u,Oe=Xe||Le||ke,at=f.y>r.y+u&&f.y<-m,Mt=f.y>=-m&&f.y<=+m,Lt=f.y>+m,je=Oe||(at||Mt||Lt),{shaderUniforms:et,shaderDefines:He}=this;for(let mt in He)He.hasOwnProperty(mt)&&(He[mt]=void 0);et.ellipsoidRadiiUv=h.divideByScalar(Z,G,et.ellipsoidRadiiUv);let{x:Dt,z:Ce}=et.ellipsoidRadiiUv,Ve=Ce/Dt;et.eccentricitySquared=1-Ve*Ve,et.evoluteScale=D.fromElements((Dt*Dt-Ce*Ce)/Dt,(Ce*Ce-Dt*Dt)/Ce,et.evoluteScale),et.ellipsoidInverseRadiiSquaredUv=h.divideComponents(h.ONE,h.multiplyComponents(et.ellipsoidRadiiUv,et.ellipsoidRadiiUv,et.ellipsoidInverseRadiiSquaredUv),et.ellipsoidInverseRadiiSquaredUv);let ct=0;He.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=ct,ct+=1,He.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=ct,ct+=1,et.clipMinMaxHeight=D.fromElements((V.z-x.z)/G,(L.z-x.z)/G,et.clipMinMaxHeight);let Di=(x.z-f.z)/G;if(et.ellipsoidInverseHeightDifferenceUv=1/Di,f.z===x.z&&(et.ellipsoidInverseHeightDifferenceUv=0),A&&(He.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,He.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=ct,E?(He.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,ct+=1):X?(He.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,ct+=2):R&&(He.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,ct+=2),et.ellipsoidRenderLongitudeMinMax=D.fromElements(V.x,L.x,et.ellipsoidRenderLongitudeMinMax)),H)if(He.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,x.x<f.x&&(He.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),O<=d)et.ellipsoidUvToShapeUvLongitude=D.fromElements(0,1,et.ellipsoidUvToShapeUvLongitude);else{let _o=P/O,fr=-(f.x-r.x)/O;et.ellipsoidUvToShapeUvLongitude=D.fromElements(_o,fr,et.ellipsoidUvToShapeUvLongitude)}if(A){let mt=W.equalsEpsilon(V.x,r.x,void 0,c),_o=W.equalsEpsilon(L.x,s.x,void 0,c);mt&&(He.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),_o&&(He.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let fr=(f.x-r.x)/P,Zc=(x.x-r.x)/P,Zr=(L.x-r.x)/P,ss=1-b/P,Ne=(Zr+.5*ss)%1;et.ellipsoidShapeUvLongitudeMinMaxMid=h.fromElements(fr,Zc,Ne,et.ellipsoidShapeUvLongitudeMinMaxMid)}if(ye&&(le&&(He.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,He.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=ct,ee?(He.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,ct+=1):fe?(He.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,ct+=1):_e&&(He.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,ct+=2)),q&&(He.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,He.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=ct,J?(He.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,ct+=2):te?(He.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,ct+=1):z&&(He.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,ct+=1)),et.ellipsoidRenderLatitudeSinMinMax=D.fromElements(Math.sin(V.y),Math.sin(L.y),et.ellipsoidRenderLatitudeSinMinMax)),je)if(He.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,Te<u)et.ellipsoidUvToShapeUvLatitude=D.fromElements(0,1,et.ellipsoidUvToShapeUvLatitude);else{let _o=(s.y-r.y)/Te,fr=(r.y-f.y)/Te;et.ellipsoidUvToShapeUvLatitude=D.fromElements(_o,fr,et.ellipsoidUvToShapeUvLatitude)}return this.shaderMaximumIntersectionsLength=ct,!0};var dTe=new ae;h0.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,c=n*r,d=(n+1)*r,u=i*r,m=(i+1)*r,p=ae.subsection(this._rectangle,s,c,a,d,dTe),g=W.lerp(this._minimumHeight,this._maximumHeight,u),f=W.lerp(this._minimumHeight,this._maximumHeight,m);return T8(p,g,f,this._ellipsoid,this._translation,this._rotation,o)};var cTe=new h,lTe=new h,X0t=new h;h0.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,cTe),s=h.multiplyByScalar(r,o,cTe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,lTe),o,lTe),c=h.add(a,s,X0t),d=ae.subsection(this._rectangle,a.x,a.y,c.x,c.y,dTe),u=W.lerp(this._minimumHeight,this._maximumHeight,a.z),m=W.lerp(this._minimumHeight,this._maximumHeight,c.z);return T8(d,u,m,this._ellipsoid,this._translation,this._rotation,i)};function T8(e,t,n,i,o,r,s){return s=En.fromRectangle(e,t,n,i,s),s.center=h.add(s.center,o,s.center),s.halfAxes=$.multiply(s.halfAxes,r,s.halfAxes),s}h0.DefaultMinBounds=Object.freeze(new h(-W.PI,-W.PI_OVER_TWO,-ne.WGS84.minimumRadius));h0.DefaultMaxBounds=Object.freeze(new h(W.PI,W.PI_OVER_TWO,10*ne.WGS84.maximumRadius));var zT=h0;var $d={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};$d.getMinBounds=function(e){switch(e){case $d.BOX:return qf.DefaultMinBounds;case $d.ELLIPSOID:return zT.DefaultMinBounds;case $d.CYLINDER:return $f.DefaultMinBounds}};$d.getMaxBounds=function(e){switch(e){case $d.BOX:return qf.DefaultMaxBounds;case $d.ELLIPSOID:return zT.DefaultMaxBounds;case $d.CYLINDER:return $f.DefaultMaxBounds}};$d.getShapeConstructor=function(e){switch(e){case $d.BOX:return qf;case $d.ELLIPSOID:return zT;case $d.CYLINDER:return $f}};var vi=Object.freeze($d);var RBi=T(S(),1);var EDi=T(S(),1);function Ih(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Ih.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(l(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});Ih.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new Ih({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};Ih.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(l(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};Ih.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)uTe(this,t)};Ih.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let o=this._array[0];if(this._comparator(e,o)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,uTe(this,i),t};Ih.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],mTe(this,0)),this._array[e-1]=void 0,t};Ih.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=S8(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&mTe(this,n)}return this._array[e-1]=void 0,t};Ih.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Ih.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[S8(this,1,2)?1:2]};function WB(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function XA(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function S8(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function uTe(e,t){if(t===0)return;let n=Math.floor(W.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=XA(e,t,i);for(o!==n&&(WB(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(XA(e,t,r)!==o)break;WB(e,t,r),t=r}}function mTe(e,t){let n=e._length,i=Math.floor(W.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,s=o+1;if(s<n){XA(e,s,r)===i&&(r=s);let a=2*o+1,c=Math.max(Math.min(n-a,4),0);for(let d=0;d<c;d++){let u=a+d;XA(e,u,r)===i&&(r=u)}}if(XA(e,r,t)===i&&(WB(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);S8(e,r,a)===i&&WB(e,r,a)}t=r}}var KT=Ih;var XDi=T(S(),1),hTe=Object.freeze({UNLOADED:0,RECEIVING:1,RECEIVED:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function PB(e,t){this.spatialNode=e,this.keyframe=t,this.state=hTe.UNLOADED,this.metadata=[],this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}PB.priorityComparator=function(e,t){return e.priority-t.priority};PB.searchComparator=function(e,t){return e.keyframe-t.keyframe};PB.LoadState=hTe;var ji=PB;var jDi=T(S(),1);function Zy(e,t,n,i,o){i===Ht.UNSIGNED_SHORT&&(i=Ht.FLOAT32);let r=e.floatingPointTexture;if(i===Ht.FLOAT32&&!r)throw new de("Floating point texture not supported");let s;i===Ht.FLOAT32||i===Ht.FLOAT64?s=qe.FLOAT:i===Ht.UINT8&&(s=qe.UNSIGNED_BYTE);let a;n===1?a=e.webgl2?ot.RED:ot.LUMINANCE:n===2?a=e.webgl2?ot.RG:ot.LUMINANCE_ALPHA:n===3?a=ot.RGB:n===4&&(a=ot.RGBA);let c=512*1024*1024,d=128*1024*1024;o=Math.min(y(o,d),c);let u=Bt.maximumTextureSize,m=Ht.getSizeInBytes(i),p=Math.floor(o/(n*m)),g=Math.min(u,W.previousPowerOfTwo(Math.floor(Math.sqrt(p)))),f=Math.ceil(Math.sqrt(t.x)),x=Math.ceil(t.z/f),_=f*t.x,C=x*t.y,V=Math.floor(g/_),L=Math.floor(g/C);if(V===0||L===0)throw new de("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.voxelCountPerTile=h.clone(t,new h),this.maximumTileCount=V*L,this.regionCountPerMegatexture=new D(V,L),this.voxelCountPerRegion=new D(_,C),this.sliceCountPerRegion=new D(f,x),this.voxelSizeUv=new D(1/g,1/g),this.sliceSizeUv=new D(t.x/g,t.y/g),this.regionSizeUv=new D(_/g,C/g),this.texture=new Pt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:g,height:g,sampler:new en({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:$t.LINEAR,magnificationFilter:hi.LINEAR})});let Z=Ht.toComponentDatatype(i);this.tileVoxelDataTemp=Q.createTypedArray(Z,_*C*n),this.nodes=new Array(this.maximumTileCount);for(let G=0;G<this.maximumTileCount;G++)this.nodes[G]=new W0t(G);for(let G=0;G<this.maximumTileCount;G++){let I=this.nodes[G];I.previousNode=G>0?this.nodes[G-1]:void 0,I.nextNode=G<this.maximumTileCount-1?this.nodes[G+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function W0t(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}Zy.prototype.add=function(e){if(this.isFull())throw new pe("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,l(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,l(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};Zy.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new pe("Megatexture index out of bounds");let t=this.nodes[e];l(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),l(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,l(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};Zy.prototype.isFull=function(){return this.emptyList===void 0};Zy.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===Ht.UNSIGNED_SHORT&&(i=Ht.FLOAT32);let o=Ht.getSizeInBytes(i),r=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.x)),a=Math.ceil(t.z/s),c=s*t.x,d=a*t.y,u=W.previousPowerOfTwo(Math.floor(Math.sqrt(r)));for(;;){let p=Math.floor(u/c),g=Math.floor(u/d);if(p*g>=e)break;u*=2}return u*u*n*o};Zy.prototype.writeDataToTexture=function(e,t){let n=t.constructor===Uint16Array?new Float32Array(t):t,i=this.voxelCountPerTile,o=this.sliceCountPerRegion,r=this.voxelCountPerRegion,s=this.channelCount,a=this.tileVoxelDataTemp;for(let x=0;x<i.z;x++){let _=x%o.x*i.x,C=Math.floor(x/o.x)*i.y;for(let V=0;V<i.y;V++)for(let L=0;L<i.x;L++){let Z=x*i.y*i.x+V*i.x+L,G=(C+V)*r.x+(_+L);for(let I=0;I<s;I++)a[G*s+I]=n[Z*s+I]}}let c=this.regionCountPerMegatexture,d=r.x,u=r.y,m=e%c.x*r.x,p=Math.floor(e/c.x)*r.y,f={source:{arrayBufferView:a,width:d,height:u},xOffset:m,yOffset:p};this.texture.copyFrom(f)};Zy.prototype.isDestroyed=function(){return!1};Zy.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),me(this)};var iL=Zy;var aBi=T(S(),1);function lm(e,t,n,i,o,r,s){this.children=void 0,this.parent=o,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=h.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new En,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var P0t=new h;lm.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,P0t),n=2*h.maximumComponent(t);this.approximateVoxelSize=n/h.minimumComponent(this.dimensions)};lm.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,s=i*2,a=o*2,c=s+1,d=r+1,u=a+1,m=t+1,p=[[m,r,s,a],[m,d,s,a],[m,r,c,a],[m,d,c,a],[m,r,s,u],[m,d,s,u],[m,r,c,u],[m,d,c,u]];this.children=p.map(([g,f,x,_])=>new lm(g,f,x,_,this,e,this.dimensions))};lm.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};lm.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,W.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var fTe={keyframe:0};function WA(e,t){return fTe.keyframe=e,Eo(t,fTe,ji.searchComparator)}lm.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:m}=t;if(m.length>=1){let p=v0t(i,m),g=m[p],f=o===i||i<g.keyframe?p:Math.min(p+1,m.length-1),x=m[f],_=i-g.keyframe,C=pTe(n-t.level,_);C<a&&(a=C,r=g);let V=x.keyframe-o,L=pTe(n-t.level,V);if(L<c&&(c=L,s=x),_===0&&V===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!l(r)||!l(s))return;let d=r.keyframe,u=s.keyframe;this.renderableKeyframeNodeLerp=d===u?0:W.clamp((e-d)/(u-d),0,1)};function v0t(e,t){let n=WA(e,t);return n<0?W.clamp(~n-1,0,t.length-1):n}function pTe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}lm.prototype.isVisited=function(e){return this.visitedFrameNumber===e};lm.prototype.createKeyframeNode=function(e){let t=WA(e,this.keyframeNodes);if(t<0){t=~t;let n=new ji(this,e);this.keyframeNodes.splice(t,0,n)}};lm.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=WA(n,this.keyframeNodes);if(i<0)throw new pe("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let r=0;r<t.length;r++)t[r].remove(e.megatextureIndex);let o=WA(n,this.renderableKeyframeNodes);if(o<0)throw new pe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.spatialNode=void 0,e.state=ji.LoadState.UNLOADED,e.metadata={},e.megatextureIndex=-1,e.priority=-Number.MAX_VALUE,e.highPriorityFrameNumber=-1};lm.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.state!==ji.LoadState.RECEIVED||e.megatextureIndex!==-1||e.metadata.length!==t.length)throw new pe("Keyframe node cannot be added to megatexture");for(let o=0;o<t.length;o++){let r=t[o];e.megatextureIndex=r.add(e.metadata[o])}e.state=ji.LoadState.LOADED;let n=this.renderableKeyframeNodes,i=WA(e.keyframe,n);if(i>=0)throw new pe("Keyframe already renderable");i=~i,n.splice(i,0,e)};lm.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return l(t)&&l(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var PA=lm;function f0(e,t,n,i,o,r,s){this._primitive=e,this.megatextures=new Array(i.length);for(let f=0;f<i.length;f++){let x=i[f],_=Rt.getComponentCount(x),C=o[f];this.megatextures[f]=new iL(t,n,_,C,s)}let a=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._frameNumber=0;let c=e._shape;this.rootNode=new PA(0,0,0,0,void 0,c,n),this._priorityQueue=new KT({maximumLength:a,comparator:ji.priorityComparator}),this._highPriorityKeyframeNodes=new Array(a),this._keyframeNodesInMegatexture=new Array(a),this._keyframeCount=r,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(r);let d=this._binaryTreeKeyframeWeighting;d[0]=0,d[r-1]=0,C8(d,1,r-2,0);let u=9,m=2048,p=Math.floor(m/u),g=Math.ceil(a/p);this.internalNodeTexture=new Pt({context:t,pixelFormat:ot.RGBA,pixelDatatype:qe.UNSIGNED_BYTE,flipY:!1,width:m,height:g,sampler:new en({minificationFilter:$t.NEAREST,magnificationFilter:hi.NEAREST})}),this.internalNodeTilesPerRow=p,this.internalNodeTexelSizeUv=new D(1/m,1/g),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new D}f0.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function C8(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,C8(e,t,o-1,i+1),C8(e,o+1,n,i+1)}f0.simultaneousRequestCountMaximum=50;f0.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=o._levelBlendFactor,d=c>0,u=a>1,m=(d?2:1)*(u?2:1);this._sampleCount=m;let p=m>=2;if(p&&!l(this.leafNodeTexture)){let V=Math.floor(512),L=Math.ceil(s/V);this.leafNodeTexture=new Pt({context:r,pixelFormat:ot.RGBA,pixelDatatype:qe.UNSIGNED_BYTE,flipY:!1,width:1024,height:L,sampler:new en({minificationFilter:$t.NEAREST,magnificationFilter:hi.NEAREST})}),this.leafNodeTexelSizeUv=D.fromElements(1/1024,1/L,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=V}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=W.clamp(t,0,a-1),n&&bTe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=_i();A0t(this,e);let f=_i();k0t(this,m,c);let x=_i();if(this._debugPrint){let _=f-g,C=x-f,V=x-g;N0t(this,_,C,V)}};f0.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};f0.prototype.isDestroyed=function(){return!1};f0.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),me(this)};function bTe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];bTe(e,i)}}function w0t(e,t){if(e._simultaneousRequestCount>=f0.simultaneousRequestCountMaximum)return;let n=e._primitive._provider;function i(c){e._simultaneousRequestCount--;let d=n.types.length;if(!l(c))t.state=ji.LoadState.UNAVAILABLE;else if(c===ji.LoadState.FAILED)t.state=ji.LoadState.FAILED;else if(!Array.isArray(c)||c.length!==d)t.state=ji.LoadState.FAILED;else{let u=e.megatextures;for(let m=0;m<d;m++){let{voxelCountPerTile:p,channelCount:g}=u[m],{x:f,y:x,z:_}=p,C=f*x*_,V=c[m],L=C*g;if(V.length===L)t.metadata[m]=V,t.state=ji.LoadState.RECEIVED;else{t.state=ji.LoadState.FAILED;break}}}}function o(){e._simultaneousRequestCount--,t.state=ji.LoadState.FAILED}let{keyframe:r,spatialNode:s}=t,a=n.requestData({tileLevel:s.level,tileX:s.x,tileY:s.y,tileZ:s.z,keyframe:r});l(a)?(e._simultaneousRequestCount++,t.state=ji.LoadState.RECEIVING,a.then(i).catch(o)):t.state=ji.LoadState.FAILED}function F0t(e){return e/(1+e)}function A0t(e,t){let n=e._frameNumber,i=e._primitive,o=i._shape,r=i.screenSpaceError,s=e._priorityQueue,a=e._keyframeCount,c=W.clamp(Math.floor(e._keyframeLocation),0,a-2),d=c+1,{camera:u,context:m,pixelRatio:p}=t,{positionWC:g,frustum:f}=u,_=m.drawingBufferHeight/p/f.sseDenominator;function C(F,b){if(F.computeScreenSpaceError(g,_),b=F.visibility(t,b),b===ms.MASK_OUTSIDE)return;if(F.visitedFrameNumber=n,a===1)F.createKeyframeNode(0);else if(F.keyframeNodes.length!==a)for(let N=0;N<a;N++)F.createKeyframeNode(N);let{screenSpaceError:R,keyframeNodes:E}=F,X=F0t(R),A=!1;for(let N=0;N<E.length;N++){let O=E[N];O.priority=10*X+M0t(c,O.keyframe,d,e),O.state!==ji.LoadState.UNAVAILABLE&&O.state!==ji.LoadState.FAILED&&O.priority!==-Number.MAX_VALUE&&s.insert(O),O.state===ji.LoadState.LOADED&&(A=!0)}if(R<r||!A){F.children=void 0;return}l(F.children)||F.constructChildNodes(o);for(let N=0;N<8;N++){let O=F.children[N];C(O,b)}}s.reset(),C(e.rootNode,ms.MASK_INDETERMINATE);let V=e._highPriorityKeyframeNodes,L=0,Z;for(;s.length>0;)Z=s.removeMaximum(),Z.highPriorityFrameNumber=n,V[L]=Z,L++;let G=e._keyframeNodesInMegatexture,I=e.megatextures[0],v=I.occupiedCount;G.length=v,G.sort(function(F,b){return F.highPriorityFrameNumber===b.highPriorityFrameNumber?b.priority-F.priority:b.highPriorityFrameNumber-F.highPriorityFrameNumber});let P=0,w=0;for(let F=0;F<L;F++)if(Z=V[F],!(Z.state===ji.LoadState.LOADED||Z.spatialNode===void 0)&&(Z.state===ji.LoadState.UNLOADED&&w0t(e,Z),Z.state===ji.LoadState.RECEIVED)){let b=0;if(I.isFull()){b=v-1-P,P++;let R=G[b];R.spatialNode.destroyKeyframeNode(R,e.megatextures)}else b=v+w,w++;Z.spatialNode.addKeyframeNodeToMegatextures(Z,e.megatextures),G[b]=Z}}function M0t(e,t,n,i){let o=Math.min(Math.abs(t-e),Math.abs(t-n)),r=Math.max(e,i._keyframeCount-n-1,1),s=Math.pow(1-o/r,4),a=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return W.lerp(a,s,.15+.85*s)}function N0t(e,t,n,i){let o=e._keyframeCount,r=e.rootNode,s=Object.keys(ji.LoadState).length,a=new Array(s),c=new Array(s),d=0;for(let C=0;C<s;C++){let V=new Array(o);a[C]=V;for(let L=0;L<o;L++)V[L]=0;c[C]=0}function u(C){let V=C.keyframeNodes;for(let L=0;L<V.length;L++){let Z=V[L],G=Z.keyframe,I=Z.state;a[I][G]+=1,c[I]+=1,d++}if(l(C.children))for(let L=0;L<8;L++){let Z=C.children[L];u(Z)}}u(r);let m=`KEYFRAMES: ${a[ji.LoadState.LOADED]}`,p=`UNLOADED: ${c[ji.LoadState.UNLOADED]} | RECEIVING: ${c[ji.LoadState.RECEIVING]} | RECEIVED: ${c[ji.LoadState.RECEIVED]} | LOADED: ${c[ji.LoadState.LOADED]} | FAILED: ${c[ji.LoadState.FAILED]} | UNAVAILABLE: ${c[ji.LoadState.UNAVAILABLE]} | TOTAL: ${d}`,g=Math.round(t*100)/100,f=Math.round(n*100)/100,x=Math.round(i*100)/100,_=`LOAD: ${g} | OCT: ${f} | ALL: ${x}`;console.log(`${m} || ${p} || ${_}`)}var vB={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function k0t(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,c=0,d=[],u=[];function m(g,f,x,_,C){let V=!1;if(l(g.children))for(let L=0;L<8;L++){let Z=g.children[L];Z.computeSurroundingRenderableKeyframeNodes(o),Z.isRenderable(r)&&(V=!0)}if(V){d[C]=vB.INTERNAL<<16|f,d[x]=_,a++,_=f,C=_*9+1;for(let L=0;L<8;L++){let Z=g.children[L];f=a,x=f*9+0,m(Z,f,x,_,C+L)}}else{if(s){let L=c*5,Z=g.renderableKeyframeNodePrevious,G=g.level-Z.spatialNode.level,I=Z.spatialNode.parent,v=l(I)?I.renderableKeyframeNodePrevious:Z,P=U0t(g,i,n),w=G,F=1,b=Z.megatextureIndex,R=v.megatextureIndex;u[L+0]=P,u[L+1]=w,u[L+2]=F,u[L+3]=b,u[L+4]=R,d[C]=vB.LEAF<<16|c}else{let L=g.renderableKeyframeNodePrevious,G=g.level-L.spatialNode.level===0?vB.LEAF:vB.PACKED_LEAF_FROM_PARENT;d[C]=G<<16|L.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&m(p,0,0,0,0),D0t(d,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&B0t(u,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function U0t(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,o=e.parent.screenSpaceError,s=((t-i)/(o-i)+n-1)/n;return W.clamp(s,0,1)}function D0t(e,t,n,i){let o=ot.componentsLength(i.pixelFormat),r=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(r,n)),a=Math.max(1,Math.ceil(r/n)),c=new Uint8Array(s*a*o);for(let m=0;m<e.length;m++){let p=e[m],g=m*o;for(let f=0;f<o;f++)c[g+f]=p>>>f*8&255}let u={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(u)}function B0t(e,t,n,i){let o=ot.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),d=new Uint8Array(a*c*o);for(let p=0;p<s;p++){let g=e[p*r+0],f=e[p*r+1],x=e[p*r+2],_=e[p*r+3],C=e[p*r+4],V=W.clamp(Math.floor(65536*g),0,65535);d[p*8+0]=V>>>0&255,d[p*8+1]=V>>>8&255,d[p*8+2]=f&255,d[p*8+3]=x&255,d[p*8+4]=_>>>0&255,d[p*8+5]=_>>>8&255,d[p*8+6]=C>>>0&255,d[p*8+7]=C>>>8&255}let m={source:{arrayBufferView:d,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(m)}f0.getApproximateTextureMemoryByteLength=function(e,t,n,i){let o=0,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=i[s],d=Rt.getComponentCount(a);o+=iL.getApproximateTextureMemoryByteLength(e,t,d,c)}return o};var oL=f0;var jBi=T(S(),1);var GBi=T(S(),1),O0t={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},rL=Object.freeze(O0t);var UBi=T(S(),1);var IBi=T(S(),1);function Y0t(e,t,n){let i=new Uint8ClampedArray(e.buffer),o=new ImageData(i,t,n),r=document.createElement("canvas");return r.width=t,r.height=n,r.getContext("2d").putImageData(o,0,0),r}var vA=Y0t;function sL(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}sL.prototype.getTexture=function(e){return this._textures[e]};function H0t(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}sL.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):H0t(this,e,t)};function z0t(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?wB(o,r,n):K0t(o,r,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function wB(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?yTe(e,n):new Pt({context:n,source:t,sampler:o});return gTe(o)&&r.generateMipmap(),r}function K0t(e,t,n){let{typedArray:i,sampler:o}=e,r=gTe(o),s=o.wrapS===Cn.REPEAT||o.wrapS===Cn.MIRRORED_REPEAT||o.wrapT===Cn.REPEAT||o.wrapT===Cn.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,d=[a,c].every(W.isPowerOfTwo);if((r||s)&&!d)if(l(i)){if(e.pixelDatatype===qe.UNSIGNED_BYTE){let m=vA(i,a,c),p=og(m);return wB({sampler:o},p,n)}}else{let m=og(t);return wB(e,m,n)}else return wB(e,t,n);return r?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),yTe(e,n)}function gTe(e){return[$t.NEAREST_MIPMAP_NEAREST,$t.NEAREST_MIPMAP_LINEAR,$t.LINEAR_MIPMAP_NEAREST,$t.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function yTe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new Pt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}sL.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let o=n[i];z0t(this,o,t)}n.length=0};sL.prototype.isDestroyed=function(){return!1};sL.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return me(this)};var wA=sL;function FA(e){e=y(e,y.EMPTY_OBJECT),this.mode=y(e.mode,cb.MODIFY_MATERIAL),this.lightingModel=e.lightingModel,this.uniforms=y(e.uniforms,y.EMPTY_OBJECT),this.varyings=y(e.varyings,y.EMPTY_OBJECT),this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=y(e.translucencyMode,Tg.INHERIT),this._textureManager=new wA,this._defaultTexture=void 0,this.uniformMap=J0t(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},q0t(this),$0t(this)}function J0t(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===rL.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=Q0t(e,i)):n[i]=j0t(e,i)}return n}function Q0t(e,t){return function(){return y(e._textureManager.getTexture(t),e._defaultTexture)}}function j0t(e,t){return function(){return e.uniforms[t].value}}function JT(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function q0t(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,o,r=e.vertexShaderText;l(r)&&(o=e.usedVariablesVertex.attributeSet,JT(r,t,o),o=e.usedVariablesVertex.featureIdSet,JT(r,n,o),o=e.usedVariablesVertex.metadataSet,JT(r,i,o));let s=e.fragmentShaderText;if(l(s)){o=e.usedVariablesFragment.attributeSet,JT(s,t,o),o=e.usedVariablesFragment.featureIdSet,JT(s,n,o),o=e.usedVariablesFragment.metadataSet,JT(s,i,o);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;JT(s,a,c)}}function xTe(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function Vc(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${xTe(t)} is not available in the ${i} shader. Did you mean ${xTe(n)} instead?`;throw new pe(o)}}function $0t(e){let t=e.usedVariablesVertex.attributeSet;Vc(t,"position","positionMC","vertex"),Vc(t,"normal","normalMC","vertex"),Vc(t,"tangent","tangentMC","vertex"),Vc(t,"bitangent","bitangentMC","vertex"),Vc(t,"positionWC","positionMC","vertex"),Vc(t,"positionEC","positionMC","vertex"),Vc(t,"normalEC","normalMC","vertex"),Vc(t,"tangentEC","tangentMC","vertex"),Vc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;Vc(n,"position","positionEC","fragment"),Vc(n,"normal","normalEC","fragment"),Vc(n,"tangent","tangentEC","fragment"),Vc(n,"bitangent","bitangentEC","fragment"),Vc(n,"normalMC","normalEC","fragment"),Vc(n,"tangentMC","tangentEC","fragment"),Vc(n,"bitangentMC","bitangentEC","fragment")}FA.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===rL.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};FA.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};FA.prototype.isDestroyed=function(){return!1};FA.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),me(this)};var QT=FA;function ep(e){e=y(e,y.EMPTY_OBJECT),this._ready=!1,this._provider=y(e.provider,ep.DefaultProvider),this._traversal=void 0,this._shape=void 0,this._shapeVisible=!1,this._paddingBefore=new h,this._paddingAfter=new h,this._minBounds=new h,this._minBoundsOld=new h,this._maxBounds=new h,this._maxBoundsOld=new h,this._exaggeratedMinBounds=new h,this._exaggeratedMinBoundsOld=new h,this._exaggeratedMaxBounds=new h,this._exaggeratedMaxBoundsOld=new h,this._minClippingBounds=new h,this._minClippingBoundsOld=new h,this._maxClippingBounds=new h,this._maxClippingBoundsOld=new h,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this._exaggeratedModelMatrix=M.clone(this._modelMatrix),this._compoundModelMatrix=new M,this._compoundModelMatrixOld=new M,this._customShader=y(e.customShader,ep.DefaultCustomShader),this._customShaderCompilationEvent=new be,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new M,this._transformPositionUvToWorld=new M,this._transformDirectionWorldToLocal=new $,this._transformNormalLocalToWorld=new $,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new Jm,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new D,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new D,megatextureTextures:[],megatextureSliceDimensions:new D,megatextureTileDimensions:new D,megatextureVoxelSizeUv:new D,megatextureSliceSizeUv:new D,megatextureTileSizeUv:new D,dimensions:new h,paddingBefore:new h,paddingAfter:new h,transformPositionViewToUv:new M,transformPositionUvToView:new M,transformDirectionViewToLocal:new $,transformNormalLocalToWorld:new $,cameraPositionUv:new h,ndcSpaceAxisAlignedBoundingBox:new se,clippingPlanesTexture:void 0,clippingPlanesMatrix:new M,stepSize:0,pickColor:new B},this._shapeDefinesOld={},this._uniformMap={};let t=this._uniforms,n=this._uniformMap;for(let o in t)if(t.hasOwnProperty(o)){let r=`u_${o}`;n[r]=function(){return t[o]}}let i=this._provider;egt(this,i)}function egt(e,t){let{shape:n,minBounds:i=vi.getMinBounds(n),maxBounds:o=vi.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=vi.getMinBounds(n),e.maxClippingBounds=vi.getMaxBounds(n),e._exaggeratedMinBounds=h.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=h.clone(e._maxBounds,e._exaggeratedMaxBounds),e._exaggeratedModelMatrix=M.clone(e._modelMatrix,e._exaggeratedModelMatrix),TTe(e,t);let r=vi.getShapeConstructor(n);e._shape=new r,e._shapeVisible=STe(e,e._shape,t)}Object.defineProperties(ep.prototype,{ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this._shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=M.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._provider.dimensions}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=W.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=h.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=h.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=h.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=h.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){hs.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(this._customShader!==e){let t=this._uniformMap,i=this._customShader.uniformMap;for(let o in i)i.hasOwnProperty(o)&&delete t[o];l(e)?this._customShader=e:this._customShader=ep.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}}});var tgt=new h,ngt=new se,igt=new se,ogt=new h,rgt=new h,sgt=new $,agt=new $,cgt=new M,lgt=new M,dgt=new M,ugt=M.fromRotationTranslation($.fromUniformScale(.5,new $),new h(.5,.5,.5),new M),mgt=M.fromRotationTranslation($.fromUniformScale(2,new $),new h(-1,-1,-1),new M);ep.prototype.update=function(e){let t=this._provider;this._customShader.update(e);let n=e.context;if(!this._ready){ygt(this,t,n),e.afterRender.push(()=>(this._ready=!0,!0));return}bgt(this,e);let i=TTe(this,t),o=this._shape;if(i&&(this._shapeVisible=STe(this,o,t),Tgt(this,o)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let r=Sgt(t.timeIntervalCollection,this._clock),s=this._traversal,a=s._sampleCount;if(s.update(e,r,i,this._disableUpdate),a!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&Igt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),Cgt(this,e)&&(this._shaderDirty=!0);let d=s.leafNodeTexture,u=this._uniforms;l(d)&&(u.octreeLeafNodeTexture=s.leafNodeTexture,u.octreeLeafNodeTexelSizeUv=D.clone(s.leafNodeTexelSizeUv,u.octreeLeafNodeTexelSizeUv),u.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(IA(this,n),this._shaderDirty=!1);let m=n.uniformState.viewProjection,p=o.orientedBoundingBox,g=Rgt(p,m,igt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;u.ndcSpaceAxisAlignedBoundingBox=se.clone(g,u.ndcSpaceAxisAlignedBoundingBox);let x=n.uniformState.inverseView;u.transformPositionViewToUv=M.multiplyTransformation(this._transformPositionWorldToUv,x,u.transformPositionViewToUv);let _=n.uniformState.view;u.transformPositionUvToView=M.multiplyTransformation(_,this._transformPositionUvToWorld,u.transformPositionUvToView);let C=n.uniformState.inverseViewRotation;u.transformDirectionViewToLocal=$.multiply(this._transformDirectionWorldToLocal,C,u.transformDirectionViewToLocal),u.transformNormalLocalToWorld=$.clone(this._transformNormalLocalToWorld,u.transformNormalLocalToWorld);let V=e.camera.positionWC;u.cameraPositionUv=M.multiplyByPoint(this._transformPositionWorldToUv,V,u.cameraPositionUv),u.stepSize=this._stepSizeMultiplier;let L=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;L.boundingVolume=o.boundingSphere,e.commandList.push(L)};var hgt=new h,V8=new h,fgt=new he,pgt=new h;function bgt(e,t){if(e._exaggeratedMinBounds=h.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=h.clone(e._maxBounds,e._exaggeratedMaxBounds),e.shape===vi.ELLIPSOID){let n=t.verticalExaggerationRelativeHeight,i=t.verticalExaggeration;e._exaggeratedMinBounds.z=(e._minBounds.z-n)*i+n,e._exaggeratedMaxBounds.z=(e._maxBounds.z-n)*i+n}else if(e.shape===vi.BOX){let n=h.fromElements(1,1,t.verticalExaggeration,hgt);e._exaggeratedModelMatrix=M.multiplyByScale(e._modelMatrix,n,e._exaggeratedModelMatrix),e._exaggeratedModelMatrix=M.multiplyByTranslation(e._exaggeratedModelMatrix,ggt(e,t),e._exaggeratedModelMatrix)}}function ggt(e,t){let{shapeTransform:n=M.IDENTITY,globalTransform:i=M.IDENTITY}=e._provider,o=M.getTranslation(n,V8),r=M.multiplyByPoint(e._modelMatrix,o,V8),s=M.multiplyByPoint(i,r,V8),c=ne.WGS84.cartesianToCartographic(s,fgt),d=0;l(c)&&(d=c.height);let u=_r.getHeight(d,t.verticalExaggeration,t.verticalExaggerationRelativeHeight);return h.fromElements(0,0,(u-d)/t.verticalExaggeration,pgt)}function ygt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=B.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=Ye(o,!0);let s=e._uniformMap;for(let a in r)if(r.hasOwnProperty(a)){let c=`u_${a}`;s[c]=function(){return r[a]}}i.dimensions=h.clone(t.dimensions,i.dimensions),e._paddingBefore=h.clone(y(t.paddingBefore,h.ZERO),e._paddingBefore),i.paddingBefore=h.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=h.clone(y(t.paddingAfter,h.ZERO),e._paddingBefore),i.paddingAfter=h.clone(e._paddingAfter,i.paddingAfter),e._traversal=xgt(e,t,n),_gt(e._traversal,i)}function TTe(e,t){let n=y(t.shapeTransform,M.IDENTITY),i=y(t.globalTransform,M.IDENTITY);return M.multiplyTransformation(i,e._exaggeratedModelMatrix,e._compoundModelMatrix),M.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),jT(e,"_compoundModelMatrix","_compoundModelMatrixOld")+jT(e,"_minBounds","_minBoundsOld")+jT(e,"_maxBounds","_maxBoundsOld")+jT(e,"_exaggeratedMinBounds","_exaggeratedMinBoundsOld")+jT(e,"_exaggeratedMaxBounds","_exaggeratedMaxBoundsOld")+jT(e,"_minClippingBounds","_minClippingBoundsOld")+jT(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function jT(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}function STe(e,t,n){if(!t.update(e._compoundModelMatrix,e._exaggeratedMinBounds,e._exaggeratedMaxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let o=t.shapeTransform,r=M.inverse(o,cgt),s=M.getRotation(o,sgt),a=M.getScale(o,ogt),c=h.maximumComponent(a),d=h.divideByScalar(a,c,rgt),u=$.multiplyByScale(s,d,agt);return e._transformPositionWorldToUv=M.multiplyTransformation(ugt,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=M.multiplyTransformation(o,mgt,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=M.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=$.inverseTranspose(u,e._transformNormalLocalToWorld),!0}function xgt(e,t,n){let i=h.clone(t.dimensions,tgt);h.add(i,e._paddingBefore,i),h.add(i,e._paddingAfter,i);let o=t.maximumTileCount,r=l(o)?oL.getApproximateTextureMemoryByteLength(o,i,t.types,t.componentTypes):void 0,s=y(t.keyframeCount,1);return new oL(e,n,i,t.types,t.componentTypes,s,r)}function _gt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=D.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let n=e.megatextures,i=n[0],o=n.length;t.megatextureTextures=new Array(o);for(let r=0;r<o;r++)t.megatextureTextures[r]=n[r].texture;t.megatextureSliceDimensions=D.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=D.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=D.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=D.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=D.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function Tgt(e,t){let n=t.shaderDefines,i=Object.keys(n).some(o=>n[o]!==e._shapeDefinesOld[o]);return i&&(e._shapeDefinesOld=Ye(n,!0)),i}function Sgt(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,o=e.indexOf(n);o>=0?i=e.get(o):(o=~o,o===e.length?(o=e.length-1,i=e.get(o),n=i.stop):(i=e.get(o),n=i.start));let r=j.secondsDifference(i.stop,i.start),a=j.secondsDifference(n,i.start)/r;return o+a}function Cgt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:o}=n;if(o){let r=e._uniforms;r.clippingPlanesTexture=n.texture,r.clippingPlanesMatrix=M.transpose(M.multiplyTransformation(M.inverse(n.modelMatrix,r.clippingPlanesMatrix),e._transformPositionUvToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}ep.prototype.isDestroyed=function(){return!1};ep.prototype.destroy=function(){let e=this._drawCommand;l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return l(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),me(this)};var _Te=new Array(new se(-1,-1,-1,1),new se(1,-1,-1,1),new se(-1,1,-1,1),new se(1,1,-1,1),new se(-1,-1,1,1),new se(1,-1,1,1),new se(-1,1,1,1),new se(1,1,1,1)),Vgt=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),Lgt=new Array(new se,new se,new se,new se,new se,new se,new se,new se);function Rgt(e,t,n){let i=M.fromRotationTranslation(e.halfAxes,e.center,lgt),o=M.multiply(t,i,dgt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,d,u=Lgt,m=_Te.length;for(d=0;d<m;d++)M.multiplyByVector(o,_Te[d],u[d]);for(d=0;d<m;d++){let p=u[d];if(p.z>=-p.w){let g=p.x/p.w,f=p.y/p.w;r=Math.min(r,g),s=Math.max(s,g),a=Math.min(a,f),c=Math.max(c,f)}else for(let g=0;g<3;g++){let f=Vgt[d*3+g],x=u[f];if(x.z>=-x.w){let _=p.z+p.w,C=x.z+x.w,V=_/(_-C),L=se.lerp(p,x,V,ngt),Z=L.x/L.w,G=L.y/L.w;r=Math.min(r,Z),s=Math.max(s,Z),a=Math.min(a,G),c=Math.max(c,G)}}}return r=W.clamp(r,-1,1),a=W.clamp(a,-1,1),s=W.clamp(s,-1,1),c=W.clamp(c,-1,1),n=se.fromElements(r,a,s,c,n),n}var L8=3e7,Zgt=new h(L8,0,0),Ggt=new h(0,L8,0),Egt=new h(0,0,L8);function Igt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,d,u,m){i.add({positions:[c,d],width:m,material:Oi.fromType("Color",{color:u})})}function r(c,d,u){let m=c.computeCorners();o(m[0],m[1],d,u),o(m[2],m[3],d,u),o(m[4],m[5],d,u),o(m[6],m[7],d,u),o(m[0],m[2],d,u),o(m[4],m[6],d,u),o(m[1],m[3],d,u),o(m[5],m[7],d,u),o(m[0],m[4],d,u),o(m[2],m[6],d,u),o(m[1],m[5],d,u),o(m[3],m[7],d,u)}function s(c){if(!n.isRenderable(c))return;let d=c.level,m=Math.max(1,5/Math.pow(2,d)),g=[B.RED,B.LIME,B.BLUE][d%3];if(r(c.orientedBoundingBox,g,m),l(c.children))for(let f=0;f<8;f++)s(c.children[f])}r(e._shape.orientedBoundingBox,B.WHITE,5),s(n.rootNode);let a=10;o(h.ZERO,Zgt,B.RED,a),o(h.ZERO,Ggt,B.LIME,a),o(h.ZERO,Egt,B.BLUE,a),i.update(t)}ep.DefaultCustomShader=new QT({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)
  13203. {
  13204. material.diffuse = vec3(1.0);
  13205. material.alpha = 1.0;
  13206. }`});function CTe(){this.ready=!0,this.shape=vi.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[Rt.SCALAR],this.componentTypes=[Ht.FLOAT32],this.maximumTileCount=1}CTe.prototype.requestData=function(e){if(!((l(e)?y(e.tileLevel,0):0)>=1))return Promise.resolve([new Float32Array(1)])};ep.DefaultProvider=new CTe;var Gy=ep;var Z3i=T(S(),1);function Xgt(e,t,n,i){if(!l(e)||l(t)&&e.id!==t)return;let r=(e.classes||{})[n];if(!l(r))return;let a=(r.properties||{})[i];if(l(a))return a}var AA=Xgt;var E3i=T(S(),1);function Wgt(e,t,n,i){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i}var MA=Wgt;var AB=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function ci(e){e=y(e,y.EMPTY_OBJECT);let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=Ye(e.contextOptions),r=l(n),s=new $G(t,o);r||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=Bn(),this._jobScheduler=new pF,this._frameState=new hF(s,new nF(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=y(e.scene3DOnly,!1),this._removeCreditContainer=!r,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new sR(s),this._ellipsoid=y(e.ellipsoid,ne.default),this._globe=void 0,this._globeTranslucencyState=new fF,this._primitives=new kl,this._groundPrimitives=new kl,this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=ci.defaultLogDepthBuffer&&s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new BT,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=y(e.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new dF(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ei({color:new B,stencil:0,owner:this}),this._depthClearCommand=new ei({depth:1,owner:this}),this._stencilClearCommand=new ei({stencil:0}),this._classificationStencilClearCommand=new ei({stencil:0,renderState:Ue.fromCache({stencilMask:Ot.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new iA(this),this._preUpdate=new be,this._postUpdate=new be,this._renderError=new be,this._preRender=new be,this._postRender=new be,this._minimumDisableDepthTestDistance=0,this._debugInspector=new mA,this._msaaSamples=y(e.msaaSamples,4),this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new be,this.morphComplete=new be,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=B.clone(B.BLACK),this._mode=oe.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Ri(this._ellipsoid),this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.atmosphere=new u_,this.fog=new mF,this.fog.enabled=ne.WGS84.equals(this._ellipsoid),ne.WGS84.equals(this._ellipsoid)||(io.DEFAULT_VIEW_RECTANGLE=ae.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new io(this),this.shadowMap=new c0({context:s,lightCamera:this._shadowMapCamera,enabled:y(e.shadows,!1)}),this.invertClassification=!1,this.invertClassificationColor=B.clone(B.WHITE),this._actualInvertClassificationColor=B.clone(this._invertClassificationColor),this._invertClassification=new QV,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new eA,this._brdfLutGenerator=new Qw,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new aA(this),this._cameraUnderground=!1,this._mapMode2D=y(e.mapMode2D,Ql.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=y(e.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=y(e.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=ja.requestCompletedEvent.addEventListener(AB(this)),this._removeTaskProcessorListenerCallback=bi.taskCompletedEvent.addEventListener(AB(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new Ke(0,0,s.drawingBufferWidth,s.drawingBufferHeight),c=new io(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new io(this),this.preloadFlightCullingVolume=void 0,this._picking=new XF(this),this._defaultView=new wT(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentCubeMap=void 0,this.light=new Tp,GTe(this,0,j.now()),this.updateFrameState(),this.initializeFrame()}ci.defaultLogDepthBuffer=!0;function Pgt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(AB(e))),n.push(t.terrainProviderChanged.addEventListener(AB(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(ci.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return Bt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Bt.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return Wm.isSupported(this._context)}},ellipsoid:{get:function(){return this._ellipsoid}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,Pgt(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(l(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(l(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===oe.SCENE2D?this.morphTo2D(0):e===oe.SCENE3D?this.morphTo3D(0):e===oe.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new io(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new uF(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,Bt.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});ci.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function vgt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function VTe(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,c=t.derivedCommands;l(t.pickId)&&(c.picking=Yf.createPickDerivedCommand(e,t,o,c.picking)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=Yf.createPickMetadataDerivedCommand(e,t,o,c.pickingMetadata))),t.pickOnly||(c.depth=Yf.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=Yf.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=c0.createReceiveDerivedCommand(s,t,n,o,c.shadows)),t.pass===Ge.TRANSLUCENT&&l(r)&&r.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=r.createDerivedCommands(c.shadows.receiveCommand,o,c.oit.shadows)):c.oit=r.createDerivedCommands(t,o,c.oit))}ci.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!l(t))return;let n=this._frameState,{shadowState:i,useLogDepth:o}=this._frameState,r=this._context,s=!1,a=i.lastDirtyTime;e.lastDirtyTime!==a&&(e.lastDirtyTime=a,e.dirty=!0,s=!0);let c=this._hdr,d=l(t.logDepth),u=l(t.hdr),m=l(t.originalCommand),p=o&&!d,g=c&&!u,f=(!o||!c)&&!m,x=n.pickingMetadata&&vgt(e,n);if(e.dirty=e.dirty||p||g||f||x,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:_,shadowMaps:C}=i;_&&e.castShadows&&(t.shadows=c0.createCastDerivedCommand(C,e,s,r,t.shadows)),(d||p)&&(t.logDepth=Yf.createLogDepthCommand(e,r,t.logDepth),VTe(this,t.logDepth.command,s)),(m||f)&&VTe(this,e,s)};var wgt=new rm({pass:wo.RENDER}),R8=new rm({pass:wo.PRELOAD}),Z8=new rm({pass:wo.PRELOAD_FLIGHT}),Fgt=new rm({pass:wo.REQUEST_RENDER_MODE_DEFER_CHECK}),LTe=new ce,G8;function Agt(e){if(!(e._mode!==oe.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return LTe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,G8=zw.fromBoundingSphere(LTe,e.camera.positionWC,G8),G8}ci.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function GTe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=j.clone(n,i.time)}ci.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=Agt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof an||this.camera.frustum instanceof Pr),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;l(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready?(t.specularEnvironmentMaps=this._specularEnvironmentCubeMap.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentCubeMap.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=B.clone(this.invertClassificationColor,this._actualInvertClassificationColor),QV.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};ci.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===Jt.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var FB=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);FB=M.inverseTransformation(FB,FB);function Mgt(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a=h.clone(s.center);if(o.mode!==oe.SCENE3D){a=M.multiplyByPoint(FB,a,a);let f=o.mapProjection,x=f.unproject(a);a=f.ellipsoid.cartographicToCartesian(x)}let c,d,{radius:u}=s;l(u)?(c=zs.createGeometry(new zs({radii:new h(u,u,u),vertexFormat:dn.FLAT_VERTEX_FORMAT})),d=M.fromTranslation(a)):(c=Ra.createGeometry(Ra.fromDimensions({dimensions:new h(2,2,2),vertexFormat:dn.FLAT_VERTEX_FORMAT})),d=M.fromRotationTranslation(s.halfAxes,a,new M)),t._debugVolume=new In({geometryInstances:new Gt({geometry:Fn.toWireframe(c),modelMatrix:d,attributes:{color:new Kt(1,0,0,1)}}),appearance:new dn({flat:!0,translucent:!1}),asynchronous:!1});let m=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=Yf.createLogDepthCommand(e,r).command);let g;l(i)&&(g=n.framebuffer,n.framebuffer=i),e.execute(r,n),l(g)&&(n.framebuffer=g),o.commandList=m}function tp(e,t,n,i){let o=t._frameState,r=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ei){e.execute(r,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&Mgt(e,t,n,i),o.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=o.passes;if(!s.pick&&!s.pickVoxel&&!s.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth){if(o.pickingMetadata&&l(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(r,n);return}if(!o.pickingMetadata&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(r,n);return}}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(r,n);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,n);return}o.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,n):e.execute(r,n)}function RTe(e,t,n){let{derivedCommands:i}=e;if(!l(i))return;let o=t._frameState,r=t._context;o.useLogDepth&&l(i.logDepth)&&(e=i.logDepth.command);let{picking:s,pickingMetadata:a,depth:c}=e.derivedCommands;l(a)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(r,n)),l(s)?(e=s.pickCommand,e.execute(r,n)):l(c)&&(e=c.depthOnlyCommand,e.execute(r,n))}function ETe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function Ngt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+W.EPSILON12}function kgt(e,t,n,i,o){o0(i,ETe,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function Ugt(e,t,n,i,o){o0(i,Ngt,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function Dgt(e,t,n){e.context.uniformState.updatePass(Ge.VOXELS);let i=n.commands[Ge.VOXELS];i.length=n.indices[Ge.VOXELS],o0(i,ETe,e.camera.positionWC);for(let o=0;o<i.length;++o)tp(i[o],e,t)}var Bgt=new Li,Ogt=new sl,Ygt=new an,Hgt=new Pr;function zgt(e){let{frustum:t}=e;return l(t.fov)?t.clone(Bgt):l(t.infiniteProjectionMatrix)?t.clone(Ogt):l(t.width)?t.clone(Ygt):t.clone(Hgt)}function Kgt(e){if(e._environmentState.useOIT){if(!l(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,o,r,s,a){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,o,r,s,a)}}return e._executeOITFunction}return e.frameState.passes.render?kgt:Ugt}function Jgt(e,t,n){let{frameState:i,context:o}=e,{pick:r,pickVoxel:s}=i.passes,a=r||s,c;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let d=Kgt(e);o.uniformState.updatePass(Ge.TRANSLUCENT);let u=n.commands[Ge.TRANSLUCENT];u.length=n.indices[Ge.TRANSLUCENT],d(e,tp,t,u,c)}function Qgt(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[Ge.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[Ge.TRANSLUCENT];i.executeTranslucentCommands(e,tp,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,tp,t,n)}function I8(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let s=zgt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,c=a.pick||a.pickVoxel;c||jgt(e,t);let{clearGlobeDepth:d,renderTranslucentDepthForPick:u,useDepthPlane:m,useGlobeDepthFramebuffer:p,useInvertClassification:g,usePostProcessSelected:f}=e._environmentState,{globeDepth:x,globeTranslucencyFramebuffer:_,sceneFramebuffer:C,frustumCommandsList:V}=e._view,L=V.length,Z=e._globeTranslucencyState,G=e._depthClearCommand,I=e._stencilClearCommand,v=e._classificationStencilClearCommand,P=e._depthPlane,w=n.position.z;function F(R,E){r.updatePass(E);let X=R.commands[E],A=R.indices[E];for(let N=0;N<A;++N)tp(X[N],e,t);return A}function b(R,E){r.updatePass(E);let X=R.commands[E],A=R.indices[E];for(let N=0;N<A;++N)RTe(X[N],e,t)}for(let R=0;R<L;++R){let E=L-R-1,X=V[E];e.mode===oe.SCENE2D?(n.position.z=w-X.near+1,s.far=Math.max(1,X.far-X.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=E!==0?X.near*e.opaqueFrustumNearOffset:X.near,s.far=X.far,r.updateFrustum(s)),G.execute(i,t),i.stencilBuffer&&I.execute(i,t),Z.translucent?(r.updatePass(Ge.GLOBE),Z.executeGlobeCommands(X,tp,_,e,t)):F(X,Ge.GLOBE),p&&x.executeCopyDepth(i,t),u||(Z.translucent?(r.updatePass(Ge.TERRAIN_CLASSIFICATION),Z.executeGlobeClassificationCommands(X,tp,_,e,t)):F(X,Ge.TERRAIN_CLASSIFICATION)),d&&(G.execute(i,t),m&&P.execute(i,t));let A;if(!g||c||u)A=F(X,Ge.CESIUM_3D_TILE),A>0&&(p&&(x.prepareColorTextures(i,d),x.executeUpdateDepth(i,t,x.depthStencilTexture)),u||(A=F(X,Ge.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let O=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,A=F(X,Ge.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),x.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),A=F(X,Ge.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=O,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),A>0&&i.stencilBuffer&&v.execute(i,t),A=F(X,Ge.CESIUM_3D_TILE_CLASSIFICATION)}if(A>0&&i.stencilBuffer&&I.execute(i,t),Dgt(e,t,X),F(X,Ge.OPAQUE),E!==0&&e.mode!==oe.SCENE2D&&(s.near=X.near,r.updateFrustum(s)),Jgt(e,t,X),Qgt(e,t,X),i.depthTexture&&e.useDepthPicking&&(p||u)){let O=e._picking.getPickDepth(e,E);O.update(i,x.depthStencilTexture),O.executeCopyDepth(i,t)}if(c||!f)continue;let N=t.framebuffer;t.framebuffer=C.getIdFramebuffer(),s.near=E!==0?X.near*e.opaqueFrustumNearOffset:X.near,s.far=X.far,r.updateFrustum(s),Z.translucent?(r.updatePass(Ge.GLOBE),Z.executeGlobeCommands(X,RTe,_,e,t)):b(X,Ge.GLOBE),d&&(G.framebuffer=t.framebuffer,G.execute(i,t),G.framebuffer=void 0),d&&m&&P.execute(i,t),b(X,Ge.CESIUM_3D_TILE),b(X,Ge.OPAQUE),b(X,Ge.TRANSLUCENT),t.framebuffer=N}}function jgt(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(Ge.ENVIRONMENT),l(i.skyBoxCommand)&&tp(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&tp(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let r;i.useGlobeDepthFramebuffer?r=o.globeDepth.framebuffer:i.usePostProcess?r=o.sceneFramebuffer.framebuffer:r=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,r),t.framebuffer=r}i.isMoonVisible&&i.moonCommand.execute(n,t)}function ITe(e){e.context.uniformState.updatePass(Ge.COMPUTE);let t=e._environmentState.sunComputeCommand;l(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function qgt(e,t){e.context.uniformState.updatePass(Ge.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function $gt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,s=r.length,a=[Ge.GLOBE,Ge.CESIUM_3D_TILE,Ge.OPAQUE,Ge.TRANSLUCENT];for(let c=0;c<t.length;++c){let d=t[c];if(e.updateDerivedCommands(d),!(!d.castShadows||a.indexOf(d.pass)<0||!e.isVisible(i,d)))if(o)for(let u=0;u<s;++u)r[u].commandList.push(d);else if(s===1)r[0].commandList.push(d);else{let u=!1;for(let m=s-1;m>=0;--m){let p=r[m].cullingVolume;if(e.isVisible(p,d))r[m].commandList.push(d),u=!0;else if(u)break}}}}function XTe(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:o}=t;if(!i)return;let{context:r}=e,{uniformState:s}=r;for(let a=0;a<o.length;++a){let c=o[a];if(c.outOfView)continue;let{passes:d}=c;for(let u=0;u<d.length;++u)d[u].commandList.length=0;$gt(e,n,c);for(let u=0;u<d.length;++u){let m=c.passes[u],{camera:p,commandList:g}=m;s.updateCamera(p),c.updatePass(r,u);for(let f=0;f<g.length;++f){let x=g[f];s.updatePass(x.pass);let _=x.derivedCommands.shadows.castCommands[a];tp(_,e,m.passState)}}}}var eyt=new h;ci.prototype.updateAndExecuteCommands=function(e,t){hyt(this,e,t),this._environmentState.useWebVR?tyt(this,e,t):this._frameState.mode!==oe.SCENE2D||this._mapMode2D===Ql.ROTATE?Ey(!0,this,e):dyt(this,e)};function tyt(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;WTe(e),n.createPotentiallyVisibleSet(e),ITe(e),r||XTe(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=io.clone(i,e._cameraVR);a.frustum=i.frustum;let c=i.frustum.near,d=c*y(e.focalLength,5),u=y(e.eyeSeparation,d/30),m=h.multiplyByScalar(a.right,u*.5,eyt);i.frustum.aspectRatio=s.width/s.height;let p=.5*u*c/d;h.add(a.position,m,i.position),i.frustum.xOffset=p,I8(e,t),s.x=s.width,h.subtract(a.position,m,i.position),i.frustum.xOffset=-p,I8(e,t),io.clone(a,i)}var nyt=new he(Math.PI,W.PI_OVER_TWO),iyt=new h,oyt=new h,ryt=new M,syt=new M,ayt=new h,cyt=new h,lyt=new Ke;function dyt(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=Ke.clone(r,lyt);t.viewport=s;let a=nyt,c=iyt;e.mapProjection.project(a,c);let u=h.clone(i.position,oyt),m=M.clone(i.transform,syt),p=i.frustum.clone();i._setTransform(M.IDENTITY);let g=M.computeViewportTransformation(s,0,1,ryt),f=i.frustum.projectionMatrix,x=i.positionWC.y,_=h.fromElements(W.sign(x)*c.x-x,0,-i.positionWC.x,ayt),C=Ft.pointToGLWindowCoordinates(f,g,_,cyt);C.x=Math.floor(C.x);let V=s.x,L=s.width;if(x===0||C.x<=V||C.x>=V+L)Ey(!0,e,t);else if(Math.abs(V+L*.5-C.x)<1)s.width=C.x-s.x,i.position.x*=W.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),Ey(!0,e,t),s.x=C.x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),Ey(!1,e,t);else if(C.x>V+L*.5){s.width=C.x-V;let Z=i.frustum.right;i.frustum.right=c.x-x,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),Ey(!0,e,t),s.x=C.x,s.width=V+L-C.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=Z-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),Ey(!1,e,t)}else{s.x=C.x,s.width=V+L-C.x;let Z=i.frustum.left;i.frustum.left=-c.x-x,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),Ey(!0,e,t),s.x=V,s.width=C.x-V,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=Z-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),Ey(!1,e,t)}i._setTransform(m),h.clone(u,i.position),i.frustum=p.clone(),t.viewport=r}function Ey(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),WTe(t),i.createPotentiallyVisibleSet(t),e&&(ITe(t),o||XTe(t)),I8(t,n)}var ZTe=new ms;ci.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,o=e.passes.offscreen,r=this.atmosphere,s=this.skyAtmosphere,a=this.globe,c=this._globeTranslucencyState;if(!i||this._mode!==oe.SCENE2D&&t.camera.frustum instanceof an||!c.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(l(s)){if(l(a))s.setDynamicLighting(Jp.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let C=r.dynamicLighting;s.setDynamicLighting(C),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=s.update(e,a),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let _=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(_)?_.drawCommand:void 0,n.sunComputeCommand=l(_)?_.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let d=n.clearGlobeDepth=l(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===oe.SCENE2D);(n.useDepthPlane=d&&this.mode===oe.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==oe.SCENE2D&&!o;let m=e.mode===oe.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,g=ZTe.planes;for(let _=0;_<5;++_)g[_]=p.planes[_];p=ZTe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,m),n.isMoonVisible=this.isVisible(p,n.moonCommand,m);let f=this.specularEnvironmentMaps,x=this._specularEnvironmentCubeMap;l(f)&&x?.url!==f?(x=x&&x.destroy(),this._specularEnvironmentCubeMap=new Wm(f)):!l(f)&&l(x)&&(x.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function uyt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new Of({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function myt(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:o}=t,r=o.length,s=r>0&&!n.pick&&!n.pickVoxel&&e.mode===oe.SCENE3D;if(s!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=s),i.lightShadowsEnabled=!1,!!s){for(let a=0;a<r;++a)if(o[a]!==i.shadowMaps[a]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let a=0;a<r;++a){let c=o[a];c.update(t),i.shadowMaps.push(c),c.fromLightSource&&(i.lightShadowMaps.push(c),i.lightShadowsEnabled=!0),c.dirty&&(++i.lastDirtyTime,c.dirty=!1)}}}function WTe(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),uyt(e),myt(e),e._globe&&e._globe.render(t)}function hyt(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,a=o.passes,c=a.pick||a.pickVoxel;l(s.globeDepth)&&(s.globeDepth.picking=c);let d=r.useWebVR;r.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!d?e._sunPostProcess=new dA:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let u=e._clearColorCommand;B.clone(n,u.color),u.execute(i,t);let m=r.useGlobeDepthFramebuffer=l(s.globeDepth);m&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,g=r.useOIT=!c&&l(p)&&p.isSupported();g&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let f=e.postProcessStages,x=r.usePostProcess=!c&&(e._hdr||f.length>0||f.ambientOcclusion.enabled||f.fxaa.enabled||f.bloom.enabled);if(r.usePostProcessSelected=!1,x&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),f.update(i,o.useLogDepth,e._hdr),f.clear(i),x=r.usePostProcess=f.ready,r.usePostProcessSelected=x&&f.hasSelected),r.isSunVisible&&e.sunBloom&&!d?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):m?t.framebuffer=s.globeDepth.framebuffer:x&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&u.execute(i,t),r.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification){let C;if(o.invertClassificationColor.alpha===1&&m&&(C=s.globeDepth.framebuffer),l(C)||i.depthTexture){if(e._invertClassification.previousFramebuffer=C,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&g){let V=e._invertClassification.unclassifiedCommand,L=V.derivedCommands;L.oit=p.createDerivedCommands(V,i,L.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}ci.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:o,translucentTileClassification:r}=i;l(o)&&o.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:c,originalFramebuffer:d}=n,u=a?o.colorFramebufferManager:void 0,m=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=c?m.framebuffer:d,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let g=m;a&&!s&&(g=u);let f=this.postProcessStages,x=g.getColorTexture(0),_=p.getColorTexture(0),C=y(u,m).getDepthStencilTexture();f.execute(t,x,C,_),f.copy(t,d)}!s&&!c&&a&&(e.framebuffer=d,o.executeCopyColor(t,e))};function fyt(e){let t=e._frameState.afterRender;for(let n=0;n<t.length;++n)t[n]()&&e.requestRender();t.length=0}function pyt(e){if(e.mode===oe.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}ci.prototype.getHeight=function(e,t){if(!l(e))return;let n=t===Qe.CLAMP_TO_TERRAIN||t===Qe.RELATIVE_TO_TERRAIN,i=t===Qe.CLAMP_TO_3D_TILE||t===Qe.RELATIVE_TO_3D_TILE;if(!l(e))return;let o=Number.NEGATIVE_INFINITY;if(!n){let s=this.primitives.length;for(let a=0;a<s;++a){let c=this.primitives.get(a);if(!c.isCesium3DTileset||!c.show||!c.enableCollision)continue;let d=c.getHeight(e,this);l(d)&&d>o&&(o=d)}}let r=this._globe;if(!i&&l(r)&&r.show){let s=r.getHeight(e);s>o&&(o=s)}if(o>Number.NEGATIVE_INFINITY)return o};var E8=new he;ci.prototype.updateHeight=function(e,t,n){let i=()=>{he.clone(e,E8);let g=this.getHeight(e,n);l(g)&&(E8.height=g,t(E8))},o=n===Qe.CLAMP_TO_TERRAIN||n===Qe.RELATIVE_TO_TERRAIN,r=n===Qe.CLAMP_TO_3D_TILE||n===Qe.RELATIVE_TO_3D_TILE,s;!r&&l(this.globe)&&(s=this.globe._surface.updateHeight(e,i));let a={},c=this._ellipsoid,d=g=>{if(o||g.isDestroyed()||!g.isCesium3DTileset)return;let f=g.updateHeight(e,i,c);a[g.id]=f};if(!o){let g=this.primitives.length;for(let f=0;f<g;++f){let x=this.primitives.get(f);d(x)}}let u=this.primitives.primitiveAdded.addEventListener(d),m=this.primitives.primitiveRemoved.addEventListener(g=>{g.isDestroyed()||!g.isCesium3DTileset||(l(a[g.id])&&a[g.id](),delete a[g.id])});return()=>{s=s&&s(),Object.values(a).forEach(g=>g()),a={},u(),m()}};function byt(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,o=t.positionCartographic;if(!l(o))return!1;if(!i.onMap()&&o.height<0)return!0;if(n===oe.SCENE2D||n===oe.MORPHING)return!1;let r=e._globeHeight;return l(r)&&o.height<r}ci.prototype.initializeFrame=function(){if(this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty){l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=pyt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=byt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function gyt(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let o=new r0({container:n});e._performanceDisplay=o,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function yyt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function xyt(e){e.primitives.postPassesUpdate(e._frameState),ja.update()}var _yt=new B;function Tyt(e){let t=e._frameState,n=e.context,{uniformState:i}=n,o=e._defaultView;e._view=o,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=wgt;let r=y(e.backgroundColor,B.BLACK);e._hdr&&(r=B.clone(r,_yt),r.red=Math.pow(r.red,e.gamma),r.green=Math.pow(r.green,e.gamma),r.blue=Math.pow(r.blue,e.gamma)),t.backgroundColor=r,t.atmosphere=e.atmosphere,e.fog.update(t),i.update(t);let s=e.shadowMap;l(s)&&s.enabled&&(!l(e.light)||e.light instanceof Tp?h.negate(i.sunDirectionWC,e._shadowMapCamera.direction):h.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=o.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=o.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=Ke.clone(a,c.viewport),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,qgt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function qT(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function Syt(e){return e._picking.updateMostDetailedRayPicks(e)}ci.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=j.now());let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===oe.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let o=Math.abs(j.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=j.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=W.incrementWrap(t.frameNumber,15e6,1);GTe(this,o,e),t.newFrame=!0}qT(this,yyt),this.primitives.show&&(qT(this,Syt),qT(this,Cyt),qT(this,Vyt),i||qT(this,Lyt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),qT(this,Tyt)),gyt(this,i),qT(this,xyt),fyt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};ci.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};ci.prototype.requestRender=function(){this._renderRequested=!0};ci.prototype.clampLineWidth=function(e){return Math.max(Bt.minimumAliasedLineWidth,Math.min(e,Bt.maximumAliasedLineWidth))};ci.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};ci.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let o=i.primitive;if(!(o instanceof Gy))return;let r=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*r[0]+r[1],a=o._traversal.findKeyframeNode(s);if(!l(a))return;let c=255*r[2]+r[3];return hA.fromKeyframeNode(o,s,c,a)};ci.prototype.pickMetadata=function(e,t,n,i){let o=this.pick(e);if(!l(o))return;let r=o.detail?.model?.structuralMetadata?.schema,s=AA(r,t,n,i);if(!l(s))return;let a=new MA(t,n,i,s);return this._picking.pickMetadata(this,e,a)};ci.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};ci.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};ci.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};ci.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function Cyt(e){let t=e._frameState;R8.camera=t.camera,R8.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,R8)}function Vyt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;Z8.camera=e.preloadFlightCamera,Z8.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,Z8)}function Lyt(e){e.primitives.updateForPass(e._frameState,Fgt)}ci.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};ci.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};ci.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};ci.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};ci.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};ci.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};ci.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};ci.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};ci.prototype.cartesianToCanvasCoordinates=function(e,t){return Mi.worldToWindowCoordinates(this,e,t)};ci.prototype.completeMorph=function(){this._transitioner.completeMorph()};ci.prototype.morphTo2D=function(e){e=y(e,2),this._transitioner.morphTo2D(e,this._ellipsoid)};ci.prototype.morphToColumbusView=function(e){e=y(e,2),this._transitioner.morphToColumbusView(e,this._ellipsoid)};ci.prototype.morphTo3D=function(e){e=y(e,2),this._transitioner.morphTo3D(e,this._ellipsoid)};function Ryt(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){l(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{l(e)&&l(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}ci.prototype.setTerrain=function(e){return Ryt(this,e),e};ci.prototype.isDestroyed=function(){return!1};ci.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),me(this)};var NA=ci;var vYi=T(S(),1);var oYi=T(S(),1),aL=`float interpolateByDistance(vec4 nearFarScalar, float distance)
  13207. {
  13208. float startDistance = nearFarScalar.x;
  13209. float startValue = nearFarScalar.y;
  13210. float endDistance = nearFarScalar.z;
  13211. float endValue = nearFarScalar.w;
  13212. float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);
  13213. return mix(startValue, endValue, t);
  13214. }
  13215. void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe)
  13216. {
  13217. float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z;
  13218. // Adjustment to the atmosphere radius applied based on the camera height.
  13219. float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0;
  13220. float distanceAdjustMax = czm_ellipsoidRadii.x;
  13221. float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0;
  13222. float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0);
  13223. // Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit
  13224. // for the position on the ellipsoid.
  13225. float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust;
  13226. float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust;
  13227. // Setup the primary ray: from the camera position to the vertex position.
  13228. vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
  13229. vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
  13230. czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);
  13231. underTranslucentGlobe = 0.0;
  13232. // Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled.
  13233. #if defined(GLOBE_TRANSLUCENT)
  13234. // Check for intersection with the inner radius of the atmopshere.
  13235. czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust);
  13236. if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) {
  13237. // Compute position on globe.
  13238. vec3 direction = normalize(positionWC);
  13239. czm_ray ellipsoidRay = czm_ray(positionWC, -direction);
  13240. czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii);
  13241. vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start);
  13242. // Control the color using the camera angle.
  13243. float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth));
  13244. // Control the opacity using the distance from Earth.
  13245. opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth));
  13246. vec3 horizonColor = vec3(0.1, 0.2, 0.3);
  13247. vec3 nearColor = vec3(0.0);
  13248. rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity);
  13249. // Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton.
  13250. underTranslucentGlobe = 1.0;
  13251. return;
  13252. }
  13253. #endif
  13254. computeScattering(
  13255. primaryRay,
  13256. length(cameraToPositionWC),
  13257. lightDirection,
  13258. atmosphereInnerRadius,
  13259. rayleighColor,
  13260. mieColor,
  13261. opacity
  13262. );
  13263. // Alter the opacity based on how close the viewer is to the ground.
  13264. // (0.0 = At edge of atmosphere, 1.0 = On ground)
  13265. float cameraHeight = czm_eyeHeight + atmosphereInnerRadius;
  13266. float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
  13267. opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0);
  13268. // Alter alpha based on time of day (0.0 = night , 1.0 = day)
  13269. float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0;
  13270. opacity *= pow(nightAlpha, 0.5);
  13271. }
  13272. `;var sYi=T(S(),1),kA=`in vec3 v_outerPositionWC;
  13273. uniform vec3 u_hsbShift;
  13274. #ifndef PER_FRAGMENT_ATMOSPHERE
  13275. in vec3 v_mieColor;
  13276. in vec3 v_rayleighColor;
  13277. in float v_opacity;
  13278. in float v_translucent;
  13279. #endif
  13280. void main (void)
  13281. {
  13282. float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
  13283. vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_outerPositionWC, lightEnum);
  13284. vec3 mieColor;
  13285. vec3 rayleighColor;
  13286. float opacity;
  13287. float translucent;
  13288. #ifdef PER_FRAGMENT_ATMOSPHERE
  13289. computeAtmosphereScattering(
  13290. v_outerPositionWC,
  13291. lightDirection,
  13292. rayleighColor,
  13293. mieColor,
  13294. opacity,
  13295. translucent
  13296. );
  13297. #else
  13298. mieColor = v_mieColor;
  13299. rayleighColor = v_rayleighColor;
  13300. opacity = v_opacity;
  13301. translucent = v_translucent;
  13302. #endif
  13303. vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity);
  13304. #ifndef HDR
  13305. color.rgb = czm_pbrNeutralTonemapping(color.rgb);
  13306. color.rgb = czm_inverseGamma(color.rgb);
  13307. #endif
  13308. #ifdef COLOR_CORRECT
  13309. const bool ignoreBlackPixels = true;
  13310. color.rgb = czm_applyHSBShift(color.rgb, u_hsbShift, ignoreBlackPixels);
  13311. #endif
  13312. // For the parts of the sky atmosphere that are not behind a translucent globe,
  13313. // we mix in the default opacity so that the sky atmosphere still appears at distance.
  13314. // This is needed because the opacity in the sky atmosphere is initially adjusted based
  13315. // on the camera height.
  13316. if (translucent == 0.0) {
  13317. color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime);
  13318. }
  13319. out_FragColor = color;
  13320. }
  13321. `;var cYi=T(S(),1),UA=`in vec4 position;
  13322. out vec3 v_outerPositionWC;
  13323. #ifndef PER_FRAGMENT_ATMOSPHERE
  13324. out vec3 v_mieColor;
  13325. out vec3 v_rayleighColor;
  13326. out float v_opacity;
  13327. out float v_translucent;
  13328. #endif
  13329. void main(void)
  13330. {
  13331. vec4 positionWC = czm_model * position;
  13332. float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
  13333. vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC.xyz, lightEnum);
  13334. #ifndef PER_FRAGMENT_ATMOSPHERE
  13335. computeAtmosphereScattering(
  13336. positionWC.xyz,
  13337. lightDirection,
  13338. v_rayleighColor,
  13339. v_mieColor,
  13340. v_opacity,
  13341. v_translucent
  13342. );
  13343. #endif
  13344. v_outerPositionWC = positionWC.xyz;
  13345. gl_Position = czm_modelViewProjection * position;
  13346. }
  13347. `;function cL(e){e=y(e,ne.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=h.multiplyByScalar(e.radii,t,new h);this._scaleMatrix=M.fromScale(n),this._modelMatrix=new M,this._command=new tt({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new h;let i=new h;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let o=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return o._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return o.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return o.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return o.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return o.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return o.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return o.atmosphereMieAnisotropy}}}Object.defineProperties(cL.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});cL.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var X8=new M;cL.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==oe.SCENE3D&&n!==oe.MORPHING||!e.passes.render)return;let i=M.fromRotationTranslation(e.context.uniformState.inverseViewRotation,h.ZERO,X8),o=M.multiplyTransformation(i,Xo.Y_UP_TO_Z_UP,X8),r=M.multiply(this._scaleMatrix,o,X8);M.clone(r,this._modelMatrix);let s=e.context,a=Zyt(this),c=e.globeTranslucencyState.translucent,d=this.perFragmentAtmosphere||c||!l(t)||!t.show,u=this._command;if(!l(u.vertexArray)){let p=zs.createGeometry(new zs({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:We.POSITION_ONLY}));u.vertexArray=ti.fromGeometry({context:s,geometry:p,attributeLocations:Fn.createAttributeLocations(p),bufferUsage:Me.STATIC_DRAW}),u.renderState=Ue.fromCache({cull:{enabled:!0,face:yi.FRONT},blending:un.ALPHA_BLEND,depthMask:!1})}let m=a|d<<2|c<<3;if(m!==this._flags){this._flags=m;let p=[];a&&p.push("COLOR_CORRECT"),d&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let g=new De({defines:p,sources:[Um,aL,UA]}),f=new De({defines:p,sources:[Um,aL,kA]});this._spSkyAtmosphere=tn.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:f}),u.shaderProgram=this._spSkyAtmosphere}return u};function Zyt(e){return!(W.equalsEpsilon(e.hueShift,0,W.EPSILON7)&&W.equalsEpsilon(e.saturationShift,0,W.EPSILON7)&&W.equalsEpsilon(e.brightnessShift,0,W.EPSILON7))}cL.prototype.isDestroyed=function(){return!1};cL.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),me(this)};var DA=cL;var aHi=T(S(),1);var FYi=T(S(),1),BA=`uniform samplerCube u_cubeMap;
  13348. in vec3 v_texCoord;
  13349. void main()
  13350. {
  13351. vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord));
  13352. out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);
  13353. }
  13354. `;var MYi=T(S(),1),OA=`in vec3 position;
  13355. out vec3 v_texCoord;
  13356. void main()
  13357. {
  13358. vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));
  13359. gl_Position = czm_projection * vec4(p, 1.0);
  13360. v_texCoord = position.xyz;
  13361. }
  13362. `;function dL(e){this.sources=e.sources,this._sources=void 0,this.show=y(e.show,!0),this._command=new tt({modelMatrix:M.clone(M.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}dL.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r}=e;if(!this.show||i!==oe.SCENE3D&&i!==oe.MORPHING||!o.render)return;if(this._sources!==this.sources){this._sources=this.sources;let a=this.sources;typeof a.positiveX=="string"?oE(r,this._sources).then(function(c){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=c}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new yr({context:r,source:a}))}let s=this._command;if(!l(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap}};let a=Ra.createGeometry(Ra.fromDimensions({dimensions:new h(2,2,2),vertexFormat:We.POSITION_ONLY})),c=this._attributeLocations=Fn.createAttributeLocations(a);s.vertexArray=ti.fromGeometry({context:r,geometry:a,attributeLocations:c,bufferUsage:Me.STATIC_DRAW}),s.renderState=Ue.fromCache({blending:un.ALPHA_BLEND})}if(!l(s.shaderProgram)||this._useHdr!==t){let a=new De({defines:[t?"HDR":""],sources:[BA]});s.shaderProgram=tn.fromCache({context:r,vertexShaderSource:OA,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=t}if(l(this._cubeMap))return s};dL.prototype.isDestroyed=function(){return!1};dL.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),me(this)};function lL(e){return rn(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}dL.createEarthSkyBox=function(){return new dL({sources:{positiveX:lL("px"),negativeX:lL("mx"),positiveY:lL("py"),negativeY:lL("my"),positiveZ:lL("pz"),negativeZ:lL("mz")}})};var YA=dL;var DHi=T(S(),1);var lHi=T(S(),1),HA=`uniform sampler2D u_texture;
  13363. in vec2 v_textureCoordinates;
  13364. void main()
  13365. {
  13366. vec4 color = texture(u_texture, v_textureCoordinates);
  13367. out_FragColor = czm_gammaCorrect(color);
  13368. }
  13369. `;var uHi=T(S(),1),zA=`uniform float u_radiusTS;
  13370. in vec2 v_textureCoordinates;
  13371. vec2 rotate(vec2 p, vec2 direction)
  13372. {
  13373. return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);
  13374. }
  13375. vec4 addBurst(vec2 position, vec2 direction, float lengthScalar)
  13376. {
  13377. vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);
  13378. float radius = length(rotatedPosition) * lengthScalar;
  13379. float burst = 1.0 - smoothstep(0.0, 0.55, radius);
  13380. return vec4(burst);
  13381. }
  13382. void main()
  13383. {
  13384. float lengthScalar = 2.0 / sqrt(2.0);
  13385. vec2 position = v_textureCoordinates - vec2(0.5);
  13386. float radius = length(position) * lengthScalar;
  13387. float surface = step(radius, u_radiusTS);
  13388. vec4 color = vec4(vec2(1.0), surface + 0.2, surface);
  13389. float glow = 1.0 - smoothstep(0.0, 0.55, radius);
  13390. color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;
  13391. vec4 burst = vec4(0.0);
  13392. // The following loop has been manually unrolled for speed, to
  13393. // avoid sin() and cos().
  13394. //
  13395. //for (float i = 0.4; i < 3.2; i += 1.047) {
  13396. // vec2 direction = vec2(sin(i), cos(i));
  13397. // burst += 0.4 * addBurst(position, direction, lengthScalar);
  13398. //
  13399. // direction = vec2(sin(i - 0.08), cos(i - 0.08));
  13400. // burst += 0.3 * addBurst(position, direction, lengthScalar);
  13401. //}
  13402. burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); // angle == 0.4
  13403. burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); // angle == 0.4 + 1.047
  13404. burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); // angle == 0.4 + 1.047 * 2.0
  13405. burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); // angle == 0.4 - 0.08
  13406. burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); // angle == 0.4 + 1.047 - 0.08
  13407. burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); // angle == 0.4 + 1.047 * 2.0 - 0.08
  13408. // End of manual loop unrolling.
  13409. color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;
  13410. out_FragColor = clamp(color, vec4(0.0), vec4(1.0));
  13411. }
  13412. `;var hHi=T(S(),1),KA=`in vec2 direction;
  13413. uniform float u_size;
  13414. out vec2 v_textureCoordinates;
  13415. void main()
  13416. {
  13417. vec4 position;
  13418. if (czm_morphTime == 1.0)
  13419. {
  13420. position = vec4(czm_sunPositionWC, 1.0);
  13421. }
  13422. else
  13423. {
  13424. position = vec4(czm_sunPositionColumbusView.zxy, 1.0);
  13425. }
  13426. vec4 positionEC = czm_view * position;
  13427. vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
  13428. vec2 halfSize = vec2(u_size * 0.5);
  13429. halfSize *= ((direction * 2.0) - 1.0);
  13430. gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);
  13431. v_textureCoordinates = direction;
  13432. }
  13433. `;function QA(){this.show=!0,this._drawCommand=new tt({primitiveType:Fe.TRIANGLES,boundingVolume:new ce,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new ce,this._boundingVolume2D=new ce,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(QA.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var Gyt=new D,Eyt=new D,Iyt=new se,JA=new se;QA.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===oe.SCENE2D||i===oe.MORPHING||!e.passes.render)return;let o=e.context,r=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||r!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=r,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let Z=Math.max(r,s);Z=Math.pow(2,Math.ceil(Math.log(Z)/Math.log(2))-2),Z=Math.max(1,Z);let G=n?o.halfFloatingPointTexture?qe.HALF_FLOAT:qe.FLOAT:qe.UNSIGNED_BYTE;this._texture=new Pt({context:o,width:Z,height:Z,pixelFormat:ot.RGBA,pixelDatatype:G}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let I=this,v={u_radiusTS:function(){return I._radiusTS}};this._commands.computeCommand=new Xc({fragmentShaderSource:zA,outputTexture:this._texture,uniformMap:v,persists:!1,owner:this,postExecute:function(){I._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let Z={direction:0},G=new Uint8Array(4*2);G[0]=0,G[1]=0,G[2]=255,G[3]=0,G[4]=255,G[5]=255,G[6]=0,G[7]=255;let I=xt.createVertexBuffer({context:o,typedArray:G,usage:Me.STATIC_DRAW}),v=[{index:Z.direction,vertexBuffer:I,componentsPerAttribute:2,normalize:!0,componentDatatype:Q.UNSIGNED_BYTE}],P=xt.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT});a.vertexArray=new ti({context:o,attributes:v,indexBuffer:P}),a.shaderProgram=tn.fromCache({context:o,vertexShaderSource:KA,fragmentShaderSource:HA,attributeLocations:Z}),a.renderState=Ue.fromCache({blending:un.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,d=o.uniformState.sunPositionColumbusView,u=this._boundingVolume,m=this._boundingVolume2D;h.clone(c,u.center),m.center.x=d.z,m.center.y=d.x,m.center.z=d.y,u.radius=W.SOLAR_RADIUS+W.SOLAR_RADIUS*this._glowLengthTS,m.radius=u.radius,i===oe.SCENE3D?ce.clone(u,a.boundingVolume):i===oe.COLUMBUS_VIEW&&ce.clone(m,a.boundingVolume);let p=Mi.computeActualEllipsoidPosition(e,c,JA),g=h.magnitude(h.subtract(p,e.camera.position,JA)),f=o.uniformState.projection,x=Iyt;x.x=0,x.y=0,x.z=-g,x.w=1;let _=M.multiplyByVector(f,x,JA),C=Mi.clipToGLWindowCoordinates(t.viewport,_,Gyt);x.x=W.SOLAR_RADIUS;let V=M.multiplyByVector(f,x,JA),L=Mi.clipToGLWindowCoordinates(t.viewport,V,Eyt);return this._size=D.magnitude(D.subtract(L,C,JA)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};QA.prototype.isDestroyed=function(){return!1};QA.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),me(this)};var jA=QA;var Kzi=T(S(),1);var Izi=T(S(),1);var wTe=T(B9(),1);var OHi=T(S(),1);function Xyt(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t});
  13434. vec4 clippingPlanesEdgeColor = vec4(1.0);
  13435. clippingPlanesEdgeColor.rgb = ${n}.rgb;
  13436. float clippingPlanesEdgeWidth = ${n}.a;
  13437. if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth)
  13438. {
  13439. out_FragColor = clippingPlanesEdgeColor;
  13440. }
  13441. `}var qA=Xyt;var zHi=T(S(),1);var Wyt={modifyFragmentShader:function(t){return t=De.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection;
  13442. void main()
  13443. {
  13444. #ifndef SHADOW_MAP
  13445. if (czm_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
  13446. if (czm_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
  13447. #endif
  13448. czm_splitter_main();
  13449. }
  13450. `,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},uL=Wyt;var $T={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function $A(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=B.clone(B.DARKGRAY),this._highlightColor=B.clone(B.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=$T.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=y(e.opaquePass,Ge.OPAQUE),this._cull=y(e.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=M.clone(M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.time=0,this.shadows=_n.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=y(e.splitDirection,vr.NONE),this._splittingEnabled=!1,this._error=void 0,Pyt(this,e)}Object.defineProperties($A.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return B.clone(this._highlightColor)},set:function(e){this._highlightColor=B.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=ce.clone(e,this._boundingSphere)}}});function Pyt(e,t){let n=x_.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&l(n.batchTableBinary)&&(n.styleableProperties=Ap.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=$T.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let o=n.normals;l(o)&&(e._isOctEncoded16P=o.octEncoded);let r=n.colors;l(r)&&(l(r.constantColor)&&(e._constantColor=B.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let s=n.batchIds;l(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var vyt=new h,wyt=new h,Fyt=new h,PTe,MB;function Ayt(e){if(!l(MB)){PTe=new wTe.default(0),MB=new Array(e);for(let t=0;t<e;++t)MB[t]=PTe.random()}return MB}function Myt(e){let n=e.length/3,i=Math.min(n,20),o=Ayt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(r,r,r,vyt),c=h.fromElements(s,s,s,wyt);for(let u=0;u<i;++u){let m=Math.floor(o[u]*n),p=h.unpack(e,m*3,Fyt);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let d=ce.fromCornerPoints(a,c);return d.radius+=W.EPSILON2,d}function vTe(e,t){let n=Q.fromTypedArray(e);return n===Q.INT||n===Q.UNSIGNED_INT||n===Q.DOUBLE?(St("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var Nyt=new se,kyt=new se,Uyt=new B,FTe=0,NB=1,F8=2,ATe=3,Dyt=4,W8=new M,Byt=new M;function Oyt(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,c=i.batchIds,d=i.styleableProperties,u=l(d),m=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,f=e._isOctEncodedDraco,x=e._quantizedRange,_=e._octEncodedRange,C=e._isRGB565,V=e._isTranslucent,L=e._hasColors,Z=e._hasNormals,G=e._hasBatchIds,I,v,P=[],w={};if(e._styleableShaderAttributes=w,u){let U=Dyt;for(let Y in d)if(d.hasOwnProperty(Y)){let k=d[Y],H=vTe(k.typedArray,Y);I=k.componentCount,v=Q.fromTypedArray(H);let J=xt.createVertexBuffer({context:n,typedArray:H,usage:Me.STATIC_DRAW});e._geometryByteLength+=J.sizeInBytes;let te={index:U,vertexBuffer:J,componentsPerAttribute:I,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0};P.push(te),w[Y]={location:U,componentCount:I},++U}}let F=xt.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Me.STATIC_DRAW});e._geometryByteLength+=F.sizeInBytes;let b;L&&(b=xt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=b.sizeInBytes);let R;Z&&(R=xt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=R.sizeInBytes);let E;G&&(c.typedArray=vTe(c.typedArray,"batchIds"),E=xt.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=E.sizeInBytes);let X=[];if(m?v=Q.UNSIGNED_SHORT:p?v=x<=255?Q.UNSIGNED_BYTE:Q.UNSIGNED_SHORT:v=Q.FLOAT,X.push({index:FTe,vertexBuffer:F,componentsPerAttribute:3,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(m||p?e._boundingSphere=ce.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=Myt(r.typedArray)),L)if(C)X.push({index:NB,vertexBuffer:b,componentsPerAttribute:1,componentDatatype:Q.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let U=V?4:3;X.push({index:NB,vertexBuffer:b,componentsPerAttribute:U,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}Z&&(g?(I=2,v=Q.UNSIGNED_BYTE):f?(I=2,v=_<=255?Q.UNSIGNED_BYTE:Q.UNSIGNED_SHORT):(I=3,v=Q.FLOAT),X.push({index:F8,vertexBuffer:R,componentsPerAttribute:I,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0})),G&&X.push({index:ATe,vertexBuffer:E,componentsPerAttribute:1,componentDatatype:Q.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),u&&(X=X.concat(P));let A=new ti({context:n,attributes:X}),N={depthTest:{enabled:!0}},O={depthTest:{enabled:!0},depthMask:!1,blending:un.ALPHA_BLEND};e._opaquePass===Ge.CESIUM_3D_TILE&&(N.stencilTest=Ot.setCesium3DTileBit(),N.stencilMask=Ot.CESIUM_3D_TILE_MASK,O.stencilTest=Ot.setCesium3DTileBit(),O.stencilMask=Ot.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ue.fromCache(N),e._translucentRenderState=Ue.fromCache(O),e._drawCommand=new tt({boundingVolume:new ce,cull:e._cull,modelMatrix:new M,primitiveType:Fe.POINTS,vertexArray:A,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:V?e._translucentRenderState:e._opaqueRenderState,pass:V?Ge.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function Yyt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=Nyt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,d;t.mode===oe.SCENE2D||c instanceof an?d=Number.POSITIVE_INFINITY:d=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=d}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return B.TRANSPARENT;let c=B.clone(a.edgeColor,Uyt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return M.IDENTITY;let c=y(e.clippingPlanesOriginMatrix,e._modelMatrix);M.multiply(n.uniformState.view3D,c,W8);let d=M.multiply(W8,a.modelMatrix,W8);return M.inverseTranspose(d,Byt)}};uL.addUniforms(e,s),(i||o||r)&&(s=Tt(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=kyt;if(l(e._quantizedVolumeScale)){let c=h.clone(e._quantizedVolumeScale,a);h.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function P8(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let o=parseInt(i[1]);t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function v8(e,t){e=e.slice(e.indexOf(`
  13451. `));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function w8(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let o=e.getAttribute(i);if(o.index===t)return o}}var Hyt={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function zyt(e,t,n){let i,o,r,s=t.context,a=l(n),c=e._isQuantized,d=e._isQuantizedDraco,u=e._isOctEncoded16P,m=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,f=e._hasColors,x=e._hasNormals,_=e._hasBatchIds,C=e._backFaceCulling,V=e._normalShading,L=e._drawCommand.vertexArray,Z=e.clippingPlanes,G=e._attenuation,I,v,P,w=g,F=Ye(Hyt),b={},R=e._styleableShaderAttributes;for(o in R)R.hasOwnProperty(o)&&(r=R[o],F[o]=`czm_3dtiles_property_${r.location}`,b[r.location]=r);if(a){let le={translucent:!1},ye="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";I=n.getColorShaderFunction(`getColorFromStyle${ye}`,F,le),v=n.getShowShaderFunction(`getShowFromStyle${ye}`,F,le),P=n.getPointSizeShaderFunction(`getPointSizeFromStyle${ye}`,F,le),l(I)&&le.translucent&&(w=!0)}e._styleTranslucent=w;let E=l(I),X=l(v),A=l(P),N=e.isClipped,O=[],U=[];E&&(P8(I,O),v8(I,U)),X&&(P8(v,O),v8(v,U)),A&&(P8(P,O),v8(P,U));let Y=U.indexOf("COLOR")>=0,k=U.indexOf("NORMAL")>=0;if(k&&!x)throw new de("Style references the NORMAL semantic but the point cloud does not have normals");for(o in R)if(R.hasOwnProperty(o)){r=R[o];let le=O.indexOf(r.location)>=0,ye=w8(L,r.location);ye.enabled=le}let H=f&&(!E||Y);if(f){let le=w8(L,NB);le.enabled=H}let J=x&&(V||C||k);if(x){let le=w8(L,F8);le.enabled=J}let te={a_position:FTe};H&&(te.a_color=NB),J&&(te.a_normal=F8),_&&(te.a_batchId=ATe);let z="",q=O.length;for(i=0;i<q;++i){let le=O[i];r=b[le];let ye=r.componentCount,Te=`czm_3dtiles_property_${le}`,Xe;ye===1?Xe="float":Xe=`vec${ye}`,z+=`in ${Xe} ${Te};
  13452. `,te[Te]=r.location}Yyt(e,t);let ee=`in vec3 a_position;
  13453. out vec4 v_color;
  13454. uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier;
  13455. uniform vec4 u_constantColor;
  13456. uniform vec4 u_highlightColor;
  13457. `;ee+=`float u_pointSize;
  13458. float tiles3d_tileset_time;
  13459. `,G&&(ee+=`float u_geometricError;
  13460. float u_depthMultiplier;
  13461. `),ee+=z,H&&(g?ee+=`in vec4 a_color;
  13462. `:p?ee+=`in float a_color;
  13463. const float SHIFT_RIGHT_11 = 1.0 / 2048.0;
  13464. const float SHIFT_RIGHT_5 = 1.0 / 32.0;
  13465. const float SHIFT_LEFT_11 = 2048.0;
  13466. const float SHIFT_LEFT_5 = 32.0;
  13467. const float NORMALIZE_6 = 1.0 / 64.0;
  13468. const float NORMALIZE_5 = 1.0 / 32.0;
  13469. `:ee+=`in vec3 a_color;
  13470. `),J&&(u||m?ee+=`in vec2 a_normal;
  13471. `:ee+=`in vec3 a_normal;
  13472. `),_&&(ee+=`in float a_batchId;
  13473. `),(c||d||m)&&(ee+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange;
  13474. `),E&&(ee+=I),X&&(ee+=v),A&&(ee+=P),ee+=`void main()
  13475. {
  13476. u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x;
  13477. tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y;
  13478. `,G&&(ee+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z;
  13479. u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w;
  13480. `),H?g?ee+=` vec4 color = a_color;
  13481. `:p?ee+=` float compressed = a_color;
  13482. float r = floor(compressed * SHIFT_RIGHT_11);
  13483. compressed -= r * SHIFT_LEFT_11;
  13484. float g = floor(compressed * SHIFT_RIGHT_5);
  13485. compressed -= g * SHIFT_LEFT_5;
  13486. float b = compressed;
  13487. vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5);
  13488. vec4 color = vec4(rgb, 1.0);
  13489. `:ee+=` vec4 color = vec4(a_color, 1.0);
  13490. `:ee+=` vec4 color = u_constantColor;
  13491. `,c||d?ee+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz;
  13492. `:ee+=` vec3 position = a_position;
  13493. `,ee+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0));
  13494. `,J?(u?ee+=` vec3 normal = czm_octDecode(a_normal);
  13495. `:m?ee+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy;
  13496. `:ee+=` vec3 normal = a_normal;
  13497. `,ee+=` vec3 normalEC = czm_normal * normal;
  13498. `):ee+=` vec3 normal = vec3(1.0);
  13499. `,E&&(ee+=` color = getColorFromStyle(position, position_absolute, color, normal);
  13500. `),X&&(ee+=` float show = float(getShowFromStyle(position, position_absolute, color, normal));
  13501. `),A?ee+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio;
  13502. `:G?ee+=` vec4 positionEC = czm_modelView * vec4(position, 1.0);
  13503. float depth = -positionEC.z;
  13504. gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize);
  13505. `:ee+=` gl_PointSize = u_pointSize;
  13506. `,ee+=` color = color * u_highlightColor;
  13507. `,J&&V&&(ee+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC);
  13508. diffuseStrength = max(diffuseStrength, 0.4);
  13509. color.xyz *= diffuseStrength * czm_lightColor;
  13510. `),ee+=` v_color = color;
  13511. gl_Position = czm_modelViewProjection * vec4(position, 1.0);
  13512. `,J&&C&&(ee+=` float visible = step(-normalEC.z, 0.0);
  13513. gl_Position *= visible;
  13514. gl_PointSize *= visible;
  13515. `),X&&(ee+=` gl_Position.w *= float(show);
  13516. gl_PointSize *= float(show);
  13517. `),ee+=`}
  13518. `;let fe=`in vec4 v_color;
  13519. `;N&&(fe+=`uniform highp sampler2D u_clippingPlanes;
  13520. uniform mat4 u_clippingPlanesMatrix;
  13521. uniform vec4 u_clippingPlanesEdgeStyle;
  13522. `,fe+=`
  13523. `,fe+=qb(Z,s),fe+=`
  13524. `),fe+=`void main()
  13525. {
  13526. out_FragColor = czm_gammaCorrect(v_color);
  13527. `,N&&(fe+=qA("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),fe+=`}
  13528. `,e.splitDirection!==vr.NONE&&(fe=uL.modifyFragmentShader(fe)),l(e._vertexShaderLoaded)&&(ee=e._vertexShaderLoaded(ee)),l(e._fragmentShaderLoaded)&&(fe=e._fragmentShaderLoaded(fe));let _e=e._drawCommand;l(_e.shaderProgram)&&_e.shaderProgram.destroy(),_e.shaderProgram=tn.fromCache({context:s,vertexShaderSource:ee,fragmentShaderSource:fe,attributeLocations:te});try{_e.shaderProgram._bind()}catch{throw new de("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function Kyt(e,t){if(e._decodingState===$T.READY)return!1;if(e._decodingState===$T.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=Op.decodePointCloud(i,t);l(o)&&(e._decodingState=$T.DECODING,o.then(function(r){e._decodingState=$T.READY;let s=l(r.POSITION)?r.POSITION.array:void 0,a=l(r.RGB)?r.RGB.array:void 0,c=l(r.RGBA)?r.RGBA.array:void 0,d=l(r.NORMAL)?r.NORMAL.array:void 0,u=l(r.BATCH_ID)?r.BATCH_ID.array:void 0,m=l(s)&&l(r.POSITION.data.quantization),p=l(d)&&l(r.NORMAL.data.quantization);if(m){let _=r.POSITION.data.quantization,C=_.range;e._quantizedVolumeScale=h.fromElements(C,C,C),e._quantizedVolumeOffset=h.unpack(_.minValues),e._quantizedRange=(1<<_.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,f=i.batchTableProperties;for(let _ in f)if(f.hasOwnProperty(_)){let C=r[_];l(g)||(g={}),g[_]={typedArray:C.array,componentCount:C.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let x=y(c,a);l(x)&&(n.colors={typedArray:x}),l(d)&&(n.normals={typedArray:d}),l(u)&&(n.batchIds={typedArray:u}),n.styleableProperties=g}).catch(function(r){e._decodingState=$T.FAILED,e._error=r}))}return!0}var Jyt=new se,Qyt=new h;$A.prototype.update=function(e){let t=e.context;if(l(this._error)){let d=this._error;throw this._error=void 0,d}if(Kyt(this,t))return;let i=!1,o=!M.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(Oyt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){M.clone(this.modelMatrix,this._modelMatrix);let d=this._drawCommand.modelMatrix;if(M.clone(this._modelMatrix,d),l(this._rtcCenter)&&M.multiplyByTranslation(d,this._rtcCenter,d),l(this._quantizedVolumeOffset)&&M.multiplyByTranslation(d,this._quantizedVolumeOffset,d),e.mode!==oe.SCENE3D){let m=e.mapProjection,p=M.getColumn(d,3,Jyt);se.equals(p,se.UNIT_W)||Ft.basisTo2D(m,d,d)}let u=this._drawCommand.boundingVolume;if(ce.clone(this._boundingSphere,u),this._cull){let m=u.center;M.multiplyByPoint(d,m,m);let p=M.getScale(d,Qyt);u.radius*=h.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let r=this.splitDirection!==vr.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&zyt(this,e,this._style),this._drawCommand.castShadows=_n.castShadows(this.shadows),this._drawCommand.receiveShadows=_n.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?Ge.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};$A.prototype.isDestroyed=function(){return!1};$A.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),me(this)};var eM=$A;function tS(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this.shadows=y(e.shadows,_n.ENABLED),this.maximumMemoryUsage=y(e.maximumMemoryUsage,256),this.shading=new lf(e.shading),this.style=e.style,this.frameFailed=new be,this.frameChanged=new be,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new tb,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(tS.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){hs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function jyt(e){return`uniform vec4 czm_pickColor;
  13529. ${e}`}function qyt(e){return function(t){return Tt(t,{czm_pickColor:function(){return e._pickId.color}})}}function $yt(){return"czm_pickColor"}tS.prototype.makeStyleDirty=function(){this._styleDirty=!0};tS.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var ext=new j;function M8(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function eS(e,t){return e._intervals.indexOf(t.start)}function txt(e,t){let n=e._intervals,i=e._clock,o=M8(e);if(o===0)return;let r=e._getAverageLoadTime(),s=j.addSeconds(i.currentTime,r*o,ext),a=n.indexOf(s),c=eS(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function nxt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function ixt(e,t,n){let i=M8(e),o=eS(e,t),r=eS(e,n);return i>=0?o>=r:o<=r}function NTe(e,t){return function(n){let i=l(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function oxt(e,t,n){let i=eS(e,t),o=e._frames,r=o[i];if(!l(r)){let s=t.data.transform,a=l(s)?M.fromArray(s):void 0,c=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:_i(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,Ee.fetchArrayBuffer({url:c}).then(function(d){r.pointCloud=new eM({arrayBuffer:d,cull:!0,fragmentShaderLoaded:jyt,uniformMapLoaded:qyt(e),pickIdLoaded:$yt})}).catch(NTe(e,c))}return r}function rxt(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function sxt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let o=t.pointCloud;if(l(o)&&!t.ready){let r=i.commandList,s=r.length;if(kTe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(_i()-t.timestamp)/1e3;rxt(e,a)}}t.touchedFrameNumber=i.frameNumber}var axt=new M;function cxt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?W.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function lxt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var dxt=new lf;function kTe(e,t,n,i){let o=y(e.shading,dxt),r=t.pointCloud,s=y(t.transform,M.IDENTITY);r.modelMatrix=M.multiplyTransformation(e.modelMatrix,s,axt),r.style=e.style,r.time=n.timeSinceLoad,r.shadows=e.shadows,r.clippingPlanes=e._clippingPlanes,r.isClipped=n.isClipped,r.attenuation=o.attenuation,r.backFaceCulling=o.backFaceCulling,r.normalShading=o.normalShading,r.geometricError=cxt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=lxt(e);try{r.update(i)}catch(a){NTe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function A8(e,t,n,i){let o=oxt(e,t,i);sxt(e,o,n,i)}function uxt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function UTe(e,t){let n=e._frames,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(l(r)&&(!l(t)||t(r))){let s=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function mxt(e,t){let n=eS(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function MTe(e,t,n,i,o){return l(n)?n.ready?!0:(A8(e,t,i,o),n.ready):!1}function hxt(e,t,n,i,o){let r,s,a,c=e._intervals,d=e._frames,u=eS(e,n),m=eS(e,t);if(u>=m){for(r=u;r>=m;--r)if(s=c.get(r),a=d[r],MTe(e,s,a,i,o))return s}else for(r=u;r<=m;++r)if(s=c.get(r),a=d[r],MTe(e,s,a,i,o))return s;return t}function fxt(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let s=i[r];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var mL={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};tS.prototype.update=function(e){if(e.mode===oe.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=j.clone(e.time));let t=Math.max(j.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,o=!1,r=l(n)&&n.enabled;r&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,o=!0);let s=this._styleDirty;this._styleDirty=!1,(o||s)&&fxt(this,o,s),mL.timeSinceLoad=t,mL.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,d=e.commandList,u=d.length,m=this._previousInterval,p=this._nextInterval,g=nxt(this);if(!l(g))return;let f=!1,x=M8(this),_=x===0;x!==this._clockMultiplier&&(f=!0,this._clockMultiplier=x),(!l(m)||_)&&(m=g),(!l(p)||f||ixt(this,g,p))&&(p=txt(this,g)),m=hxt(this,m,g,mL,e);let C=mxt(this,m);l(C)||(A8(this,m,mL,e),C=this._lastRenderedFrame),l(C)&&kTe(this,C,mL,e),l(p)&&A8(this,p,mL,e);let V=this;l(C)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(C)&&C!==this._lastRenderedFrame&&V.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return V.frameChanged.raiseEvent(V),!0}),this._previousInterval=m,this._nextInterval=p,this._lastRenderedFrame=C;let L=this._totalMemoryUsageInBytes,Z=this.maximumMemoryUsage*1024*1024;L>Z&&UTe(this,uxt(e));let I=d.length-u;l(a)&&a.attenuation&&a.eyeDomeLighting&&I>0&&c.update(e,u,a,this.boundingSphere)};tS.prototype.isDestroyed=function(){return!1};tS.prototype.destroy=function(){return UTe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),me(this)};var hL=tS;function DTe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function pxt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let o=e._targetFrameRate;if(!l(o))e.resize(),e.render(),requestAnimationFrame(n);else{let r=1e3/o,s=i-t;s>r&&(e.resize(),e.render(),t=i-s%r),requestAnimationFrame(n)}}catch(o){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors&&e.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,o)}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function BTe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function OTe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=BTe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=o,i*=o,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function YTe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let o=e._scene.camera.frustum;l(o.aspectRatio)?o.aspectRatio=n/i:(o.top=o.right*(i/n),o.bottom=-o.top)}}function Go(e,t){e=Xn(e),t=y(t,y.EMPTY_OBJECT);let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=zt.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=zt.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}y(t.blurActiveElementOnCanvasFocus,!0)&&(i.addEventListener("mousedown",r),i.addEventListener("pointerdown",r)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?Xn(t.creditContainer):n;c.appendChild(a);let d=l(t.creditViewport)?Xn(t.creditViewport):n,u=y(t.showRenderLoopErrors,!0),m=y(t.useBrowserRecommendedResolution,!0);this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=d,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=u,this._resolutionScale=1,this._useBrowserRecommendedResolution=m,this._forceResize=!1,this._entityView=void 0,this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._trackedEntityChanged=new be,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new oh,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),OTe(this);try{let p=y(t.ellipsoid,ne.default),g=new NA({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:d,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:y(t.scene3DOnly,!1),shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=g,g.camera.constrainedAxis=h.UNIT_Z,BTe(this),YTe(this);let f=t.globe;l(f)||(f=new kw(p)),f!==!1&&(g.globe=f,g.globe.shadows=y(t.terrainShadows,_n.RECEIVE_ONLY));let x=t.skyBox;!l(x)&&ne.WGS84.equals(p)&&(x=YA.createEarthSkyBox()),x!==!1&&(g.skyBox=x,g.sun=new jA,ne.WGS84.equals(p)&&(g.moon=new Hw));let _=t.skyAtmosphere;!l(_)&&ne.WGS84.equals(p)&&(_=new DA(p),_.show=t.globe!==!1&&f.show),_!==!1&&(g.skyAtmosphere=_);let C=t.baseLayer;t.globe!==!1&&C!==!1&&(l(C)||(C=ka.fromWorldImagery()),g.imageryLayers.add(C)),l(t.terrainProvider)&&t.globe!==!1&&(g.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&g.setTerrain(t.terrain),this._screenSpaceEventHandler=new Qd(i),l(t.sceneMode)&&(t.sceneMode===oe.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===oe.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=y(t.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let V=this;this._onRenderError=function(P,w){V._useDefaultRenderLoop=!1,V._renderLoopRunning=!1,V._showRenderLoopErrors&&V.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,w)},g.renderError.addEventListener(this._onRenderError);let L=t.dataSources,Z=!1;l(L)||(L=new BP,Z=!0);let G=new Zv({scene:g,dataSourceCollection:L}),I=new lr;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=L,this._destroyDataSourceCollection=Z,this._dataSourceDisplay=G,this._eventHelper=I,this._canAnimateUpdateCallback=this._updateCanAnimate,I.add(this._clock.onTick,Go.prototype._onTick,this),I.add(g.morphStart,Go.prototype._clearTrackedObject,this),I.add(L.dataSourceAdded,Go.prototype._onDataSourceAdded,this),I.add(L.dataSourceRemoved,Go.prototype._onDataSourceRemoved,this),I.add(g.postRender,Go.prototype._postRender,this);let v=L.length;for(let P=0;P<v;P++)this._dataSourceAdded(L,L.get(P));this._dataSourceAdded(void 0,G.defaultDataSource),I.add(L.dataSourceAdded,Go.prototype._dataSourceAdded,this),I.add(L.dataSourceRemoved,Go.prototype._dataSourceRemoved,this)}catch(p){throw u&&this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:',p),p}}Object.defineProperties(Go.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},camera:{get:function(){return this._scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&pxt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,N8(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===oe.COLUMBUS_VIEW||n===oe.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===oe.COLUMBUS_VIEW||n===oe.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(M.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,DTe(this.clock,e))}}});Go.prototype.showErrorPanel=function(e,t,n){let i=this._element,o=document.createElement("div");o.className="cesium-widget-errorPanel";let r=document.createElement("div");r.className="cesium-widget-errorPanel-content",o.appendChild(r);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),r.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",r.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let d=l(t),u=l(n);if(d||u){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),u){let f=Mf(n);d||(typeof n=="string"&&(n=new Error(n)),t=Mf({name:n.name,message:n.message}),f=n.stack),typeof console<"u"&&console.error(`${e}
  13530. ${t}
  13531. ${f}`);let x=document.createElement("div");x.className="cesium-widget-errorPanel-message-details collapsed";let _=document.createElement("span");_.className="cesium-widget-errorPanel-more-details",_.appendChild(document.createTextNode("See more...")),x.appendChild(_),x.onclick=function(C){x.removeChild(_),x.appendChild(document.createTextNode(f)),x.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",x.onclick=void 0},a.appendChild(x)}g.innerHTML=`<p>${t}</p>`}let m=document.createElement("div");m.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(m);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(o)},m.appendChild(p),i.appendChild(o)};Go.prototype.isDestroyed=function(){return!1};Go.prototype.destroy=function(){let e=this.dataSources,t=e.length;for(let n=0;n<t;n++)this._dataSourceRemoved(e,e.get(n));this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),this._eventHelper.removeAll(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),me(this)};Go.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,OTe(this),YTe(this),this._scene.requestRender())};Go.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Go.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Go.prototype._onEntityCollectionChanged,this)};Go.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Go.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Go.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var fL=new ce;Go.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(l(i)){let o=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(o,!0,fL)===ft.DONE&&i.update(t,fL)}};Go.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.trackedEntity===r&&(this.trackedEntity=void 0)}};Go.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Go.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&DTe(this.clock,e)};Go.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Go.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Go.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let o=e.length;this._automaticallyTrackDataSourceClocks&&o>0?this.clockTrackedDataSource=e.get(o-1):this.clockTrackedDataSource=void 0}};Go.prototype.zoomTo=function(e,t){return HTe(this,e,{offset:t},!1)};Go.prototype.flyTo=function(e,t){return HTe(this,e,t,!0)};function HTe(e,t,n,i){N8(e);let o=new Promise(r=>{e._completeZoom=function(s){r(s)}});return e._zoomPromise=o,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(r){if(e._zoomPromise===o){if(r instanceof ka){let s;l(r.imageryProvider)?s=Promise.resolve(r.getImageryRectangle()):s=new Promise(a=>{let c=r.readyEvent.addEventListener(()=>{c(),a(r.getImageryRectangle())})}),s.then(function(a){return _T(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof ua||r instanceof hL||r instanceof Gy){e._zoomTarget=r;return}if(r.isLoading&&l(r.loadingEvent)){let s=r.loadingEvent.addEventListener(function(){s(),e._zoomPromise===o&&(e._zoomTarget=r.entities.values.slice(0))});return}if(Array.isArray(r)){e._zoomTarget=r.slice(0);return}r=r.values??r,l(r.entities)&&(r=r.entities.values),Array.isArray(r)?e._zoomTarget=r.slice(0):e._zoomTarget=[r]}}),e.scene.requestRender(),o}function tM(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function N8(e){let t=e._zoomPromise;l(t)&&(tM(e),e._completeZoom(!1))}Go.prototype._postRender=function(){bxt(this),gxt(this)};function bxt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===oe.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function s(u){l(o.offset)||(o.offset=new Qu(0,-.5,u.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,r):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(M.IDENTITY),e._completeZoom(!0)),tM(e)}if(t instanceof hL){if(l(t.boundingSphere)){s(t.boundingSphere);return}let u=t.frameChanged.addEventListener(function(m){s(m.boundingSphere),u()});return}if(t instanceof ua||t instanceof Gy){s(t.boundingSphere);return}if(t instanceof he){r={destination:n.ellipsoid.cartographicToCartesian(t),duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(r):(i.setView(r),e._completeZoom(!0)),tM(e);return}let a=t,c=[];for(let u=0,m=a.length;u<m;u++){let p=e._dataSourceDisplay.getBoundingSphere(a[u],!1,fL);if(p===ft.PENDING)return;p!==ft.FAILED&&c.push(ce.clone(fL))}if(c.length===0){N8(e);return}e.trackedEntity=void 0;let d=ce.fromBoundingSpheres(c);e._zoomIsFlight?(tM(e),i.flyToBoundingSphere(d,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(d,o.offset),i.lookAtTransform(M.IDENTITY),tM(e),e._completeZoom(!0))}function gxt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=K.getValueOrUndefined(t.position,n);if(!l(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,fL);if(r===ft.PENDING)return;let s=o.mode;(s===oe.COLUMBUS_VIEW||s===oe.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===oe.COLUMBUS_VIEW||s===oe.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==ft.FAILED?fL:void 0;e._entityView=new Ev(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var nM=Go;var WKi=T(S(),1),iM=`uniform sampler2D u_noiseTexture;
  13532. uniform vec3 u_noiseTextureDimensions;
  13533. uniform float u_noiseDetail;
  13534. in vec2 v_offset;
  13535. in vec3 v_maximumSize;
  13536. in vec4 v_color;
  13537. in float v_slice;
  13538. in float v_brightness;
  13539. float wrap(float value, float rangeLength) {
  13540. if(value < 0.0) {
  13541. float absValue = abs(value);
  13542. float modValue = mod(absValue, rangeLength);
  13543. return mod(rangeLength - modValue, rangeLength);
  13544. }
  13545. return mod(value, rangeLength);
  13546. }
  13547. vec3 wrapVec(vec3 value, float rangeLength) {
  13548. return vec3(wrap(value.x, rangeLength),
  13549. wrap(value.y, rangeLength),
  13550. wrap(value.z, rangeLength));
  13551. }
  13552. vec2 voxelToUV(vec3 voxelIndex) {
  13553. float textureSliceWidth = u_noiseTextureDimensions.x;
  13554. float noiseTextureRows = u_noiseTextureDimensions.y;
  13555. float inverseNoiseTextureRows = u_noiseTextureDimensions.z;
  13556. float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth;
  13557. vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared,
  13558. inverseNoiseTextureRows / textureSliceWidth);
  13559. vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth);
  13560. float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows);
  13561. float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows);
  13562. float xPixelCoord = wrappedIndex.x + column * textureSliceWidth;
  13563. float yPixelCoord = wrappedIndex.y + row * textureSliceWidth;
  13564. return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions;
  13565. }
  13566. // Interpolate a voxel with its neighbor (along the positive X-axis)
  13567. vec4 lerpSamplesX(vec3 voxelIndex, float x) {
  13568. vec2 uv0 = voxelToUV(voxelIndex);
  13569. vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0));
  13570. vec4 sample0 = texture(u_noiseTexture, uv0);
  13571. vec4 sample1 = texture(u_noiseTexture, uv1);
  13572. return mix(sample0, sample1, x);
  13573. }
  13574. vec4 sampleNoiseTexture(vec3 position) {
  13575. float textureSliceWidth = u_noiseTextureDimensions.x;
  13576. vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0);
  13577. vec3 lerpValue = fract(recenteredPos);
  13578. vec3 voxelIndex = floor(recenteredPos);
  13579. vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x);
  13580. vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x);
  13581. vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x);
  13582. vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x);
  13583. vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y);
  13584. vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y);
  13585. return mix(yLerp0, yLerp1, lerpValue.z);
  13586. }
  13587. // Intersection with a unit sphere with radius 0.5 at center (0, 0, 0).
  13588. bool intersectSphere(vec3 origin, vec3 dir, float slice,
  13589. out vec3 point, out vec3 normal) {
  13590. float A = dot(dir, dir);
  13591. float B = dot(origin, dir);
  13592. float C = dot(origin, origin) - 0.25;
  13593. float discriminant = (B * B) - (A * C);
  13594. if(discriminant < 0.0) {
  13595. return false;
  13596. }
  13597. float root = sqrt(discriminant);
  13598. float t = (-B - root) / A;
  13599. if(t < 0.0) {
  13600. t = (-B + root) / A;
  13601. }
  13602. point = origin + t * dir;
  13603. if(slice >= 0.0) {
  13604. point.z = (slice / 2.0) - 0.5;
  13605. if(length(point) > 0.5) {
  13606. return false;
  13607. }
  13608. }
  13609. normal = normalize(point);
  13610. point -= czm_epsilon2 * normal;
  13611. return true;
  13612. }
  13613. // Transforms the ray origin and direction into unit sphere space,
  13614. // then transforms the result back into the ellipsoid's space.
  13615. bool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice,
  13616. out vec3 point, out vec3 normal) {
  13617. if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) {
  13618. return false;
  13619. }
  13620. vec3 o = (origin - center) / scale;
  13621. vec3 d = dir / scale;
  13622. vec3 p, n;
  13623. bool intersected = intersectSphere(o, d, slice, p, n);
  13624. if(intersected) {
  13625. point = (p * scale) + center;
  13626. normal = n;
  13627. }
  13628. return intersected;
  13629. }
  13630. // Assume that if phase shift is being called for octave i,
  13631. // the frequency is of i - 1. This saves us from doing extra
  13632. // division / multiplication operations.
  13633. vec2 phaseShift2D(vec2 p, vec2 freq) {
  13634. return (czm_pi / 2.0) * sin(freq.yx * p.yx);
  13635. }
  13636. vec2 phaseShift3D(vec3 p, vec2 freq) {
  13637. return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z));
  13638. }
  13639. // The cloud texture function derived from Gardner's 1985 paper,
  13640. // "Visual Simulation of Clouds."
  13641. // https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner.pdf
  13642. const float T0 = 0.6; // contrast of the texture pattern
  13643. const float k = 0.1; // computed to produce a maximum value of 1
  13644. const float C0 = 0.8; // coefficient
  13645. const float FX0 = 0.6; // frequency X
  13646. const float FY0 = 0.6; // frequency Y
  13647. const int octaves = 5;
  13648. float T(vec3 point) {
  13649. vec2 sum = vec2(0.0);
  13650. float Ci = C0;
  13651. vec2 FXY = vec2(FX0, FY0);
  13652. vec2 PXY = vec2(0.0);
  13653. for(int i = 1; i <= octaves; i++) {
  13654. PXY = phaseShift3D(point, FXY);
  13655. Ci *= 0.707;
  13656. FXY *= 2.0;
  13657. vec2 sinTerm = sin(FXY * point.xy + PXY);
  13658. sum += Ci * sinTerm + vec2(T0);
  13659. }
  13660. return k * sum.x * sum.y;
  13661. }
  13662. const float a = 0.5; // fraction of surface reflection due to ambient or scattered light,
  13663. const float t = 0.4; // fraction of texture shading
  13664. const float s = 0.25; // fraction of specular reflection
  13665. float I(float Id, float Is, float It) {
  13666. return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a;
  13667. }
  13668. const vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7));
  13669. vec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice,
  13670. float brightness) {
  13671. vec3 cloudPoint, cloudNormal;
  13672. if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice,
  13673. cloudPoint, cloudNormal)) {
  13674. return vec4(0.0);
  13675. }
  13676. float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0); // diffuse reflection
  13677. float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); // specular reflection
  13678. float It = T(cloudPoint); // texture function
  13679. float intensity = I(Id, Is, It);
  13680. vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0));
  13681. vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint);
  13682. float W = noise.x;
  13683. float W2 = noise.y;
  13684. float W3 = noise.z;
  13685. // The dot product between the cloud's normal and the ray's direction is greatest
  13686. // in the center of the ellipsoid's surface. It decreases towards the edge.
  13687. // Thus, it is used to blur the areas leading to the edges of the ellipsoid,
  13688. // so that no harsh lines appear.
  13689. // The first (and biggest) layer of worley noise is then subtracted from this.
  13690. // The final result is scaled up so that the base cloud is not too translucent.
  13691. float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0);
  13692. float TR = pow(ndDot, 3.0) - W; // translucency
  13693. TR *= 1.3;
  13694. // Subtracting the second and third layers of worley noise is more complicated.
  13695. // If these layers of noise were simply subtracted from the current translucency,
  13696. // the shape derived from the first layer of noise would be completely deleted.
  13697. // The erosion of this noise should thus be constricted to the edges of the cloud.
  13698. // However, because the edges of the ellipsoid were already blurred away, mapping
  13699. // the noise to (1.0 - ndDot) will have no impact on most of the cloud's appearance.
  13700. // The value of (0.5 - ndDot) provides the best compromise.
  13701. float minusDot = 0.5 - ndDot;
  13702. // Even with the previous calculation, subtracting the second layer of wnoise
  13703. // erode too much of the cloud. The addition of it, however, will detailed
  13704. // volume to the cloud. As long as the noise is only added and not subtracted,
  13705. // the results are aesthetically pleasing.
  13706. // The minusDot product is mapped in a way that it is larger at the edges of
  13707. // the ellipsoid, so a subtraction and min operation are used instead of
  13708. // an addition and max one.
  13709. TR -= min(minusDot * W2, 0.0);
  13710. // The third level of worley noise is subtracted from the result, with some
  13711. // modifications. First, a scalar is added to minusDot so that the noise
  13712. // starts affecting the shape farther away from the center of the ellipsoid's
  13713. // surface. Then, it is scaled down so its impact is not too intense.
  13714. TR -= 0.8 * (minusDot + 0.25) * W3;
  13715. // The texture function's shading does not correlate with the shape of the cloud
  13716. // produced by the layers of noise, so an extra shading scalar is calculated.
  13717. // The darkest areas of the cloud are assigned to be where the noise erodes
  13718. // the cloud the most. This is then interpolated based on the translucency
  13719. // and the diffuse shading term of that point in the cloud.
  13720. float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR);
  13721. // To avoid values that are too dark, this scalar is increased by a small amount
  13722. // and clamped so it never goes to zero.
  13723. shading = clamp(shading + 0.2, 0.3, 1.0);
  13724. // Finally, the contrast of the cloud's color is increased.
  13725. vec3 finalColor = mix(vec3(0.5), shading * color, 1.15);
  13726. return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color;
  13727. }
  13728. void main() {
  13729. #ifdef DEBUG_BILLBOARDS
  13730. out_FragColor = vec4(0.0, 0.5, 0.5, 1.0);
  13731. #endif
  13732. // To avoid calculations with high values,
  13733. // we raycast from an arbitrarily smaller space.
  13734. vec2 coordinate = v_maximumSize.xy * v_offset;
  13735. vec3 ellipsoidScale = 0.82 * v_maximumSize;
  13736. vec3 ellipsoidCenter = vec3(0.0);
  13737. float zOffset = max(ellipsoidScale.z - 10.0, 0.0);
  13738. vec3 eye = vec3(0, 0, -10.0 - zOffset);
  13739. vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye);
  13740. vec3 rayOrigin = eye;
  13741. #ifdef DEBUG_ELLIPSOIDS
  13742. vec3 point, normal;
  13743. if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice,
  13744. point, normal)) {
  13745. out_FragColor = v_brightness * v_color;
  13746. }
  13747. #else
  13748. #ifndef DEBUG_BILLBOARDS
  13749. vec4 cloud = drawCloud(rayOrigin, rayDir,
  13750. ellipsoidCenter, ellipsoidScale, v_slice, v_brightness);
  13751. if(cloud.w < 0.01) {
  13752. discard;
  13753. }
  13754. out_FragColor = cloud;
  13755. #endif
  13756. #endif
  13757. }
  13758. `;var vKi=T(S(),1),oM=`#ifdef INSTANCED
  13759. in vec2 direction;
  13760. #endif
  13761. in vec4 positionHighAndScaleX;
  13762. in vec4 positionLowAndScaleY;
  13763. in vec4 packedAttribute0;
  13764. in vec4 packedAttribute1;
  13765. in vec4 color;
  13766. out vec2 v_offset;
  13767. out vec3 v_maximumSize;
  13768. out vec4 v_color;
  13769. out float v_slice;
  13770. out float v_brightness;
  13771. void main() {
  13772. // Unpack attributes.
  13773. vec3 positionHigh = positionHighAndScaleX.xyz;
  13774. vec3 positionLow = positionLowAndScaleY.xyz;
  13775. vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w);
  13776. float show = packedAttribute0.x;
  13777. float brightness = packedAttribute0.y;
  13778. vec2 coordinates = packedAttribute0.wz;
  13779. vec3 maximumSize = packedAttribute1.xyz;
  13780. float slice = packedAttribute1.w;
  13781. #ifdef INSTANCED
  13782. vec2 dir = direction;
  13783. #else
  13784. vec2 dir = coordinates;
  13785. #endif
  13786. vec2 offset = dir - vec2(0.5, 0.5);
  13787. vec2 scaledOffset = scale * offset;
  13788. vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
  13789. vec4 positionEC = czm_modelViewRelativeToEye * p;
  13790. positionEC.xy += scaledOffset;
  13791. positionEC.xyz *= show;
  13792. gl_Position = czm_projection * positionEC;
  13793. v_offset = offset;
  13794. v_maximumSize = maximumSize;
  13795. v_color = color;
  13796. v_slice = slice;
  13797. v_brightness = brightness;
  13798. }
  13799. `;var FKi=T(S(),1),rM=`uniform vec3 u_noiseTextureDimensions;
  13800. uniform float u_noiseDetail;
  13801. uniform vec3 u_noiseOffset;
  13802. in vec2 v_position;
  13803. float wrap(float value, float rangeLength) {
  13804. if(value < 0.0) {
  13805. float absValue = abs(value);
  13806. float modValue = mod(absValue, rangeLength);
  13807. return mod(rangeLength - modValue, rangeLength);
  13808. }
  13809. return mod(value, rangeLength);
  13810. }
  13811. vec3 wrapVec(vec3 value, float rangeLength) {
  13812. return vec3(wrap(value.x, rangeLength),
  13813. wrap(value.y, rangeLength),
  13814. wrap(value.z, rangeLength));
  13815. }
  13816. vec3 random3(vec3 p) {
  13817. float dot1 = dot(p, vec3(127.1, 311.7, 932.8));
  13818. float dot2 = dot(p, vec3(269.5, 183.3, 421.4));
  13819. return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2));
  13820. }
  13821. // Frequency corresponds to cell size.
  13822. // The higher the frequency, the smaller the cell size.
  13823. vec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) {
  13824. float textureSliceWidth = u_noiseTextureDimensions.x;
  13825. vec3 cell = centerCell + offset;
  13826. cell = wrapVec(cell, textureSliceWidth / u_noiseDetail);
  13827. cell += floor(u_noiseOffset / u_noiseDetail);
  13828. vec3 p = offset + random3(cell);
  13829. return p;
  13830. }
  13831. float worleyNoise(vec3 p, float freq) {
  13832. vec3 centerCell = floor(p * freq);
  13833. vec3 pointInCell = fract(p * freq);
  13834. float shortestDistance = 1000.0;
  13835. for(float z = -1.0; z <= 1.0; z++) {
  13836. for(float y = -1.0; y <= 1.0; y++) {
  13837. for(float x = -1.0; x <= 1.0; x++) {
  13838. vec3 offset = vec3(x, y, z);
  13839. vec3 point = getWorleyCellPoint(centerCell, offset, freq);
  13840. float distance = length(pointInCell - point);
  13841. if(distance < shortestDistance) {
  13842. shortestDistance = distance;
  13843. }
  13844. }
  13845. }
  13846. }
  13847. return shortestDistance;
  13848. }
  13849. const float MAX_FBM_ITERATIONS = 10.0;
  13850. float worleyFBMNoise(vec3 p, float octaves, float scale) {
  13851. float noise = 0.0;
  13852. float freq = 1.0;
  13853. float persistence = 0.625;
  13854. for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) {
  13855. if(i >= octaves) {
  13856. break;
  13857. }
  13858. noise += worleyNoise(p * scale, freq * scale) * persistence;
  13859. persistence *= 0.5;
  13860. freq *= 2.0;
  13861. }
  13862. return noise;
  13863. }
  13864. void main() {
  13865. float textureSliceWidth = u_noiseTextureDimensions.x;
  13866. float inverseNoiseTextureRows = u_noiseTextureDimensions.z;
  13867. float x = mod(v_position.x, textureSliceWidth);
  13868. float y = mod(v_position.y, textureSliceWidth);
  13869. float sliceRow = floor(v_position.y / textureSliceWidth);
  13870. float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth;
  13871. vec3 position = vec3(x, y, z);
  13872. position /= u_noiseDetail;
  13873. float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0);
  13874. float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0);
  13875. float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0);
  13876. out_FragColor = vec4(worley0, worley1, worley2, 1.0);
  13877. }
  13878. `;var MKi=T(S(),1),sM=`uniform vec3 u_noiseTextureDimensions;
  13879. in vec2 position;
  13880. out vec2 v_position;
  13881. void main()
  13882. {
  13883. gl_Position = vec4(position, 0.1, 1.0);
  13884. float textureSliceWidth = u_noiseTextureDimensions.x;
  13885. float noiseTextureRows = u_noiseTextureDimensions.y;
  13886. float inverseNoiseTextureRows = u_noiseTextureDimensions.z;
  13887. vec2 transformedPos = (position * 0.5) + vec2(0.5);
  13888. transformedPos *= textureSliceWidth;
  13889. transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows;
  13890. transformedPos.y *= noiseTextureRows;
  13891. v_position = transformedPos;
  13892. }
  13893. `;var kKi=T(S(),1),aM=`
  13894. in vec2 v_textureCoordinates;
  13895. void main()
  13896. {
  13897. czm_materialInput materialInput;
  13898. materialInput.s = v_textureCoordinates.s;
  13899. materialInput.st = v_textureCoordinates;
  13900. materialInput.str = vec3(v_textureCoordinates, 0.0);
  13901. materialInput.normalEC = vec3(0.0, 0.0, -1.0);
  13902. czm_material material = czm_getMaterial(materialInput);
  13903. out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
  13904. }
  13905. `;var hJi=T(S(),1);var HKi=T(S(),1);function gL(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var nS=new ae;function yxt(e,t,n,i){let o=i.length;for(let r=0;r<o;++r){let s=i[r];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}gL.prototype.addAvailableTileRange=function(e,t,n,i,o){let r=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=o;++p)for(let g=t;g<=i;++g)yxt(e,g,p,s)||s.push(new pL(r,void 0,0,g,p));r.tileXYToRectangle(t,n,e,nS);let a=nS.west,c=nS.north;r.tileXYToRectangle(i,o,e,nS);let d=nS.east,u=nS.south,m=new Cxt(e,a,u,d,c);for(let p=0;p<s.length;++p){let g=s[p];k8(g.extent,m)&&Vxt(this._maximumLevel,g,m)}};gL.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(bL(i.extent,e)){t=i;break}}return l(t)?cM(void 0,t,e):-1};var xxt=[],_xt=[],Txt=new ae,Sxt=new ae;gL.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=xxt;t.length=0,e.east<e.west?(t.push(ae.fromRadians(-Math.PI,e.south,e.east,e.north,Txt)),t.push(ae.fromRadians(e.west,e.south,Math.PI,e.north,Sxt))):t.push(e);let n=_xt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)lM(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var zTe=new he;gL.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,nS);return ae.center(i,zTe),this.computeMaximumLevelAtPosition(zTe)>=e};gL.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let o=0;return o|=this.isTileAvailable(i,2*t,2*n+1)?1:0,o|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,o|=this.isTileAvailable(i,2*t,2*n)?4:0,o|=this.isTileAvailable(i,2*t+1,2*n)?8:0,o};function pL(e,t,n,i,o){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=o,this.extent=e.tileXYToRectangle(i,o,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(pL.prototype,{nw:{get:function(){return this._nw||(this._nw=new pL(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new pL(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new pL(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new pL(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function Cxt(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function k8(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),r=Math.min(e.north,t.north);return i<r&&n<o}function Vxt(e,t,n){for(;t.level<e;)if(kB(t.nw.extent,n))t=t.nw;else if(kB(t.ne.extent,n))t=t.ne;else if(kB(t.sw.extent,n))t=t.sw;else if(kB(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=Eo(t.rectangles,n.level,Lxt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function Lxt(e,t){return e.level-t}function kB(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function bL(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function cM(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&bL(t._nw.extent,n),s=t._ne&&bL(t._ne.extent,n),a=t._sw&&bL(t._sw.extent,n),c=t._se&&bL(t._se.extent,n);if(r+s+a+c>1){r&&(i=Math.max(i,cM(t,t._nw,n))),s&&(i=Math.max(i,cM(t,t._ne,n))),a&&(i=Math.max(i,cM(t,t._sw,n))),c&&(i=Math.max(i,cM(t,t._se,n)));break}else r?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:o=!0}for(;t!==e;){let r=t.rectangles;for(let s=r.length-1;s>=0&&r[s].level>i;--s){let a=r[s];bL(a,n)&&(i=a.level)}t=t.parent}return i}function lM(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||k8(t.extent,n[i]);if(!o)return;let r=t.rectangles;for(i=0;i<r.length;++i){let s=r[i];e[s.level]||(e[s.level]=n),e[s.level]=Rxt(e[s.level],s)}lM(e,t._nw,n),lM(e,t._ne,n),lM(e,t._sw,n),lM(e,t._se,n)}function Rxt(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];k8(o,t)?(o.west<t.west&&n.push(new ae(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new ae(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new ae(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new ae(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var Xh=gL;var Zxt=15;function KTe(e){this.ellipsoid=y(e.ellipsoid,ne.default),this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}KTe.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure};function Gxt(e,t){let n=t.copyrightText;l(n)&&(e.credit=new Et(n));let i=t.spatialReference,o=y(i.latestWkid,i.wkid),r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=ae.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new Yi(s);else if(o===3857){let d=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>d&&(t.extent.xmax=d),t.extent.ymax>d&&(t.extent.ymax=d),t.extent.xmin<-d&&(t.extent.xmin=-d),t.extent.ymin<-d&&(t.extent.ymin=-d),s.rectangleSouthwestInMeters=new D(r.xmin,r.ymin),s.rectangleNortheastInMeters=new D(r.xmax,r.ymax),e.tilingScheme=new ns(s)}else throw new de("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new de("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?$u.LERC:$u.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new Xh(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new Xh(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=ts.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),l(t.minValues)&&l(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function Ext(e,t,n){try{let i=await t.fetchJson();Gxt(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw Zo.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),i}}function Iy(e){e=y(e,y.EMPTY_OBJECT),this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0,this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._errorEvent=new be}Object.defineProperties(Iy.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});Iy.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Ee.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new KTe(t);await Ext(o,i);let r=new Iy(t);return o.build(r),r._resource=n,r};Iy.prototype.requestTileGeometry=function(e,t,n,i){let o=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),r=this._hasAvailability,s=Promise.resolve(!0),a;if(r&&!l(U8(this,n+1,e*2,t*2))){let m=JTe(this,n+1,e*2,t*2);s=m.promise,a=m.request}let c=o.fetchArrayBuffer();if(!l(c)||!l(s))return;let d=this,u=this._tilesAvailable;return Promise.all([c,s]).then(function(m){return new Ma({buffer:m[0],width:d._width,height:d._height,childTileMask:r?u.computeChildMaskForTile(n,e,t):Zxt,structure:d._terrainDataStructure,encoding:d._encoding})}).catch(async function(m){if(l(a)&&a.state===jn.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=jn.CANCELLED,Promise.reject(m)}return Promise.reject(m)})};function U8(e,t,n,i){if(!e._hasAvailability)return;let o=e._tilesAvailabilityLoaded,r=e._tilesAvailable;if(t>e._lodCount)return!1;if(r.isTileAvailable(t,n,i))return!0;if(o.isTileAvailable(t,n,i))return!1}Iy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Iy.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=U8(this,n,e,t);if(l(i))return i;JTe(this,n,e,t)};Iy.prototype.loadTileDataAvailability=function(e,t,n){};function Ixt(e,t,n,i){let o=t-1,r=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},d=new D(e.x+1,e.y+1),u=!1,m=!1;for(;!(u&&m);){let p=d.x,g=m?d.y+1:d.y;if(!u){for(let f=e.y;f<g;++f)if(i[f*t+d.x]!==s){u=!0;break}u?(a.push(new D(d.x,e.y)),--d.x,--p,c.endX=d.x):d.x===o?(c.endX=d.x,u=!0):++d.x}if(!m){let f=d.y*t;for(let x=e.x;x<=p;++x)if(i[f+x]!==s){m=!0;break}m?(a.push(new D(e.x,d.y)),--d.y,c.endY=d.y):d.y===r?(c.endY=d.y,m=!0):++d.y}}return{endingIndices:a,range:c,value:s}}function Xxt(e,t,n,i,o){let r=[];if(o.every(function(c){return c===o[0]}))return o[0]===1&&r.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),r;let a=[new D(0,0)];for(;a.length>0;){let c=a.pop(),d=Ixt(c,n,i,o);if(d.value===1){let m=d.range;m.startX+=e,m.endX+=e,m.startY+=t,m.endY+=t,r.push(m)}let u=d.endingIndices;u.length>0&&(a=a.concat(u))}return r}function JTe(e,t,n,i){if(!e._hasAvailability)return{};let o=Math.floor(n/128)*128,r=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${r}/${o}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let d=new Ho({throttle:!1,throttleByServer:!0,type:cs.TERRAIN}),m=e._resource.getDerivedResource({url:a,request:d}).fetchJson();return l(m)?(m=m.then(function(p){let g=Xxt(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let f=e._tilesAvailable;for(let x=0;x<g.length;++x){let _=g[x];f.addAvailableTileRange(t,_.startX,_.startY,_.endX,_.endY)}return U8(e,t,n,i)}),c[a]={promise:m,request:d},m=m.finally(function(p){return delete c[a],p}),{promise:m,request:d}):{}}var D8=Iy;var _Ji=T(S(),1);var QTe="https://dev.virtualearth.net/REST/v1/Locations";function B8(e){e=y(e,y.EMPTY_OBJECT);let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new Ee({url:QTe,queryParameters:n}),this._credit=new Et('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(B8.prototype,{url:{get:function(){return QTe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});B8.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(o){let r=o.bbox,s=r[0],a=r[1],c=r[2],d=r[3];return{displayName:o.name,destination:ae.fromDegrees(a,s,d,c)}})})};var O8=B8;var CJi=T(S(),1);function Y8(){}Object.defineProperties(Y8.prototype,{credit:{get:function(){}}});Y8.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],o=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let r=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(r);r.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(o)){let r={displayName:e,destination:h.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var H8=Y8;var WJi=T(S(),1);var Wxt=new se,jTe=new h,yL=new h;function Pxt(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],o=1/(n[1]-i),r=t[0],s=t[1];return function(a,c){l(c)||(c=new h);let d=(a-i)*o;return h.lerp(r,s,d,c)}}return function(i,o){l(o)||(o=new h);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=Wxt;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,d,u,m,p;return r===0?(c=t[0],d=t[1],u=e.firstTangent,m=h.subtract(t[2],c,jTe),h.multiplyByScalar(m,.5,m),p=M.multiplyByVector(gg.hermiteCoefficientMatrix,a,a)):r===t.length-2?(c=t[r],d=t[r+1],m=e.lastTangent,u=h.subtract(d,t[r-1],jTe),h.multiplyByScalar(u,.5,u),p=M.multiplyByVector(gg.hermiteCoefficientMatrix,a,a)):(c=t[r-1],d=t[r],u=t[r+1],m=t[r+2],p=M.multiplyByVector(Xy.catmullRomCoefficientMatrix,a,a)),o=h.multiplyByScalar(c,p.x,o),h.multiplyByScalar(d,p.y,yL),h.add(o,yL,o),h.multiplyByScalar(u,p.z,yL),h.add(o,yL,o),h.multiplyByScalar(m,p.w,yL),h.add(o,yL,o)}}var vxt=new h,wxt=new h;function Xy(e){e=y(e,y.EMPTY_OBJECT);let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(t.length>2&&(l(i)||(i=vxt,h.multiplyByScalar(t[1],2,i),h.subtract(i,t[2],i),h.subtract(i,t[0],i),h.multiplyByScalar(i,.5,i)),!l(o))){let r=t.length-1;o=wxt,h.multiplyByScalar(t[r-1],2,o),h.subtract(t[r],o,o),h.add(o,t[r-2],o),h.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=h.clone(i),this._lastTangent=h.clone(o),this._evaluateFunction=Pxt(this),this._lastTimeIndex=0}Object.defineProperties(Xy.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});Xy.catmullRomCoefficientMatrix=new M(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);Xy.prototype.findTimeInterval=to.prototype.findTimeInterval;Xy.prototype.wrapTime=to.prototype.wrapTime;Xy.prototype.clampTime=to.prototype.clampTime;Xy.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var z8=Xy;var CQi=T(S(),1);var qJi=T(S(),1);var AJi=T(S(),1);var UB={};UB.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){l(r)?r.length=0:r=[];let s,a,c;t?(s=n<e,a=i<e,c=o<e):(s=n>e,a=i>e,c=o>e);let d=s+a+c,u,m,p,g,f,x;return d===1?s?(u=(e-n)/(i-n),m=(e-n)/(o-n),r.push(1),r.push(2),m!==1&&(r.push(-1),r.push(0),r.push(2),r.push(m)),u!==1&&(r.push(-1),r.push(0),r.push(1),r.push(u))):a?(p=(e-i)/(o-i),g=(e-i)/(n-i),r.push(2),r.push(0),g!==1&&(r.push(-1),r.push(1),r.push(0),r.push(g)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):c&&(f=(e-o)/(n-o),x=(e-o)/(i-o),r.push(0),r.push(1),x!==1&&(r.push(-1),r.push(2),r.push(1),r.push(x)),f!==1&&(r.push(-1),r.push(2),r.push(0),r.push(f))):d===2?!s&&n!==e?(g=(e-i)/(n-i),f=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(g),r.push(-1),r.push(2),r.push(0),r.push(f)):!a&&i!==e?(x=(e-o)/(i-o),u=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(x),r.push(-1),r.push(0),r.push(1),r.push(u)):!c&&o!==e&&(m=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(m),r.push(-1),r.push(1),r.push(2),r.push(p)):d!==3&&(r.push(0),r.push(1),r.push(2)),r};UB.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,c){let d=n-s,u=s-o,m=r-a,p=i-a,g=1/(m*d+u*p),f=t-a,x=e-s,_=(m*x+u*f)*g,C=(-p*x+d*f)*g,V=1-_-C;return l(c)?(c.x=_,c.y=C,c.z=V,c):new h(_,C,V)};UB.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,c){let d=(s-o)*(t-r)-(a-r)*(e-o),u=(n-e)*(t-r)-(i-t)*(e-o),m=(a-r)*(n-e)-(s-o)*(i-t);if(m===0)return;let p=d/m,g=u/m;if(p>=0&&p<=1&&g>=0&&g<=1)return l(c)||(c=new D),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var p0=UB;function Wy(e){this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function o(s,a){return i[s]-i[a]}function r(s,a){return n[s]-n[a]}this._westIndices=BB(e.westIndices,o,t),this._southIndices=BB(e.southIndices,r,t),this._eastIndices=BB(e.eastIndices,o,t),this._northIndices=BB(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=y(e.childTileMask,15),this._createdByUpsampling=y(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(Wy.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var DB=[];function BB(e,t,n){DB.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)DB[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(DB.sort(t),Ae.createTypedArray(n,DB)):e}var qTe="createVerticesFromQuantizedTerrainMesh",Fxt=new bi(qTe),Axt=new bi(qTe,Th.maximumAsynchronousTasks);Wy.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid,d=t.tileXYToRectangle(n,i,o),m=(a?Axt:Fxt).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:d,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:r,exaggerationRelativeHeight:s});if(!l(m))return;let p=this;return Promise.resolve(m).then(function(g){let f=p._quantizedVertices.length/3,x=f+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,_=Ae.createTypedArray(x,g.indices),C=new Float32Array(g.vertices),V=g.center,L=g.minimumHeight,Z=g.maximumHeight,G=p._boundingSphere,I=p._orientedBoundingBox,v=y(h.clone(g.occludeePointInScaledSpace),p._horizonOcclusionPoint),P=g.vertexStride,w=_c.clone(g.encoding);return p._mesh=new tm(V,C,_,g.indexCountWithoutSkirts,f,L,Z,G,v,P,I,w,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var Mxt=new bi("upsampleQuantizedTerrainMesh",Th.maximumAsynchronousTasks);Wy.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,d=n*2===r,u=e.ellipsoid,m=e.tileXYToRectangle(o,r,s),p=Mxt.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:d,childRectangle:m,ellipsoid:u});if(!l(p))return;let g=Math.min(this._westSkirtHeight,this._eastSkirtHeight);g=Math.min(g,this._southSkirtHeight),g=Math.min(g,this._northSkirtHeight);let f=c?g*.5:this._westSkirtHeight,x=d?g*.5:this._southSkirtHeight,_=c?this._eastSkirtHeight:g*.5,C=d?this._northSkirtHeight:g*.5,V=this._credits;return Promise.resolve(p).then(function(L){let Z=new Uint16Array(L.vertices),G=Ae.createTypedArray(Z.length/3,L.indices),I;return l(L.encodedNormals)&&(I=new Uint8Array(L.encodedNormals)),new Wy({quantizedVertices:Z,indices:G,encodedNormals:I,minimumHeight:L.minimumHeight,maximumHeight:L.maximumHeight,boundingSphere:ce.clone(L.boundingSphere),orientedBoundingBox:En.clone(L.orientedBoundingBox),horizonOcclusionPoint:h.clone(L.horizonOcclusionPoint),westIndices:L.westIndices,southIndices:L.southIndices,eastIndices:L.eastIndices,northIndices:L.northIndices,westSkirtHeight:f,southSkirtHeight:x,eastSkirtHeight:_,northSkirtHeight:C,childTileMask:0,credits:V,createdByUpsampling:!0})})};var K8=32767,$Te=new h;Wy.prototype.interpolateHeight=function(e,t,n){let i=W.clamp((t-e.west)/e.width,0,1);i*=K8;let o=W.clamp((n-e.south)/e.height,0,1);return o*=K8,l(this._mesh)?Dxt(this,i,o):Bxt(this,i,o)};function eSe(e,t,n,i,o,r,s,a){let c=Math.min(n,o,s),d=Math.max(n,o,s),u=Math.min(i,r,a),m=Math.max(i,r,a);return e>=c&&e<=d&&t>=u&&t<=m}var Nxt=new D,kxt=new D,Uxt=new D;function Dxt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],m=s[a+2],p=r.decodeTextureCoordinates(o,d,Nxt),g=r.decodeTextureCoordinates(o,u,kxt),f=r.decodeTextureCoordinates(o,m,Uxt);if(eSe(t,n,p.x,p.y,g.x,g.y,f.x,f.y)){let x=p0.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,f.x,f.y,$Te);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let _=r.decodeHeight(o,d),C=r.decodeHeight(o,u),V=r.decodeHeight(o,m);return x.x*_+x.y*C+x.z*V}}}}function Bxt(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],m=s[a+2],p=i[d],g=i[u],f=i[m],x=o[d],_=o[u],C=o[m];if(eSe(t,n,p,x,g,_,f,C)){let V=p0.computeBarycentricCoordinates(t,n,p,x,g,_,f,C,$Te);if(V.x>=-1e-15&&V.y>=-1e-15&&V.z>=-1e-15){let L=V.x*r[d]+V.y*r[u]+V.z*r[m];return W.lerp(e._minimumHeight,e._maximumHeight,L/K8)}}}}Wy.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};Wy.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var iS=Wy;function Oxt(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function nSe(e){this.requestVertexNormals=y(e.requestVertexNormals,!1),this.requestWaterMask=y(e.requestWaterMask,!1),this.requestMetadata=y(e.requestMetadata,!0),this.ellipsoid=y(e.ellipsoid,ne.default),this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}nSe.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=l(this.lastResource.credits)?this.lastResource.credits:[];e._tileCredits=t.concat(this.tileCredits),e._availability=this.availability,e._tilingScheme=this.tilingScheme,e._requestWaterMask=this.requestWaterMask,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._heightmapStructure=this.heightmapStructure,e._layers=this.layers,e._hasWaterMask=this.hasWaterMask,e._hasVertexNormals=this.hasVertexNormals,e._hasMetadata=this.hasMetadata};async function iSe(e,t,n){if(!t.format){let x="The tile format is not specified in the layer.json file.";throw e.previousError=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new de(x)}if(!t.tiles||t.tiles.length===0){let x="The layer.json file does not specify any tile URL templates.";throw e.previousError=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new de(x)}let i=!1,o=!1,r=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,l(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),o=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let x=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new de(x)}let c=t.tiles,d=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,d),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new Yi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new ns({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let x=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new de(x)}if(e.levelZeroMaximumGeometricError=ts.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let x=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,x),new de(x)}let u;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let m=t.metadataAvailability,p=t.available,g;if(l(p)&&!l(m)){g=new Xh(e.tilingScheme,p.length);for(let x=0;x<p.length;++x){let _=p[x],C=e.tilingScheme.getNumberOfYTilesAtLevel(x);l(e.overallAvailability[x])||(e.overallAvailability[x]=[]);for(let V=0;V<_.length;++V){let L=_[V],Z=C-L.endY-1,G=C-L.startY-1;e.overallAvailability[x].push([L.startX,Z,L.endX,G]),g.addAvailableTileRange(x,L.startX,Z,L.endX,G)}}}else l(m)&&(u=new Xh(e.tilingScheme,d),g=new Xh(e.tilingScheme,d),e.overallAvailability[0]=[[0,0,1,0]],g.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||o,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||r,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new Oxt({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:m,availabilityTilesLoaded:u,littleEndianExtensionSize:s}));let f=t.parentUrl;return l(f)?l(g)?(e.lastResource=e.lastResource.getDerivedResource({url:f}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await j8(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function Yxt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=`
  13906. ${t.message}`),e.previousError=Zo.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return j8(e,n);throw new de(i)}async function Hxt(e,t,n){await iSe(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new Xh(e.tilingScheme,e.overallMaxZoom);for(let r=0;r<i;++r){let s=e.overallAvailability[r];for(let a=0;a<s.length;++a){let c=s[a];o.addAvailableTileRange(r,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let o=new Et(e.attribution);e.tileCredits.push(o)}return!0}async function j8(e,t){try{let n=await e.layerJsonResource.fetchJson();return Hxt(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await iSe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):Yxt(e,n,t)}}function Wh(e){e=y(e,y.EMPTY_OBJECT),this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=y(e.requestVertexNormals,!1),this._requestWaterMask=y(e.requestWaterMask,!1),this._requestMetadata=y(e.requestMetadata,!0),this._errorEvent=new be;let t=e.credit;typeof t=="string"&&(t=new Et(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._tileCredits=void 0}var J8={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function tSe(e){return!l(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function zxt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Ma({buffer:r,childTileMask:new Uint8Array(t,r.byteLength,1)[0],waterMask:new Uint8Array(t,r.byteLength+1,t.byteLength-r.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function Kxt(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,c=3,d=c+1,u=Float64Array.BYTES_PER_ELEMENT*c,m=Float64Array.BYTES_PER_ELEMENT*d,g=Uint16Array.BYTES_PER_ELEMENT*3,f=3,x=Uint16Array.BYTES_PER_ELEMENT,_=x*f,C=new DataView(t),V=new h(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=u;let L=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let Z=C.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let G=new ce(new h(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0)),C.getFloat64(a+u,!0));a+=m;let I=new h(C.getFloat64(a,!0),C.getFloat64(a+8,!0),C.getFloat64(a+16,!0));a+=u;let v=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let P=new Uint16Array(t,a,v*3);a+=v*g,v>64*1024&&(x=Uint32Array.BYTES_PER_ELEMENT,_=x*f);let w=P.subarray(0,v),F=P.subarray(v,2*v),b=P.subarray(v*2,3*v);wn.zigZagDeltaDecode(w,F,b),a%x!==0&&(a+=x-a%x);let R=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let E=Ae.createTypedArrayFromArrayBuffer(v,t,a,R*f);a+=R*_;let X=0,A=E.length;for(let le=0;le<A;++le){let ye=E[le];E[le]=X-ye,ye===0&&++X}let N=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let O=Ae.createTypedArrayFromArrayBuffer(v,t,a,N);a+=N*x;let U=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let Y=Ae.createTypedArrayFromArrayBuffer(v,t,a,U);a+=U*x;let k=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let H=Ae.createTypedArrayFromArrayBuffer(v,t,a,k);a+=k*x;let J=C.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let te=Ae.createTypedArrayFromArrayBuffer(v,t,a,J);a+=J*x;let z,q;for(;a<C.byteLength;){let le=C.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let ye=C.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,le===J8.OCT_VERTEX_NORMALS&&e._requestVertexNormals)z=new Uint8Array(t,a,v*2);else if(le===J8.WATER_MASK&&e._requestWaterMask)q=new Uint8Array(t,a,ye);else if(le===J8.METADATA&&e._requestMetadata){let Te=C.getUint32(a,!0);if(Te>0){let Le=Wo(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,Te).available;if(l(Le))for(let ke=0;ke<Le.length;++ke){let Oe=n+ke+1,at=Le[ke],Mt=e._tilingScheme.getNumberOfYTilesAtLevel(Oe);for(let Lt=0;Lt<at.length;++Lt){let Ie=at[Lt],je=Mt-Ie.endY-1,et=Mt-Ie.startY-1;e.availability.addAvailableTileRange(Oe,Ie.startX,je,Ie.endX,et),r.availability.addAvailableTileRange(Oe,Ie.startX,je,Ie.endX,et)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=ye}let ee=e.getLevelMaximumGeometricError(n)*5,fe=e._tilingScheme.tileXYToRectangle(i,o,n),_e=En.fromRectangle(fe,L,Z,e._tilingScheme.ellipsoid);return new iS({center:V,minimumHeight:L,maximumHeight:Z,boundingSphere:G,orientedBoundingBox:_e,horizonOcclusionPoint:I,quantizedVertices:P,encodedNormals:z,indices:E,westIndices:O,southIndices:Y,eastIndices:H,northIndices:te,westSkirtHeight:ee,southSkirtHeight:ee,eastSkirtHeight:ee,northSkirtHeight:ee,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:q,credits:e._tileCredits})}Wh.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,s=o.length,a=!1,c=Promise.resolve();if(s===1)r=o[0];else for(let d=0;d<s;++d){let u=o[d];if(!l(u.availability)||u.availability.isTileAvailable(n,e,t)){r=u;break}let m=q8(this,e,t,n,u,d===0);m.result&&(a=!0,c=c.then(()=>m.promise))}return!l(r)&&a?c.then(()=>new Promise(d=>{setTimeout(()=>{let u=this.requestTileGeometry(e,t,n,i);d(u)},0)})):oSe(this,e,t,n,r,i)};function oSe(e,t,n,i,o,r){if(!l(o))return Promise.reject(new de("Terrain tile doesn't exist"));let s=o.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&o.hasVertexNormals&&c.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&c.push("watermask"),e._requestMetadata&&o.hasMetadata&&c.push("metadata");let d,u,m=s[(t+a+i)%s.length],p=o.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(u={extensions:c.join("-")}),d=tSe(void 0)):d=tSe(c);let g=p.getDerivedResource({url:m,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:u,headers:d,request:r}).fetchArrayBuffer();if(l(g))return g.then(function(f){return l(f)?l(e._heightmapStructure)?zxt(e,f,i,t,n):Kxt(e,f,i,t,n,o):Promise.reject(new de("Mesh buffer doesn't exist."))})}Object.defineProperties(Wh.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});Wh.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Wh.fromIonAssetId=async function(e,t){let n=await fd.fromAssetId(e);return Wh.fromUrl(n,t)};Wh.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT),e=await Promise.resolve(e);let n=Ee.createIfNeeded(e);n.appendForwardSlash();let i=new nSe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await j8(i);let o=new Wh(t);return i.build(o),o};Wh.prototype.getTileDataAvailable=function(e,t,n){if(!l(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,o=i.length;for(let r=0;r<o;++r)if(q8(this,e,t,n,i[r],r===0).result)return;return!1};Wh.prototype.loadTileDataAvailability=function(e,t,n){if(!l(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,o=i.length;for(let r=0;r<o;++r){let s=q8(this,e,t,n,i[r],r===0);if(l(s.promise))return s.promise}};function Q8(e,t,n,i){if(i===0)return;let o=e.availabilityLevels,r=i%o===0?i-o:(i/o|0)*o,s=1<<i-r,a=t/s|0,c=n/s|0;return{level:r,x:a,y:c}}function q8(e,t,n,i,o,r){if(!l(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},c=o.availabilityTilesLoaded,d=o.availability,u=Q8(o,t,n,i);for(;l(u);){if(d.isTileAvailable(u.level,u.x,u.y)&&!c.isTileAvailable(u.level,u.x,u.y)){let m;if(!r&&(s=`${u.level}-${u.x}-${u.y}`,m=o.availabilityPromiseCache[s],!l(m))){let p=new Ho({throttle:!1,throttleByServer:!0,type:cs.TERRAIN});m=oSe(e,u.x,u.y,u.level,o,p),l(m)&&(o.availabilityPromiseCache[s]=m,m.then(a))}return{result:!0,promise:m}}u=Q8(o,u.x,u.y,u.level)}return{result:!1}}Wh._getAvailabilityTile=Q8;var oS=Wh;var XQi=T(S(),1);function b0(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new $c(n),this._workerName="createCircleGeometry"}b0.packedLength=$c.packedLength;b0.pack=function(e,t,n){return $c.pack(e._ellipseGeometry,t,n)};var rSe=new $c({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Da={center:new h,radius:void 0,ellipsoid:ne.clone(ne.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new We,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};b0.unpack=function(e,t,n){let i=$c.unpack(e,t,rSe);return Da.center=h.clone(i._center,Da.center),Da.ellipsoid=ne.clone(i._ellipsoid,Da.ellipsoid),Da.ellipsoid=ne.clone(i._ellipsoid,rSe._ellipsoid),Da.height=i._height,Da.extrudedHeight=i._extrudedHeight,Da.granularity=i._granularity,Da.vertexFormat=We.clone(i._vertexFormat,Da.vertexFormat),Da.stRotation=i._stRotation,Da.shadowVolume=i._shadowVolume,l(n)?(Da.semiMajorAxis=i._semiMajorAxis,Da.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new $c(Da),n):(Da.radius=i._semiMajorAxis,new b0(Da))};b0.createGeometry=function(e){return $c.createGeometry(e._ellipseGeometry)};b0.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new b0({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:We.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(b0.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var $8=b0;var MQi=T(S(),1);function xL(e){e=y(e,y.EMPTY_OBJECT);let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new Pd(n),this._workerName="createCircleOutlineGeometry"}xL.packedLength=Pd.packedLength;xL.pack=function(e,t,n){return Pd.pack(e._ellipseGeometry,t,n)};var Jxt=new Pd({center:new h,semiMajorAxis:1,semiMinorAxis:1}),eu={center:new h,radius:void 0,ellipsoid:ne.clone(ne.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};xL.unpack=function(e,t,n){let i=Pd.unpack(e,t,Jxt);return eu.center=h.clone(i._center,eu.center),eu.ellipsoid=ne.clone(i._ellipsoid,eu.ellipsoid),eu.height=i._height,eu.extrudedHeight=i._extrudedHeight,eu.granularity=i._granularity,eu.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(eu.semiMajorAxis=i._semiMajorAxis,eu.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Pd(eu),n):(eu.radius=i._semiMajorAxis,new xL(eu))};xL.createGeometry=function(e){return Pd.createGeometry(e._ellipseGeometry)};var e7=xL;var KQi=T(S(),1);function _L(e){e=y(e,y.EMPTY_OBJECT),this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Yi({ellipsoid:y(e.ellipsoid,ne.default)})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=ts.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be;let n=e.credit;typeof n=="string"&&(n=new Et(n)),this._credit=n}Object.defineProperties(_L.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});_L.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!l(o))return;let r=this._width,s=this._height;return Promise.resolve(o).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new Ma({buffer:c,width:r,height:s})})};_L.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};_L.prototype.getTileDataAvailable=function(e,t,n){};_L.prototype.loadTileDataAvailability=function(e,t,n){};var t7=_L;var QQi=T(S(),1);function sSe(e){this.proxy=e}sSe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var n7=sSe;var qQi=T(S(),1),Qxt={SEARCH:0,AUTOCOMPLETE:1},Py=Object.freeze(Qxt);var i4i=T(S(),1);function OB(){pe.throwInstantiationError()}Object.defineProperties(OB.prototype,{credit:{get:pe.throwInstantiationError}});OB.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(Et.getIonCredit)};OB.prototype.geocode=pe.throwInstantiationError;var TL=OB;var s4i=T(S(),1);function aSe(){pe.throwInstantiationError()}aSe.createGeometry=function(e){pe.throwInstantiationError()};var i7=aSe;var Z4i=T(S(),1),n_t=T(o7(),1);var h4i=T(S(),1);var l4i=T(S(),1);function jxt(e,t){return(e&t)!==0}var Lc=jxt;var qxt=[1,2,4,8],cSe=15,$xt=16,e_t=64,t_t=128;function np(e,t,n,i,o,r){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=o,this.terrainProvider=r,this.ancestorHasTerrain=!1,this.terrainState=void 0}np.clone=function(e,t){return l(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new np(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};np.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};np.prototype.hasSubtree=function(){return Lc(this._bits,$xt)};np.prototype.hasImagery=function(){return Lc(this._bits,e_t)};np.prototype.hasTerrain=function(){return Lc(this._bits,t_t)};np.prototype.hasChildren=function(){return Lc(this._bits,cSe)};np.prototype.hasChild=function(e){return Lc(this._bits,qxt[e])};np.prototype.getChildBitmask=function(){return this._bits&cSe};var dM=np;function i_t(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let o=0;o<t;++o)i[o]=e.charCodeAt(o);return n}var o_t=i_t(`E\xF4\xBD\vy\xE2jE"\x92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!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=W.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(tu.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});tu.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof Ee)&&(t=e.url);let n=Ee.createIfNeeded(t);n.appendForwardSlash();let i=new tu;i._resource=n;try{await r_t(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${dSe(i,"",1).url}: ${o}`;throw new de(r)}return i};tu.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;Lc(t,r)?Lc(e,r)&&(s|=1):(s|=2,Lc(e,r)||(s|=1)),i+=s}return i};tu.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];Lc(s,2)?Lc(s,1)||(t|=r):(n|=r,Lc(s,1)&&(t|=r))}return{x:t,y:n,level:i}};tu.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,o;for(;i.length>1;)if(o=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(o))&&(n=!1);break}else if(t===null){n=!1;break}return n};var lSe=new bi("decodeGoogleEarthEnterprisePacket");tu.prototype.getQuadTreePacket=function(e,t,n){t=y(t,1),e=y(e,"");let o=dSe(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return lSe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(d){let u,m=-1;if(e!==""){m=e.length+1;let f=d[e];u=r[e],u._bits|=f._bits,delete d[e]}let p=Object.keys(d);p.sort(function(f,x){return f.length-x.length});let g=p.length;for(let f=0;f<g;++f){let x=p[f];if(d[x]!==null){let C=dM.clone(d[x]),V=x.length;if(V===m)C.setParent(u);else if(V>1){let L=r[x.substring(0,x.length-1)];C.setParent(L)}r[x]=C}else r[x]=null}})})};tu.prototype.populateSubtree=function(e,t,n,i){let o=tu.tileXYToQuadKey(e,t,n);return a7(this,o,i)};function a7(e,t,n){let i=e._tileInfo,o=t,r=i[o];if(l(r)&&(!r.hasSubtree()||r.hasChildren()))return r;for(;r===void 0&&o.length>1;)o=o.substring(0,o.length-1),r=i[o];let s,a=e._subtreePromises,c=a[o];if(l(c))return c.then(function(){return s=new Ho({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),a7(e,t,s)});if(!l(r)||!r.hasSubtree())return Promise.reject(new de(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(o,r.cnodeVersion,n),!!l(c))return a[o]=c,c.then(function(){return s=new Ho({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),a7(e,t,s)}).finally(function(){delete a[o]})}tu.prototype.getTileInformation=function(e,t,n){let i=tu.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};tu.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function dSe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var r7,s7;function r_t(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(s7)){let n=rn("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;s7=Qy(n).then(function(){r7=window.cesiumGoogleEarthDbRootParser(n_t),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return s7.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=r7.EncryptedDbRootProto.decode(new Uint8Array(n)),o=i.encryptionData,r=o.byteOffset,s=r+o.byteLength,a=e.key=o.buffer.slice(r,s);o=i.dbrootData,r=o.byteOffset,s=r+o.byteLength;let c=o.buffer.slice(r,s);return lSe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=r7.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=y(i.imageryPresent,e.imageryPresent),e.protoImagery=i.protoImagery,e.terrainPresent=y(i.terrainPresent,e.terrainPresent),l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=y(a.negativeAltitudeExponentBias,e.negativeAltitudeExponentBias),e.negativeAltitudeThreshold=y(a.compressedNegativeAltitudeThreshold,e.negativeAltitudeThreshold)}l(i.databaseVersion)&&(e._quadPacketVersion=y(i.databaseVersion.quadtreeVersion,e._quadPacketVersion));let o=e.providers,r=y(i.providerInfo,[]),s=r.length;for(let a=0;a<s;++a){let c=r[a],d=c.copyrightString;l(d)&&(o[c.providerId]=new Et(d.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=o_t})}var g0=tu;var O4i=T(S(),1);function rS(e){e=y(e,y.EMPTY_OBJECT),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=y(e.childTileMask,15),n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=y(e.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(rS.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var hSe="createVerticesFromGoogleEarthEnterpriseBuffer",s_t=new bi(hSe),a_t=new bi(hSe,Th.maximumAsynchronousTasks),uSe=new ae,c7=new ae;rS.prototype.createMesh=function(e){e=y(e,y.EMPTY_OBJECT);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=y(e.exaggeration,1),s=y(e.exaggerationRelativeHeight,0),a=y(e.throttle,!0),c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,uSe),t.tileXYToRectangle(n,i,o,c7);let d=c.cartographicToCartesian(ae.center(c7)),m=40075.16/(1<<o);this._skirtHeight=Math.min(m*8,1e3);let g=(a?a_t:s_t).scheduleTask({buffer:this._buffer,nativeRectangle:uSe,rectangle:c7,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(g))return;let f=this;return g.then(function(x){return f._mesh=new tm(d,new Float32Array(x.vertices),new Uint16Array(x.indices),x.indexCountWithoutSkirts,x.vertexCountWithoutSkirts,x.minimumHeight,x.maximumHeight,ce.clone(x.boundingSphere3D),h.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,En.clone(x.orientedBoundingBox),_c.clone(x.encoding),x.westIndicesSouthToNorth,x.southIndicesEastToWest,x.eastIndicesNorthToSouth,x.northIndicesWestToEast),f._minimumHeight=x.minimumHeight,f._maximumHeight=x.maximumHeight,f._buffer=void 0,f._mesh})};rS.prototype.interpolateHeight=function(e,t,n){let i=W.clamp((t-e.west)/e.width,0,1),o=W.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?m_t(this,i,o):p_t(this,i,o,e)};var c_t=new bi("upsampleQuantizedTerrainMesh",Th.maximumAsynchronousTasks);rS.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,d=n*2===r,u=e.ellipsoid,m=e.tileXYToRectangle(o,r,s),p=c_t.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:d,childRectangle:m,ellipsoid:u});if(!l(p))return;let g=this;return p.then(function(f){let x=new Uint16Array(f.vertices),_=Ae.createTypedArray(x.length/3,f.indices),C=g._skirtHeight;return new iS({quantizedVertices:x,indices:_,minimumHeight:f.minimumHeight,maximumHeight:f.maximumHeight,boundingSphere:ce.clone(f.boundingSphere),orientedBoundingBox:En.clone(f.orientedBoundingBox),horizonOcclusionPoint:h.clone(f.horizonOcclusionPoint),westIndices:f.westIndices,southIndices:f.southIndices,eastIndices:f.eastIndices,northIndices:f.northIndices,westSkirtHeight:C,southSkirtHeight:C,eastSkirtHeight:C,northSkirtHeight:C,childTileMask:0,createdByUpsampling:!0,credits:g._credits})})};rS.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};rS.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var l_t=new D,d_t=new D,u_t=new D,fSe=new h;function m_t(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],m=s[a+2],p=r.decodeTextureCoordinates(o,d,l_t),g=r.decodeTextureCoordinates(o,u,d_t),f=r.decodeTextureCoordinates(o,m,u_t),x=p0.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,f.x,f.y,fSe);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let _=r.decodeHeight(o,d),C=r.decodeHeight(o,u),V=r.decodeHeight(o,m);return x.x*_+x.y*C+x.z*V}}}var h_t=Uint16Array.BYTES_PER_ELEMENT,mSe=Uint32Array.BYTES_PER_ELEMENT,l7=Int32Array.BYTES_PER_ELEMENT,f_t=Float32Array.BYTES_PER_ELEMENT,d7=Float64Array.BYTES_PER_ELEMENT;function p_t(e,t,n,i){let o=e._buffer,r=0,s=0,a=0;n>.5?(t>.5?(r=2,s=.5):r=3,a=.5):t>.5&&(r=1,s=.5);let c=new DataView(o),d=0;for(let G=0;G<r;++G)d+=c.getUint32(d,!0),d+=mSe;d+=mSe,d+=2*d7;let u=W.toRadians(c.getFloat64(d,!0)*180);d+=d7;let m=W.toRadians(c.getFloat64(d,!0)*180);d+=d7;let p=i.width/u/2,g=i.height/m/2,f=c.getInt32(d,!0);d+=l7;let x=c.getInt32(d,!0)*3;d+=l7,d+=l7;let _=new Array(f),C=new Array(f),V=new Array(f),L;for(L=0;L<f;++L)_[L]=s+c.getUint8(d++)*p,C[L]=a+c.getUint8(d++)*g,V[L]=c.getFloat32(d,!0)*6371010,d+=f_t;let Z=new Array(x);for(L=0;L<x;++L)Z[L]=c.getUint16(d,!0),d+=h_t;for(L=0;L<x;L+=3){let G=Z[L],I=Z[L+1],v=Z[L+2],P=_[G],w=_[I],F=_[v],b=C[G],R=C[I],E=C[v],X=p0.computeBarycentricCoordinates(t,n,P,b,w,R,F,E,fSe);if(X.x>=-1e-15&&X.y>=-1e-15&&X.z>=-1e-15)return X.x*V[G]+X.y*V[I]+X.z*V[v]}}var SL=rS;var cji=T(S(),1);var dm={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},YB=new j;function HB(){this._terrainCache={},this._lastTidy=j.now()}HB.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:j.now()}};HB.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};HB.prototype.tidy=function(){if(j.now(YB),j.secondsDifference(YB,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let o=t[i],r=e[o];j.secondsDifference(YB,r.timestamp)>10&&delete e[o]}j.clone(YB,this._lastTidy)}};function vy(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=new Yi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ae(-W.PI,-W.PI,W.PI,W.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Et(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new HB,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new be}Object.defineProperties(vy.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});vy.fromMetadata=function(e,t){if(!e.terrainPresent)throw new de(`The server ${e.url} doesn't have terrain`);let n=new vy(t);return n._metadata=e,n};var b_t=new bi("decodeGoogleEarthEnterprisePacket");function pSe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===dm.PARENT){i=0;for(let o=0;o<4;++o){let r=n.getTileInformationFromQuadKey(e+o.toString());l(r)&&r.hasTerrain()&&(i|=1<<o)}}return i}vy.prototype.requestTileGeometry=function(e,t,n,i){let o=g0.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!l(a))return Promise.reject(new de("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=dm.UNKNOWN);let d=r.get(o);if(l(d)){let C=s.providers[a.terrainProvider];return Promise.resolve(new SL({buffer:d,childTileMask:pSe(o,a,s),credits:l(C)?[C]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(c===dm.NONE)return Promise.reject(new de("Terrain tile doesn't exist"))}else return Promise.resolve(new Ma({buffer:new Uint8Array(16*16),width:16,height:16}));let u,m=o,p=-1;switch(c){case dm.SELF:p=a.terrainVersion;break;case dm.PARENT:m=m.substring(0,m.length-1),u=s.getTileInformationFromQuadKey(m),p=u.terrainVersion;break;case dm.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(m=m.substring(0,m.length-1),u=s.getTileInformationFromQuadKey(m),l(u)&&u.hasTerrain()&&(p=u.terrainVersion));break}if(p<0)return Promise.reject(new de("Terrain tile doesn't exist"));let g=this._terrainPromises,f=this._terrainRequests,x,_;if(l(g[m]))x=g[m],_=f[m];else{_=i;let C=g_t(this,m,p,_).fetchArrayBuffer();if(!l(C))return;x=C.then(function(V){return l(V)?b_t.scheduleTask({buffer:V,type:"Terrain",key:s.key},[V]).then(function(L){let Z=s.getTileInformationFromQuadKey(m);Z.terrainState=dm.SELF,r.add(m,L[0]);let G=Z.terrainProvider,I=L.length-1;for(let v=0;v<I;++v){let P=m+v.toString(),w=s.getTileInformationFromQuadKey(P);l(w)&&(r.add(P,L[v+1]),w.terrainState=dm.PARENT,w.terrainProvider===0&&(w.terrainProvider=G))}}):Promise.reject(new de("Failed to load terrain."))}),g[m]=x,f[m]=_,x=x.finally(function(){delete g[m],delete f[m]})}return x.then(function(){let C=r.get(o);if(l(C)){let V=s.providers[a.terrainProvider];return new SL({buffer:C,childTileMask:pSe(o,a,s),credits:l(V)?[V]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new de("Failed to load terrain."))}).catch(function(C){return _.state===jn.CANCELLED?(i.state=_.state,Promise.reject(C)):(a.terrainState=dm.NONE,Promise.reject(C))})};vy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};vy.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=g0.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(l(r)){if(!r.ancestorHasTerrain)return!0;let s=r.terrainState;if(s===dm.NONE)return!1;if((!l(s)||s===dm.UNKNOWN)&&(r.terrainState=dm.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let a=i.getTileInformationFromQuadKey(o);if(!l(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(o)){let s=new Ho({throttle:!1,throttleByServer:!0,type:cs.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};vy.prototype.loadTileDataAvailability=function(e,t,n){};function g_t(e,t,n,i){return n=l(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var u7=vy;var mji=T(S(),1);var zB={};zB.defaultApiKey=void 0;zB.mapTilesApiEndpoint=new Ee({url:"https://tile.googleapis.com/v1/"});zB.getDefaultCredit=function(){return new Et('<img src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align: -5px" alt="Google">',!0)};var sS=zB;var pji=T(S(),1);var uM={};uM.type=void 0;uM.getRequiredDataPoints=pe.throwInstantiationError;uM.interpolateOrderZero=pe.throwInstantiationError;uM.interpolate=pe.throwInstantiationError;var m7=uM;var Iji=T(S(),1);var Sji=T(S(),1);function h7(e){this._url=Ee.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(h7.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});h7.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===Py.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,s=o.bbox;if(l(s))r=ae.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],c=o.geometry.coordinates[1];r=h.fromDegrees(a,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var mM=h7;function f7(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.accessToken,Pm.defaultAccessToken),n=Ee.createIfNeeded(y(e.server,Pm.defaultServer));n.appendForwardSlash();let i=Pm.getDefaultTokenCredit(t);l(i)&&e.scene.frameState.creditDisplay.addStaticCredit(Et.clone(i));let o=n.getDerivedResource({url:"v1/geocode"});l(t)&&o.appendQueryParameters({access_token:t}),this._accessToken=t,this._server=n,this._pelias=new mM(o)}Object.defineProperties(f7.prototype,{credit:{get:function(){}}});f7.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var hM=f7;var Pji=T(S(),1);function KB(){pe.throwInstantiationError()}Object.defineProperties(KB.prototype,{ellipsoid:{get:pe.throwInstantiationError}});KB.prototype.project=pe.throwInstantiationError;KB.prototype.unproject=pe.throwInstantiationError;var p7=KB;var Mji=T(S(),1);function CL(e){e=y(e,y.EMPTY_OBJECT);let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(CL.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});CL.prototype.findTimeInterval=to.prototype.findTimeInterval;CL.prototype.wrapTime=to.prototype.wrapTime;CL.prototype.clampTime=to.prototype.clampTime;CL.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);l(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=o*this._count+s;t[s]=n[a]*(1-r)+n[a+this._count]*r}return t};var b7=CL;var zji=T(S(),1);function g7(e,t,n){e=Ee.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=y(n,{}),this._credit=new Et('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(g7.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});g7.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:Tt(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(l(r))o=ae.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;o=h.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var y7=g7;var Qji=T(S(),1);var y_t={packedLength:void 0,pack:pe.throwInstantiationError,unpack:pe.throwInstantiationError},x7=y_t;var $ji=T(S(),1);var x_t={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:pe.throwInstantiationError,unpackInterpolationResult:pe.throwInstantiationError},_7=x_t;var n8i=T(S(),1);function bSe(){pe.throwInstantiationError()}bSe.prototype.getURL=pe.throwInstantiationError;var T7=bSe;var x8i=T(S(),1);function __t(e,t,n,i,o,r,s){let a=Gi.numberOfPoints(e,t,o),c,d=n.red,u=n.green,m=n.blue,p=n.alpha,g=i.red,f=i.green,x=i.blue,_=i.alpha;if(B.equals(n,i)){for(c=0;c<a;c++)r[s++]=B.floatToByte(d),r[s++]=B.floatToByte(u),r[s++]=B.floatToByte(m),r[s++]=B.floatToByte(p);return s}let C=(g-d)/a,V=(f-u)/a,L=(x-m)/a,Z=(_-p)/a,G=s;for(c=0;c<a;c++)r[G++]=B.floatToByte(d+c*C),r[G++]=B.floatToByte(u+c*V),r[G++]=B.floatToByte(m+c*L),r[G++]=B.floatToByte(p+c*Z);return G}function fM(e){e=y(e,y.EMPTY_OBJECT);let t=e.positions,n=e.colors,i=y(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=y(e.arcType,nn.GEODESIC),this._granularity=y(e.granularity,W.RADIANS_PER_DEGREE),this._ellipsoid=y(e.ellipsoid,ne.default),this._workerName="createSimplePolylineGeometry";let o=1+t.length*h.packedLength;o+=l(n)?1+n.length*B.packedLength:1,this.packedLength=o+ne.packedLength+3}fM.pack=function(e,t,n){n=y(n,0);let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=B.packedLength)B.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};fM.unpack=function(e,t,n){t=y(t,0);let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=B.packedLength)s[i]=B.unpack(e,t);let a=ne.unpack(e,t);t+=ne.packedLength;let c=e[t++]===1,d=e[t++],u=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=d,n._granularity=u,n):new fM({positions:r,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:d,granularity:u})};var JB=new Array(2),QB=new Array(2),T_t={positions:JB,height:QB,ellipsoid:void 0,minDistance:void 0,granularity:void 0};fM.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,s=e._ellipsoid,a=W.chordLength(r,s.maximumRadius),c=l(n)&&!i,d,u=t.length,m,p,g,f,x=0;if(o===nn.GEODESIC||o===nn.RHUMB){let Z,G,I;o===nn.GEODESIC?(Z=W.chordLength(r,s.maximumRadius),G=Gi.numberOfPoints,I=Gi.generateArc):(Z=r,G=Gi.numberOfPointsRhumbLine,I=Gi.generateRhumbArc);let v=Gi.extractHeights(t,s),P=T_t;if(o===nn.GEODESIC?P.minDistance=a:P.granularity=r,P.ellipsoid=s,c){let w=0;for(d=0;d<u-1;d++)w+=G(t[d],t[d+1],Z)+1;m=new Float64Array(w*3),g=new Uint8Array(w*4),P.positions=JB,P.height=QB;let F=0;for(d=0;d<u-1;++d){JB[0]=t[d],JB[1]=t[d+1],QB[0]=v[d],QB[1]=v[d+1];let b=I(P);if(l(n)){let R=b.length/3;f=n[d];for(let E=0;E<R;++E)g[F++]=B.floatToByte(f.red),g[F++]=B.floatToByte(f.green),g[F++]=B.floatToByte(f.blue),g[F++]=B.floatToByte(f.alpha)}m.set(b,x),x+=b.length}}else if(P.positions=t,P.height=v,m=new Float64Array(I(P)),l(n)){for(g=new Uint8Array(m.length/3*4),d=0;d<u-1;++d){let F=t[d],b=t[d+1],R=n[d],E=n[d+1];x=__t(F,b,R,E,a,g,x)}let w=n[u-1];g[x++]=B.floatToByte(w.red),g[x++]=B.floatToByte(w.green),g[x++]=B.floatToByte(w.blue),g[x++]=B.floatToByte(w.alpha)}}else{p=c?u*2-2:u,m=new Float64Array(p*3),g=l(n)?new Uint8Array(p*4):void 0;let Z=0,G=0;for(d=0;d<u;++d){let I=t[d];if(c&&d>0&&(h.pack(I,m,Z),Z+=3,f=n[d-1],g[G++]=B.floatToByte(f.red),g[G++]=B.floatToByte(f.green),g[G++]=B.floatToByte(f.blue),g[G++]=B.floatToByte(f.alpha)),c&&d===u-1)break;h.pack(I,m,Z),Z+=3,l(n)&&(f=n[d],g[G++]=B.floatToByte(f.red),g[G++]=B.floatToByte(f.green),g[G++]=B.floatToByte(f.blue),g[G++]=B.floatToByte(f.alpha))}}let _=new mn;_.position=new Ze({componentDatatype:Q.DOUBLE,componentsPerAttribute:3,values:m}),l(n)&&(_.color=new Ze({componentDatatype:Q.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=m.length/3;let C=(p-1)*2,V=Ae.createTypedArray(p,C),L=0;for(d=0;d<p-1;++d)V[L++]=d,V[L++]=d+1;return new ht({attributes:_,indices:V,primitiveType:Fe.LINES,boundingSphere:ce.fromPoints(t)})};var S7=fM;var R8i=T(S(),1);function VL(e){let t=y(e.radius,1),i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new zs(i),this._workerName="createSphereGeometry"}VL.packedLength=zs.packedLength;VL.pack=function(e,t,n){return zs.pack(e._ellipsoidGeometry,t,n)};var S_t=new zs,wy={radius:void 0,radii:new h,vertexFormat:new We,stackPartitions:void 0,slicePartitions:void 0};VL.unpack=function(e,t,n){let i=zs.unpack(e,t,S_t);return wy.vertexFormat=We.clone(i._vertexFormat,wy.vertexFormat),wy.stackPartitions=i._stackPartitions,wy.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,wy.radii),n._ellipsoidGeometry=new zs(wy),n):(wy.radius=i._radii.x,new VL(wy))};VL.createGeometry=function(e){return zs.createGeometry(e._ellipsoidGeometry)};var C7=VL;var E8i=T(S(),1);function Fy(e){}Object.defineProperties(Fy.prototype,{ellipsoid:{get:pe.throwInstantiationError},rectangle:{get:pe.throwInstantiationError},projection:{get:pe.throwInstantiationError}});Fy.prototype.getNumberOfXTilesAtLevel=pe.throwInstantiationError;Fy.prototype.getNumberOfYTilesAtLevel=pe.throwInstantiationError;Fy.prototype.rectangleToNativeRectangle=pe.throwInstantiationError;Fy.prototype.tileXYToNativeRectangle=pe.throwInstantiationError;Fy.prototype.tileXYToRectangle=pe.throwInstantiationError;Fy.prototype.positionToTileXY=pe.throwInstantiationError;var V7=Fy;var Y8i=T(S(),1);function C_t(e,t){this.rectangle=e,this.maxLevel=t}function gSe(e){this.ellipsoid=y(e.ellipsoid,ne.default),this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}gSe.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles};function V_t(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Yi({ellipsoid:e.ellipsoid});else throw new de(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=ts.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let o=t.getElementsByTagName("DataExtent");for(let r=0;r<o.length;++r){let s=o[r],a=W.toRadians(parseFloat(s.getAttribute("minx"))),c=W.toRadians(parseFloat(s.getAttribute("miny"))),d=W.toRadians(parseFloat(s.getAttribute("maxx"))),u=W.toRadians(parseFloat(s.getAttribute("maxy"))),m=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new C_t(new ae(a,c,d,u),m))}}function L_t(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),Zo.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new de(i)}async function R_t(e,t,n){try{let i=await t.fetchXML();V_t(e,i)}catch(i){L_t(t,i,n)}}function Ay(e){e=y(e,y.EMPTY_OBJECT),this._errorEvent=new be,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let t=e.credit;typeof t=="string"&&(t=new Et(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(Ay.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});Ay.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=new gSe(t),i=Ee.createIfNeeded(e);await R_t(n,i);let o=new Ay(t);return n.build(o),o._resource=i,o};Ay.prototype.requestTileGeometry=function(e,t,n,i){let o=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${o-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(s))return;let a=this;return Promise.resolve(s).then(function(c){return new Ma({buffer:bm(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:Z_t(a,e,t,n),structure:a._terrainDataStructure})})};Ay.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var ySe=new ae;function Z_t(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,s=o.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<r.length&&a!==15;++c){let d=r[c];if(d.maxLevel<=i)continue;let u=d.rectangle,m=ae.intersection(u,s,ySe);l(m)&&(jB(o,u,t*2,n*2,i+1)&&(a|=4),jB(o,u,t*2+1,n*2,i+1)&&(a|=8),jB(o,u,t*2,n*2+1,i+1)&&(a|=1),jB(o,u,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function jB(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(ae.intersection(r,t,ySe))}Ay.prototype.getTileDataAvailable=function(e,t,n){};Ay.prototype.loadTileDataAvailability=function(e,t,n){};var L7=Ay;var q8i=T(S(),1);function aS(e){e=y(e,y.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=y(e.epoch,Be.MINIMUM_VALUE),this.tolerance=y(e.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(aS.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(l(t)&&(this._clockSubscription(),this._clockSubscription=void 0),l(e)&&(this._clockSubscription=e.onTick.addEventListener(aS.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(l(t)&&t.removeEventListener("seeked",this._seekFunction,!1),l(e)&&(this._seeking=!1,this._seekFunction=G_t(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});aS.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,me(this)};aS.prototype.isDestroyed=function(){return!1};aS.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;let t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier};aS.prototype._onTick=function(e){let t=this._element;if(!l(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let o=e.currentTime,r=y(this.epoch,Be.MINIMUM_VALUE),s=j.secondsDifference(o,r),a=t.duration,c,d=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let u=i?y(this.tolerance,1):.001;Math.abs(c-d)>u&&(this._seeking=!0,t.currentTime=c)};function G_t(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var R7=aS;var e7i=T(S(),1),E_t={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033},Z7=Object.freeze(E_t);var o7i=T(S(),1);function I_t(e){return e=y(e,y.EMPTY_OBJECT),oS.fromIonAssetId(2426648,{requestVertexNormals:y(e.requestVertexNormals,!1)})}var pM=I_t;var l7i=T(S(),1);function X_t(e){return e=y(e,y.EMPTY_OBJECT),oS.fromIonAssetId(1,{requestVertexNormals:y(e.requestVertexNormals,!1),requestWaterMask:y(e.requestWaterMask,!1),ellipsoid:ne.WGS84})}var cS=X_t;var m7i=T(S(),1);var W_t=1953029805,P_t=2917034100;function G7(e,t){if(G7.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new de("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),o=i.getUint32(0,!0);if(o===W_t||o===P_t)return t;let r=new DataView(e),s=0,a=t.byteLength,c=a-a%8,d=n,u,m=8;for(;s<c;)for(m=(m+8)%24,u=m;s<c&&u<d;)i.setUint32(s,i.getUint32(s,!0)^r.getUint32(u,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^r.getUint32(u+4,!0),!0),s+=8,u+=24;if(s<a)for(u>=d&&(m=(m+8)%24,u=m);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(u)),s++,u++}G7.passThroughDataForTesting=!1;var bM=G7;var g7i=T(S(),1);var v_t=new h;function w_t(e,t,n,i){let o=rx(e,t,n,i,v_t);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var E7=w_t;var x7i=T(S(),1);function F_t(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var lS=F_t;var S7i=T(S(),1);function A_t(e){switch(e){case ie.FLOAT:return"float";case ie.FLOAT_VEC2:return"vec2";case ie.FLOAT_VEC3:return"vec3";case ie.FLOAT_VEC4:return"vec4";case ie.FLOAT_MAT2:return"mat2";case ie.FLOAT_MAT3:return"mat3";case ie.FLOAT_MAT4:return"mat4";case ie.SAMPLER_2D:return"sampler2D";case ie.BOOL:return"bool"}}var I7=A_t;var V7i=T(S(),1);function M_t(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var gM=M_t;var E7i=T(S(),1);var N_t=new h(1,1,1);function X7(e){e=y(e,N_t),this._dimensions=h.clone(e)}Object.defineProperties(X7.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var k_t=new h;X7.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,k_t),i=W.randomBetween(-n.x,n.x),o=W.randomBetween(-n.y,n.y),r=W.randomBetween(-n.z,n.z);e.position=h.fromElements(i,o,r,e.position),e.velocity=h.normalize(e.position,e.velocity)};var W7=X7;var W7i=T(S(),1);function ip(){this.featurePropertiesDirty=!1}Object.defineProperties(ip.prototype,{featuresLength:{get:function(){pe.throwInstantiationError()}},pointsLength:{get:function(){pe.throwInstantiationError()}},trianglesLength:{get:function(){pe.throwInstantiationError()}},geometryByteLength:{get:function(){pe.throwInstantiationError()}},texturesByteLength:{get:function(){pe.throwInstantiationError()}},batchTableByteLength:{get:function(){pe.throwInstantiationError()}},innerContents:{get:function(){pe.throwInstantiationError()}},ready:{get:function(){pe.throwInstantiationError()}},tileset:{get:function(){pe.throwInstantiationError()}},tile:{get:function(){pe.throwInstantiationError()}},url:{get:function(){pe.throwInstantiationError()}},batchTable:{get:function(){pe.throwInstantiationError()}},metadata:{get:function(){pe.throwInstantiationError()},set:function(e){pe.throwInstantiationError()}},group:{get:function(){pe.throwInstantiationError()},set:function(e){pe.throwInstantiationError()}}});ip.prototype.hasProperty=function(e,t){pe.throwInstantiationError()};ip.prototype.getFeature=function(e){pe.throwInstantiationError()};ip.prototype.applyDebugSettings=function(e,t){pe.throwInstantiationError()};ip.prototype.applyStyle=function(e){pe.throwInstantiationError()};ip.prototype.update=function(e,t){pe.throwInstantiationError()};ip.prototype.pick=function(e,t,n){pe.throwInstantiationError()};ip.prototype.isDestroyed=function(){pe.throwInstantiationError()};ip.prototype.destroy=function(){pe.throwInstantiationError()};var P7=ip;var Y7i=T(S(),1);var A7i=T(S(),1);function LL(e,t){this._conditionsExpression=Ye(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,D_t(this,t)}Object.defineProperties(LL.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function U_t(e,t){this.condition=e,this.expression=t}function D_t(e,t){let n=[],i=e._conditions;if(!l(i))return;let o=i.length;for(let r=0;r<o;++r){let s=i[r],a=String(s[0]),c=String(s[1]);n.push(new U_t(new Tu(a,t),new Tu(c,t)))}e._runtimeConditions=n}LL.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluate(e,t)}};LL.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluateColor(e,t)}};LL.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!l(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let c=o[a],d=c.condition.getShaderExpression(t,n),u=c.expression.getShaderExpression(t,n);r+=` ${a===0?"if":"else if"} (${d})
  13913. {
  13914. return ${u};
  13915. }
  13916. `}return r=`${i} ${e}
  13917. {
  13918. ${r} return ${i}(1.0);
  13919. }
  13920. `,r};LL.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!l(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let o=t[i];e.push.apply(e,o.condition.getVariables()),e.push.apply(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var yM=LL;function My(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,B_t(this,e)}function B_t(e,t){t=y(Ye(t,!0),e._style),e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin;let n={};if(l(t.meta)){let i=t.defines,o=y(t.meta,y.EMPTY_OBJECT);for(let r in o)o.hasOwnProperty(r)&&(n[r]=new Tu(o[r],i))}e._meta=n,e._ready=!0}function ir(e,t){let n=y(e._style,y.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new Tu(String(t));if(typeof t=="string")return new Tu(t,n);if(l(t.conditions))return new yM(t,n)}else return;return t}function or(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Ye(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(My.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=ir(this,e),this._style.show=or(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=ir(this,e),this._style.color=or(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=ir(this,e),this._style.pointSize=or(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=ir(this,e),this._style.pointOutlineColor=or(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=ir(this,e),this._style.pointOutlineWidth=or(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=ir(this,e),this._style.labelColor=or(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=ir(this,e),this._style.labelOutlineColor=or(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=ir(this,e),this._style.labelOutlineWidth=or(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=ir(this,e),this._style.font=or(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=ir(this,e),this._style.labelStyle=or(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=ir(this,e),this._style.labelText=or(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=ir(this,e),this._style.backgroundColor=or(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=ir(this,e),this._style.backgroundPadding=or(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=ir(this,e),this._style.backgroundEnabled=or(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=ir(this,e),this._style.scaleByDistance=or(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=ir(this,e),this._style.translucencyByDistance=or(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=ir(this,e),this._style.distanceDisplayCondition=or(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=ir(this,e),this._style.heightOffset=or(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=ir(this,e),this._style.anchorLineEnabled=or(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=ir(this,e),this._style.anchorLineColor=or(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=ir(this,e),this._style.image=or(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=ir(this,e),this._style.disableDepthTestDistance=or(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=ir(this,e),this._style.horizontalOrigin=or(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=ir(this,e),this._style.verticalOrigin=or(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=ir(this,e),this._style.labelHorizontalOrigin=or(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=ir(this,e),this._style.labelVerticalOrigin=or(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});My.fromUrl=function(e){return Ee.createIfNeeded(e).fetchJson(e).then(function(n){return new My(n)})};My.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};My.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};My.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};My.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&e.push.apply(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var dS=My;var V6i=T(S(),1);var J7i=T(S(),1);function xM(e){e=y(e,y.EMPTY_OBJECT),this._maximumSubtreeCount=y(e.maximumSubtreeCount,0),this._subtreeRequestCounter=0,this._queue=new KT({comparator:xM.comparator})}xM.prototype.addSubtree=function(e){let t=new O_t(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),o=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};xM.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let o=0;o<i;o++){let r=n[o],a=r.subtree.implicitCoordinates;if(e.isEqual(a))return r.subtree}};xM.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};function O_t(e,t){this.subtree=e,this.stamp=t}var _M=xM;var e6i=T(S(),1);function qB(e){this._resource=e,this._metadataTable=void 0}Object.defineProperties(qB.prototype,{metadataTable:{get:function(){return this._metadataTable}}});qB.fromJson=async function(e,t,n,i){let o;l(t)?o={json:t,binary:void 0}:o=H_t(n);let r=await Y_t(e,o.json,o.binary),s={},a=o.json.bufferViews.length;for(let m=0;m<a;++m){let p=o.json.bufferViews[m],g=p.byteOffset,f=g+p.byteLength,_=r[p.buffer].subarray(g,f);s[m]=_}let c=o.json.voxelTable,d=o.json.propertyTables[c],u=new qB(e);return u._metadataTable=new Il({count:d.count,properties:d.properties,class:i.classes[d.class],bufferViews:s}),u};function Y_t(e,t,n){let i=t.buffers.length,o=new Array(i);for(let r=0;r<i;r++){let s=t.buffers[r];if(l(s.uri)){let c=e.getDerivedResource({url:s.uri});o[r]=c.fetchArrayBuffer().then(function(d){return new Uint8Array(d)})}else o[r]=Promise.resolve(n)}return Promise.all(o)}function H_t(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=Wo(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}var TM=qB;function $B(e){e=y(e,y.EMPTY_OBJECT),this.shapeTransform=void 0,this.globalTransform=void 0,this.shape=void 0,this.minBounds=void 0,this.maxBounds=void 0,this.dimensions=void 0,this.paddingBefore=void 0,this.paddingAfter=void 0,this.names=void 0,this.types=void 0,this.componentTypes=void 0,this.minimumValues=void 0,this.maximumValues=void 0,this.maximumTileCount=void 0,this._implicitTileset=void 0,this._subtreeCache=new _M}$B.fromUrl=async function(e){let t=Ee.createIfNeeded(e),n=await t.fetchJson();K_t(n);let i=$_t(n,t);await i.load();let o=n.root,r=o.content.extensions["3DTILES_content_voxels"],s=r.class,a=oi(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,c=i.schema,d=new w_({metadataJson:a,schema:c}),u=new $B;eTt(u,d,s);let m=new A_(t,o,c),{shape:p,minBounds:g,maxBounds:f,shapeTransform:x,globalTransform:_}=J_t(o);u.shape=p,u.minBounds=g,u.maxBounds=f,u.dimensions=h.unpack(r.dimensions),u.shapeTransform=x,u.globalTransform=_,u.maximumTileCount=z_t(d);let C,V;return l(r.padding)&&(C=h.unpack(r.padding.before),V=h.unpack(r.padding.after)),u.paddingBefore=C,u.paddingAfter=V,u._implicitTileset=m,Ci.unload(i),u};function z_t(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(r_.TILESET_TILE_COUNT)}function K_t(e){let t=e.root;if(!l(t.content))throw new de("Root must have content");if(!oi(t.content,"3DTILES_content_voxels"))throw new de("Root tile content must have 3DTILES_content_voxels extension");if(!oi(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new de("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!oi(e,"3DTILES_metadata"))throw new de("Tileset must have a metadata schema")}function J_t(e){let t=e.boundingVolume,n;if(l(e.transform)?n=M.unpack(e.transform):n=M.clone(M.IDENTITY),l(t.box))return j_t(t.box,n);if(l(t.region))return Q_t(t.region);if(oi(t,"3DTILES_bounding_volume_cylinder"))return q_t(t.extensions["3DTILES_bounding_volume_cylinder"].cylinder,n);throw new de("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function Q_t(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=M.fromScale(ne.WGS84.radii),c=new h(t,n,r),d=new h(i,o,s);return{shape:vi.ELLIPSOID,minBounds:c,maxBounds:d,shapeTransform:a,globalTransform:M.clone(M.IDENTITY)}}function j_t(e,t){let n=En.unpack(e),i=M.fromRotationTranslation(n.halfAxes,n.center);return{shape:vi.BOX,minBounds:h.clone(qf.DefaultMinBounds),maxBounds:h.clone(qf.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function q_t(e,t){let n=En.unpack(e),i=M.fromRotationTranslation(n.halfAxes,n.center);return{shape:vi.CYLINDER,minBounds:h.clone($f.DefaultMinBounds),maxBounds:h.clone($f.DefaultMaxBounds),shapeTransform:i,globalTransform:t}}function $_t(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Ci.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Ci.getSchemaLoader({schema:i})}function eTt(e,t,n){let{schema:i,statistics:o}=t,r=o?.classes[n],s=i.classes[n].properties,a=Object.entries(s).map(([m,p])=>{let{type:g,componentType:f}=p,x=r?.properties[m].min,_=r?.properties[m].max,C=Rt.getComponentCount(g),V=xSe(x,C),L=xSe(_,C);return{id:m,type:g,componentType:f,minValue:V,maxValue:L}});e.names=a.map(m=>m.id),e.types=a.map(m=>m.type),e.componentTypes=a.map(m=>m.componentType);let c=a.map(m=>m.minValue),d=a.map(m=>m.maxValue),u=c.some(l);e.minimumValues=u?c:void 0,e.maximumValues=u?d:void 0}function xSe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function tTt(e,t){let n=e.contentUriTemplates[0].getDerivedResource({templateValues:t.getTemplateValues()}),i=e.baseResource.getDerivedResource({url:n.url}),o=await i.fetchArrayBuffer(),r=gf(o);return await TM.fromJson(i,r.jsonPayload,r.binaryPayload,e.metadataSchema)}async function nTt(e,t){let n=e._implicitTileset,i=e._subtreeCache,o=i.find(t);if(l(o))return o;let r=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:r.url}),a=await s.fetchArrayBuffer();if(o=i.find(t),l(o))return o;let c=gf(a);return o=await o_.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}$B.prototype.requestData=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.tileLevel,0),n=y(e.tileX,0),i=y(e.tileY,0),o=y(e.tileZ,0);if(y(e.keyframe,0)!==0)return;let s=this._implicitTileset,a=this.names,c=new M_({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),d=c.isSubtreeRoot()&&c.level>0,u=d?c.getParentSubtreeCoordinates():c.getSubtreeCoordinates();return nTt(this,u).then(function(p){return(d?p.childSubtreeIsAvailableAtCoordinates(c):p.tileIsAvailableAtCoordinates(c))?tTt(s,c):Promise.reject("Tile is not available")}).then(function(p){return a.map(function(g){return p.metadataTable.getPropertyTypedArray(g)})})};var v7=$B;var E6i=T(S(),1);function w7(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(w7.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});w7.prototype.emit=function(e){let t=W.randomBetween(0,W.TWO_PI),n=W.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=h.fromElements(i,o,r,e.position),e.velocity=h.clone(h.UNIT_Z,e.velocity)};var SM=w7;var xqi=T(S(),1);var X6i=T(S(),1),F7={CUMULUS:0};F7.validate=function(e){return e===F7.CUMULUS};var RL=Object.freeze(F7);var M6i=T(S(),1);function Ph(e,t){if(e=y(e,y.EMPTY_OBJECT),this._show=y(e.show,!0),this._position=h.clone(y(e.position,h.ZERO)),!l(e.scale)&&l(e.maximumSize))this._maximumSize=h.clone(e.maximumSize),this._scale=new D(this._maximumSize.x,this._maximumSize.y);else{this._scale=D.clone(y(e.scale,new D(20,12)));let n=new h(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=h.clone(y(e.maximumSize,n))}this._slice=y(e.slice,-1),this._color=B.clone(y(e.color,B.WHITE)),this._brightness=y(e.brightness,1),this._cloudCollection=t,this._index=-1}var iTt=Ph.SHOW_INDEX=0,oTt=Ph.POSITION_INDEX=1,rTt=Ph.SCALE_INDEX=2,sTt=Ph.MAXIMUM_SIZE_INDEX=3,aTt=Ph.SLICE_INDEX=4,cTt=Ph.BRIGHTNESS_INDEX=5,lTt=Ph.COLOR_INDEX=6;Ph.NUMBER_OF_PROPERTIES=7;function uS(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(Ph.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,uS(this,iTt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),uS(this,oTt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;D.equals(t,e)||(D.clone(e,t),uS(this,rTt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),uS(this,sTt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;B.equals(t,e)||(B.clone(e,t),uS(this,lTt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,uS(this,aTt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,uS(this,cTt))}}});Ph.prototype._destroy=function(){this._cloudCollection=void 0};var nu=Ph;var iu,e3=new h,dTt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},uTt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},mTt=nu.SHOW_INDEX,hTt=nu.POSITION_INDEX,fTt=nu.SCALE_INDEX,pTt=nu.MAXIMUM_SIZE_INDEX,bTt=nu.SLICE_INDEX,gTt=nu.BRIGHTNESS_INDEX,yTt=nu.NUMBER_OF_PROPERTIES,xTt=nu.COLOR_INDEX;function vh(e){e=y(e,y.EMPTY_OBJECT),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(yTt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=y(e.noiseDetail,16),this.noiseOffset=h.clone(y(e.noiseOffset,h.ZERO)),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:_Se(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=y(e.show,!0),this._colorCommands=[],this.debugBillboards=y(e.debugBillboards,!1),this._compiledDebugBillboards=!1,this.debugEllipsoids=y(e.debugEllipsoids,!1),this._compiledDebugEllipsoids=!1}function _Se(e){return function(){return e3.x=e._textureSliceWidth,e3.y=e._noiseTextureRows,e3.z=1/e._noiseTextureRows,e3}}Object.defineProperties(vh.prototype,{length:{get:function(){return M7(this),this._clouds.length}}});function TSe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}vh.prototype.add=function(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.cloudType,RL.CUMULUS),n;return t===RL.CUMULUS&&(n=new nu(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};vh.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};vh.prototype.removeAll=function(){TSe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function M7(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(n._index=r++,t.push(s))}e._clouds=t}}vh.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};vh.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};vh.prototype.get=function(e){return M7(this),this._clouds[e]};var _Tt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),TTt=new Uint16Array([0,1,2,0,2,3]);function STt(e){let t=xt.createVertexBuffer({context:e,typedArray:_Tt,usage:Me.STATIC_DRAW}),n=xt.createIndexBuffer({context:e,typedArray:TTt,usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:Q.FLOAT}];return new ti({context:e,attributes:i,indexBuffer:n})}var N7;function CTt(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s,o[r+4]=s+2,o[r+5]=s+3;return n=xt.createIndexBuffer({context:e,typedArray:o,usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function VTt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=xt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:Ae.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function LTt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=xt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Me.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function RTt(e,t,n){let i=[{index:iu.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:iu.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:iu.packedAttribute0,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:iu.packedAttribute1,componentsPerAttribute:4,componentDatatype:Q.FLOAT,usage:Me.STATIC_DRAW},{index:iu.color,componentsPerAttribute:4,componentDatatype:Q.UNSIGNED_BYTE,normalize:!0,usage:Me.STATIC_DRAW}];n&&i.push({index:iu.direction,componentsPerAttribute:2,componentDatatype:Q.FLOAT,vertexBuffer:LTt(e)});let o=n?t:4*t;return new Sp(e,i,o,n)}var A7=new On;function SSe(e,t,n,i){let o,r=n[iu.positionHighAndScaleX],s=n[iu.positionLowAndScaleY],a=i.position;On.fromCartesian(a,A7);let c=i.scale,d=A7.high,u=A7.low;e._instanced?(o=i._index,r(o,d.x,d.y,d.z,c.x),s(o,u.x,u.y,u.z,c.y)):(o=i._index*4,r(o+0,d.x,d.y,d.z,c.x),r(o+1,d.x,d.y,d.z,c.x),r(o+2,d.x,d.y,d.z,c.x),r(o+3,d.x,d.y,d.z,c.x),s(o+0,u.x,u.y,u.z,c.y),s(o+1,u.x,u.y,u.z,c.y),s(o+2,u.x,u.y,u.z,c.y),s(o+3,u.x,u.y,u.z,c.y))}function CSe(e,t,n,i){let o,r=n[iu.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(o=i._index,r(o,s,a,0,0)):(o=i._index*4,r(o+0,s,a,0,0),r(o+1,s,a,1,0),r(o+2,s,a,1,1),r(o+3,s,a,0,1))}function VSe(e,t,n,i){let o,r=n[iu.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(o=i._index,r(o,s.x,s.y,s.z,a)):(o=i._index*4,r(o+0,s.x,s.y,s.z,a),r(o+1,s.x,s.y,s.z,a),r(o+2,s.x,s.y,s.z,a),r(o+3,s.x,s.y,s.z,a))}function LSe(e,t,n,i){let o,r=n[iu.color],s=i.color,a=B.floatToByte(s.red),c=B.floatToByte(s.green),d=B.floatToByte(s.blue),u=B.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,c,d,u)):(o=i._index*4,r(o+0,a,c,d,u),r(o+1,a,c,d,u),r(o+2,a,c,d,u),r(o+3,a,c,d,u))}function ZTt(e,t,n,i){SSe(e,t,n,i),CSe(e,t,n,i),VSe(e,t,n,i),LSe(e,t,n,i)}function GTt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=STt(a),o._spNoise=tn.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,d=o.noiseOffset;o._noiseTexture=new Pt({context:a,width:r*r/s,height:r*s,pixelDatatype:qe.UNSIGNED_BYTE,pixelFormat:ot.RGBA,sampler:new en({wrapS:Cn.REPEAT,wrapT:Cn.REPEAT,minificationFilter:$t.NEAREST,magnificationFilter:hi.NEAREST})});let u=new Xc({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:_Se(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return d}},persists:!1,owner:e,postExecute:function(m){o._ready=!0,o._loading=!1}});t.commandList.push(u),o._loading=!0}function ETt(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let o=e._clouds,r=o.length;if(r>0){n._vaf=RTt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];ZTt(e,t,s,c)}n._vaf.commit(N7(i))}}var ITt=[];function XTt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,d=ITt;d.length=0,(c[hTt]||c[fTt])&&d.push(SSe),(c[mTt]||c[gTt])&&d.push(CSe),(c[pTt]||c[bTt])&&d.push(VSe),c[xTt]&&d.push(LSe);let u=d.length,m=i._vaf.writers,p,g,f;if(a/r>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,f=0;f<u;++f)d[f](e,t,m,g);i._vaf.commit(N7(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,f=0;f<u;++f)d[f](e,t,m,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function WTt(e,t,n,i){let o=t.context,r=e,s=new De({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new De({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=tn.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:iu}),r._rs=Ue.fromCache({depthTest:{enabled:!0,func:ie.LESS},depthMask:!1,blending:un.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function PTt(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let d=0;d<c;d++){let u=s[d];l(u)||(u=s[d]=new tt),u.pass=Ge.TRANSLUCENT,u.owner=e,u.uniformMap=o,u.count=a[d].indicesCount,u.vertexArray=a[d].va,u.shaderProgram=n._sp,u.renderState=n._rs,n._instanced&&(u.count=6,u.instanceCount=n._clouds.length),r.push(u)}}}vh.prototype.update=function(e){if(M7(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&GTt(this,e,sM,rM),this._instanced=e.context.instancedArrays,iu=this._instanced?uTt:dTt,N7=this._instanced?VTt:CTt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?ETt(this,e):r>0&&XTt(this,e),r>i*1.5&&(o.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&WTt(this,e,oM,iM),PTt(this,e))};vh.prototype.isDestroyed=function(){return!1};vh.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),TSe(this._clouds),me(this)};var k7=vh;var Vqi=T(S(),1);var vTt=W.toRadians(30);function U7(e){this._angle=y(e,vTt)}Object.defineProperties(U7.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});U7.prototype.emit=function(e){let t=Math.tan(this._angle),n=W.randomBetween(0,W.TWO_PI),i=W.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=h.fromElements(o,r,s,e.velocity),h.normalize(e.velocity,e.velocity),e.position=h.clone(h.ZERO,e.position)};var D7=U7;var Eqi=T(S(),1);function CM(e){e=y(e,y.EMPTY_OBJECT);let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=y(e.glslDatatype,"vec3"),o=`v_${t}`,r;if(t==="normal"||t==="tangent"||t==="bitangent")r=`vec4 getColor() { return vec4((${o} + vec3(1.0)) * 0.5, 1.0); }
  13921. `;else switch(t==="st"&&(i="vec2"),i){case"float":r=`vec4 getColor() { return vec4(vec3(${o}), 1.0); }
  13922. `;break;case"vec2":r=`vec4 getColor() { return vec4(${o}, 0.0, 1.0); }
  13923. `;break;case"vec3":r=`vec4 getColor() { return vec4(${o}, 1.0); }
  13924. `;break;case"vec4":r=`vec4 getColor() { return ${o}; }
  13925. `;break}let s=`in vec3 position3DHigh;
  13926. in vec3 position3DLow;
  13927. in float batchId;
  13928. ${n?"":`in ${i} ${t};
  13929. `}out ${i} ${o};
  13930. void main()
  13931. {
  13932. vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);
  13933. ${n?`${o} = czm_batchTable_${t}(batchId);
  13934. `:`${o} = ${t};
  13935. `}gl_Position = czm_modelViewProjectionRelativeToEye * p;
  13936. }`,a=`in ${i} ${o};
  13937. ${r}
  13938. void main()
  13939. {
  13940. out_FragColor = getColor();
  13941. }`;this.material=void 0,this.translucent=y(e.translucent,!1),this._vertexShaderSource=y(e.vertexShaderSource,s),this._fragmentShaderSource=y(e.fragmentShaderSource,a),this._renderState=eo.getDefaultRenderState(!1,!1,e.renderState),this._closed=y(e.closed,!1),this._attributeName=t,this._glslDatatype=i}Object.defineProperties(CM.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});CM.prototype.getFragmentShaderSource=eo.prototype.getFragmentShaderSource;CM.prototype.isTranslucent=eo.prototype.isTranslucent;CM.prototype.getRenderState=eo.prototype.getRenderState;var B7=CM;var Dqi=T(S(),1);function t3(e){e=y(e,y.EMPTY_OBJECT),this.length=y(e.length,1e7),this._length=void 0,this.width=y(e.width,2),this._width=void 0,this.show=y(e.show,!0),this.modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this._modelMatrix=new M,this.id=e.id,this._id=void 0,this._primitive=void 0}t3.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!M.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=M.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new Gt({geometry:new Ob({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:Jr.VERTEX_FORMAT,colors:[B.RED,B.RED],arcType:nn.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),n=new Gt({geometry:new Ob({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:Jr.VERTEX_FORMAT,colors:[B.GREEN,B.GREEN],arcType:nn.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),i=new Gt({geometry:new Ob({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:Jr.VERTEX_FORMAT,colors:[B.BLUE,B.BLUE],arcType:nn.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this});this._primitive=new In({geometryInstances:[t,n,i],appearance:new Jr,asynchronous:!1})}this._primitive.update(e)}};t3.prototype.isDestroyed=function(){return!1};t3.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),me(this)};var VM=t3;var zqi=T(S(),1);function wTt(e){this.direction=h.clone(e.direction),this.color=B.clone(y(e.color,B.WHITE)),this.intensity=y(e.intensity,1)}var O7=wTt;var s$i=T(S(),1);var Jqi=T(S(),1),LM=`in vec3 v_positionMC;
  13942. in vec3 v_positionEC;
  13943. in vec2 v_st;
  13944. void main()
  13945. {
  13946. czm_materialInput materialInput;
  13947. vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));
  13948. #ifdef FACE_FORWARD
  13949. normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
  13950. #endif
  13951. materialInput.s = v_st.s;
  13952. materialInput.st = v_st;
  13953. materialInput.str = vec3(v_st, 0.0);
  13954. // Convert tangent space material normal to eye space
  13955. materialInput.normalEC = normalEC;
  13956. materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);
  13957. // Convert view vector to world space
  13958. vec3 positionToEyeEC = -v_positionEC;
  13959. materialInput.positionToEyeEC = positionToEyeEC;
  13960. czm_material material = czm_getMaterial(materialInput);
  13961. #ifdef FLAT
  13962. out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
  13963. #else
  13964. out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
  13965. #endif
  13966. }
  13967. `;var jqi=T(S(),1),RM=`in vec3 position3DHigh;
  13968. in vec3 position3DLow;
  13969. in vec2 st;
  13970. in float batchId;
  13971. out vec3 v_positionMC;
  13972. out vec3 v_positionEC;
  13973. out vec2 v_st;
  13974. void main()
  13975. {
  13976. vec4 p = czm_computePosition();
  13977. v_positionMC = position3DHigh + position3DLow; // position in model coordinates
  13978. v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
  13979. v_st = st;
  13980. gl_Position = czm_modelViewProjectionRelativeToEye * p;
  13981. }
  13982. `;function mS(e){e=y(e,y.EMPTY_OBJECT);let t=y(e.translucent,!0),n=y(e.aboveGround,!1);this.material=l(e.material)?e.material:Oi.fromType(Oi.ColorType),this.translucent=y(e.translucent,!0),this._vertexShaderSource=y(e.vertexShaderSource,RM),this._fragmentShaderSource=y(e.fragmentShaderSource,LM),this._renderState=eo.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=y(e.flat,!1),this._faceForward=y(e.faceForward,n),this._aboveGround=n}Object.defineProperties(mS.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return mS.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});mS.VERTEX_FORMAT=We.POSITION_AND_ST;mS.prototype.getFragmentShaderSource=eo.prototype.getFragmentShaderSource;mS.prototype.isTranslucent=eo.prototype.isTranslucent;mS.prototype.getRenderState=eo.prototype.getRenderState;var Y7=mS;var f$i=T(S(),1);function $l(e){this._scene=e.scene,this.samplingWindow=y(e.samplingWindow,$l.defaultSettings.samplingWindow),this.quietPeriod=y(e.quietPeriod,$l.defaultSettings.quietPeriod),this.warmupPeriod=y(e.warmupPeriod,$l.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=y(e.minimumFrameRateDuringWarmup,$l.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=y(e.minimumFrameRateAfterWarmup,$l.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new be,this._nominalFrameRate=new be,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(o,r){FTt(t,r)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){ATt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}$l.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};$l.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new $l({scene:e})),e._frameRateMonitor};Object.defineProperties($l.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});$l.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};$l.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};$l.prototype.isDestroyed=function(){return!1};$l.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),me(this)};function FTt(e,t){if(e._pauseCount>0)return;let n=_i();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/zn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/zn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/zn.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let o=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/o;let r=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);o>r?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function ATt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var ZM=$l;var G$i=T(S(),1);var RSe=T(o7(),1);function H7(){this._image=new Image}H7.prototype.isReady=function(){return!0};H7.prototype.shouldDiscardImage=function(e){return e===this._image};function hS(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new Yi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ae(-W.PI,-W.PI,W.PI,W.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Et(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new H7),this._errorEvent=new be}Object.defineProperties(hS.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});hS.fromMetadata=function(e,t){if(!e.imageryPresent)throw new de(`The server ${e.url} doesn't have imagery`);let n=new hS(t);return n._metadata=e,n};hS.prototype.getTileCredits=function(e,t,n){let i=this._metadata,o=i.getTileInformation(e,t,n);if(l(o)){let r=i.providers[o.imageryProvider];if(l(r))return[r]}};hS.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=g0.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!l(a)){if(r.isValid(s)){let d=new Ho({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,d);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let c=MTt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(d){bM(r.key,d);let u=new Uint8Array(d),m,p=r.protoImagery;if((!l(p)||!p)&&(m=NTt(u)),!l(m)&&(!l(p)||p)){let g=kTt(u);m=g.imageType,u=g.imageData}return!l(m)||!l(u)?o:jx({uint8Array:u,format:m,flipY:!0})})};hS.prototype.pickFeatures=function(e,t,n,i,o){};function MTt(e,t,n,i,o,r){let s=g0.tileXYToQuadKey(n,i,o),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:r})}function NTt(e){let t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function kTt(e){let t=RSe.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let o=i.imageType;if(l(o))switch(o){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new de("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let r=i.alphaType;return l(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var z7=hS;var w$i=T(S(),1);var UTt=new B(1,1,1,.4),DTt=new B(0,1,0,.05),BTt=new B(0,.5,0,.2);function fS(e){e=y(e,y.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Yi({ellipsoid:e.ellipsoid}),this._cells=y(e.cells,8),this._color=y(e.color,UTt),this._glowColor=y(e.glowColor,DTt),this._glowWidth=y(e.glowWidth,6),this._backgroundColor=y(e.backgroundColor,BTt),this._errorEvent=new be,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._canvasSize=y(e.canvasSize,256),this._canvas=this._createGridCanvas()}Object.defineProperties(fS.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});fS.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let r=1+i/this._cells*(n-1);e.moveTo(r,0),e.lineTo(r,n),e.moveTo(0,r),e.lineTo(n,r)}e.stroke()};fS.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),o=this._backgroundColor.toCssColorString();i.fillStyle=o,i.fillRect(t,t,n,n);let r=this._glowColor.toCssColorString();i.strokeStyle=r,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};fS.prototype.getTileCredits=function(e,t,n){};fS.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};fS.prototype.pickFeatures=function(e,t,n,i,o){};var K7=fS;var gto=T(S(),1);var Deo=T(S(),1);var Veo=T(S(),1);var Y$i=T(S(),1);function wh(){}wh._maxDecodingConcurrency=Math.max(zt.hardwareConcurrency-1,1);wh._decodeTaskProcessor=new bi("decodeI3S",wh._maxDecodingConcurrency);wh._promise=void 0;async function OTt(){if(await wh._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return wh._decodeTaskProcessor;throw new de("I3S decoder could not be initialized.")}wh.decode=async function(e,t,n,i,o){return l(wh._promise)||(wh._promise=OTt()),wh._promise.then(function(r){let s=n._parent._data,a=n._parent._inverseRotationMatrix,c=0,d=0,u=0;l(s.obb)?(c=s.obb.center[0],d=s.obb.center[1],u=s.obb.center[2]):l(s.mbs)&&(c=s.mbs[0],d=s.mbs[1],u=s.mbs[2]);let m=$.fromRotationX(-W.PI_OVER_TWO),p=new $;$.multiply(m,a,p);let g=he.fromDegrees(c,d,u),f=ne.WGS84.cartographicToCartesian(g),x={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ne.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:g,cartesianCenter:f,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(x)})};var GM=wh;var J$i=T(S(),1);function J7(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(J7.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});J7.prototype.load=async function(){return this._data=await Fh.loadJson(this._resource),this._data};var EM=J7;var $$i=T(S(),1);function y0(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;let n=`attributes/${t.key}/0`;l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(y0.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(l(this._values)){if(l(this._values.attributeValues))return this._values.attributeValues;if(l(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function n3(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}function YTt(e){return e==="String"?1:n3(e)}async function HTt(e){let t=await e._dataProvider._loadBinary(e._resource),n=new DataView(t);e._data=t,e._validateHeader(n);let i=e._parseHeader(n),o=e._getBodyOffset(i);e._validateBody(n,o),e._parseBody(n,o)}y0.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=HTt(this).catch(function(e){console.error(e)}),this._loadPromise)};y0.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);i=o+Math.pow(2,32)*r,n+=8}else if(t==="Int64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);r<Math.pow(2,31)?i=o+Math.pow(2,32)*r:i=o+Math.pow(2,32)*(r-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};y0.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],o=this._parseValue(e,i.valueType,t);this._header[i.property]=o.value,t=o.offset}return t};y0.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],o=i==="ObjectIds"?"objectIds":i,r=this._storageInfo[o];if(l(r)){this._values[o]=[];for(let s=0;s<this._header.count;++s)if(r.valueType!=="String"){let a=this._parseValue(e,r.valueType,t);this._values[o].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],c="";for(let d=0;d<a;++d){let u=this._parseValue(e,r.valueType,t);u.value.charCodeAt(0)!==0&&(c+=u.value),t=u.offset}this._values[o].push(c)}}}};y0.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=n3(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=n3(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};y0.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=YTt(i.valueType)}if(e.byteLength<t)throw new de(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};y0.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new de(`Invalid attribute buffer (field: ${this.name}, count is missing)`);let n;for(let i=0;i<this._storageInfo.ordering.length&&t<e.byteLength;i++){let o=this._storageInfo.ordering[i],r=o==="ObjectIds"?"objectIds":o,s=this._storageInfo[r];if(l(s))if(s.valueType!=="String"){r==="attributeByteCounts"&&(n=t);let a=n3(s.valueType);t+=a*this._header.count}else{if(!l(n))throw new de(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let a=0;a<this._header.count&&t<e.byteLength;++a){let c=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=c.value,n=c.offset}}else throw new de(`Invalid attribute buffer (field: ${this.name}, ${r} is missing)`)}if(e.byteLength<t)throw new de(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var IM=y0;var seo=T(S(),1);function XM(e,t){let n=e._dataProvider,i=e._layer,o;l(e._nodeIndex)?o=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):o=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=o,this._customAttributes=void 0}Object.defineProperties(XM.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});XM.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var zTt=new h,KTt=new h,JTt=new h,QTt=new h,jTt=new h;function Q7(e,t,n,i){let o=h.subtract(i,n,zTt),r=h.cross(o,h.subtract(e,n,KTt),QTt),s=h.cross(o,h.subtract(t,n,JTt),jTt);return h.dot(r,s)>=0}var qTt=new h,$Tt=new h,eSt=new h,tSt=new h,nSt=new h,iSt=new h,oSt=new h,rSt=new h,sSt=new h,aSt=new h;XM.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new h(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,$.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,c,d=this._customAttributes.positions,u=this._customAttributes.indices,m;l(u)?m=u.length:m=d.length/3;for(let p=0;p<m;p++){let g,f,x;l(u)?(g=u[p],f=u[p+1],x=u[p+2]):(g=p*3,f=p*3+1,x=p*3+2);let _=h.fromElements(d[g*3],d[g*3+1],d[g*3+2],qTt),C=h.fromElements(d[f*3],d[f*3+1],d[f*3+2],$Tt),V=new h(d[x*3],d[x*3+1],d[x*3+2],eSt);if(!Q7(i,_,C,V)||!Q7(i,C,_,V)||!Q7(i,V,_,C))continue;let L=h.subtract(C,_,tSt),Z=h.subtract(V,_,nSt),G=h.cross(L,Z,iSt);if(h.magnitude(G)===0)continue;let I=h.normalize(G,oSt),v=h.subtract(i,_,rSt),P=Math.abs(h.dot(v,I));if(P<o){o=P,r=p;let w=h.magnitudeSquared(h.subtract(i,_,v)),F=h.magnitudeSquared(h.subtract(i,C,sSt)),b=h.magnitudeSquared(h.subtract(i,V,aSt));w<F&&w<b?(a=g,c=_,s=w):F<b?(a=f,c=C,s=F):(a=x,c=V,s=b)}}if(l(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:h.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function ZSe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(lS(e[i])):t.push(e[i]);return t}XM.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},d=!1,u,m="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let L=this._parent._data.mesh.material.definition;if(L>=0&&L<this._layer._data.materialDefinitions.length){if(u=this._layer._data.materialDefinitions[L],c=u,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){d=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let Z="0";if(l(this._layer._data.textureSetDefinitions))for(let G=0;G<this._layer._data.textureSetDefinitions.length;G++){let I=this._layer._data.textureSetDefinitions[G];for(let v=0;v<I.formats.length;v++){let P=I.formats[v];if(P.format==="jpg"){Z=P.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(m=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${Z}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=ZSe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=ZSe(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(d=!0,m=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,c.pbrMetallicRoughness.baseColorTexture={index:0});l(c.alphaMode)&&(c.alphaMode=c.alphaMode.toUpperCase());let p=[],g=[],f=[];d&&(p=[{sampler:0,source:0}],g=[{uri:m}],f=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let x=[],_=n.length;for(let V=0;V<_;V++){let L=n[V].primitives,Z=L.length;for(let G=0;G<Z;G++){let I=L[G];if(l(I.material)){for(;I.material>=x.length;){let P=Ye(c,!0);x.push(P)}let v=x[I.material];l(I.extra)&&I.extra.isTransparent?l(v.alphaMode)||(v.alphaMode="BLEND"):v.alphaMode==="BLEND"&&(v.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:x,textures:p,images:g,samplers:f,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var ZL=XM;function Rc(e,t,n){let i,o,r,s;n?(i=0,o=e):(i=e._level+1,o=e._layer),typeof t=="number"?r=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=o,this._nodeIndex=r,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0,this._symbologyData=void 0}Object.defineProperties(Rc.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});Rc.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new ku(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await Fh.loadJson(this._resource);e._data=o,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":l(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),l(i)&&l(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function GSe(e,t){let n=new IM(e,t);return e._fields[t.name]=n,n.load()}Rc.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(l(e))for(let n=0;n<e.length;n++){let i=e[n],o=this._fields[i.name];l(o)?t.push(o.load()):t.push(GSe(this,i))}return Promise.all(t)};Rc.prototype.loadField=function(e){let t=this._fields[e];if(l(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(l(n))for(let i=0;i<n.length;i++){let o=n[i];if(o.name===e)return GSe(this,o)}return Promise.resolve()};Rc.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!l(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};Rc.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};Rc.prototype._loadChildren=function(){let e=this;if(l(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(l(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],o=new Rc(e,y(i.href,i),!1);e._children.push(o),t.push(o.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};Rc.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new ZL(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(l(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new ZL(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};Rc.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new EM(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};Rc.prototype._clearGeometryData=function(){this._geometryData=[]};Rc.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=he.fromDegrees(e.center[0],e.center[1],e.center[2]):n=he.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let C=0;C<this._dataProvider._geoidDataList.length;C++){let V=this._dataProvider._geoidDataList[C],L=V.projection.project(n);if(L.x>V.nativeExtent.west&&L.x<V.nativeExtent.east&&L.y>V.nativeExtent.south&&L.y<V.nativeExtent.north){n.height+=uSt(L.x,L.y,V);break}}let i={},o,r=0;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},r=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),o=ne.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=ne.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let C=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/C}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let C=this._data.lodThreshold;s=r/C}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let C=0;C<this._data.lodSelection.length;C++)this._data.lodSelection[C].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[C].maxError);s===1/0&&(s=1e5);let a=s*16,c=new Ca(0,0,0),d=Ft.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(d=new we(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let u=$.fromQuaternion(d),m=$.inverse(u,new $),p=new M(u[0],u[1],u[2],0,u[3],u[4],u[5],0,u[6],u[7],u[8],0,o.x,o.y,o.z,1),g=M.inverse(p,new M),f=M.clone(p);l(this._parent._globalTransform)&&M.multiply(p,this._parent._inverseGlobalTransform,f),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=m;let x=[];for(let C=0;C<this._children.length;C++)x.push(this._children[C]._create3DTileDefinition());return{children:x,refine:"REPLACE",boundingVolume:i,transform:[f[0],f[4],f[8],f[12],f[1],f[5],f[9],f[13],f[2],f[6],f[10],f[14],f[3],f[7],f[11],f[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};Rc.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};Rc.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=[this._loadGeometryData()];if(this._dataProvider.legacyVersion16&&t.push(this._loadFeatureData()),await Promise.all(t),l(this._geometryData)&&this._geometryData.length>0){this._dataProvider._applySymbology&&await this._loadSymbology();let o=this._geometryData[0].resource.url,r=this._layer._data.store.defaultGeometrySchema,s=this._geometryData[0],a=await GM.decode(o,r,s,this._featureData[0],this._symbologyData);if(!l(a))return;e=s._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors,a.meshData.rootExtensions,a.meshData.extensionsUsed),this._geometryData[0]._customAttributes=a.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};async function cSt(e){let t=e._layer._filters,n=[];for(let i=0;i<t.length;i++){let o=e.loadField(t[i].name);n.push(o)}return await Promise.all(n),t}function lSt(e,t,n){if(!l(n.values)||n.values.length===0)return!1;let i=l(t)?t.values:[],o;e<i.length&&(o=i[e]);let r=!1;for(let s=0;s<n.values.length;s++)if(n.values[s]===o){r=!0;break}return r}async function ESe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await cSt(e);if(i.length>0)for(let o=0;o<n.featuresLength;o++)for(let r=0;r<i.length;r++){let s=i[r];if(!lSt(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}Rc.prototype._filterFeatures=function(){let e=[];for(let n=0;n<this._children.length;n++){let i=this._children[n]._filterFeatures();e.push(i)}let t=this._tile?.content?._model;if(l(this._geometryData)&&this._geometryData.length>0&&l(t)&&t.ready){t.show=!1;let n=ESe(this,t);e.push(n)}return Promise.all(e)};ku.prototype._hookedRequestContent=ku.prototype.requestContent;ku.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading){this._isLoading=!0;let e=this;return this._i3sNode._createContentURL().then(t=>{if(!l(t)){e._isLoading=!1;return}return e._contentResource=new Ee({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return l(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&l(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{ESe(e._i3sNode,n)})),e._isLoading=!1,t})}};function dSt(e,t,n,i,o,r){let s=n*(1-e)+i*e,a=o*(1-e)+r*e;return s*(1-t)+a*t}function i3(e,t,n,i){let o=e+t*n;return i[o]}function uSt(e,t,n){let i=n.nativeExtent,o=(e-i.west)/(i.east-i.west)*(n.width-1),r=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(o),a=Math.floor(r);o-=s,r-=a;let c=s<n.width?s+1:s,d=a<n.height?a+1:a;a=n.height-1-a,d=n.height-1-d;let u=i3(s,a,n.width,n.buffer),m=i3(c,a,n.width,n.buffer),p=i3(s,d,n.width,n.buffer),g=i3(c,d,n.width,n.buffer),f=dSt(o,r,u,m,p,g);return f=f*n.scale+n.offset,f}Object.defineProperties(ku.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var GL=Rc;var Ieo=T(S(),1);function o3(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(o3.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function j7(e,t){let n=[];for(let i=0;i<e.length;i++){let o=B.byteToFloat(e[i]);i<3?n.push(lS(o)):n.push(o)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function EL(e,t){let n={edges:void 0,material:void 0};if(l(e)&&l(e.symbolLayers))for(let i=0;i<e.symbolLayers.length;i++){let o=e.symbolLayers[i];if(o.type==="Fill"){let r=o.edges,s=o.outline;if(l(r)?(n.edges={},l(r.color)&&(n.edges.color=j7(r.color,r.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=j7(s.color,s.transparency))),!t){let a=o.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=j7(a.color,a.transparency)))}break}}return n}function mSt(e,t){if(l(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let o=e.uniqueValueGroups[i].classes;if(l(o))for(let r=0;r<o.length;r++){let s=EL(o[r].symbol,t),a=o[r].values;for(let c=0;c<a.length;c++){let d=a[c],u=n;for(let m=0;m<d.length;m++){let p=d[m];m===d.length-1?u[p]=s:(l(u[p])||(u[p]={}),u=u[p])}}}}return n}if(l(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let o=e.uniqueValueInfos[i];n[o.value]=EL(o.symbol,t)}return n}}function hSt(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(o,r){let s=y(o.classMaxValue,o.classMinValue),a=y(r.classMaxValue,r.classMinValue);return s-a});let i={ranges:[],symbols:[]};l(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let o=0;o<n.length;o++){let r=n[o];l(r.classMinValue)&&(i.ranges.length===0||r.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMinValue),i.symbols.push(void 0)),l(r.classMaxValue)&&(i.ranges.length===0||r.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMaxValue),i.symbols.push(EL(r.symbol,t)))}return i.symbols.push(void 0),i}}o3.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(l(e)&&l(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=l(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=EL(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=EL(i.defaultSymbol,n),this._valueFields.push(i.field1),l(i.field2)&&this._valueFields.push(i.field2),l(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=mSt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=EL(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=hSt(i,n))}};function ISe(e,t,n,i){let o=t[n];if(i<o.length){let r=o[i],s=e[r];return l(s)&&++n<t.length?ISe(s,t,n,i):s}}function fSt(e,t){let n=0,i=e.length;if(n<i)do{let o=n+i>>>1;e[o]<t?n=o+1:i=o}while(n<i);return n}function pSt(e,t,n){let i=t[n],o=fSt(e.ranges,i);return e.symbols[o]}o3.prototype._getSymbology=async function(e){let t={default:this._defaultSymbology};if(this._valueFields.length>0){let n=[];for(let r=0;r<this._valueFields.length;r++)n.push(e.loadField(this._valueFields[r]));await Promise.all(n);let i=[];for(let r=0;r<this._valueFields.length;r++)i.push(e.fields[this._valueFields[r]].values);let o;if(l(this._uniqueValueHash)?o=r=>ISe(this._uniqueValueHash,i,0,r):l(this._classBreaksHash)&&(o=r=>pSt(this._classBreaksHash,i[0],r)),l(o)){let r=i[0];for(let s=0;s<r.length;s++){let a=o(s);l(a)&&(t[s]=a)}}}return t};var WM=o3;function ed(e,t,n){this._dataProvider=e,this._parent=n,!l(t.href)&&l(t.id)&&(t.href=`layers/${t.id}`);let i=this._parent.resource.getUrlComponent(),o="";i.match(/layers\/\d/)?o=`${i}`.replace(/\/+$/,""):o=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let r=this._version.split(".");this._majorVersion=parseInt(r[0]),this._minorVersion=r.length>1?parseInt(r[1]):0,this._resource=new Ee({url:o}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._filters=[],this._symbology=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(ed.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(l(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});ed.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new de(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new WM(this)),await this._dataProvider.loadGeoidData(),await this._loadRootNode(e),await this._create3DTileset(e),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};ed.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let o=0;o<i.length;o++){let r=i[o],s=[],a=!1;if(l(r.compressedAttributes)&&e){a=!0;let c=r.compressedAttributes.attributes;for(let d=0;d<c.length;d++)s.push(c[d])}else for(let c in r)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(r)})}n.sort(function(o,r){return o.compressed&&!r.compressed?-1:!o.compressed&&r.compressed?1:o.attributes.length-r.attributes.length}),this._geometryDefinitions.push(n)}};ed.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n)){for(let i=0;i<n.length;++i){let o=n[i],r=!1,s=o.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){r=!0;break}if(!r)return{bufferIndex:o.index,definition:n,geometryBufferInfo:o}}if(l(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};ed.prototype._loadRootNode=function(e){if(l(this._data.nodePages)){let t=0;l(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new GL(this,t,!0)}else this._rootNode=new GL(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};ed.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage;return this._loadNodePage(t).then(function(i){return i.nodes[n]})};ed._fetchJson=function(e){return e.fetchJson()};ed.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=ed._fetchJson(n).then(function(o){return l(o.error)&&o.error.code!==200?Promise.reject(o.error):(t._nodePages[e]=o.nodes,o)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};ed.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=ae.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=ae.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};ed.prototype._create3DTileset=async function(e){let t={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n),o=this._symbology?.defaultSymbology?.edges?.color;l(o)&&!l(e?.outlineColor)&&(e=l(e)?Ye(e):{},e.outlineColor=B.fromCartesian4(se.fromArray(o))),this._tileset=await ua.fromUrl(i,e),this._tileset.show=this._parent.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(r){r._i3sNode._clearGeometryData(),URL.revokeObjectURL(r._contentResource._url),r._contentResource=r._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(r){l(r._i3sNode)&&r._i3sNode._loadChildren()})};ed.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};ed.prototype.filterByAttributes=function(e){this._filters=l(e)?Ye(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var pS=ed;var zeo=T(S(),1);function r3(e,t){this._dataProvider=e,this._resource=new Ee({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(r3.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});r3.prototype.load=async function(){return this._data=await Fh.loadJson(this._resource),this._data};r3.prototype._getValues=function(e){let t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return l(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var PM=r3;var eto=T(S(),1);function vM(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=y(n.visibility,!0),this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(vM.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},name:{get:function(){return this._name}},modelName:{get:function(){return this._modelName}},sublayers:{get:function(){return this._sublayers}},visibility:{get:function(){return this._visibility},set:function(e){if(this._visibility!==e){this._visibility=e;for(let t=0;t<this._i3sLayers.length;t++)this._i3sLayers[t]._updateVisibility()}}},show:{get:function(){return this._visibility&&this._parent.show}}});vM._fromData=async function(e,t,n,i){let o=new vM(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(l(r)){let s=[];for(let c=0;c<r.length;c++){let d=vM._fromData(e,t,r[c],o);s.push(d)}let a=await Promise.all(s);for(let c=0;c<a.length;c++){let d=a[c];o._sublayers.push(d),o._i3sLayers.push(...d._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),s=new Ee({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await Fh.loadJson(o._resource),c=new pS(e,a,o);o._i3sLayers.push(c)}else console.log(`${o._data.layerType} layer ${o._data.name} is skipped as not supported.`);return o};var wM=vM;var PSe=T(XSe(),1);function ys(e){e=y(e,y.EMPTY_OBJECT),this._name=e.name,this._show=y(e.show,!0),this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=y(e.showFeatures,!1),this._adjustMaterialAlphaMode=y(e.adjustMaterialAlphaMode,!1),this._applySymbology=y(e.applySymbology,!1),this._calculateNormals=y(e.calculateNormals,!1),this._cesium3dTilesetOptions=y(e.cesium3dTilesetOptions,y.EMPTY_OBJECT),this._layers=[],this._sublayers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,this._attributeStatistics=[],this._layersExtent=[]}Object.defineProperties(ys.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(let t=0;t<this._layers.length;t++)this._layers[t]._updateVisibility()}}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},sublayers:{get:function(){return this._sublayers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},resource:{get:function(){return this._resource}},showFeatures:{get:function(){return this._showFeatures}},adjustMaterialAlphaMode:{get:function(){return this._adjustMaterialAlphaMode}},applySymbology:{get:function(){return this._applySymbology}},calculateNormals:{get:function(){return this._calculateNormals}}});ys.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return me(this)};ys.prototype.isDestroyed=function(){return!1};ys.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};ys.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};ys.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};ys.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)l(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};function bSt(e,t){let n=e.resource.getUrlComponent(),i="";return n.match(/layers\/\d/)?i=`${n}`.replace(/\/+$/,""):i=`${n}`.replace(/\/?$/,"/").concat(`layers/${t}`),i}async function WSe(e,t,n){if(t.layerType==="Building"){l(n.showFeatures)||(e._showFeatures=!0),l(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),l(n.applySymbology)||(e._applySymbology=!0),l(n.calculateNormals)||(e._calculateNormals=!0);let i=bSt(e,t.id);if(l(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=wM._fromData(e,i,t.sublayers[s],e);o.push(a)}let r=await Promise.all(o);for(let s=0;s<r.length;s++){let a=r[s];e._sublayers.push(a),e._layers.push(...a._i3sLayers)}}if(l(t.statisticsHRef)){let o=i.concat(`/${t.statisticsHRef}`),r=new PM(e,o);await r.load(),e._attributeStatistics.push(r)}if(l(t.fullExtent)){let o=ae.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax);e._layersExtent.push(o)}}else if(t.layerType==="3DObject"||t.layerType==="IntegratedMesh"){!l(n.calculateNormals)&&!l(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new pS(e,t,e);e._layers.push(i),l(i._extent)&&e._layersExtent.push(i._extent)}else console.log(`${t.layerType} layer ${t.name} is skipped as not supported.`)}ys.fromUrl=async function(e,t){t=y(t,y.EMPTY_OBJECT);let n=Ee.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await ys.loadJson(n),o=new ys(t);if(o._resource=n,o._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=WSe(o,i.layers[a],t);s.push(c)}await Promise.all(s)}else await WSe(o,i,t);o._computeExtent();let r=[];for(let s=0;s<o._layers.length;s++)r.push(o._layers[s].load(t.cesium3dTilesetOptions));return await Promise.all(r),o};ys._fetchJson=function(e){return e.fetchJson()};ys.loadJson=async function(e){let t=await ys._fetchJson(e);if(l(t.error)){if(console.error("Failed to fetch I3S ",e.url),l(t.error.message)&&console.error(t.error.message),l(t.error.details))for(let n=0;n<t.error.details.length;n++)console.log(t.error.details[n]);throw new de(t.error)}return t};ys.prototype._loadBinary=async function(e){let t=await e.fetchArrayBuffer();if(t.byteLength>0&&new Uint8Array(t)[0]===123&&new TextDecoder().decode(t).includes("404"))throw new de(`Failed to load binary: ${e.url}`);return t};ys.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),o={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return o.magic[0]=103,o.magic[1]=108,o.magic[2]=84,o.magic[3]=70,o.version[0]=2,o.length[0]=i.byteLength,o.chunkLength[0]=n.byteLength,o.chunkType[0]=1313821514,o.chunkData.set(n),i};var gSt=new D;function ySt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=he.fromRadians(t.west,t.north),a=he.fromRadians(t.east,t.south),c=n.positionToTileXY(s,r),d=n.positionToTileXY(a,r);for(let m=c.x;m<=d.x;m++)for(let p=c.y;p<=d.y;p++){let g=D.fromElements(m,p,gSt),f=g.toString();if(!o.hasOwnProperty(f)){let x={x:g.x,y:g.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[f]=x,i.push(x)}}let u=[];for(let m=0;m<i.length;++m){let p=i[m],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);u.push(g)}return Promise.all(u).then(function(m){let p=[];for(let g=0;g<m.length;g++){let f={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},x=m[g],_="Geographic";n._projection instanceof Zi&&(_="WebMercator");let C={projectionType:_,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(f.x,f.y,f.level),height:x._height,width:x._width,scale:x._structure.heightScale,offset:x._structure.heightOffset};if(x._encoding===$u.LERC){let V=PSe.default.decode(x._buffer);C.buffer=V.pixels[0]}else C.buffer=x._buffer;p.push(C)}return p})}async function xSt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await ySt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}ys.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=xSt(this),this._geoidDataPromise)};ys.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?ae.union(e,n,e):e=ae.clone(n)}this._extent=e};ys.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};ys.prototype.getAttributeValues=function(e){for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(l(n))return n}return[]};ys.prototype.filterByAttributes=function(e){let t=[];for(let n=0;n<this._layers.length;n++){let i=this._layers[n].filterByAttributes(e);t.push(i)}return Promise.all(t)};var Fh=ys;var _to=T(S(),1);function vSe(){}Object.defineProperties(vSe.prototype,{color:{get:pe.throwInstantiationError},intensity:{get:pe.throwInstantiationError}});var q7=vSe;var Zto=T(S(),1);var _St=/\/$/,wSe=new Et('&copy; <a href="https://www.mapbox.com/about/maps/">Mapbox</a> &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function IL(e){e=y(e,y.EMPTY_OBJECT);let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=Ee.createIfNeeded(y(e.url,"https://api.mapbox.com/styles/v1/"));this._styleId=t,this._accessToken=n;let o=y(e.tilesize,512);this._tilesize=o;let r=y(e.username,"mapbox");this._username=r;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();_St.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new Et(c))):c=wSe,this._resource=i,this._imageryProvider=new Na({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(IL.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});IL.prototype.getTileCredits=function(e,t,n){};IL.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};IL.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};IL._defaultCredit=wSe;var $7=IL;var Eto=T(S(),1);function e6(e){}e6.prototype.isReady=function(){return!0};e6.prototype.shouldDiscardImage=function(e){return!1};var t6=e6;var Mto=T(S(),1);var TSt=new Et("MapQuest, Open Street Map and contributors, CC-BY-SA");function a3(e){e=y(e,y.EMPTY_OBJECT);let t=Ee.createIfNeeded(y(e.url,"https://tile.openstreetmap.org/"));t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${y(e.fileExtension,"png")}`;let n=new ns({ellipsoid:e.ellipsoid}),i=256,o=256,r=y(e.minimumLevel,0),s=e.maximumLevel,a=y(e.rectangle,n.rectangle),c=n.positionToTileXY(ae.southwest(a),r),d=n.positionToTileXY(ae.northeast(a),r),u=(Math.abs(d.x-c.x)+1)*(Math.abs(d.y-c.y)+1),m=y(e.credit,TSt);typeof m=="string"&&(m=new Et(m)),Na.call(this,{url:t,credit:m,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}l(Object.create)&&(a3.prototype=Object.create(Na.prototype),a3.prototype.constructor=a3);var x0=a3;var Yto=T(S(),1);var SSt=new D(1,1);function n6(e){e=y(e,y.EMPTY_OBJECT),this.mass=y(e.mass,1),this.position=h.clone(y(e.position,h.ZERO)),this.velocity=h.clone(y(e.velocity,h.ZERO)),this.life=y(e.life,Number.MAX_VALUE),this.image=e.image,this.startColor=B.clone(y(e.startColor,B.WHITE)),this.endColor=B.clone(y(e.endColor,B.WHITE)),this.startScale=y(e.startScale,1),this.endScale=y(e.endScale,1),this.imageSize=D.clone(y(e.imageSize,SSt)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(n6.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var FSe=new h;n6.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,FSe),h.add(this.position,FSe,this.position),l(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var XL=n6;var Kto=T(S(),1);function ASe(e){e=y(e,y.EMPTY_OBJECT),this.time=y(e.time,0),this.minimum=y(e.minimum,0),this.maximum=y(e.maximum,50),this._complete=!1}Object.defineProperties(ASe.prototype,{complete:{get:function(){return this._complete}}});var i6=ASe;var jto=T(S(),1);function MSe(e){}MSe.prototype.emit=function(e){pe.throwInstantiationError()};var o6=MSe;var mno=T(S(),1);var NSe=new D(1,1);function FM(e){e=y(e,y.EMPTY_OBJECT),this.show=y(e.show,!0),this.updateCallback=e.updateCallback,this.loop=y(e.loop,!0),this.image=y(e.image,void 0);let t=e.emitter;l(t)||(t=new SM(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=M.clone(y(e.modelMatrix,M.IDENTITY)),this._emitterModelMatrix=M.clone(y(e.emitterModelMatrix,M.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new M,this._startColor=B.clone(y(e.color,y(e.startColor,B.WHITE))),this._endColor=B.clone(y(e.color,y(e.endColor,B.WHITE))),this._startScale=y(e.scale,y(e.startScale,1)),this._endScale=y(e.scale,y(e.endScale,1)),this._emissionRate=y(e.emissionRate,5),this._minimumSpeed=y(e.speed,y(e.minimumSpeed,1)),this._maximumSpeed=y(e.speed,y(e.maximumSpeed,1)),this._minimumParticleLife=y(e.particleLife,y(e.minimumParticleLife,5)),this._maximumParticleLife=y(e.particleLife,y(e.maximumParticleLife,5)),this._minimumMass=y(e.mass,y(e.minimumMass,1)),this._maximumMass=y(e.mass,y(e.maximumMass,1)),this._minimumImageSize=D.clone(y(e.imageSize,y(e.minimumImageSize,NSe))),this._maximumImageSize=D.clone(y(e.imageSize,y(e.maximumImageSize,NSe))),this._sizeInMeters=y(e.sizeInMeters,!1),this._lifetime=y(e.lifetime,Number.MAX_VALUE),this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new be,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(FM.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!M.equals(this._modelMatrix,e),M.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!M.equals(this._emitterModelMatrix,e),M.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){B.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){B.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function CSt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(l(o)){let m=o.length;for(let p=0;p<m;++p)i+=o[p].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,d=e._particlePool,u=Math.max(a-c.length-d.length,0);for(let m=0;m<u;++m){let p=new XL;p._billboard=r.add({image:s,show:!1}),d.push(p)}e._particleEstimate=a}function VSt(e){let t=e._particlePool.pop();return l(t)||(t=new XL),t}function LSt(e,t){e._particlePool.push(t)}function RSt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,s=e._particleEstimate,a=r-Math.max(s-o-r,0);for(let c=a;c<r;++c){let d=n[c];i.remove(d._billboard)}n.length=a}function ZSt(e){l(e._billboard)&&(e._billboard.show=!1)}function kSe(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=W.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=W.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=W.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=W.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new B(i,o,r,s),n.scale=W.lerp(t.startScale,t.endScale,t.normalizedAge)}function GSt(e,t){t.startColor=B.clone(e._startColor,t.startColor),t.endColor=B.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=W.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=W.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=W.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=W.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=W.randomBetween(e._minimumSpeed,e._maximumSpeed);h.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function ESt(e,t){if(e._isComplete)return 0;t=W.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let s=e.bursts[r],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=W.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var c3=new h;FM.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new Sd),this._updateParticlePool&&(CSt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=j.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,o=this.updateCallback,r,s,a=n.length;for(r=0;r<a;++r)s=n[r],s.update(t,o)?kSe(this,s):(ZSt(s),LSt(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=ESt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=M.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let d=this._combinedMatrix;for(r=0;r<c;r++)s=VSt(this),this._emitter.emit(s),h.add(s.position,s.velocity,c3),M.multiplyByPoint(d,c3,c3),s.position=M.multiplyByPoint(d,s.position,s.position),h.subtract(c3,s.position,s.velocity),h.normalize(s.velocity,s.velocity),GSt(this,s),kSe(this,s)}if(this._billboardCollection.update(e),this._previousTime=j.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=W.mod(this._currentTime,this._lifetime),this.bursts){let d=this.bursts.length;for(r=0;r<d;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&RSt(this)};FM.prototype.isDestroyed=function(){return!1};FM.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),me(this)};var r6=FM;var pno=T(S(),1);function ou(){pe.throwInstantiationError()}ou.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(ou.prototype,{quadtree:{get:pe.throwInstantiationError,set:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError}});ou.prototype.update=pe.throwInstantiationError;ou.prototype.beginUpdate=pe.throwInstantiationError;ou.prototype.endUpdate=pe.throwInstantiationError;ou.prototype.getLevelMaximumGeometricError=pe.throwInstantiationError;ou.prototype.loadTile=pe.throwInstantiationError;ou.prototype.computeTileVisibility=pe.throwInstantiationError;ou.prototype.showTileThisFrame=pe.throwInstantiationError;ou.prototype.computeDistanceToTile=pe.throwInstantiationError;ou.prototype.isDestroyed=pe.throwInstantiationError;ou.prototype.destroy=pe.throwInstantiationError;var s6=ou;var _no=T(S(),1);function a6(e){e=y(e,1),this._radius=y(e,1)}Object.defineProperties(a6.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});a6.prototype.emit=function(e){let t=W.randomBetween(0,W.TWO_PI),n=W.randomBetween(0,W.PI),i=W.randomBetween(0,this._radius),o=i*Math.cos(t)*Math.sin(n),r=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=h.fromElements(o,r,s,e.position),e.velocity=h.normalize(e.position,e.velocity)};var c6=a6;var Cno=T(S(),1);function AM(){}AM.prototype.evaluate=function(e,t){pe.throwInstantiationError()};AM.prototype.evaluateColor=function(e,t){pe.throwInstantiationError()};AM.prototype.getShaderFunction=function(e,t,n,i){pe.throwInstantiationError()};AM.prototype.getVariables=function(){pe.throwInstantiationError()};var l6=AM;var Gno=T(S(),1);function WL(e){this._ready=!1,this._provider=void 0,this._errorEvent=new be,this._readyEvent=new be,XSt(this,e)}Object.defineProperties(WL.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});WL.fromWorldTerrain=function(e){return new WL(cS(e))};WL.fromWorldBathymetry=function(e){return new WL(pM(e))};function ISt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function XSt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){ISt(e._errorEvent,i)}}var MM=WL;var Xno=T(S(),1);function PL(){}PL.prototype.boundingVolume=void 0;PL.prototype.boundingSphere=void 0;PL.prototype.distanceToCamera=function(e){pe.throwInstantiationError()};PL.prototype.intersectPlane=function(e){pe.throwInstantiationError()};PL.prototype.createDebugVolume=function(e){pe.throwInstantiationError()};var d6=PL;var Mno=T(S(),1);function NM(e){e=y(e,y.EMPTY_OBJECT),this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Yi({ellipsoid:e.ellipsoid}),this._color=y(e.color,B.YELLOW),this._errorEvent=new be,this._tileWidth=y(e.tileWidth,256),this._tileHeight=y(e.tileHeight,256),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(NM.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});NM.prototype.getTileCredits=function(e,t,n){};NM.prototype.requestImage=function(e,t,n,i){let o=document.createElement("canvas");o.width=256,o.height=256;let r=o.getContext("2d"),s=this._color.toCssColorString();return r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="bold 25px Arial",r.textAlign="center",r.fillStyle=s,r.fillText(`L: ${n}`,124,86),r.fillText(`X: ${e}`,124,136),r.fillText(`Y: ${t}`,124,186),Promise.resolve(o)};NM.prototype.pickFeatures=function(e,t,n,i,o){};var kM=NM;var Uno=T(S(),1);function u6(e){pe.throwInstantiationError()}u6.prototype.isReady=pe.throwInstantiationError;u6.prototype.shouldDiscardImage=pe.throwInstantiationError;var m6=u6;var Bno=T(S(),1),WSt={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},h6=Object.freeze(WSt);var tio=T(S(),1);function l3(e,t){this.show=!0,l(e)||(e=new Ke),this.rectangle=Ke.clone(e),l(t)||(t=Oi.fromType(Oi.ColorType,{color:new B(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}l3.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!Ke.equals(t.viewport,this.rectangle))&&(this._rs=Ue.fromCache({blending:un.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let o=new De({sources:[this._material.shaderSource,aM]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Ge.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};l3.prototype.isDestroyed=function(){return!1};l3.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),me(this)};var f6=l3;var oio=T(S(),1);function p6(){pe.throwInstantiationError()}Object.defineProperties(p6.prototype,{globalTransform:{get:pe.throwInstantiationError},shapeTransform:{get:pe.throwInstantiationError},shape:{get:pe.throwInstantiationError},minBounds:{get:pe.throwInstantiationError},maxBounds:{get:pe.throwInstantiationError},dimensions:{get:pe.throwInstantiationError},paddingBefore:{get:pe.throwInstantiationError},paddingAfter:{get:pe.throwInstantiationError},names:{get:pe.throwInstantiationError},types:{get:pe.throwInstantiationError},componentTypes:{get:pe.throwInstantiationError},minimumValues:{get:pe.throwInstantiationError},maximumValues:{get:pe.throwInstantiationError},maximumTileCount:{get:pe.throwInstantiationError},keyframeCount:{get:pe.throwInstantiationError},timeIntervalCollection:{get:pe.throwInstantiationError}});p6.prototype.requestData=pe.throwInstantiationError;var b6=p6;var aio=T(S(),1);function bS(){pe.throwInstantiationError()}Object.defineProperties(bS.prototype,{orientedBoundingBox:{get:pe.throwInstantiationError},boundingSphere:{get:pe.throwInstantiationError},boundTransform:{get:pe.throwInstantiationError},shapeTransform:{get:pe.throwInstantiationError},shaderUniforms:{get:pe.throwInstantiationError},shaderDefines:{get:pe.throwInstantiationError},shaderMaximumIntersectionsLength:{get:pe.throwInstantiationError}});bS.prototype.update=pe.throwInstantiationError;bS.prototype.computeOrientedBoundingBoxForTile=pe.throwInstantiationError;bS.prototype.computeOrientedBoundingBoxForSample=pe.throwInstantiationError;bS.DefaultMinBounds=pe.throwInstantiationError;bS.DefaultMaxBounds=pe.throwInstantiationError;var g6=bS;var Cio=T(S(),1);var PSt=new B,vSt=new B,wSt=new B,FSt=new B,USe=new se,UM=new Uint8Array(4);function DSe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return B.lerp(t.color,n.color,o,i)}function d3(e,t){return{height:e,color:B.clone(t)}}function BSe(e){return e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?t.height===i[n-1].height:!0,a=r?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?B.equals(t.color,i[n-1].color):!1,a=r?B.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?B.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function ASt(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],s=r.entries,a=s.length,c=[];for(n=0;n<a;n++){let g=s[n],f=W.clamp(g.height,td._minimumHeight,td._maximumHeight),x=B.clone(g.color,PSt);x.red*=x.alpha,x.green*=x.alpha,x.blue*=x.alpha,c.push(d3(f,x))}let d=!0,u=!0;for(n=0;n<a-1;n++){let g=c[n+0],f=c[n+1];d=d&&g.height<=f.height,u=u&&g.height>=f.height}u?c=c.reverse():d||o0(c,function(g,f){return W.sign(g.height-f.height)});let m=y(r.extendDownwards,!1),p=y(r.extendUpwards,!1);c.length===1&&!m&&!p&&(m=!0,p=!0),m&&c.splice(0,0,d3(td._minimumHeight,c[0].color)),p&&c.splice(c.length,0,d3(td._maximumHeight,c[c.length-1].color)),c=BSe(c),i.push(c)}return i}function MSt(e){let t=ASt(e),n=[],i=[],o;function r(d,u){n.push(d3(d,u))}function s(d,u,m){let p=B.multiplyByScalar(m,1-u.alpha,FSt);p=B.add(p,u,p),r(d,p)}let a=t.length;for(o=0;o<a;o++){let d=t[o],u=0,m=0;i=n,n=[];let p=d.length,g=i.length;for(;u<p||m<g;){let f=u<p?d[u]:void 0,x=u>0?d[u-1]:void 0,_=u<p-1?d[u+1]:void 0,C=m<g?i[m]:void 0,V=m>0?i[m-1]:void 0,L=m<g-1?i[m+1]:void 0;if(l(f)&&l(C)&&f.height===C.height){let Z=l(L)&&C.height===L.height,G=!l(V),I=!l(L),v=l(_)&&f.height===_.height,P=!l(x),w=!l(_);Z?v?(s(f.height,f.color,C.color),s(f.height,_.color,L.color)):P?(r(f.height,C.color),s(f.height,f.color,L.color)):w?(s(f.height,f.color,C.color),r(f.height,L.color)):(s(f.height,f.color,C.color),s(f.height,f.color,L.color)):G?v?(r(f.height,f.color),s(f.height,_.color,C.color)):w?(r(f.height,f.color),r(f.height,C.color)):(P||r(f.height,f.color),s(f.height,f.color,C.color)):I?v?(s(f.height,f.color,C.color),r(f.height,_.color)):P?(r(f.height,C.color),r(f.height,f.color)):w?s(f.height,f.color,C.color):(s(f.height,f.color,C.color),r(f.height,f.color)):v?(s(f.height,f.color,C.color),s(f.height,_.color,C.color)):P?(r(f.height,C.color),s(f.height,f.color,C.color)):w?(s(f.height,f.color,C.color),r(f.height,C.color)):s(f.height,f.color,C.color),u+=v?2:1,m+=Z?2:1}else if(l(f)&&l(C)&&l(V)&&f.height<C.height){let Z=DSe(f.height,V,C,wSt);l(x)?l(_)?s(f.height,f.color,Z):(s(f.height,f.color,Z),r(f.height,Z)):(r(f.height,Z),s(f.height,f.color,Z)),u++}else if(l(C)&&l(f)&&l(x)&&C.height<f.height){let Z=DSe(C.height,x,f,vSt);l(V)?l(L)?s(C.height,Z,C.color):(s(C.height,Z,C.color),r(C.height,Z)):(r(C.height,Z),s(C.height,Z,C.color)),m++}else l(f)&&(!l(C)||f.height<C.height)?(l(C)&&!l(V)&&!l(_)?(r(f.height,f.color),r(f.height,td._emptyColor),r(C.height,td._emptyColor)):(!l(C)&&l(V)&&!l(x)&&(r(V.height,td._emptyColor),r(f.height,td._emptyColor)),r(f.height,f.color)),u++):l(C)&&(!l(f)||C.height<f.height)&&(r(C.height,C.color),m++)}}return BSe(n)}function td(e){let{scene:t,layers:n}=y(e,y.EMPTY_OBJECT),{context:i}=t,o=MSt(n),r=o.length,s,a,c;if(!td._useFloatTexture(i)){a=qe.UNSIGNED_BYTE,c=ot.RGBA,s=new Uint8Array(r*4);for(let g=0;g<r;g++)se.packFloat(o[g].height,USe),se.pack(USe,s,g*4)}else{a=qe.FLOAT,c=i.webgl2?ot.RED:ot.LUMINANCE,s=new Float32Array(r);for(let g=0;g<r;g++)s[g]=o[g].height}let u=Pt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new en({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:$t.NEAREST,magnificationFilter:hi.NEAREST})}),m=new Uint8Array(r*4);for(let g=0;g<r;g++)o[g].color.toBytes(UM),m[g*4+0]=UM[0],m[g*4+1]=UM[1],m[g*4+2]=UM[2],m[g*4+3]=UM[3];let p=Pt.create({context:i,pixelFormat:ot.RGBA,pixelDatatype:qe.UNSIGNED_BYTE,source:{arrayBufferView:m,width:r,height:1},sampler:new en({wrapS:Cn.CLAMP_TO_EDGE,wrapT:Cn.CLAMP_TO_EDGE,minificationFilter:$t.LINEAR,magnificationFilter:hi.LINEAR})});return Oi.fromType("ElevationBand",{heights:u,colors:p})}td._useFloatTexture=function(e){return e.floatingPointTexture};td._maximumHeight=5906376425472;td._minimumHeight=-5906376425472;td._emptyColor=new B(0,0,0,0);var y6=td;var Xio=T(S(),1);async function NSt(e,t){if(t=y(t,{}),t.cacheBytes=y(t.cacheBytes,1536*1024*1024),t.maximumCacheOverflowBytes=y(t.maximumCacheOverflowBytes,1024*1024*1024),t.enableCollision=y(t.enableCollision,!0),e=y(e,sS.defaultApiKey),!l(e))return kSt(t);let n,i=sS.getDefaultCredit();l(i)&&(n=[i]);let o=new Ee({url:`${sS.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:e},credits:n});return ua.fromUrl(o,t)}var OSe={};async function kSt(e){let i=OSe[2275207];l(i)||(i=fd.fromAssetId(2275207),OSe[2275207]=i);let o=await i;return ua.fromUrl(o,e)}var x6=NSt;var Mio=T(S(),1);async function USt(e){let t=await ua.fromIonAssetId(96188,e);e=y(e,y.EMPTY_OBJECT);let n=e.style;if(!l(n)){let i=y(e.defaultColor,B.WHITE).toCssColorString();n=new dS({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var _6=USt;var Kio=T(S(),1);function DSt(e){e=y(e,y.EMPTY_OBJECT);let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=M.clone(y(e.modelMatrix,M.IDENTITY)),r=y(e.length,1e4);if(l(i.normal)&&t.push(new Gt({geometry:Fn.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Kt(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new Gt({geometry:Fn.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Kt(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new Gt({geometry:Fn.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new Kt(0,0,1,1)},modelMatrix:o})),t.length>0)return new In({asynchronous:!1,geometryInstances:t,appearance:new dn({flat:!0,translucent:!1})})}var T6=DSt;var Qio=T(S(),1),S6=`uniform sampler2D u_depthTexture;
  13983. in vec2 v_textureCoordinates;
  13984. void main()
  13985. {
  13986. float z_window = czm_unpackDepth(texture(u_depthTexture, v_textureCoordinates));
  13987. z_window = czm_reverseLogDepth(z_window);
  13988. float n_range = czm_depthRange.near;
  13989. float f_range = czm_depthRange.far;
  13990. float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);
  13991. float scale = pow(z_ndc * 0.5 + 0.5, 8.0);
  13992. out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);
  13993. }
  13994. `;var ooo=T(S(),1);function BSt(e){e=y(e,y.EMPTY_OBJECT),this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=y(e.pixelFormat,ot.RGBA),this.pixelDatatype=y(e.pixelDatatype,qe.UNSIGNED_BYTE);let t=e.url;typeof t=="string"&&(t=Ee.createIfNeeded(t)),this.resource=t;let i=y(e.repeat,!0)?Cn.REPEAT:Cn.CLAMP_TO_EDGE;this.sampler=new en({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var C6=BSt;var soo=T(S(),1),OSt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4"},V6=Object.freeze(OSt);var coo=T(S(),1),YSt={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"},L6=Object.freeze(YSt);var uoo=T(S(),1);function HSt(e){async function t({data:i}){let o=[],r={id:i.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=i.baseUrl;try{let s=await e(i.parameters,o);r.result=s}catch(s){s instanceof Error?r.error={name:s.name,message:s.message,stack:s.stack}:r.error=s}i.canTransferArrayBuffer||(o.length=0);try{postMessage(r,o)}catch(s){r.result=void 0,r.error=`postMessage failed with error: ${Mf(s)}
  13995. with responseMessage: ${JSON.stringify(r)}`,postMessage(r)}}function n(i){postMessage({id:i.data?.id,error:`postMessage failed with error: ${JSON.stringify(i)}`})}return self.onmessage=t,self.onmessageerror=n,self}var R6=HSt;globalThis.CESIUM_VERSION="1.123";var MEo=T(S(),1);var pVo=T(S(),1);var uVo=T(S(),1);var nVo=T(S(),1),DM;typeof ko<"u"&&(DM=ko);(function(){/*!
  13996. * Knockout JavaScript library v3.5.1
  13997. * (c) The Knockout.js team - http://knockoutjs.com/
  13998. * License: MIT (http://www.opensource.org/licenses/mit-license.php)
  13999. */(function(){(function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,o=t.jQuery,r=t.JSON;o||typeof jQuery>"u"||(o=jQuery),function(s){s(t.ko={})}(function(s,a){function c(b,R){return b===null||typeof b in x?b===R:!1}function d(b,R){var E;return function(){E||(E=f.a.setTimeout(function(){E=e,b()},R))}}function u(b,R){var E;return function(){clearTimeout(E),E=f.a.setTimeout(b,R)}}function m(b,R){R&&R!=="change"?R==="beforeChange"?this.pc(b):this.gb(b,R):this.qc(b)}function p(b,R){R!==null&&R.s&&R.s()}function g(b,R){var E=this.qd,X=E[Z];X.ra||(this.Qb&&this.mb[R]?(E.uc(R,b,this.mb[R]),this.mb[R]=null,--this.Qb):X.I[R]||E.uc(R,b,X.J?{da:b}:E.$c(b)),b.Ja&&b.gd())}var f=typeof s<"u"?s:{};f.b=function(b,R){for(var E=b.split("."),X=f,A=0;A<E.length-1;A++)X=X[E[A]];X[E[E.length-1]]=R},f.L=function(b,R,E){b[R]=E},f.version="3.5.1",f.b("version",f.version),f.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},f.a=function(){function b(z,q){for(var ee in z)A.call(z,ee)&&q(ee,z[ee])}function R(z,q){if(q)for(var ee in q)A.call(q,ee)&&(z[ee]=q[ee]);return z}function E(z,q){return z.__proto__=q,z}function X(z,q,ee,fe){var _e=z[q].match(J)||[];f.a.D(ee.match(J),function(le){f.a.Na(_e,le,fe)}),z[q]=_e.join(" ")}var A=Object.prototype.hasOwnProperty,N={__proto__:[]}instanceof Array,O=typeof Symbol=="function",U={},Y={};U[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],U.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),b(U,function(z,q){if(q.length)for(var ee=0,fe=q.length;ee<fe;ee++)Y[q[ee]]=z});var k={propertychange:!0},H=n&&function(){for(var z=3,q=n.createElement("div"),ee=q.getElementsByTagName("i");q.innerHTML="<!--[if gt IE "+ ++z+"]><i></i><![endif]-->",ee[0];);return 4<z?z:e}(),J=/\S+/g,te;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(z,q,ee){for(var fe=0,_e=z.length;fe<_e;fe++)q.call(ee,z[fe],fe,z)},A:typeof Array.prototype.indexOf=="function"?function(z,q){return Array.prototype.indexOf.call(z,q)}:function(z,q){for(var ee=0,fe=z.length;ee<fe;ee++)if(z[ee]===q)return ee;return-1},Lb:function(z,q,ee){for(var fe=0,_e=z.length;fe<_e;fe++)if(q.call(ee,z[fe],fe,z))return z[fe];return e},Pa:function(z,q){var ee=f.a.A(z,q);0<ee?z.splice(ee,1):ee===0&&z.shift()},wc:function(z){var q=[];return z&&f.a.D(z,function(ee){0>f.a.A(q,ee)&&q.push(ee)}),q},Mb:function(z,q,ee){var fe=[];if(z)for(var _e=0,le=z.length;_e<le;_e++)fe.push(q.call(ee,z[_e],_e));return fe},jb:function(z,q,ee){var fe=[];if(z)for(var _e=0,le=z.length;_e<le;_e++)q.call(ee,z[_e],_e)&&fe.push(z[_e]);return fe},Nb:function(z,q){if(q instanceof Array)z.push.apply(z,q);else for(var ee=0,fe=q.length;ee<fe;ee++)z.push(q[ee]);return z},Na:function(z,q,ee){var fe=f.a.A(f.a.bc(z),q);0>fe?ee&&z.push(q):ee||z.splice(fe,1)},Ba:N,extend:R,setPrototypeOf:E,Ab:N?E:R,P:b,Ga:function(z,q,ee){if(!z)return z;var fe={},_e;for(_e in z)A.call(z,_e)&&(fe[_e]=q.call(ee,z[_e],_e,z));return fe},Tb:function(z){for(;z.firstChild;)f.removeNode(z.firstChild)},Yb:function(z){z=f.a.la(z);for(var q=(z[0]&&z[0].ownerDocument||n).createElement("div"),ee=0,fe=z.length;ee<fe;ee++)q.appendChild(f.oa(z[ee]));return q},Ca:function(z,q){for(var ee=0,fe=z.length,_e=[];ee<fe;ee++){var le=z[ee].cloneNode(!0);_e.push(q?f.oa(le):le)}return _e},va:function(z,q){if(f.a.Tb(z),q)for(var ee=0,fe=q.length;ee<fe;ee++)z.appendChild(q[ee])},Xc:function(z,q){var ee=z.nodeType?[z]:z;if(0<ee.length){for(var fe=ee[0],_e=fe.parentNode,le=0,ye=q.length;le<ye;le++)_e.insertBefore(q[le],fe);for(le=0,ye=ee.length;le<ye;le++)f.removeNode(ee[le])}},Ua:function(z,q){if(z.length){for(q=q.nodeType===8&&q.parentNode||q;z.length&&z[0].parentNode!==q;)z.splice(0,1);for(;1<z.length&&z[z.length-1].parentNode!==q;)z.length--;if(1<z.length){var ee=z[0],fe=z[z.length-1];for(z.length=0;ee!==fe;)z.push(ee),ee=ee.nextSibling;z.push(fe)}}return z},Zc:function(z,q){7>H?z.setAttribute("selected",q):z.selected=q},Db:function(z){return z===null||z===e?"":z.trim?z.trim():z.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(z,q){return z=z||"",q.length>z.length?!1:z.substring(0,q.length)===q},vd:function(z,q){if(z===q)return!0;if(z.nodeType===11)return!1;if(q.contains)return q.contains(z.nodeType!==1?z.parentNode:z);if(q.compareDocumentPosition)return(q.compareDocumentPosition(z)&16)==16;for(;z&&z!=q;)z=z.parentNode;return!!z},Sb:function(z){return f.a.vd(z,z.ownerDocument.documentElement)},kd:function(z){return!!f.a.Lb(z,f.a.Sb)},R:function(z){return z&&z.tagName&&z.tagName.toLowerCase()},Ac:function(z){return f.onError?function(){try{return z.apply(this,arguments)}catch(q){throw f.onError&&f.onError(q),q}}:z},setTimeout:function(z,q){return setTimeout(f.a.Ac(z),q)},Gc:function(z){setTimeout(function(){throw f.onError&&f.onError(z),z},0)},B:function(z,q,ee){var fe=f.a.Ac(ee);if(ee=k[q],f.options.useOnlyNativeEvents||ee||!o)if(ee||typeof z.addEventListener!="function")if(typeof z.attachEvent<"u"){var _e=function(ye){fe.call(z,ye)},le="on"+q;z.attachEvent(le,_e),f.a.K.za(z,function(){z.detachEvent(le,_e)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else z.addEventListener(q,fe,!1);else te||(te=typeof o(z).on=="function"?"on":"bind"),o(z)[te](q,fe)},Fb:function(z,q){if(!z||!z.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var ee;if(f.a.R(z)==="input"&&z.type&&q.toLowerCase()=="click"?(ee=z.type,ee=ee=="checkbox"||ee=="radio"):ee=!1,f.options.useOnlyNativeEvents||!o||ee)if(typeof n.createEvent=="function")if(typeof z.dispatchEvent=="function")ee=n.createEvent(Y[q]||"HTMLEvents"),ee.initEvent(q,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,z),z.dispatchEvent(ee);else throw Error("The supplied element doesn't support dispatchEvent");else if(ee&&z.click)z.click();else if(typeof z.fireEvent<"u")z.fireEvent("on"+q);else throw Error("Browser doesn't support triggering events");else o(z).trigger(q)},f:function(z){return f.O(z)?z():z},bc:function(z){return f.O(z)?z.v():z},Eb:function(z,q,ee){var fe;q&&(typeof z.classList=="object"?(fe=z.classList[ee?"add":"remove"],f.a.D(q.match(J),function(_e){fe.call(z.classList,_e)})):typeof z.className.baseVal=="string"?X(z.className,"baseVal",q,ee):X(z,"className",q,ee))},Bb:function(z,q){var ee=f.a.f(q);(ee===null||ee===e)&&(ee="");var fe=f.h.firstChild(z);!fe||fe.nodeType!=3||f.h.nextSibling(fe)?f.h.va(z,[z.ownerDocument.createTextNode(ee)]):fe.data=ee,f.a.Ad(z)},Yc:function(z,q){if(z.name=q,7>=H)try{var ee=z.name.replace(/[&<>'"]/g,function(fe){return"&#"+fe.charCodeAt(0)+";"});z.mergeAttributes(n.createElement("<input name='"+ee+"'/>"),!1)}catch{}},Ad:function(z){9<=H&&(z=z.nodeType==1?z:z.parentNode,z.style&&(z.style.zoom=z.style.zoom))},wd:function(z){if(H){var q=z.style.width;z.style.width=0,z.style.width=q}},Pd:function(z,q){z=f.a.f(z),q=f.a.f(q);for(var ee=[],fe=z;fe<=q;fe++)ee.push(fe);return ee},la:function(z){for(var q=[],ee=0,fe=z.length;ee<fe;ee++)q.push(z[ee]);return q},Da:function(z){return O?Symbol(z):z},Zd:H===6,$d:H===7,W:H,Lc:function(z,q){for(var ee=f.a.la(z.getElementsByTagName("input")).concat(f.a.la(z.getElementsByTagName("textarea"))),fe=typeof q=="string"?function(ye){return ye.name===q}:function(ye){return q.test(ye.name)},_e=[],le=ee.length-1;0<=le;le--)fe(ee[le])&&_e.push(ee[le]);return _e},Nd:function(z){return typeof z=="string"&&(z=f.a.Db(z))?r&&r.parse?r.parse(z):new Function("return "+z)():null},hc:function(z,q,ee){if(!r||!r.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return r.stringify(f.a.f(z),q,ee)},Od:function(z,q,ee){ee=ee||{};var fe=ee.params||{},_e=ee.includeFields||this.Jc,le=z;if(typeof z=="object"&&f.a.R(z)==="form")for(var le=z.action,ye=_e.length-1;0<=ye;ye--)for(var Te=f.a.Lc(z,_e[ye]),Xe=Te.length-1;0<=Xe;Xe--)fe[Te[Xe].name]=Te[Xe].value;q=f.a.f(q);var Le=n.createElement("form");Le.style.display="none",Le.action=le,Le.method="post";for(var ke in q)z=n.createElement("input"),z.type="hidden",z.name=ke,z.value=f.a.hc(f.a.f(q[ke])),Le.appendChild(z);b(fe,function(Oe,at){var Mt=n.createElement("input");Mt.type="hidden",Mt.name=Oe,Mt.value=at,Le.appendChild(Mt)}),n.body.appendChild(Le),ee.submitter?ee.submitter(Le):Le.submit(),setTimeout(function(){Le.parentNode.removeChild(Le)},0)}}}(),f.b("utils",f.a),f.b("utils.arrayForEach",f.a.D),f.b("utils.arrayFirst",f.a.Lb),f.b("utils.arrayFilter",f.a.jb),f.b("utils.arrayGetDistinctValues",f.a.wc),f.b("utils.arrayIndexOf",f.a.A),f.b("utils.arrayMap",f.a.Mb),f.b("utils.arrayPushAll",f.a.Nb),f.b("utils.arrayRemoveItem",f.a.Pa),f.b("utils.cloneNodes",f.a.Ca),f.b("utils.createSymbolOrString",f.a.Da),f.b("utils.extend",f.a.extend),f.b("utils.fieldsIncludedWithJsonPost",f.a.Jc),f.b("utils.getFormFields",f.a.Lc),f.b("utils.objectMap",f.a.Ga),f.b("utils.peekObservable",f.a.bc),f.b("utils.postJson",f.a.Od),f.b("utils.parseJson",f.a.Nd),f.b("utils.registerEventHandler",f.a.B),f.b("utils.stringifyJson",f.a.hc),f.b("utils.range",f.a.Pd),f.b("utils.toggleDomNodeCssClass",f.a.Eb),f.b("utils.triggerEvent",f.a.Fb),f.b("utils.unwrapObservable",f.a.f),f.b("utils.objectForEach",f.a.P),f.b("utils.addOrRemoveItem",f.a.Na),f.b("utils.setTextContent",f.a.Bb),f.b("unwrap",f.a.f),Function.prototype.bind||(Function.prototype.bind=function(b){var R=this;if(arguments.length===1)return function(){return R.apply(b,arguments)};var E=Array.prototype.slice.call(arguments,1);return function(){var X=E.slice(0);return X.push.apply(X,arguments),R.apply(b,X)}}),f.a.g=new function(){var b=0,R="__ko__"+new Date().getTime(),E={},X,A;return f.a.W?(X=function(N,O){var U=N[R];if(!U||U==="null"||!E[U]){if(!O)return e;U=N[R]="ko"+b++,E[U]={}}return E[U]},A=function(N){var O=N[R];return O?(delete E[O],N[R]=null,!0):!1}):(X=function(N,O){var U=N[R];return!U&&O&&(U=N[R]={}),U},A=function(N){return N[R]?(delete N[R],!0):!1}),{get:function(N,O){var U=X(N,!1);return U&&U[O]},set:function(N,O,U){(N=X(N,U!==e))&&(N[O]=U)},Ub:function(N,O,U){return N=X(N,!0),N[O]||(N[O]=U)},clear:A,Z:function(){return b+++R}}},f.b("utils.domData",f.a.g),f.b("utils.domData.clear",f.a.g.clear),f.a.K=new function(){function b(O,U){var Y=f.a.g.get(O,X);return Y===e&&U&&(Y=[],f.a.g.set(O,X,Y)),Y}function R(O){var U=b(O,!1);if(U)for(var U=U.slice(0),Y=0;Y<U.length;Y++)U[Y](O);f.a.g.clear(O),f.a.K.cleanExternalData(O),N[O.nodeType]&&E(O.childNodes,!0)}function E(O,U){for(var Y=[],k,H=0;H<O.length;H++)if((!U||O[H].nodeType===8)&&(R(Y[Y.length]=k=O[H]),O[H]!==k))for(;H--&&f.a.A(Y,O[H])==-1;);}var X=f.a.g.Z(),A={1:!0,8:!0,9:!0},N={1:!0,9:!0};return{za:function(O,U){if(typeof U!="function")throw Error("Callback must be a function");b(O,!0).push(U)},yb:function(O,U){var Y=b(O,!1);Y&&(f.a.Pa(Y,U),Y.length==0&&f.a.g.set(O,X,e))},oa:function(O){return f.u.G(function(){A[O.nodeType]&&(R(O),N[O.nodeType]&&E(O.getElementsByTagName("*")))}),O},removeNode:function(O){f.oa(O),O.parentNode&&O.parentNode.removeChild(O)},cleanExternalData:function(O){o&&typeof o.cleanData=="function"&&o.cleanData([O])}}},f.oa=f.a.K.oa,f.removeNode=f.a.K.removeNode,f.b("cleanNode",f.oa),f.b("removeNode",f.removeNode),f.b("utils.domNodeDisposal",f.a.K),f.b("utils.domNodeDisposal.addDisposeCallback",f.a.K.za),f.b("utils.domNodeDisposal.removeDisposeCallback",f.a.K.yb),function(){var b=[0,"",""],R=[1,"<table>","</table>"],E=[3,"<table><tbody><tr>","</tr></tbody></table>"],X=[1,"<select multiple='multiple'>","</select>"],A={thead:R,tbody:R,tfoot:R,tr:[2,"<table><tbody>","</tbody></table>"],td:E,th:E,option:X,optgroup:X},N=8>=f.a.W;f.a.ua=function(O,U){var Y;if(o){if(o.parseHTML)Y=o.parseHTML(O,U)||[];else if((Y=o.clean([O],U))&&Y[0]){for(var k=Y[0];k.parentNode&&k.parentNode.nodeType!==11;)k=k.parentNode;k.parentNode&&k.parentNode.removeChild(k)}}else{(Y=U)||(Y=n);var k=Y.parentWindow||Y.defaultView||t,H=f.a.Db(O).toLowerCase(),J=Y.createElement("div"),te;for(te=(H=H.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&A[H[1]]||b,H=te[0],te="ignored<div>"+te[1]+O+te[2]+"</div>",typeof k.innerShiv=="function"?J.appendChild(k.innerShiv(te)):(N&&Y.body.appendChild(J),J.innerHTML=te,N&&J.parentNode.removeChild(J));H--;)J=J.lastChild;Y=f.a.la(J.lastChild.childNodes)}return Y},f.a.Md=function(O,U){var Y=f.a.ua(O,U);return Y.length&&Y[0].parentElement||f.a.Yb(Y)},f.a.fc=function(O,U){if(f.a.Tb(O),U=f.a.f(U),U!==null&&U!==e)if(typeof U!="string"&&(U=U.toString()),o)o(O).html(U);else for(var Y=f.a.ua(U,O.ownerDocument),k=0;k<Y.length;k++)O.appendChild(Y[k])}}(),f.b("utils.parseHtmlFragment",f.a.ua),f.b("utils.setHtml",f.a.fc),f.aa=function(){function b(E,X){if(E){if(E.nodeType==8){var A=f.aa.Uc(E.nodeValue);A!=null&&X.push({ud:E,Kd:A})}else if(E.nodeType==1)for(var A=0,N=E.childNodes,O=N.length;A<O;A++)b(N[A],X)}}var R={};return{Xb:function(E){if(typeof E!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var X=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return R[X]=E,"<!--[ko_memo:"+X+"]-->"},bd:function(E,X){var A=R[E];if(A===e)throw Error("Couldn't find any memo with ID "+E+". Perhaps it's already been unmemoized.");try{return A.apply(null,X||[]),!0}finally{delete R[E]}},cd:function(E,X){var A=[];b(E,A);for(var N=0,O=A.length;N<O;N++){var U=A[N].ud,Y=[U];X&&f.a.Nb(Y,X),f.aa.bd(A[N].Kd,Y),U.nodeValue="",U.parentNode&&U.parentNode.removeChild(U)}},Uc:function(E){return(E=E.match(/^\[ko_memo\:(.*?)\]$/))?E[1]:null}}}(),f.b("memoization",f.aa),f.b("memoization.memoize",f.aa.Xb),f.b("memoization.unmemoize",f.aa.bd),f.b("memoization.parseMemoText",f.aa.Uc),f.b("memoization.unmemoizeDomNodeAndDescendants",f.aa.cd),f.na=function(){function b(){if(A){for(var U=A,Y=0,k;O<A;)if(k=X[O++]){if(O>U){if(5e3<=++Y){O=A,f.a.Gc(Error("'Too much recursion' after processing "+Y+" task groups."));break}U=A}try{k()}catch(H){f.a.Gc(H)}}}}function R(){b(),O=A=X.length=0}var E,X=[],A=0,N=1,O=0;return t.MutationObserver?E=function(U){var Y=n.createElement("div");return new MutationObserver(U).observe(Y,{attributes:!0}),function(){Y.classList.toggle("foo")}}(R):E=n&&"onreadystatechange"in n.createElement("script")?function(U){var Y=n.createElement("script");Y.onreadystatechange=function(){Y.onreadystatechange=null,n.documentElement.removeChild(Y),Y=null,U()},n.documentElement.appendChild(Y)}:function(U){setTimeout(U,0)},{scheduler:E,zb:function(U){return A||f.na.scheduler(R),X[A++]=U,N++},cancel:function(U){U=U-(N-A),U>=O&&U<A&&(X[U]=null)},resetForTesting:function(){var U=A-O;return O=A=X.length=0,U},Sd:b}}(),f.b("tasks",f.na),f.b("tasks.schedule",f.na.zb),f.b("tasks.runEarly",f.na.Sd),f.Ta={throttle:function(b,R){b.throttleEvaluation=R;var E=null;return f.$({read:b,write:function(X){clearTimeout(E),E=f.a.setTimeout(function(){b(X)},R)}})},rateLimit:function(b,R){var E,X,A;typeof R=="number"?E=R:(E=R.timeout,X=R.method),b.Hb=!1,A=typeof X=="function"?X:X=="notifyWhenChangesStop"?u:d,b.ub(function(N){return A(N,E,R)})},deferred:function(b,R){if(R!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");b.Hb||(b.Hb=!0,b.ub(function(E){var X,A=!1;return function(){if(!A){f.na.cancel(X),X=f.na.zb(E);try{A=!0,b.notifySubscribers(e,"dirty")}finally{A=!1}}}}))},notify:function(b,R){b.equalityComparer=R=="always"?null:c}};var x={undefined:1,boolean:1,number:1,string:1};f.b("extenders",f.Ta),f.ic=function(b,R,E){this.da=b,this.lc=R,this.mc=E,this.Ib=!1,this.fb=this.Jb=null,f.L(this,"dispose",this.s),f.L(this,"disposeWhenNodeIsRemoved",this.l)},f.ic.prototype.s=function(){this.Ib||(this.fb&&f.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},f.ic.prototype.l=function(b){this.Jb=b,f.a.K.za(b,this.fb=this.s.bind(this))},f.T=function(){f.a.Ab(this,_),_.qb(this)};var _={qb:function(b){b.U={change:[]},b.sc=1},subscribe:function(b,R,E){var X=this;E=E||"change";var A=new f.ic(X,R?b.bind(R):b,function(){f.a.Pa(X.U[E],A),X.hb&&X.hb(E)});return X.Qa&&X.Qa(E),X.U[E]||(X.U[E]=[]),X.U[E].push(A),A},notifySubscribers:function(b,R){if(R=R||"change",R==="change"&&this.Gb(),this.Wa(R)){var E=R==="change"&&this.ed||this.U[R].slice(0);try{f.u.xc();for(var X=0,A;A=E[X];++X)A.Ib||A.lc(b)}finally{f.u.end()}}},ob:function(){return this.sc},Dd:function(b){return this.ob()!==b},Gb:function(){++this.sc},ub:function(b){var R=this,E=f.O(R),X,A,N,O,U;R.gb||(R.gb=R.notifySubscribers,R.notifySubscribers=m);var Y=b(function(){R.Ja=!1,E&&O===R&&(O=R.nc?R.nc():R());var k=A||U&&R.sb(N,O);U=A=X=!1,k&&R.gb(N=O)});R.qc=function(k,H){H&&R.Ja||(U=!H),R.ed=R.U.change.slice(0),R.Ja=X=!0,O=k,Y()},R.pc=function(k){X||(N=k,R.gb(k,"beforeChange"))},R.rc=function(){U=!0},R.gd=function(){R.sb(N,R.v(!0))&&(A=!0)}},Wa:function(b){return this.U[b]&&this.U[b].length},Bd:function(b){if(b)return this.U[b]&&this.U[b].length||0;var R=0;return f.a.P(this.U,function(E,X){E!=="dirty"&&(R+=X.length)}),R},sb:function(b,R){return!this.equalityComparer||!this.equalityComparer(b,R)},toString:function(){return"[object Object]"},extend:function(b){var R=this;return b&&f.a.P(b,function(E,X){var A=f.Ta[E];typeof A=="function"&&(R=A(R,X)||R)}),R}};f.L(_,"init",_.qb),f.L(_,"subscribe",_.subscribe),f.L(_,"extend",_.extend),f.L(_,"getSubscriptionsCount",_.Bd),f.a.Ba&&f.a.setPrototypeOf(_,Function.prototype),f.T.fn=_,f.Qc=function(b){return b!=null&&typeof b.subscribe=="function"&&typeof b.notifySubscribers=="function"},f.b("subscribable",f.T),f.b("isSubscribable",f.Qc),f.S=f.u=function(){function b(N){E.push(X),X=N}function R(){X=E.pop()}var E=[],X,A=0;return{xc:b,end:R,cc:function(N){if(X){if(!f.Qc(N))throw Error("Only subscribable things can act as dependencies");X.od.call(X.pd,N,N.fd||(N.fd=++A))}},G:function(N,O,U){try{return b(),N.apply(O,U||[])}finally{R()}},qa:function(){if(X)return X.o.qa()},Va:function(){if(X)return X.o.Va()},Ya:function(){if(X)return X.Ya},o:function(){if(X)return X.o}}}(),f.b("computedContext",f.S),f.b("computedContext.getDependenciesCount",f.S.qa),f.b("computedContext.getDependencies",f.S.Va),f.b("computedContext.isInitial",f.S.Ya),f.b("computedContext.registerDependency",f.S.cc),f.b("ignoreDependencies",f.Yd=f.u.G);var C=f.a.Da("_latestValue");f.ta=function(b){function R(){return 0<arguments.length?(R.sb(R[C],arguments[0])&&(R.ya(),R[C]=arguments[0],R.xa()),this):(f.u.cc(R),R[C])}return R[C]=b,f.a.Ba||f.a.extend(R,f.T.fn),f.T.fn.qb(R),f.a.Ab(R,V),f.options.deferUpdates&&f.Ta.deferred(R,!0),R};var V={equalityComparer:c,v:function(){return this[C]},xa:function(){this.notifySubscribers(this[C],"spectate"),this.notifySubscribers(this[C])},ya:function(){this.notifySubscribers(this[C],"beforeChange")}};f.a.Ba&&f.a.setPrototypeOf(V,f.T.fn);var L=f.ta.Ma="__ko_proto__";V[L]=f.ta,f.O=function(b){if((b=typeof b=="function"&&b[L])&&b!==V[L]&&b!==f.o.fn[L])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!b},f.Za=function(b){return typeof b=="function"&&(b[L]===V[L]||b[L]===f.o.fn[L]&&b.Nc)},f.b("observable",f.ta),f.b("isObservable",f.O),f.b("isWriteableObservable",f.Za),f.b("isWritableObservable",f.Za),f.b("observable.fn",V),f.L(V,"peek",V.v),f.L(V,"valueHasMutated",V.xa),f.L(V,"valueWillMutate",V.ya),f.Ha=function(b){if(b=b||[],typeof b!="object"||!("length"in b))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return b=f.ta(b),f.a.Ab(b,f.Ha.fn),b.extend({trackArrayChanges:!0})},f.Ha.fn={remove:function(b){for(var R=this.v(),E=[],X=typeof b!="function"||f.O(b)?function(O){return O===b}:b,A=0;A<R.length;A++){var N=R[A];if(X(N)){if(E.length===0&&this.ya(),R[A]!==N)throw Error("Array modified during remove; cannot remove item");E.push(N),R.splice(A,1),A--}}return E.length&&this.xa(),E},removeAll:function(b){if(b===e){var R=this.v(),E=R.slice(0);return this.ya(),R.splice(0,R.length),this.xa(),E}return b?this.remove(function(X){return 0<=f.a.A(b,X)}):[]},destroy:function(b){var R=this.v(),E=typeof b!="function"||f.O(b)?function(N){return N===b}:b;this.ya();for(var X=R.length-1;0<=X;X--){var A=R[X];E(A)&&(A._destroy=!0)}this.xa()},destroyAll:function(b){return b===e?this.destroy(function(){return!0}):b?this.destroy(function(R){return 0<=f.a.A(b,R)}):[]},indexOf:function(b){var R=this();return f.a.A(R,b)},replace:function(b,R){var E=this.indexOf(b);0<=E&&(this.ya(),this.v()[E]=R,this.xa())},sorted:function(b){var R=this().slice(0);return b?R.sort(b):R.sort()},reversed:function(){return this().slice(0).reverse()}},f.a.Ba&&f.a.setPrototypeOf(f.Ha.fn,f.ta.fn),f.a.D("pop push reverse shift sort splice unshift".split(" "),function(b){f.Ha.fn[b]=function(){var R=this.v();this.ya(),this.zc(R,b,arguments);var E=R[b].apply(R,arguments);return this.xa(),E===R?this:E}}),f.a.D(["slice"],function(b){f.Ha.fn[b]=function(){var R=this();return R[b].apply(R,arguments)}}),f.Pc=function(b){return f.O(b)&&typeof b.remove=="function"&&typeof b.push=="function"},f.b("observableArray",f.Ha),f.b("isObservableArray",f.Pc),f.Ta.trackArrayChanges=function(b,R){function E(){function J(){if(U){var te=[].concat(b.v()||[]),z;b.Wa("arrayChange")&&((!A||1<U)&&(A=f.a.Pb(Y,te,b.Ob)),z=A),Y=te,A=null,U=0,z&&z.length&&b.notifySubscribers(z,"arrayChange")}}X?J():(X=!0,O=b.subscribe(function(){++U},null,"spectate"),Y=[].concat(b.v()||[]),A=null,N=b.subscribe(J))}if(b.Ob={},R&&typeof R=="object"&&f.a.extend(b.Ob,R),b.Ob.sparse=!0,!b.zc){var X=!1,A=null,N,O,U=0,Y,k=b.Qa,H=b.hb;b.Qa=function(J){k&&k.call(b,J),J==="arrayChange"&&E()},b.hb=function(J){H&&H.call(b,J),J!=="arrayChange"||b.Wa("arrayChange")||(N&&N.s(),O&&O.s(),O=N=null,X=!1,Y=e)},b.zc=function(J,te,z){function q(Le,ke,Oe){return ee[ee.length]={status:Le,value:ke,index:Oe}}if(X&&!U){var ee=[],fe=J.length,_e=z.length,le=0;switch(te){case"push":le=fe;case"unshift":for(te=0;te<_e;te++)q("added",z[te],le+te);break;case"pop":le=fe-1;case"shift":fe&&q("deleted",J[le],le);break;case"splice":te=Math.min(Math.max(0,0>z[0]?fe+z[0]:z[0]),fe);for(var fe=_e===1?fe:Math.min(te+(z[1]||0),fe),_e=te+_e-2,le=Math.max(fe,_e),ye=[],Te=[],Xe=2;te<le;++te,++Xe)te<fe&&Te.push(q("deleted",J[te],te)),te<_e&&ye.push(q("added",z[Xe],te));f.a.Kc(Te,ye);break;default:return}A=ee}}}};var Z=f.a.Da("_state");f.o=f.$=function(b,R,E){function X(){if(0<arguments.length){if(typeof A=="function")A.apply(N.nb,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return N.ra||f.u.cc(X),(N.ka||N.J&&X.Xa())&&X.ha(),N.X}if(typeof b=="object"?E=b:(E=E||{},b&&(E.read=b)),typeof E.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var A=E.write,N={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:E.read,nb:R||E.owner,l:E.disposeWhenNodeIsRemoved||E.l||null,Sa:E.disposeWhen||E.Sa,Rb:null,I:{},V:0,Ic:null};return X[Z]=N,X.Nc=typeof A=="function",f.a.Ba||f.a.extend(X,f.T.fn),f.T.fn.qb(X),f.a.Ab(X,G),E.pure?(N.wb=!0,N.J=!0,f.a.extend(X,I)):E.deferEvaluation&&f.a.extend(X,v),f.options.deferUpdates&&f.Ta.deferred(X,!0),N.l&&(N.jc=!0,N.l.nodeType||(N.l=null)),N.J||E.deferEvaluation||X.ha(),N.l&&X.ja()&&f.a.K.za(N.l,N.Rb=function(){X.s()}),X};var G={equalityComparer:c,qa:function(){return this[Z].V},Va:function(){var b=[];return f.a.P(this[Z].I,function(R,E){b[E.Ka]=E.da}),b},Vb:function(b){if(!this[Z].V)return!1;var R=this.Va();return f.a.A(R,b)!==-1?!0:!!f.a.Lb(R,function(E){return E.Vb&&E.Vb(b)})},uc:function(b,R,E){if(this[Z].wb&&R===this)throw Error("A 'pure' computed must not be called recursively");this[Z].I[b]=E,E.Ka=this[Z].V++,E.La=R.ob()},Xa:function(){var b,R,E=this[Z].I;for(b in E)if(Object.prototype.hasOwnProperty.call(E,b)&&(R=E[b],this.Ia&&R.da.Ja||R.da.Dd(R.La)))return!0},Jd:function(){this.Ia&&!this[Z].rb&&this.Ia(!1)},ja:function(){var b=this[Z];return b.ka||0<b.V},Rd:function(){this.Ja?this[Z].ka&&(this[Z].sa=!0):this.Hc()},$c:function(b){if(b.Hb){var R=b.subscribe(this.Jd,this,"dirty"),E=b.subscribe(this.Rd,this);return{da:b,s:function(){R.s(),E.s()}}}return b.subscribe(this.Hc,this)},Hc:function(){var b=this,R=b.throttleEvaluation;R&&0<=R?(clearTimeout(this[Z].Ic),this[Z].Ic=f.a.setTimeout(function(){b.ha(!0)},R)):b.Ia?b.Ia(!0):b.ha(!0)},ha:function(b){var R=this[Z],E=R.Sa,X=!1;if(!R.rb&&!R.ra){if(R.l&&!f.a.Sb(R.l)||E&&E()){if(!R.jc){this.s();return}}else R.jc=!1;R.rb=!0;try{X=this.zd(b)}finally{R.rb=!1}return X}},zd:function(b){var R=this[Z],X=!1,E=R.wb?e:!R.V,X={qd:this,mb:R.I,Qb:R.V};f.u.xc({pd:X,od:g,o:this,Ya:E}),R.I={},R.V=0;var A=this.yd(R,X);return R.V?X=this.sb(R.X,A):(this.s(),X=!0),X&&(R.J?this.Gb():this.notifySubscribers(R.X,"beforeChange"),R.X=A,this.notifySubscribers(R.X,"spectate"),!R.J&&b&&this.notifySubscribers(R.X),this.rc&&this.rc()),E&&this.notifySubscribers(R.X,"awake"),X},yd:function(b,R){try{var E=b.Wc;return b.nb?E.call(b.nb):E()}finally{f.u.end(),R.Qb&&!b.J&&f.a.P(R.mb,p),b.sa=b.ka=!1}},v:function(b){var R=this[Z];return(R.ka&&(b||!R.V)||R.J&&this.Xa())&&this.ha(),R.X},ub:function(b){f.T.fn.ub.call(this,b),this.nc=function(){return this[Z].J||(this[Z].sa?this.ha():this[Z].ka=!1),this[Z].X},this.Ia=function(R){this.pc(this[Z].X),this[Z].ka=!0,R&&(this[Z].sa=!0),this.qc(this,!R)}},s:function(){var b=this[Z];!b.J&&b.I&&f.a.P(b.I,function(R,E){E.s&&E.s()}),b.l&&b.Rb&&f.a.K.yb(b.l,b.Rb),b.I=e,b.V=0,b.ra=!0,b.sa=!1,b.ka=!1,b.J=!1,b.l=e,b.Sa=e,b.Wc=e,this.Nc||(b.nb=e)}},I={Qa:function(b){var R=this,E=R[Z];if(!E.ra&&E.J&&b=="change"){if(E.J=!1,E.sa||R.Xa())E.I=null,E.V=0,R.ha()&&R.Gb();else{var X=[];f.a.P(E.I,function(A,N){X[N.Ka]=A}),f.a.D(X,function(A,N){var O=E.I[A],U=R.$c(O.da);U.Ka=N,U.La=O.La,E.I[A]=U}),R.Xa()&&R.ha()&&R.Gb()}E.ra||R.notifySubscribers(E.X,"awake")}},hb:function(b){var R=this[Z];R.ra||b!="change"||this.Wa("change")||(f.a.P(R.I,function(E,X){X.s&&(R.I[E]={da:X.da,Ka:X.Ka,La:X.La},X.s())}),R.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var b=this[Z];return b.J&&(b.sa||this.Xa())&&this.ha(),f.T.fn.ob.call(this)}},v={Qa:function(b){b!="change"&&b!="beforeChange"||this.v()}};f.a.Ba&&f.a.setPrototypeOf(G,f.T.fn);var P=f.ta.Ma;G[P]=f.o,f.Oc=function(b){return typeof b=="function"&&b[P]===G[P]},f.Fd=function(b){return f.Oc(b)&&b[Z]&&b[Z].wb},f.b("computed",f.o),f.b("dependentObservable",f.o),f.b("isComputed",f.Oc),f.b("isPureComputed",f.Fd),f.b("computed.fn",G),f.L(G,"peek",G.v),f.L(G,"dispose",G.s),f.L(G,"isActive",G.ja),f.L(G,"getDependenciesCount",G.qa),f.L(G,"getDependencies",G.Va),f.xb=function(b,R){return typeof b=="function"?f.o(b,R,{pure:!0}):(b=f.a.extend({},b),b.pure=!0,f.o(b,R))},f.b("pureComputed",f.xb),function(){function b(X,A,N){if(N=N||new E,X=A(X),typeof X!="object"||X===null||X===e||X instanceof RegExp||X instanceof Date||X instanceof String||X instanceof Number||X instanceof Boolean)return X;var O=X instanceof Array?[]:{};return N.save(X,O),R(X,function(U){var Y=A(X[U]);switch(typeof Y){case"boolean":case"number":case"string":case"function":O[U]=Y;break;case"object":case"undefined":var k=N.get(Y);O[U]=k!==e?k:b(Y,A,N)}}),O}function R(X,A){if(X instanceof Array){for(var N=0;N<X.length;N++)A(N);typeof X.toJSON=="function"&&A("toJSON")}else for(N in X)A(N)}function E(){this.keys=[],this.values=[]}f.ad=function(X){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return b(X,function(A){for(var N=0;f.O(A)&&10>N;N++)A=A();return A})},f.toJSON=function(X,A,N){return X=f.ad(X),f.a.hc(X,A,N)},E.prototype={constructor:E,save:function(X,A){var N=f.a.A(this.keys,X);0<=N?this.values[N]=A:(this.keys.push(X),this.values.push(A))},get:function(X){return X=f.a.A(this.keys,X),0<=X?this.values[X]:e}}}(),f.b("toJS",f.ad),f.b("toJSON",f.toJSON),f.Wd=function(b,R,E){function X(A){var N=f.xb(b,E).extend({ma:"always"}),O=N.subscribe(function(U){U&&(O.s(),A(U))});return N.notifySubscribers(N.v()),O}return typeof Promise!="function"||R?X(R.bind(E)):new Promise(X)},f.b("when",f.Wd),function(){f.w={M:function(b){switch(f.a.R(b)){case"option":return b.__ko__hasDomDataOptionValue__===!0?f.a.g.get(b,f.c.options.$b):7>=f.a.W?b.getAttributeNode("value")&&b.getAttributeNode("value").specified?b.value:b.text:b.value;case"select":return 0<=b.selectedIndex?f.w.M(b.options[b.selectedIndex]):e;default:return b.value}},cb:function(b,R,E){switch(f.a.R(b)){case"option":typeof R=="string"?(f.a.g.set(b,f.c.options.$b,e),"__ko__hasDomDataOptionValue__"in b&&delete b.__ko__hasDomDataOptionValue__,b.value=R):(f.a.g.set(b,f.c.options.$b,R),b.__ko__hasDomDataOptionValue__=!0,b.value=typeof R=="number"?R:"");break;case"select":(R===""||R===null)&&(R=e);for(var X=-1,A=0,N=b.options.length,O;A<N;++A)if(O=f.w.M(b.options[A]),O==R||O===""&&R===e){X=A;break}(E||0<=X||R===e&&1<b.size)&&(b.selectedIndex=X,f.a.W===6&&f.a.setTimeout(function(){b.selectedIndex=X},0));break;default:(R===null||R===e)&&(R=""),b.value=R}}}}(),f.b("selectExtensions",f.w),f.b("selectExtensions.readValue",f.w.M),f.b("selectExtensions.writeValue",f.w.cb),f.m=function(){function b(U){U=f.a.Db(U),U.charCodeAt(0)===123&&(U=U.slice(1,-1)),U+=`
  14000. ,`;var Y=[],k=U.match(X),H,J=[],te=0;if(1<k.length){for(var z=0,q;q=k[z];++z){var ee=q.charCodeAt(0);if(ee===44){if(0>=te){Y.push(H&&J.length?{key:H,value:J.join("")}:{unknown:H||J.join("")}),H=te=0,J=[];continue}}else if(ee===58){if(!te&&!H&&J.length===1){H=J.pop();continue}}else{if(ee===47&&1<q.length&&(q.charCodeAt(1)===47||q.charCodeAt(1)===42))continue;ee===47&&z&&1<q.length?(ee=k[z-1].match(A))&&!N[ee[0]]&&(U=U.substr(U.indexOf(q)+1),k=U.match(X),z=-1,q="/"):ee===40||ee===123||ee===91?++te:ee===41||ee===125||ee===93?--te:H||J.length||ee!==34&&ee!==39||(q=q.slice(1,-1))}J.push(q)}if(0<te)throw Error("Unbalanced parentheses, braces, or brackets")}return Y}var R=["true","false","null","undefined"],E=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,X=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*
  14001. |/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),A=/[\])"'A-Za-z0-9_$]+$/,N={in:1,return:1,typeof:1},O={};return{Ra:[],wa:O,ac:b,vb:function(U,Y){function k(ee,fe){var _e;if(!z){var le=f.getBindingHandler(ee);if(le&&le.preprocess&&!(fe=le.preprocess(fe,ee,k)))return;(le=O[ee])&&(_e=fe,0<=f.a.A(R,_e)?_e=!1:(le=_e.match(E),_e=le===null?!1:le[1]?"Object("+le[1]+")"+le[2]:_e),le=_e),le&&J.push("'"+(typeof O[ee]=="string"?O[ee]:ee)+"':function(_z){"+_e+"=_z}")}te&&(fe="function(){return "+fe+" }"),H.push("'"+ee+"':"+fe)}Y=Y||{};var H=[],J=[],te=Y.valueAccessors,z=Y.bindingParams,q=typeof U=="string"?b(U):U;return f.a.D(q,function(ee){k(ee.key||ee.unknown,ee.value)}),J.length&&k("_ko_property_writers","{"+J.join(",")+" }"),H.join(",")},Id:function(U,Y){for(var k=0;k<U.length;k++)if(U[k].key==Y)return!0;return!1},eb:function(U,Y,k,H,J){U&&f.O(U)?!f.Za(U)||J&&U.v()===H||U(H):(U=Y.get("_ko_property_writers"))&&U[k]&&U[k](H)}}}(),f.b("expressionRewriting",f.m),f.b("expressionRewriting.bindingRewriteValidators",f.m.Ra),f.b("expressionRewriting.parseObjectLiteral",f.m.ac),f.b("expressionRewriting.preProcessBindings",f.m.vb),f.b("expressionRewriting._twoWayBindings",f.m.wa),f.b("jsonExpressionRewriting",f.m),f.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",f.m.vb),function(){function b(k){return k.nodeType==8&&N.test(A?k.text:k.nodeValue)}function R(k){return k.nodeType==8&&O.test(A?k.text:k.nodeValue)}function E(k,H){for(var J=k,te=1,z=[];J=J.nextSibling;){if(R(J)&&(f.a.g.set(J,Y,!0),te--,te===0))return z;z.push(J),b(J)&&te++}if(!H)throw Error("Cannot find closing comment tag to match: "+k.nodeValue);return null}function X(k,H){var J=E(k,H);return J?0<J.length?J[J.length-1].nextSibling:k.nextSibling:null}var A=n&&n.createComment("test").text==="<!--test-->",N=A?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,O=A?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,U={ul:!0,ol:!0},Y="__ko_matchedEndComment__";f.h={ea:{},childNodes:function(k){return b(k)?E(k):k.childNodes},Ea:function(k){if(b(k)){k=f.h.childNodes(k);for(var H=0,J=k.length;H<J;H++)f.removeNode(k[H])}else f.a.Tb(k)},va:function(k,H){if(b(k)){f.h.Ea(k);for(var J=k.nextSibling,te=0,z=H.length;te<z;te++)J.parentNode.insertBefore(H[te],J)}else f.a.va(k,H)},Vc:function(k,H){var J;b(k)?(J=k.nextSibling,k=k.parentNode):J=k.firstChild,J?H!==J&&k.insertBefore(H,J):k.appendChild(H)},Wb:function(k,H,J){J?(J=J.nextSibling,b(k)&&(k=k.parentNode),J?H!==J&&k.insertBefore(H,J):k.appendChild(H)):f.h.Vc(k,H)},firstChild:function(k){if(b(k))return!k.nextSibling||R(k.nextSibling)?null:k.nextSibling;if(k.firstChild&&R(k.firstChild))throw Error("Found invalid end comment, as the first child of "+k);return k.firstChild},nextSibling:function(k){if(b(k)&&(k=X(k)),k.nextSibling&&R(k.nextSibling)){var H=k.nextSibling;if(R(H)&&!f.a.g.get(H,Y))throw Error("Found end comment without a matching opening comment, as child of "+k);return null}return k.nextSibling},Cd:b,Vd:function(k){return(k=(A?k.text:k.nodeValue).match(N))?k[1]:null},Sc:function(k){if(U[f.a.R(k)]){var H=k.firstChild;if(H)do if(H.nodeType===1){var J;J=H.firstChild;var te=null;if(J)do if(te)te.push(J);else if(b(J)){var z=X(J,!0);z?J=z:te=[J]}else R(J)&&(te=[J]);while(J=J.nextSibling);if(J=te)for(te=H.nextSibling,z=0;z<J.length;z++)te?k.insertBefore(J[z],te):k.appendChild(J[z])}while(H=H.nextSibling)}}}}(),f.b("virtualElements",f.h),f.b("virtualElements.allowedBindings",f.h.ea),f.b("virtualElements.emptyNode",f.h.Ea),f.b("virtualElements.insertAfter",f.h.Wb),f.b("virtualElements.prepend",f.h.Vc),f.b("virtualElements.setDomNodeChildren",f.h.va),function(){f.ga=function(){this.nd={}},f.a.extend(f.ga.prototype,{nodeHasBindings:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind")!=null||f.j.getComponentNameForNode(b);case 8:return f.h.Cd(b);default:return!1}},getBindings:function(b,R){var E=this.getBindingsString(b,R),E=E?this.parseBindingsString(E,R,b):null;return f.j.tc(E,b,R,!1)},getBindingAccessors:function(b,R){var E=this.getBindingsString(b,R),E=E?this.parseBindingsString(E,R,b,{valueAccessors:!0}):null;return f.j.tc(E,b,R,!0)},getBindingsString:function(b){switch(b.nodeType){case 1:return b.getAttribute("data-bind");case 8:return f.h.Vd(b);default:return null}},parseBindingsString:function(b,R,E,X){try{var A=this.nd,N=b+(X&&X.valueAccessors||""),O;if(!(O=A[N])){var U,Y="with($context){with($data||{}){return{"+f.m.vb(b,X)+"}}}";U=new Function("$context","$element",Y),O=A[N]=U}return O(R,E)}catch(k){throw k.message=`Unable to parse bindings.
  14002. Bindings value: `+b+`
  14003. Message: `+k.message,k}}}),f.ga.instance=new f.ga}(),f.b("bindingProvider",f.ga),function(){function b(le){var ye=(le=f.a.g.get(le,_e))&&le.N;ye&&(le.N=null,ye.Tc())}function R(le,ye,Te){this.node=le,this.yc=ye,this.kb=[],this.H=!1,ye.N||f.a.K.za(le,b),Te&&Te.N&&(Te.N.kb.push(le),this.Kb=Te)}function E(le){return function(){return le}}function X(le){return le()}function A(le){return f.a.Ga(f.u.G(le),function(ye,Te){return function(){return le()[Te]}})}function N(le,ye,Te){return typeof le=="function"?A(le.bind(null,ye,Te)):f.a.Ga(le,E)}function O(le,ye){return A(this.getBindings.bind(this,le,ye))}function U(le,ye){var Te=f.h.firstChild(ye);if(Te){var Xe,Le=f.ga.instance,ke=Le.preprocessNode;if(ke){for(;Xe=Te;)Te=f.h.nextSibling(Xe),ke.call(Le,Xe);Te=f.h.firstChild(ye)}for(;Xe=Te;)Te=f.h.nextSibling(Xe),Y(le,Xe)}f.i.ma(ye,f.i.H)}function Y(le,ye){var Te=le,Xe=ye.nodeType===1;Xe&&f.h.Sc(ye),(Xe||f.ga.instance.nodeHasBindings(ye))&&(Te=H(ye,null,le).bindingContextForDescendants),Te&&!ee[f.a.R(ye)]&&U(Te,ye)}function k(le){var ye=[],Te={},Xe=[];return f.a.P(le,function Le(ke){if(!Te[ke]){var Oe=f.getBindingHandler(ke);Oe&&(Oe.after&&(Xe.push(ke),f.a.D(Oe.after,function(at){if(le[at]){if(f.a.A(Xe,at)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Xe.join(", "));Le(at)}}),Xe.length--),ye.push({key:ke,Mc:Oe})),Te[ke]=!0}}),ye}function H(le,ye,Te){var Xe=f.a.g.Ub(le,_e,{}),Le=Xe.hd;if(!ye){if(Le)throw Error("You cannot apply bindings multiple times to the same element.");Xe.hd=!0}Le||(Xe.context=Te),Xe.Zb||(Xe.Zb={});var ke;if(ye&&typeof ye!="function")ke=ye;else{var Oe=f.ga.instance,at=Oe.getBindingAccessors||O,Mt=f.$(function(){return(ke=ye?ye(Te,le):at.call(Oe,le,Te))&&(Te[te]&&Te[te](),Te[q]&&Te[q]()),ke},null,{l:le});ke&&Mt.ja()||(Mt=null)}var Lt=Te,Ie;if(ke){var je=function(){return f.a.Ga(Mt?Mt():ke,X)},et=Mt?function(He){return function(){return X(Mt()[He])}}:function(He){return ke[He]};je.get=function(He){return ke[He]&&X(et(He))},je.has=function(He){return He in ke},f.i.H in ke&&f.i.subscribe(le,f.i.H,function(){var He=(0,ke[f.i.H])();if(He){var Dt=f.h.childNodes(le);Dt.length&&He(Dt,f.Ec(Dt[0]))}}),f.i.pa in ke&&(Lt=f.i.Cb(le,Te),f.i.subscribe(le,f.i.pa,function(){var He=(0,ke[f.i.pa])();He&&f.h.firstChild(le)&&He(le)})),Xe=k(ke),f.a.D(Xe,function(He){var Dt=He.Mc.init,Ce=He.Mc.update,Ve=He.key;if(le.nodeType===8&&!f.h.ea[Ve])throw Error("The binding '"+Ve+"' cannot be used with virtual elements");try{typeof Dt=="function"&&f.u.G(function(){var ct=Dt(le,et(Ve),je,Lt.$data,Lt);if(ct&&ct.controlsDescendantBindings){if(Ie!==e)throw Error("Multiple bindings ("+Ie+" and "+Ve+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");Ie=Ve}}),typeof Ce=="function"&&f.$(function(){Ce(le,et(Ve),je,Lt.$data,Lt)},null,{l:le})}catch(ct){throw ct.message='Unable to process binding "'+Ve+": "+ke[Ve]+`"
  14004. Message: `+ct.message,ct}})}return Xe=Ie===e,{shouldBindDescendants:Xe,bindingContextForDescendants:Xe&&Lt}}function J(le,ye){return le&&le instanceof f.fa?le:new f.fa(le,e,e,ye)}var te=f.a.Da("_subscribable"),z=f.a.Da("_ancestorBindingInfo"),q=f.a.Da("_dataDependency");f.c={};var ee={script:!0,textarea:!0,template:!0};f.getBindingHandler=function(le){return f.c[le]};var fe={};f.fa=function(le,ye,Te,Xe,Le){function ke(){var et=Lt?Mt():Mt,He=f.a.f(et);return ye?(f.a.extend(Oe,ye),z in ye&&(Oe[z]=ye[z])):(Oe.$parents=[],Oe.$root=He,Oe.ko=f),Oe[te]=Ie,at?He=Oe.$data:(Oe.$rawData=et,Oe.$data=He),Te&&(Oe[Te]=He),Xe&&Xe(Oe,ye,He),ye&&ye[te]&&!f.S.o().Vb(ye[te])&&ye[te](),je&&(Oe[q]=je),Oe.$data}var Oe=this,at=le===fe,Mt=at?e:le,Lt=typeof Mt=="function"&&!f.O(Mt),Ie,je=Le&&Le.dataDependency;Le&&Le.exportDependencies?ke():(Ie=f.xb(ke),Ie.v(),Ie.ja()?Ie.equalityComparer=null:Oe[te]=e)},f.fa.prototype.createChildContext=function(le,ye,Te,Xe){if(!Xe&&ye&&typeof ye=="object"&&(Xe=ye,ye=Xe.as,Te=Xe.extend),ye&&Xe&&Xe.noChildContext){var Le=typeof le=="function"&&!f.O(le);return new f.fa(fe,this,null,function(ke){Te&&Te(ke),ke[ye]=Le?le():le},Xe)}return new f.fa(le,this,ye,function(ke,Oe){ke.$parentContext=Oe,ke.$parent=Oe.$data,ke.$parents=(Oe.$parents||[]).slice(0),ke.$parents.unshift(ke.$parent),Te&&Te(ke)},Xe)},f.fa.prototype.extend=function(le,ye){return new f.fa(fe,this,null,function(Te){f.a.extend(Te,typeof le=="function"?le(Te):le)},ye)};var _e=f.a.g.Z();R.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},R.prototype.sd=function(le){f.a.Pa(this.kb,le),!this.kb.length&&this.H&&this.Cc()},R.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,f.a.K.yb(this.node,b),f.i.ma(this.node,f.i.pa),this.Tc())},f.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(le,ye,Te,Xe,Le){var ke=f.a.g.Ub(le,_e,{});return ke.Fa||(ke.Fa=new f.T),Le&&Le.notifyImmediately&&ke.Zb[ye]&&f.u.G(Te,Xe,[le]),ke.Fa.subscribe(Te,Xe,ye)},ma:function(le,ye){var Te=f.a.g.get(le,_e);if(Te&&(Te.Zb[ye]=!0,Te.Fa&&Te.Fa.notifySubscribers(le,ye),ye==f.i.H)){if(Te.N)Te.N.Cc();else if(Te.N===e&&Te.Fa&&Te.Fa.Wa(f.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(le,ye){var Te=f.a.g.Ub(le,_e,{});return Te.N||(Te.N=new R(le,Te,ye[z])),ye[z]==Te?ye:ye.extend(function(Xe){Xe[z]=Te})}},f.Td=function(le){return(le=f.a.g.get(le,_e))&&le.context},f.ib=function(le,ye,Te){return le.nodeType===1&&f.h.Sc(le),H(le,ye,J(Te))},f.ld=function(le,ye,Te){return Te=J(Te),f.ib(le,N(ye,Te,le),Te)},f.Oa=function(le,ye){ye.nodeType!==1&&ye.nodeType!==8||U(J(le),ye)},f.vc=function(le,ye,Te){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(ye=n.body,!ye)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!ye||ye.nodeType!==1&&ye.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");Y(J(le,Te),ye)},f.Dc=function(le){return!le||le.nodeType!==1&&le.nodeType!==8?e:f.Td(le)},f.Ec=function(le){return(le=f.Dc(le))?le.$data:e},f.b("bindingHandlers",f.c),f.b("bindingEvent",f.i),f.b("bindingEvent.subscribe",f.i.subscribe),f.b("bindingEvent.startPossiblyAsyncContentBinding",f.i.Cb),f.b("applyBindings",f.vc),f.b("applyBindingsToDescendants",f.Oa),f.b("applyBindingAccessorsToNode",f.ib),f.b("applyBindingsToNode",f.ld),f.b("contextFor",f.Dc),f.b("dataFor",f.Ec)}(),function(b){function R(O,U){var Y=Object.prototype.hasOwnProperty.call(A,O)?A[O]:b,k;Y?Y.subscribe(U):(Y=A[O]=new f.T,Y.subscribe(U),E(O,function(H,J){var te=!(!J||!J.synchronous);N[O]={definition:H,Gd:te},delete A[O],k||te?Y.notifySubscribers(H):f.na.zb(function(){Y.notifySubscribers(H)})}),k=!0)}function E(O,U){X("getConfig",[O],function(Y){Y?X("loadComponent",[O,Y],function(k){U(k,Y)}):U(null,null)})}function X(O,U,Y,k){k||(k=f.j.loaders.slice(0));var H=k.shift();if(H){var J=H[O];if(J){var te=!1;if(J.apply(H,U.concat(function(z){te?Y(null):z!==null?Y(z):X(O,U,Y,k)}))!==b&&(te=!0,!H.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else X(O,U,Y,k)}else Y(null)}var A={},N={};f.j={get:function(O,U){var Y=Object.prototype.hasOwnProperty.call(N,O)?N[O]:b;Y?Y.Gd?f.u.G(function(){U(Y.definition)}):f.na.zb(function(){U(Y.definition)}):R(O,U)},Bc:function(O){delete N[O]},oc:X},f.j.loaders=[],f.b("components",f.j),f.b("components.get",f.j.get),f.b("components.clearCachedDefinition",f.j.Bc)}(),function(){function b(Y,k,H,J){function te(){--q===0&&J(z)}var z={},q=2,ee=H.template;H=H.viewModel,ee?A(k,ee,function(fe){f.j.oc("loadTemplate",[Y,fe],function(_e){z.template=_e,te()})}):te(),H?A(k,H,function(fe){f.j.oc("loadViewModel",[Y,fe],function(_e){z[U]=_e,te()})}):te()}function R(Y,k,H){if(typeof k=="function")H(function(te){return new k(te)});else if(typeof k[U]=="function")H(k[U]);else if("instance"in k){var J=k.instance;H(function(){return J})}else"viewModel"in k?R(Y,k.viewModel,H):Y("Unknown viewModel value: "+k)}function E(Y){switch(f.a.R(Y)){case"script":return f.a.ua(Y.text);case"textarea":return f.a.ua(Y.value);case"template":if(X(Y.content))return f.a.Ca(Y.content.childNodes)}return f.a.Ca(Y.childNodes)}function X(Y){return t.DocumentFragment?Y instanceof DocumentFragment:Y&&Y.nodeType===11}function A(Y,k,H){typeof k.require=="string"?a||t.require?(a||t.require)([k.require],function(J){J&&typeof J=="object"&&J.Xd&&J.default&&(J=J.default),H(J)}):Y("Uses require, but no AMD loader is present"):H(k)}function N(Y){return function(k){throw Error("Component '"+Y+"': "+k)}}var O={};f.j.register=function(Y,k){if(!k)throw Error("Invalid configuration for "+Y);if(f.j.tb(Y))throw Error("Component "+Y+" is already registered");O[Y]=k},f.j.tb=function(Y){return Object.prototype.hasOwnProperty.call(O,Y)},f.j.unregister=function(Y){delete O[Y],f.j.Bc(Y)},f.j.Fc={getConfig:function(Y,k){k(f.j.tb(Y)?O[Y]:null)},loadComponent:function(Y,k,H){var J=N(Y);A(J,k,function(te){b(Y,J,te,H)})},loadTemplate:function(Y,k,H){if(Y=N(Y),typeof k=="string")H(f.a.ua(k));else if(k instanceof Array)H(k);else if(X(k))H(f.a.la(k.childNodes));else if(k.element)if(k=k.element,t.HTMLElement?k instanceof HTMLElement:k&&k.tagName&&k.nodeType===1)H(E(k));else if(typeof k=="string"){var J=n.getElementById(k);J?H(E(J)):Y("Cannot find element with ID "+k)}else Y("Unknown element type: "+k);else Y("Unknown template value: "+k)},loadViewModel:function(Y,k,H){R(N(Y),k,H)}};var U="createViewModel";f.b("components.register",f.j.register),f.b("components.isRegistered",f.j.tb),f.b("components.unregister",f.j.unregister),f.b("components.defaultLoader",f.j.Fc),f.j.loaders.push(f.j.Fc),f.j.dd=O}(),function(){function b(E,X){var A=E.getAttribute("params");if(A){var A=R.parseBindingsString(A,X,E,{valueAccessors:!0,bindingParams:!0}),A=f.a.Ga(A,function(U){return f.o(U,null,{l:E})}),N=f.a.Ga(A,function(U){var Y=U.v();return U.ja()?f.o({read:function(){return f.a.f(U())},write:f.Za(Y)&&function(k){U()(k)},l:E}):Y});return Object.prototype.hasOwnProperty.call(N,"$raw")||(N.$raw=A),N}return{$raw:{}}}f.j.getComponentNameForNode=function(E){var X=f.a.R(E);if(f.j.tb(X)&&(X.indexOf("-")!=-1||""+E=="[object HTMLUnknownElement]"||8>=f.a.W&&E.tagName===X))return X},f.j.tc=function(E,X,A,N){if(X.nodeType===1){var O=f.j.getComponentNameForNode(X);if(O){if(E=E||{},E.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var U={name:O,params:b(X,A)};E.component=N?function(){return U}:U}}return E};var R=new f.ga;9>f.a.W&&(f.j.register=function(E){return function(X){return E.apply(this,arguments)}}(f.j.register),n.createDocumentFragment=function(E){return function(){var X=E(),A=f.j.dd,N;for(N in A);return X}}(n.createDocumentFragment))}(),function(){function b(X,A,N){if(A=A.template,!A)throw Error("Component '"+X+"' has no template");X=f.a.Ca(A),f.h.va(N,X)}function R(X,A,N){var O=X.createViewModel;return O?O.call(X,A,N):A}var E=0;f.c.component={init:function(X,A,N,O,U){function Y(){var z=k&&k.dispose;typeof z=="function"&&z.call(k),J&&J.s(),H=k=J=null}var k,H,J,te=f.a.la(f.h.childNodes(X));return f.h.Ea(X),f.a.K.za(X,Y),f.o(function(){var z=f.a.f(A()),q,ee;if(typeof z=="string"?q=z:(q=f.a.f(z.name),ee=f.a.f(z.params)),!q)throw Error("No component name specified");var fe=f.i.Cb(X,U),_e=H=++E;f.j.get(q,function(le){if(H===_e){if(Y(),!le)throw Error("Unknown component '"+q+"'");b(q,le,X);var ye=R(le,ee,{element:X,templateNodes:te});le=fe.createChildContext(ye,{extend:function(Te){Te.$component=ye,Te.$componentTemplateNodes=te}}),ye&&ye.koDescendantsComplete&&(J=f.i.subscribe(X,f.i.pa,ye.koDescendantsComplete,ye)),k=ye,f.Oa(le,X)}})},null,{l:X}),{controlsDescendantBindings:!0}}},f.h.ea.component=!0}();var w={class:"className",for:"htmlFor"};f.c.attr={update:function(b,R){var E=f.a.f(R())||{};f.a.P(E,function(X,A){A=f.a.f(A);var N=X.indexOf(":"),N="lookupNamespaceURI"in b&&0<N&&b.lookupNamespaceURI(X.substr(0,N)),O=A===!1||A===null||A===e;O?N?b.removeAttributeNS(N,X):b.removeAttribute(X):A=A.toString(),8>=f.a.W&&X in w?(X=w[X],O?b.removeAttribute(X):b[X]=A):O||(N?b.setAttributeNS(N,X,A):b.setAttribute(X,A)),X==="name"&&f.a.Yc(b,O?"":A)})}},function(){f.c.checked={after:["value","attr"],init:function(b,R,E){function X(){var z=b.checked,q=N();if(!f.S.Ya()&&(z||!U&&!f.S.qa())){var ee=f.u.G(R);if(k){var fe=H?ee.v():ee,_e=te;te=q,_e!==q?z&&(f.a.Na(fe,q,!0),f.a.Na(fe,_e,!1)):f.a.Na(fe,q,z),H&&f.Za(ee)&&ee(fe)}else O&&(q===e?q=z:z||(q=e)),f.m.eb(ee,E,"checked",q,!0)}}function A(){var z=f.a.f(R()),q=N();k?(b.checked=0<=f.a.A(z,q),te=q):b.checked=O&&q===e?!!z:N()===z}var N=f.xb(function(){if(E.has("checkedValue"))return f.a.f(E.get("checkedValue"));if(J)return E.has("value")?f.a.f(E.get("value")):b.value}),O=b.type=="checkbox",U=b.type=="radio";if(O||U){var Y=R(),k=O&&f.a.f(Y)instanceof Array,H=!(k&&Y.push&&Y.splice),J=U||k,te=k?N():e;U&&!b.name&&f.c.uniqueName.init(b,function(){return!0}),f.o(X,null,{l:b}),f.a.B(b,"click",X),f.o(A,null,{l:b}),Y=e}}},f.m.wa.checked=!0,f.c.checkedValue={update:function(b,R){b.value=f.a.f(R())}}}(),f.c.class={update:function(b,R){var E=f.a.Db(f.a.f(R()));f.a.Eb(b,b.__ko__cssValue,!1),b.__ko__cssValue=E,f.a.Eb(b,E,!0)}},f.c.css={update:function(b,R){var E=f.a.f(R());E!==null&&typeof E=="object"?f.a.P(E,function(X,A){A=f.a.f(A),f.a.Eb(b,X,A)}):f.c.class.update(b,R)}},f.c.enable={update:function(b,R){var E=f.a.f(R());E&&b.disabled?b.removeAttribute("disabled"):E||b.disabled||(b.disabled=!0)}},f.c.disable={update:function(b,R){f.c.enable.update(b,function(){return!f.a.f(R())})}},f.c.event={init:function(b,R,E,X,A){var N=R()||{};f.a.P(N,function(O){typeof O=="string"&&f.a.B(b,O,function(U){var Y,k=R()[O];if(k){try{var H=f.a.la(arguments);X=A.$data,H.unshift(X),Y=k.apply(X,H)}finally{Y!==!0&&(U.preventDefault?U.preventDefault():U.returnValue=!1)}E.get(O+"Bubble")===!1&&(U.cancelBubble=!0,U.stopPropagation&&U.stopPropagation())}})})}},f.c.foreach={Rc:function(b){return function(){var R=b(),E=f.a.bc(R);return!E||typeof E.length=="number"?{foreach:R,templateEngine:f.ba.Ma}:(f.a.f(R),{foreach:E.data,as:E.as,noChildContext:E.noChildContext,includeDestroyed:E.includeDestroyed,afterAdd:E.afterAdd,beforeRemove:E.beforeRemove,afterRender:E.afterRender,beforeMove:E.beforeMove,afterMove:E.afterMove,templateEngine:f.ba.Ma})}},init:function(b,R){return f.c.template.init(b,f.c.foreach.Rc(R))},update:function(b,R,E,X,A){return f.c.template.update(b,f.c.foreach.Rc(R),E,X,A)}},f.m.Ra.foreach=!1,f.h.ea.foreach=!0,f.c.hasfocus={init:function(b,R,E){function X(O){b.__ko_hasfocusUpdating=!0;var U=b.ownerDocument;if("activeElement"in U){var Y;try{Y=U.activeElement}catch{Y=U.body}O=Y===b}U=R(),f.m.eb(U,E,"hasfocus",O,!0),b.__ko_hasfocusLastValue=O,b.__ko_hasfocusUpdating=!1}var A=X.bind(null,!0),N=X.bind(null,!1);f.a.B(b,"focus",A),f.a.B(b,"focusin",A),f.a.B(b,"blur",N),f.a.B(b,"focusout",N),b.__ko_hasfocusLastValue=!1},update:function(b,R){var E=!!f.a.f(R());b.__ko_hasfocusUpdating||b.__ko_hasfocusLastValue===E||(E?b.focus():b.blur(),!E&&b.__ko_hasfocusLastValue&&b.ownerDocument.body.focus(),f.u.G(f.a.Fb,null,[b,E?"focusin":"focusout"]))}},f.m.wa.hasfocus=!0,f.c.hasFocus=f.c.hasfocus,f.m.wa.hasFocus="hasfocus",f.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(b,R){f.a.fc(b,R())}},function(){function b(R,E,X){f.c[R]={init:function(A,N,O,U,Y){var k,H,J={},te,z,q;if(E){U=O.get("as");var ee=O.get("noChildContext");q=!(U&&ee),J={as:U,noChildContext:ee,exportDependencies:q}}return z=(te=O.get("completeOn")=="render")||O.has(f.i.pa),f.o(function(){var fe=f.a.f(N()),_e=!X!=!fe,le=!H,ye;(q||_e!==k)&&(z&&(Y=f.i.Cb(A,Y)),_e&&((!E||q)&&(J.dataDependency=f.S.o()),ye=E?Y.createChildContext(typeof fe=="function"?fe:N,J):f.S.qa()?Y.extend(null,J):Y),le&&f.S.qa()&&(H=f.a.Ca(f.h.childNodes(A),!0)),_e?(le||f.h.va(A,f.a.Ca(H)),f.Oa(ye,A)):(f.h.Ea(A),te||f.i.ma(A,f.i.H)),k=_e)},null,{l:A}),{controlsDescendantBindings:!0}}},f.m.Ra[R]=!1,f.h.ea[R]=!0}b("if"),b("ifnot",!1,!0),b("with",!0)}(),f.c.let={init:function(b,R,E,X,A){return R=A.extend(R),f.Oa(R,b),{controlsDescendantBindings:!0}}},f.h.ea.let=!0;var F={};f.c.options={init:function(b){if(f.a.R(b)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<b.length;)b.remove(0);return{controlsDescendantBindings:!0}},update:function(b,R,E){function X(){return f.a.jb(b.options,function(ee){return ee.selected})}function A(ee,fe,_e){var le=typeof fe;return le=="function"?fe(ee):le=="string"?ee[fe]:_e}function N(ee,fe){if(z&&k)f.i.ma(b,f.i.H);else if(te.length){var _e=0<=f.a.A(te,f.w.M(fe[0]));f.a.Zc(fe[0],_e),z&&!_e&&f.u.G(f.a.Fb,null,[b,"change"])}}var O=b.multiple,U=b.length!=0&&O?b.scrollTop:null,Y=f.a.f(R()),k=E.get("valueAllowUnset")&&E.has("value"),H=E.get("optionsIncludeDestroyed");R={};var J,te=[];k||(O?te=f.a.Mb(X(),f.w.M):0<=b.selectedIndex&&te.push(f.w.M(b.options[b.selectedIndex]))),Y&&(typeof Y.length>"u"&&(Y=[Y]),J=f.a.jb(Y,function(ee){return H||ee===e||ee===null||!f.a.f(ee._destroy)}),E.has("optionsCaption")&&(Y=f.a.f(E.get("optionsCaption")),Y!==null&&Y!==e&&J.unshift(F)));var z=!1;if(R.beforeRemove=function(ee){b.removeChild(ee)},Y=N,E.has("optionsAfterRender")&&typeof E.get("optionsAfterRender")=="function"&&(Y=function(ee,fe){N(0,fe),f.u.G(E.get("optionsAfterRender"),null,[fe[0],ee!==F?ee:e])}),f.a.ec(b,J,function(ee,fe,_e){return _e.length&&(te=!k&&_e[0].selected?[f.w.M(_e[0])]:[],z=!0),fe=b.ownerDocument.createElement("option"),ee===F?(f.a.Bb(fe,E.get("optionsCaption")),f.w.cb(fe,e)):(_e=A(ee,E.get("optionsValue"),ee),f.w.cb(fe,f.a.f(_e)),ee=A(ee,E.get("optionsText"),_e),f.a.Bb(fe,ee)),[fe]},R,Y),!k){var q;O?q=te.length&&X().length<te.length:q=te.length&&0<=b.selectedIndex?f.w.M(b.options[b.selectedIndex])!==te[0]:te.length||0<=b.selectedIndex,q&&f.u.G(f.a.Fb,null,[b,"change"])}(k||f.S.Ya())&&f.i.ma(b,f.i.H),f.a.wd(b),U&&20<Math.abs(U-b.scrollTop)&&(b.scrollTop=U)}},f.c.options.$b=f.a.g.Z(),f.c.selectedOptions={init:function(b,R,E){function X(){var O=R(),U=[];f.a.D(b.getElementsByTagName("option"),function(Y){Y.selected&&U.push(f.w.M(Y))}),f.m.eb(O,E,"selectedOptions",U)}function A(){var O=f.a.f(R()),U=b.scrollTop;O&&typeof O.length=="number"&&f.a.D(b.getElementsByTagName("option"),function(Y){var k=0<=f.a.A(O,f.w.M(Y));Y.selected!=k&&f.a.Zc(Y,k)}),b.scrollTop=U}if(f.a.R(b)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var N;f.i.subscribe(b,f.i.H,function(){N?X():(f.a.B(b,"change",X),N=f.o(A,null,{l:b}))},null,{notifyImmediately:!0})},update:function(){}},f.m.wa.selectedOptions=!0,f.c.style={update:function(b,R){var E=f.a.f(R()||{});f.a.P(E,function(X,A){if(A=f.a.f(A),(A===null||A===e||A===!1)&&(A=""),o)o(b).css(X,A);else if(/^--/.test(X))b.style.setProperty(X,A);else{X=X.replace(/-(\w)/g,function(O,U){return U.toUpperCase()});var N=b.style[X];b.style[X]=A,A===N||b.style[X]!=N||isNaN(A)||(b.style[X]=A+"px")}})}},f.c.submit={init:function(b,R,E,X,A){if(typeof R()!="function")throw Error("The value for a submit binding must be a function");f.a.B(b,"submit",function(N){var O,U=R();try{O=U.call(A.$data,b)}finally{O!==!0&&(N.preventDefault?N.preventDefault():N.returnValue=!1)}})}},f.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(b,R){f.a.Bb(b,R())}},f.h.ea.text=!0,function(){if(t&&t.navigator){var b=function(J){if(J)return parseFloat(J[1])},R=t.navigator.userAgent,E,X,A,N,O;(E=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(O=b(R.match(/Edge\/([^ ]+)$/)))||b(R.match(/Chrome\/([^ ]+)/))||(X=b(R.match(/Version\/([^ ]+) Safari/)))||(A=b(R.match(/Firefox\/([^ ]+)/)))||(N=f.a.W||b(R.match(/MSIE ([^ ]+)/)))||(N=b(R.match(/rv:([^ )]+)/)))}if(8<=N&&10>N)var U=f.a.g.Z(),Y=f.a.g.Z(),k=function(J){var te=this.activeElement;(te=te&&f.a.g.get(te,Y))&&te(J)},H=function(J,te){var z=J.ownerDocument;f.a.g.get(z,U)||(f.a.g.set(z,U,!0),f.a.B(z,"selectionchange",k)),f.a.g.set(J,Y,te)};f.c.textInput={init:function(J,te,z){function q(ke,Oe){f.a.B(J,ke,Oe)}function ee(){var ke=f.a.f(te());(ke===null||ke===e)&&(ke=""),Te!==e&&ke===Te?f.a.setTimeout(ee,4):J.value!==ke&&(Le=!0,J.value=ke,Le=!1,le=J.value)}function fe(){ye||(Te=J.value,ye=f.a.setTimeout(_e,4))}function _e(){clearTimeout(ye),Te=ye=e;var ke=J.value;le!==ke&&(le=ke,f.m.eb(te(),z,"textInput",ke))}var le=J.value,ye,Te,Xe=f.a.W==9?fe:_e,Le=!1;N&&q("keypress",_e),11>N&&q("propertychange",function(ke){Le||ke.propertyName!=="value"||Xe(ke)}),N==8&&(q("keyup",_e),q("keydown",_e)),H&&(H(J,Xe),q("dragend",fe)),(!N||9<=N)&&q("input",Xe),5>X&&f.a.R(J)==="textarea"?(q("keydown",fe),q("paste",fe),q("cut",fe)):11>E?q("keydown",fe):4>A?(q("DOMAutoComplete",_e),q("dragdrop",_e),q("drop",_e)):O&&J.type==="number"&&q("keydown",fe),q("change",_e),q("blur",_e),f.o(ee,null,{l:J})}},f.m.wa.textInput=!0,f.c.textinput={preprocess:function(J,te,z){z("textInput",J)}}}(),f.c.uniqueName={init:function(b,R){if(R()){var E="ko_unique_"+ ++f.c.uniqueName.rd;f.a.Yc(b,E)}}},f.c.uniqueName.rd=0,f.c.using={init:function(b,R,E,X,A){var N;return E.has("as")&&(N={as:E.get("as"),noChildContext:E.get("noChildContext")}),R=A.createChildContext(R,N),f.Oa(R,b),{controlsDescendantBindings:!0}}},f.h.ea.using=!0,f.c.value={init:function(b,R,E){var X=f.a.R(b),A=X=="input";if(!A||b.type!="checkbox"&&b.type!="radio"){var N=[],O=E.get("valueUpdate"),U=!1,Y=null;O&&(typeof O=="string"?N=[O]:N=f.a.wc(O),f.a.Pa(N,"change"));var k=function(){Y=null,U=!1;var te=R(),z=f.w.M(b);f.m.eb(te,E,"value",z)};!f.a.W||!A||b.type!="text"||b.autocomplete=="off"||b.form&&b.form.autocomplete=="off"||f.a.A(N,"propertychange")!=-1||(f.a.B(b,"propertychange",function(){U=!0}),f.a.B(b,"focus",function(){U=!1}),f.a.B(b,"blur",function(){U&&k()})),f.a.D(N,function(te){var z=k;f.a.Ud(te,"after")&&(z=function(){Y=f.w.M(b),f.a.setTimeout(k,0)},te=te.substring(5)),f.a.B(b,te,z)});var H;if(H=A&&b.type=="file"?function(){var te=f.a.f(R());te===null||te===e||te===""?b.value="":f.u.G(k)}:function(){var te=f.a.f(R()),z=f.w.M(b);Y!==null&&te===Y?f.a.setTimeout(H,0):(te!==z||z===e)&&(X==="select"?(z=E.get("valueAllowUnset"),f.w.cb(b,te,z),z||te===f.w.M(b)||f.u.G(k)):f.w.cb(b,te))},X==="select"){var J;f.i.subscribe(b,f.i.H,function(){J?E.get("valueAllowUnset")?H():k():(f.a.B(b,"change",k),J=f.o(H,null,{l:b}))},null,{notifyImmediately:!0})}else f.a.B(b,"change",k),f.o(H,null,{l:b})}else f.ib(b,{checkedValue:R})},update:function(){}},f.m.wa.value=!0,f.c.visible={update:function(b,R){var E=f.a.f(R()),X=b.style.display!="none";E&&!X?b.style.display="":!E&&X&&(b.style.display="none")}},f.c.hidden={update:function(b,R){f.c.visible.update(b,function(){return!f.a.f(R())})}},function(b){f.c[b]={init:function(R,E,X,A,N){return f.c.event.init.call(this,R,function(){var O={};return O[b]=E(),O},X,A,N)}}}("click"),f.ca=function(){},f.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},f.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},f.ca.prototype.makeTemplateSource=function(b,R){if(typeof b=="string"){R=R||n;var E=R.getElementById(b);if(!E)throw Error("Cannot find template with ID "+b);return new f.C.F(E)}if(b.nodeType==1||b.nodeType==8)return new f.C.ia(b);throw Error("Unknown template type: "+b)},f.ca.prototype.renderTemplate=function(b,R,E,X){return b=this.makeTemplateSource(b,X),this.renderTemplateSource(b,R,E,X)},f.ca.prototype.isTemplateRewritten=function(b,R){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(b,R).data("isRewritten")},f.ca.prototype.rewriteTemplate=function(b,R,E){b=this.makeTemplateSource(b,E),R=R(b.text()),b.text(R),b.data("isRewritten",!0)},f.b("templateEngine",f.ca),f.kc=function(){function b(X,A,N,O){X=f.m.ac(X);for(var U=f.m.Ra,Y=0;Y<X.length;Y++){var k=X[Y].key;if(Object.prototype.hasOwnProperty.call(U,k)){var H=U[k];if(typeof H=="function"){if(k=H(X[Y].value))throw Error(k)}else if(!H)throw Error("This template engine does not support the '"+k+"' binding within its templates")}}return N="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+f.m.vb(X,{valueAccessors:!0})+" } })()},'"+N.toLowerCase()+"')",O.createJavaScriptEvaluatorBlock(N)+A}var R=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,E=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(X,A,N){A.isTemplateRewritten(X,N)||A.rewriteTemplate(X,function(O){return f.kc.Ld(O,A)},N)},Ld:function(X,A){return X.replace(R,function(N,O,U,Y,k){return b(k,O,U,A)}).replace(E,function(N,O){return b(O,"<!-- ko -->","#comment",A)})},md:function(X,A){return f.aa.Xb(function(N,O){var U=N.nextSibling;U&&U.nodeName.toLowerCase()===A&&f.ib(U,X,O)})}}}(),f.b("__tr_ambtns",f.kc.md),function(){f.C={},f.C.F=function(E){if(this.F=E){var X=f.a.R(E);this.ab=X==="script"?1:X==="textarea"?2:X=="template"&&E.content&&E.content.nodeType===11?3:4}},f.C.F.prototype.text=function(){var E=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[E];var X=arguments[0];E==="innerHTML"?f.a.fc(this.F,X):this.F[E]=X};var b=f.a.g.Z()+"_";f.C.F.prototype.data=function(E){if(arguments.length===1)return f.a.g.get(this.F,b+E);f.a.g.set(this.F,b+E,arguments[1])};var R=f.a.g.Z();f.C.F.prototype.nodes=function(){var E=this.F;if(arguments.length==0){var X=f.a.g.get(E,R)||{},A=X.lb||(this.ab===3?E.content:this.ab===4?E:e);if(!A||X.jd){var N=this.text();N&&N!==X.bb&&(A=f.a.Md(N,E.ownerDocument),f.a.g.set(E,R,{lb:A,bb:N,jd:!0}))}return A}X=arguments[0],this.ab!==e&&this.text(""),f.a.g.set(E,R,{lb:X})},f.C.ia=function(E){this.F=E},f.C.ia.prototype=new f.C.F,f.C.ia.prototype.constructor=f.C.ia,f.C.ia.prototype.text=function(){if(arguments.length==0){var E=f.a.g.get(this.F,R)||{};return E.bb===e&&E.lb&&(E.bb=E.lb.innerHTML),E.bb}f.a.g.set(this.F,R,{bb:arguments[0]})},f.b("templateSources",f.C),f.b("templateSources.domElement",f.C.F),f.b("templateSources.anonymousTemplate",f.C.ia)}(),function(){function b(Y,k,H){var J;for(k=f.h.nextSibling(k);Y&&(J=Y)!==k;)Y=f.h.nextSibling(J),H(J,Y)}function R(Y,k){if(Y.length){var H=Y[0],J=Y[Y.length-1],te=H.parentNode,z=f.ga.instance,q=z.preprocessNode;if(q){if(b(H,J,function(ee,fe){var _e=ee.previousSibling,le=q.call(z,ee);le&&(ee===H&&(H=le[0]||fe),ee===J&&(J=le[le.length-1]||_e))}),Y.length=0,!H)return;H===J?Y.push(H):(Y.push(H,J),f.a.Ua(Y,te))}b(H,J,function(ee){ee.nodeType!==1&&ee.nodeType!==8||f.vc(k,ee)}),b(H,J,function(ee){ee.nodeType!==1&&ee.nodeType!==8||f.aa.cd(ee,[k])}),f.a.Ua(Y,te)}}function E(Y){return Y.nodeType?Y:0<Y.length?Y[0]:null}function X(Y,k,H,J,te){te=te||{};var z=(Y&&E(Y)||H||{}).ownerDocument,q=te.templateEngine||N;if(f.kc.xd(H,q,z),H=q.renderTemplate(H,J,te,z),typeof H.length!="number"||0<H.length&&typeof H[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(z=!1,k){case"replaceChildren":f.h.va(Y,H),z=!0;break;case"replaceNode":f.a.Xc(Y,H),z=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+k)}return z&&(R(H,J),te.afterRender&&f.u.G(te.afterRender,null,[H,J[te.as||"$data"]]),k=="replaceChildren"&&f.i.ma(Y,f.i.H)),H}function A(Y,k,H){return f.O(Y)?Y():typeof Y=="function"?Y(k,H):Y}var N;f.gc=function(Y){if(Y!=e&&!(Y instanceof f.ca))throw Error("templateEngine must inherit from ko.templateEngine");N=Y},f.dc=function(Y,k,H,J,te){if(H=H||{},(H.templateEngine||N)==e)throw Error("Set a template engine before calling renderTemplate");if(te=te||"replaceChildren",J){var z=E(J);return f.$(function(){var ee=k&&k instanceof f.fa?k:new f.fa(k,null,null,null,{exportDependencies:!0}),q=A(Y,ee.$data,ee),ee=X(J,te,q,ee,H);te=="replaceNode"&&(J=ee,z=E(J))},null,{Sa:function(){return!z||!f.a.Sb(z)},l:z&&te=="replaceNode"?z.parentNode:z})}return f.aa.Xb(function(q){f.dc(Y,k,H,q,"replaceNode")})},f.Qd=function(Y,k,H,J,te){function z(Te,Xe){f.u.G(f.a.ec,null,[J,Te,ee,H,q,Xe]),f.i.ma(J,f.i.H)}function q(Te,Xe){R(Xe,fe),H.afterRender&&H.afterRender(Xe,Te),fe=null}function ee(Te,Xe){fe=te.createChildContext(Te,{as:_e,noChildContext:H.noChildContext,extend:function(ke){ke.$index=Xe,_e&&(ke[_e+"Index"]=Xe)}});var Le=A(Y,Te,fe);return X(J,"ignoreTargetNode",Le,fe,H)}var fe,_e=H.as,le=H.includeDestroyed===!1||f.options.foreachHidesDestroyed&&!H.includeDestroyed;if(le||H.beforeRemove||!f.Pc(k))return f.$(function(){var Te=f.a.f(k)||[];typeof Te.length>"u"&&(Te=[Te]),le&&(Te=f.a.jb(Te,function(Xe){return Xe===e||Xe===null||!f.a.f(Xe._destroy)})),z(Te)},null,{l:J});z(k.v());var ye=k.subscribe(function(Te){z(k(),Te)},null,"arrayChange");return ye.l(J),ye};var O=f.a.g.Z(),U=f.a.g.Z();f.c.template={init:function(Y,k){var H=f.a.f(k());if(typeof H=="string"||"name"in H)f.h.Ea(Y);else if("nodes"in H){if(H=H.nodes||[],f.O(H))throw Error('The "nodes" option must be a plain, non-observable array.');var J=H[0]&&H[0].parentNode;J&&f.a.g.get(J,U)||(J=f.a.Yb(H),f.a.g.set(J,U,!0)),new f.C.ia(Y).nodes(J)}else if(H=f.h.childNodes(Y),0<H.length)J=f.a.Yb(H),new f.C.ia(Y).nodes(J);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(Y,k,H,J,te){var z=k();k=f.a.f(z),H=!0,J=null,typeof k=="string"?k={}:(z="name"in k?k.name:Y,"if"in k&&(H=f.a.f(k.if)),H&&"ifnot"in k&&(H=!f.a.f(k.ifnot)),H&&!z&&(H=!1)),"foreach"in k?J=f.Qd(z,H&&k.foreach||[],k,Y,te):H?(H=te,"data"in k&&(H=te.createChildContext(k.data,{as:k.as,noChildContext:k.noChildContext,exportDependencies:!0})),J=f.dc(z,H,k,Y)):f.h.Ea(Y),te=J,(k=f.a.g.get(Y,O))&&typeof k.s=="function"&&k.s(),f.a.g.set(Y,O,!te||te.ja&&!te.ja()?e:te)}},f.m.Ra.template=function(Y){return Y=f.m.ac(Y),Y.length==1&&Y[0].unknown||f.m.Id(Y,"name")?null:"This template engine does not support anonymous templates nested within its templates"},f.h.ea.template=!0}(),f.b("setTemplateEngine",f.gc),f.b("renderTemplate",f.dc),f.a.Kc=function(b,R,E){if(b.length&&R.length){var X,A,N,O,U;for(X=A=0;(!E||X<E)&&(O=b[A]);++A){for(N=0;U=R[N];++N)if(O.value===U.value){O.moved=U.index,U.moved=O.index,R.splice(N,1),X=N=0;break}X+=N}}},f.a.Pb=function(){function b(R,E,X,A,N){var O=Math.min,U=Math.max,Y=[],k,H=R.length,J,te=E.length,z=te-H||1,q=H+te+1,ee,fe,_e;for(k=0;k<=H;k++)for(fe=ee,Y.push(ee=[]),_e=O(te,k+z),J=U(0,k-1);J<=_e;J++)ee[J]=J?k?R[k-1]===E[J-1]?fe[J-1]:O(fe[J]||q,ee[J-1]||q)+1:J+1:k+1;for(O=[],U=[],z=[],k=H,J=te;k||J;)te=Y[k][J]-1,J&&te===Y[k][J-1]?U.push(O[O.length]={status:X,value:E[--J],index:J}):k&&te===Y[k-1][J]?z.push(O[O.length]={status:A,value:R[--k],index:k}):(--J,--k,N.sparse||O.push({status:"retained",value:E[J]}));return f.a.Kc(z,U,!N.dontLimitMoves&&10*H),O.reverse()}return function(R,E,X){return X=typeof X=="boolean"?{dontLimitMoves:X}:X||{},R=R||[],E=E||[],R.length<E.length?b(R,E,"added","deleted",X):b(E,R,"deleted","added",X)}}(),f.b("utils.compareArrays",f.a.Pb),function(){function b(X,A,N,O,U){var Y=[],k=f.$(function(){var H=A(N,U,f.a.Ua(Y,X))||[];0<Y.length&&(f.a.Xc(Y,H),O&&f.u.G(O,null,[N,H,U])),Y.length=0,f.a.Nb(Y,H)},null,{l:X,Sa:function(){return!f.a.kd(Y)}});return{Y,$:k.ja()?k:e}}var R=f.a.g.Z(),E=f.a.g.Z();f.a.ec=function(X,A,N,O,U,Y){function k(He){Le={Aa:He,pb:f.ta(fe++)},q.push(Le),z||Xe.push(Le)}function H(He){Le=te[He],fe!==Le.pb.v()&&Te.push(Le),Le.pb(fe++),f.a.Ua(Le.Y,X),q.push(Le)}function J(He,Dt){if(He)for(var Ce=0,Ve=Dt.length;Ce<Ve;Ce++)f.a.D(Dt[Ce].Y,function(ct){He(ct,Ce,Dt[Ce].Aa)})}A=A||[],typeof A.length>"u"&&(A=[A]),O=O||{};var te=f.a.g.get(X,R),z=!te,q=[],ee=0,fe=0,_e=[],le=[],ye=[],Te=[],Xe=[],Le,ke=0;if(z)f.a.D(A,k);else{if(!Y||te&&te._countWaitingForRemove){var Oe=f.a.Mb(te,function(He){return He.Aa});Y=f.a.Pb(Oe,A,{dontLimitMoves:O.dontLimitMoves,sparse:!0})}for(var Oe=0,at,Mt,Lt;at=Y[Oe];Oe++)switch(Mt=at.moved,Lt=at.index,at.status){case"deleted":for(;ee<Lt;)H(ee++);Mt===e&&(Le=te[ee],Le.$&&(Le.$.s(),Le.$=e),f.a.Ua(Le.Y,X).length&&(O.beforeRemove&&(q.push(Le),ke++,Le.Aa===E?Le=null:ye.push(Le)),Le&&_e.push.apply(_e,Le.Y))),ee++;break;case"added":for(;fe<Lt;)H(ee++);Mt!==e?(le.push(q.length),H(Mt)):k(at.value)}for(;fe<A.length;)H(ee++);q._countWaitingForRemove=ke}f.a.g.set(X,R,q),J(O.beforeMove,Te),f.a.D(_e,O.beforeRemove?f.oa:f.removeNode);var Ie,je,et;try{et=X.ownerDocument.activeElement}catch{}if(le.length)for(;(Oe=le.shift())!=e;){for(Le=q[Oe],Ie=e;Oe;)if((je=q[--Oe].Y)&&je.length){Ie=je[je.length-1];break}for(A=0;ee=Le.Y[A];Ie=ee,A++)f.h.Wb(X,ee,Ie)}for(Oe=0;Le=q[Oe];Oe++){for(Le.Y||f.a.extend(Le,b(X,N,Le.Aa,U,Le.pb)),A=0;ee=Le.Y[A];Ie=ee,A++)f.h.Wb(X,ee,Ie);!Le.Ed&&U&&(U(Le.Aa,Le.Y,Le.pb),Le.Ed=!0,Ie=Le.Y[Le.Y.length-1])}for(et&&X.ownerDocument.activeElement!=et&&et.focus(),J(O.beforeRemove,ye),Oe=0;Oe<ye.length;++Oe)ye[Oe].Aa=E;J(O.afterMove,Te),J(O.afterAdd,Xe)}}(),f.b("utils.setDomNodeChildrenFromArrayMapping",f.a.ec),f.ba=function(){this.allowTemplateRewriting=!1},f.ba.prototype=new f.ca,f.ba.prototype.constructor=f.ba,f.ba.prototype.renderTemplateSource=function(b,R,E,X){return(R=!(9>f.a.W)&&b.nodes?b.nodes():null)?f.a.la(R.cloneNode(!0).childNodes):(b=b.text(),f.a.ua(b,X))},f.ba.Ma=new f.ba,f.gc(f.ba.Ma),f.b("nativeTemplateEngine",f.ba),function(){f.$a=function(){var R=this.Hd=function(){if(!o||!o.tmpl)return 0;try{if(0<=o.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1}();this.renderTemplateSource=function(E,X,A,N){if(N=N||n,A=A||{},2>R)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var O=E.data("precompiled");return O||(O=E.text()||"",O=o.template(null,"{{ko_with $item.koBindingContext}}"+O+"{{/ko_with}}"),E.data("precompiled",O)),E=[X.$data],X=o.extend({koBindingContext:X},A.templateOptions),X=o.tmpl(O,E,X),X.appendTo(N.createElement("div")),o.fragments={},X},this.createJavaScriptEvaluatorBlock=function(E){return"{{ko_code ((function() { return "+E+" })()) }}"},this.addTemplate=function(E,X){n.write("<script type='text/html' id='"+E+"'>"+X+"<\/script>")},0<R&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},f.$a.prototype=new f.ca,f.$a.prototype.constructor=f.$a;var b=new f.$a;0<b.Hd&&f.gc(b),f.b("jqueryTmplTemplateEngine",f.$a)}()})})()})()})();var zSt=ko;typeof window<"u"?(ko=window.ko,typeof DM<"u"?window.ko=DM:delete window.ko):(ko=global.ko,typeof DM<"u"?global.ko=DM:delete global.ko);var gS=zSt;var oVo=T(S(),1);/**
  14005. * @license
  14006. * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5
  14007. * Copyright (c) Steve Sanderson
  14008. * MIT license
  14009. */var Z6="__knockoutObservables",G6="__knockoutSubscribable";function YSe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=HSe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===Z6||o===G6)&&!(o in i)){var r=e[o],s=r instanceof Array,a=n.isObservable(r)?r:s?n.observableArray(r):n.observable(r);Object.defineProperty(e,o,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[o]=a,s&&JSt(n,a)}}),e}function HSe(e,t){var n=e[Z6];return!n&&t&&(n={},Object.defineProperty(e,Z6,{value:n})),n}function KSt(e,t,n){var i=this,o={owner:e,deferEvaluation:!0};if(typeof n=="function")o.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');o.read=n.get,o.write=n.set}return e[t]=i.computed(o),YSe.call(i,e,[t]),e}function JSt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=QSt(e,t,i))})}function QSt(e,t,n){var i=jSt(e,n);return i.subscribe(t)}function jSt(e,t){var n=t[G6];if(!n){n=new e.subscribable,Object.defineProperty(t,G6,{value:n});var i={};qSt(t,n,i),$St(e,t,n,i)}return n}function qSt(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var o=e[i];e[i]=function(){var r=o.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),r}})}function $St(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(o){Object.defineProperty(t,o,{enumerable:!1,value:function(){var r;i.pause=!0;try{r=e.observableArray.fn[o].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),r}})})}function zSe(e,t){if(!e)return null;var n=HSe(e,!1);return n&&n[t]||null}function eCt(e,t){var n=zSe(e,t);n&&n.valueHasMutated()}function tCt(e){e.track=YSe,e.getObservable=zSe,e.valueHasMutated=eCt,e.defineProperty=KSt}var BM={attachToKo:tCt};var sVo=T(S(),1),KSe="http://www.w3.org/2000/svg",JSe="cesium-svgPath-svg",nCt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(KSe,"svg:svg");i.setAttribute("class",JSe);let o=document.createElementNS(KSe,"path");return i.appendChild(o),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let r=e.unwrap(n());o.setAttribute("d",e.unwrap(r.path));let s=e.unwrap(r.width),a=e.unwrap(r.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),r.css&&i.setAttribute("class",`${JSe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},OM=nCt;BM.attachToKo(gS);OM.register(gS);var Se=gS;function YM(e){l(e)||(e=new oh),this._clock=e,this._eventHelper=new lr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Se.observable(j.now()),this.systemTime.equalityComparer=j.equals,this.startTime=Se.observable(e.startTime),this.startTime.equalityComparer=j.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Se.observable(e.stopTime),this.stopTime.equalityComparer=j.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Se.observable(e.currentTime),this.currentTime.equalityComparer=j.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Se.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Se.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Se.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Se.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Se.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Se.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(YM.prototype,{clock:{get:function(){return this._clock}}});YM.prototype.synchronize=function(){let e=this._clock;this.systemTime=j.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};YM.prototype.isDestroyed=function(){return!1};YM.prototype.destroy=function(){this._eventHelper.removeAll(),me(this)};var HM=YM;var yVo=T(S(),1);function iCt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,pe.throwInstantiationError()}var E6=iCt;var SVo=T(S(),1);var zM={};zM.createCheckbox=function(e,t,n){let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),r.setAttribute("data-bind",s),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};zM.createSection=function(e,t,n,i){let o=document.createElement("div");o.className="cesium-cesiumInspector-section",o.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(o);let r=document.createElement("h3");r.className="cesium-cesiumInspector-sectionHeader",r.appendChild(document.createTextNode(t)),r.setAttribute("data-bind",`click: ${i}`),o.appendChild(r);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",o.appendChild(s),s};zM.createRangeInput=function(e,t,n,i,o,r){r=y(r,t);let s=document.createElement("input");s.setAttribute("data-bind",`value: ${r}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=y(o,"any"),a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let d=document.createElement("div");return d.className="cesium-cesiumInspector-slider",d.appendChild(document.createTextNode(e)),d.appendChild(s),d.appendChild(c),d};zM.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let o=`click: ${t}`;return l(n)&&(o+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",o),i};var Ba=zM;var GVo=T(S(),1);function QSe(e,t){this._command=e,t=y(t,y.EMPTY_OBJECT),this.toggled=y(t.toggled,!1),this.tooltip=y(t.tooltip,""),Se.track(this,["toggled","tooltip"])}Object.defineProperties(QSe.prototype,{command:{get:function(){return this._command}}});var Ny=QSe;var vVo=T(S(),1);function oCt(e,t){t=y(t,!0);let n=new be,i=new be;function o(){let r={args:arguments,cancel:!1},s;return n.raiseEvent(r),r.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return o.canExecute=t,Se.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var Ln=oCt;var AVo=T(S(),1);function rCt(e,t,n,i,o){return n.call(i,e[t]),Se.getObservable(e,t).subscribe(n,i,o)}var xa=rCt;var DVo=T(S(),1);var yS="http://www.w3.org/2000/svg",$Se="http://www.w3.org/1999/xlink",u3,KM=B.fromCssColorString("rgba(247,250,255,0.384)"),m3=B.fromCssColorString("rgba(143,191,255,0.216)"),I6=B.fromCssColorString("rgba(153,197,255,0.098)"),h3=B.fromCssColorString("rgba(255,255,255,0.086)"),sCt=B.fromCssColorString("rgba(255,255,255,0.267)"),aCt=B.fromCssColorString("rgba(255,255,255,0)"),jSe=B.fromCssColorString("rgba(66,67,68,0.3)"),qSe=B.fromCssColorString("rgba(0,0,0,0.5)");function ky(e){return B.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var JM={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function Ah(e){let t=document.createElementNS(yS,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let o=0;o<i;++o)t.appendChild(Ah(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS($Se,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function X6(e,t,n){let i=document.createElementNS(yS,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(yS,"tspan");return o.textContent=n,i.appendChild(o),i}function cCt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var f3=new B;function os(e,t){let n=t.alpha,i=1-n;return f3.red=e.red*i+t.red*n,f3.green=e.green*i+t.green*n,f3.blue=e.blue*i+t.blue*n,f3.toCssColorString()}function W6(e,t,n){let i=JM[n],o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Ah(o)}function lCt(e,t,n){let i=JM[n],o=JM.animation_pathWingButton,r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Ah(r)}function dCt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&u3!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let o=e._centerX,r=e._centerY,a=e._svgNode.getBoundingClientRect(),c,d;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,d=t.touches[0].clientY):(c=t.clientX,d=t.clientY),!i&&(c>a.right||c<a.left||d<a.top||d>a.bottom))return;let u=e._shuttleRingPointer.getBoundingClientRect(),m=c-o-a.left,p=d-r-a.top,g=Math.atan2(p,m)*180/Math.PI+90;g>180&&(g-=360);let f=n.shuttleRingAngle;i||c<u.right&&c>u.left&&d>u.top&&d<u.bottom?(u3=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<f?n.slower():g>f&&n.faster(),t.preventDefault()}else e===u3&&(u3=void 0),n.shuttleRingDragging=!1}function _0(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[xa(t,"toggled",this.setToggled,this),xa(t,"tooltip",this.setTooltip,this),xa(t.command,"canExecute",this.setEnabled,this)]}_0.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();me(this)};_0.prototype.isDestroyed=function(){return!1};_0.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};_0.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};_0.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function vL(e,t){e=Xn(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let o=document.createElement("div");o.className="cesium-animation-theme",o.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=o,this._themeNormal=o.childNodes[0],this._themeHover=o.childNodes[1],this._themeSelect=o.childNodes[2],this._themeDisabled=o.childNodes[3],this._themeKnob=o.childNodes[4],this._themePointer=o.childNodes[5],this._themeSwoosh=o.childNodes[6],this._themeSwooshHover=o.childNodes[7];let r=document.createElementNS(yS,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",$Se);let s=document.createElementNS(yS,"g");this._topG=s,this._realtimeSVG=new _0(lCt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new _0(W6(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new _0(W6(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new _0(W6(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(yS,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=Ah({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let d=JM.animation_pathSwooshFX,u=JM.animation_pathPointer,m=Ah({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:d.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:d.d},{tagName:d.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:d.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=m,this._shuttleRingPointer=Ah({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:u.tagName,d:u.d});let p=Ah({tagName:"g",transform:"translate(100,100)"});this._knobOuter=Ah({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,f=Ah({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=X6(0,-24,""),this._knobTime=X6(0,-7,""),this._knobStatus=X6(0,-41,"");let x=Ah({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),_=document.createElementNS(yS,"g");_.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(_),s.appendChild(p),s.appendChild(a),_.appendChild(c),_.appendChild(m),_.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(f),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(x),r.appendChild(s),e.appendChild(r);let C=this;function V(v){dCt(C,v)}this._mouseCallback=V,c.addEventListener("mousedown",V,!0),c.addEventListener("touchstart",V,!0),m.addEventListener("mousedown",V,!0),m.addEventListener("touchstart",V,!0),n.addEventListener("mousemove",V,!0),n.addEventListener("touchmove",V,!0),n.addEventListener("mouseup",V,!0),n.addEventListener("touchend",V,!0),n.addEventListener("touchcancel",V,!0),this._shuttleRingPointer.addEventListener("mousedown",V,!0),this._shuttleRingPointer.addEventListener("touchstart",V,!0),this._knobOuter.addEventListener("mousedown",V,!0),this._knobOuter.addEventListener("touchstart",V,!0);let L=this._knobTime.childNodes[0],Z=this._knobDate.childNodes[0],G=this._knobStatus.childNodes[0],I;this._subscriptions=[xa(t.pauseViewModel,"toggled",function(v){I!==v&&(I=v,I?C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),xa(t,"shuttleRingAngle",function(v){cCt(C._shuttleRingPointer,C._knobOuter,v)}),xa(t,"dateLabel",function(v){Z.textContent!==v&&(Z.textContent=v)}),xa(t,"timeLabel",function(v){L.textContent!==v&&(L.textContent=v)}),xa(t,"multiplierLabel",function(v){G.textContent!==v&&(G.textContent=v)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(vL.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});vL.prototype.isDestroyed=function(){return!1};vL.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let n=this._subscriptions;for(let i=0,o=n.length;i<o;i++)n[i].dispose();return me(this)};vL.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,o=132,r=e,s=t;e===0&&t===0?(r=i,s=o):e===0?(s=t,r=i*(t/o)):t===0&&(r=e,s=o*(e/i));let a=r/i,c=s/o;n.style.cssText=`width: ${r}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",r),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${r} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};vL.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let u=this;u._observer=new MutationObserver(function(){e.body.contains(u._container)&&(u._observer.disconnect(),u._observer=void 0,u.applyThemeChanges())}),u._observer.observe(e,{childList:!0,subtree:!0});return}let t=ky(this._themeNormal),n=ky(this._themeHover),i=ky(this._themeSelect),o=ky(this._themeDisabled),r=ky(this._themeKnob),s=ky(this._themePointer),a=ky(this._themeSwoosh),c=ky(this._themeSwooshHover),d=Ah({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":os(t,KM)},{tagName:"stop",offset:"12%","stop-color":os(t,m3)},{tagName:"stop",offset:"46%","stop-color":os(t,I6)},{tagName:"stop",offset:"81%","stop-color":os(t,h3)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":os(n,KM)},{tagName:"stop",offset:"12%","stop-color":os(n,m3)},{tagName:"stop",offset:"46%","stop-color":os(n,I6)},{tagName:"stop",offset:"81%","stop-color":os(n,h3)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":os(i,KM)},{tagName:"stop",offset:"12%","stop-color":os(i,m3)},{tagName:"stop",offset:"46%","stop-color":os(i,I6)},{tagName:"stop",offset:"81%","stop-color":os(i,h3)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":os(o,sCt)},{tagName:"stop",offset:"75%","stop-color":os(o,aCt)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":os(s,qSe)},{tagName:"stop",offset:"100%","stop-color":os(s,qSe)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":os(r,KM)},{tagName:"stop",offset:"60%","stop-color":os(r,jSe)},{tagName:"stop",offset:"85%","stop-color":os(r,m3)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":os(r,jSe)},{tagName:"stop",offset:"60%","stop-color":os(r,KM)},{tagName:"stop",offset:"85%","stop-color":os(r,h3)}]}]});l(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d};var QM=vL;var QVo=T(S(),1);var uCt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Uy=15,wL=105;function eCe(e,t){return e-t}function P6(e,t){let n=Eo(t,e,eCe);return n<0?~n:n}function mCt(e,t){if(Math.abs(e)<=Uy)return e/Uy;let n=Uy,i=wL,o,r=0,s;return e>0?(o=Math.log(t[t.length-1]),s=(o-r)/(i-n),Math.exp(r+s*(e-n))):(o=Math.log(-t[0]),s=(o-r)/(i-n),-Math.exp(r+s*(Math.abs(e)-n)))}function hCt(e,t,n){if(n.clockStep===mo.SYSTEM_CLOCK)return Uy;if(Math.abs(e)<=1)return e*Uy;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=Uy,r=wL,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(r-o),(Math.log(e)-a)/c+o):(s=Math.log(-t[0]),c=(s-a)/(r-o),-((Math.log(Math.abs(e))-a)/c+o))}function um(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=um.defaultDateFormatter,this._timeFormatter=um.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Se.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(um.defaultTicks),this.timeLabel=void 0,Se.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Se.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Se.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===mo.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,Se.defineProperty(this,"shuttleRingAngle",{get:function(){return hCt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,wL),-wL);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=mo.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===wL){c.multiplier=s>0?a[a.length-1]:a[0];return}let d=mCt(s,a);if(t.snapToTicks)d=a[P6(d,a)];else if(d!==0){let u=Math.abs(d);if(u>100){let m=u.toFixed(0).length-2,p=Math.pow(10,m);d=Math.round(d/p)*p|0}else u>Uy?d=Math.round(d):u>1?d=+d.toFixed(1):u>0&&(d=+d.toFixed(2))}c.multiplier=d}}),this._canAnimate=void 0,Se.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===Br.UNBOUNDED)return!0;let c=s.multiplier,d=s.currentTime,u=s.startTime,m=!1;if(a===Br.LOOP_STOP)m=j.greaterThan(d,u)||d.equals(u)&&c>0;else{let p=s.stopTime;m=j.greaterThan(d,u)&&j.lessThan(d,p)||d.equals(u)&&c>0||d.equals(p)&&c<0}return m||(s.shouldAnimate=!1),m}),this._isSystemTimeAvailable=void 0,Se.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===Br.UNBOUNDED)return!0;let c=s.systemTime;return j.greaterThanOrEquals(c,s.startTime)&&j.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,Se.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Ln(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new Ny(n,{toggled:Se.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Ln(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new Ny(i,{toggled:Se.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=Ln(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new Ny(o,{toggled:Se.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==mo.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=Ln(function(){t._clockViewModel.clockStep=mo.SYSTEM_CLOCK},Se.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new Ny(r,{toggled:Se.computed(function(){return e.clockStep===mo.SYSTEM_CLOCK}),tooltip:Se.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Ln(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=P6(c,a)-1;d>=0&&(s.multiplier=a[d])}),this._faster=Ln(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=P6(c,a)+1;d<a.length&&(s.multiplier=a[d])})}um.defaultDateFormatter=function(e,t){let n=j.toGregorianDate(e);return`${uCt[n.month-1]} ${n.day} ${n.year}`};um.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];um.defaultTimeFormatter=function(e,t){let n=j.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};um.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};um.prototype.setShuttleRingTicks=function(e){let t,n,i,o={},r=this._sortedFilteredPositiveTicks;for(r.length=0,t=0,n=e.length;t<n;++t)i=e[t],o.hasOwnProperty(i)||(o[i]=!0,r.push(i));r.sort(eCe);let s=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&s.push(-i);Array.prototype.push.apply(s,r),this._allShuttleRingTicks=s};Object.defineProperties(um.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});um._maxShuttleRingAngle=wL;um._realtimeShuttleRingAngle=Uy;var jM=um;var lLo=T(S(),1);var nLo=T(S(),1);function tCe(e){e=y(e,y.EMPTY_OBJECT);let t=e.globe,n=y(e.imageryProviderViewModels,[]),i=y(e.terrainProviderViewModels,[]);this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Se.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=Se.getObservable(this,"imageryProviderViewModels"),r=Se.pureComputed(function(){let m=o(),p={},g;for(g=0;g<m.length;g++){let _=m[g],C=_.category;l(p[C])?p[C].push(_):p[C]=[_]}let f=Object.keys(p),x=[];for(g=0;g<f.length;g++){let _=f[g];x.push({name:_,providers:p[_]})}return x});this._imageryProviders=r;let s=Se.getObservable(this,"terrainProviderViewModels"),a=Se.pureComputed(function(){let m=s(),p={},g;for(g=0;g<m.length;g++){let _=m[g],C=_.category;l(p[C])?p[C].push(_):p[C]=[_]}let f=Object.keys(p),x=[];for(g=0;g<f.length;g++){let _=f[g];x.push({name:_,providers:p[_]})}return x});this._terrainProviders=a,this.buttonTooltip=void 0,Se.defineProperty(this,"buttonTooltip",function(){let m=this.selectedImagery,p=this.selectedTerrain,g=l(m)?m.name:void 0,f=l(p)?p.name:void 0;return l(g)&&l(f)?`${g}
  14010. ${f}`:l(g)?g:f}),this.buttonImageUrl=void 0,Se.defineProperty(this,"buttonImageUrl",function(){let m=this.selectedImagery;if(l(m))return m.iconUrl}),this.selectedImagery=void 0;let c=Se.observable();this._currentImageryLayers=[],Se.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(m){if(c()===m){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,f=g.length,x=this._globe.imageryLayers,_=!1;for(p=0;p<f;p++){let C=x.length;for(let V=0;V<C;V++){let L=x.get(V);if(L===g[p]){x.remove(L),_=!0;break}}}if(l(m)){let C=m.creationCommand();if(Array.isArray(C)){let V=C.length;for(this._currentImageryLayers=[],p=V-1;p>=0;p--){let L=ka.fromProviderAsync(C[p]);x.add(L,0),this._currentImageryLayers.push(L)}}else{this._currentImageryLayers=[];let V=ka.fromProviderAsync(C);if(V.name=m.name,_)x.add(V,0);else{let L=x.get(0);l(L)&&x.remove(L),x.add(V,0)}this._currentImageryLayers.push(V)}}c(m),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let d=Se.observable();Se.defineProperty(this,"selectedTerrain",{get:function(){return d()},set:function(m){if(d()===m){this.dropDownVisible=!1;return}let p;if(l(m)&&(p=m.creationCommand()),l(p)&&!l(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof kf),this._globe.terrainProvider=p;else if(l(p)){let g=!1,f=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,f()}),_=new MM(p).readyEvent.addEventListener(C=>{g||(this._globe.depthTestAgainstTerrain=!(C instanceof kf),this._globe.terrainProvider=C,_())})}d(m),this.dropDownVisible=!1}});let u=this;this._toggleDropDown=Ln(function(){u.dropDownVisible=!u.dropDownVisible}),this.selectedImagery=y(e.selectedImageryProviderViewModel,n[0]),this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(tCe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var qM=tCe;function p3(e,t){e=Xn(e);let n=new qM(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let o=document.createElement("img");o.setAttribute("draggable","false"),o.className="cesium-baseLayerPicker-selected",o.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-baseLayerPicker-dropDown",r.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(r);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",r.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let d=document.createElement("div");d.className="cesium-baseLayerPicker-categoryTitle",d.setAttribute("data-bind","text: name"),c.appendChild(d);let u=document.createElement("div");u.className="cesium-baseLayerPicker-choices",u.setAttribute("data-bind","foreach: providers"),c.appendChild(u);let m=document.createElement("div");m.className="cesium-baseLayerPicker-item",m.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),u.appendChild(m);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),m.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),m.appendChild(g);let f=document.createElement("div");f.className="cesium-baseLayerPicker-sectionTitle",f.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),f.innerHTML="Terrain",r.appendChild(f);let x=document.createElement("div");x.className="cesium-baseLayerPicker-section",x.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(x);let _=document.createElement("div");_.className="cesium-baseLayerPicker-category",x.appendChild(_);let C=document.createElement("div");C.className="cesium-baseLayerPicker-categoryTitle",C.setAttribute("data-bind","text: name"),_.appendChild(C);let V=document.createElement("div");V.className="cesium-baseLayerPicker-choices",V.setAttribute("data-bind","foreach: providers"),_.appendChild(V);let L=document.createElement("div");L.className="cesium-baseLayerPicker-item",L.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),V.appendChild(L);let Z=document.createElement("img");Z.className="cesium-baseLayerPicker-itemIcon",Z.setAttribute("data-bind","attr: { src: iconUrl }"),Z.setAttribute("draggable","false"),L.appendChild(Z);let G=document.createElement("div");G.className="cesium-baseLayerPicker-itemLabel",G.setAttribute("data-bind","text: name"),L.appendChild(G),Se.applyBindings(n,i),Se.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(I){i.contains(I.target)||r.contains(I.target)||(n.dropDownVisible=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(p3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});p3.prototype.isDestroyed=function(){return!1};p3.prototype.destroy=function(){return zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Se.cleanNode(this._element),Se.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),me(this)};var $M=p3;var pLo=T(S(),1);function nCe(e){let t=e.creationFunction;l(t.canExecute)||(t=Ln(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=y(e.category,""),Se.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(nCe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var rs=nCe;var xLo=T(S(),1);function fCt(){let e=[],t=devicePixelRatio>=2;return e.push(new rs({name:"Bing Maps Aerial",iconUrl:rn("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return n0({style:t0.AERIAL})}})),e.push(new rs({name:"Bing Maps Aerial with Labels",iconUrl:rn("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return n0({style:t0.AERIAL_WITH_LABELS})}})),e.push(new rs({name:"Bing Maps Roads",iconUrl:rn("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return n0({style:t0.ROAD})}})),e.push(new rs({name:"ArcGIS World Imagery",iconUrl:rn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at
  14011. https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return $b.fromBasemapType(Ch.SATELLITE,{enablePickFeatures:!1})}})),e.push(new rs({name:"ArcGIS World Hillshade",iconUrl:rn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at
  14012. https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return $b.fromBasemapType(Ch.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new rs({name:"Esri World Ocean",iconUrl:rn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at
  14013. https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return $b.fromBasemapType(Ch.OCEANS,{enablePickFeatures:!1})}})),e.push(new rs({name:"Open\xADStreet\xADMap",iconUrl:rn("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.
  14014. http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new x0({url:"https://tile.openstreetmap.org/"})}})),e.push(new rs({name:"Stadia x Stamen Watercolor",iconUrl:rn("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and reminiscent of hand drawn maps, the watercolor maps from Stamen Design apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.
  14015. https://docs.stadiamaps.com/map-styles/stamen-watercolor/`,category:"Other",creationFunction:function(){return new x0({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`&copy; <a href="https://stamen.com/" target="_blank">Stamen Design</a>
  14016. &copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
  14017. &copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
  14018. &copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new rs({name:"Stadia x Stamen Toner",iconUrl:rn("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and the most popular of the excellent styles from Stamen Design, these high-contrast B+W (black and white) maps are the perfect backdrop for your colorful and eye-catching overlays.
  14019. https://docs.stadiamaps.com/map-styles/stamen-toner/`,category:"Other",creationFunction:function(){return new x0({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`&copy; <a href="https://stamen.com/" target="_blank">Stamen Design</a>
  14020. &copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
  14021. &copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
  14022. &copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new rs({name:"Stadia Alidade Smooth",iconUrl:rn("Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png"),tooltip:`Stadia's custom Alidade Smooth style is designed for maps that use a lot of markers or overlays. It features a muted color scheme and fewer points of interest to allow your added data to shine.
  14023. https://docs.stadiamaps.com/map-styles/alidade-smooth/`,category:"Other",creationFunction:function(){return new x0({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
  14024. &copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
  14025. &copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new rs({name:"Stadia Alidade Smooth Dark",iconUrl:rn("Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png"),tooltip:`Stadia Alidade Smooth Dark, like its lighter cousin, is also designed to stay out of the way. It just flips the dark mode switch on the color scheme. With the lights out, your data can now literally shine.
  14026. https://docs.stadiamaps.com/map-styles/alidade-smooth-dark/`,category:"Other",creationFunction:function(){return new x0({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
  14027. &copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
  14028. &copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new rs({name:"Sentinel-2",iconUrl:rn("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return e0.fromAssetId(3954)}})),e.push(new rs({name:"Blue Marble",iconUrl:rn("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return e0.fromAssetId(3845)}})),e.push(new rs({name:"Earth at night",iconUrl:rn("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return e0.fromAssetId(3812)}})),e.push(new rs({name:"Natural Earth\xA0II",iconUrl:rn("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast.
  14029. http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return gy.fromUrl(rn("Assets/Textures/NaturalEarthII"))}})),e}var e9=fCt;var CLo=T(S(),1);function pCt(){let e=[];return e.push(new rs({name:"WGS84 Ellipsoid",iconUrl:rn("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new kf({ellipsoid:ne.WGS84})}})),e.push(new rs({name:"Cesium World Terrain",iconUrl:rn("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return cS({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var t9=pCt;var wLo=T(S(),1);var GLo=T(S(),1);function bCt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof ua&&(e.tileset=n.primitive),e.pickActive=!1}}function oCe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof ua&&(e.tileset=i.primitive)},Sn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Sn.MOUSE_MOVE),e.picking=e.picking)}var gCt={maximumFractionDigits:3};function n9(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,gCt):Math.round(t).toLocaleString()}function i9(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[wo.PICK]:e._statisticsPerPass[wo.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${n9(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${n9(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${n9(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function rCe(){let e=Ci.statistics;return`
  14030. <ul class="cesium-cesiumInspector-statistics">
  14031. <li><strong>Geometry Memory (MB): </strong>${n9(e.geometryByteLength)}</li>
  14032. <li><strong>Texture Memory (MB): </strong>${n9(e.texturesByteLength)}</li>
  14033. </ul>
  14034. `}var yCt=[{text:"Highlight",value:Gl.HIGHLIGHT},{text:"Replace",value:Gl.REPLACE},{text:"Mix",value:Gl.MIX}],iCe=new B(1,1,0,.4),xCt=new B,b3=new B;function _a(e,t){let n=this,i=e.canvas;this._eventHandler=new Qd(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new r0({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,Se.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=Se.observable({}),this.properties=[],Se.defineProperty(this,"properties",function(){let k=[],H=n._properties();for(let J in H)H.hasOwnProperty(J)&&k.push(J);return k});let o=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(k){o(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=k)}}),this.dynamicScreenSpaceError=!1;let r=Se.observable();Se.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(k){r(k),l(n._tileset)&&(n._tileset.colorBlendMode=k,n._scene.requestRender())}}),this.colorBlendMode=Gl.HIGHLIGHT;let s=Se.observable(),a=Se.observable();Se.defineProperty(this,"picking",{get:function(){return a()},set:function(k){a(k),k?n._eventHandler.setInputAction(function(H){let J=e.pick(H.endPosition);if(J instanceof Ns?(n.feature=J,n.tile=J.content.tile):l(J)&&l(J.content)?(n.feature=void 0,n.tile=J.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(J)&&l(J.content)){let te;e.pickPositionSupported&&(te=e.pickPosition(H.endPosition),l(te)&&(n._tileset.debugPickPosition=te)),n._tileset.debugPickedTile=J.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Sn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Sn.MOUSE_MOVE))}}),this.picking=!0;let c=Se.observable();Se.defineProperty(this,"colorize",{get:function(){return c()},set:function(k){c(k),l(n._tileset)&&(n._tileset.debugColorizeTiles=k,n._scene.requestRender())}}),this.colorize=!1;let d=Se.observable();Se.defineProperty(this,"wireframe",{get:function(){return d()},set:function(k){d(k),l(n._tileset)&&(n._tileset.debugWireframe=k,n._scene.requestRender())}}),this.wireframe=!1;let u=Se.observable();Se.defineProperty(this,"showBoundingVolumes",{get:function(){return u()},set:function(k){u(k),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=k,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let m=Se.observable();Se.defineProperty(this,"showContentBoundingVolumes",{get:function(){return m()},set:function(k){m(k),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=k,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Se.observable();Se.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(k){p(k),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=k,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=Se.observable();Se.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(k){g(k),l(n._tileset)&&(n._tileset.debugFreezeFrame=k,n._scene.debugShowFrustumPlanes=k,n._scene.requestRender())}}),this.freezeFrame=!1,Se.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(k){s(k),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=k,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let f=Se.observable();Se.defineProperty(this,"showGeometricError",{get:function(){return f()},set:function(k){f(k),l(n._tileset)&&(n._tileset.debugShowGeometricError=k,n._scene.requestRender())}}),this.showGeometricError=!1;let x=Se.observable();Se.defineProperty(this,"showRenderingStatistics",{get:function(){return x()},set:function(k){x(k),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=k,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let _=Se.observable();Se.defineProperty(this,"showMemoryUsage",{get:function(){return _()},set:function(k){_(k),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=k,n._scene.requestRender())}}),this.showMemoryUsage=!1;let C=Se.observable();Se.defineProperty(this,"showUrl",{get:function(){return C()},set:function(k){C(k),l(n._tileset)&&(n._tileset.debugShowUrl=k,n._scene.requestRender())}}),this.showUrl=!1;let V=Se.observable();Se.defineProperty(this,"maximumScreenSpaceError",{get:function(){return V()},set:function(k){k=Number(k),isNaN(k)||(V(k),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=k))}}),this.maximumScreenSpaceError=16;let L=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return L()},set:function(k){k=Number(k),isNaN(k)||(L(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=k))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Se.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(L(),1/6)},set:function(k){let H=Math.pow(k,6);L(H),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=H)}});let Z=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return Z()},set:function(k){k=Number(k),isNaN(k)||(Z(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=k))}}),this.dynamicScreenSpaceErrorFactor=24;let G=bCt(this),I=Se.observable();Se.defineProperty(this,"pickActive",{get:function(){return I()},set:function(k){I(k),k?n._eventHandler.setInputAction(G,Sn.LEFT_CLICK):n._eventHandler.removeInputAction(Sn.LEFT_CLICK)}});let v=Se.observable();Se.defineProperty(this,"pointCloudShading",{get:function(){return v()},set:function(k){v(k),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=k)}}),this.pointCloudShading=!1;let P=Se.observable();Se.defineProperty(this,"geometricErrorScale",{get:function(){return P()},set:function(k){k=Number(k),isNaN(k)||(P(k),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=k))}}),this.geometricErrorScale=1;let w=Se.observable();Se.defineProperty(this,"maximumAttenuation",{get:function(){return w()},set:function(k){k=Number(k),isNaN(k)||(w(k),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=k===0?void 0:k))}}),this.maximumAttenuation=0;let F=Se.observable();Se.defineProperty(this,"baseResolution",{get:function(){return F()},set:function(k){k=Number(k),isNaN(k)||(F(k),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=k===0?void 0:k))}}),this.baseResolution=0;let b=Se.observable();Se.defineProperty(this,"eyeDomeLighting",{get:function(){return b()},set:function(k){b(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=k)}}),this.eyeDomeLighting=!1;let R=Se.observable();Se.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return R()},set:function(k){k=Number(k),isNaN(k)||(R(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=k))}}),this.eyeDomeLightingStrength=1;let E=Se.observable();Se.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return E()},set:function(k){k=Number(k),isNaN(k)||(E(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=k))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let X=Se.observable();Se.defineProperty(this,"skipLevelOfDetail",{get:function(){return X()},set:function(k){X(k),l(n._tileset)&&(n._tileset.skipLevelOfDetail=k)}}),this.skipLevelOfDetail=!0;let A=Se.observable();Se.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return A()},set:function(k){k=Number(k),isNaN(k)||(A(k),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=k))}}),this.skipScreenSpaceErrorFactor=16;let N=Se.observable();Se.defineProperty(this,"baseScreenSpaceError",{get:function(){return N()},set:function(k){k=Number(k),isNaN(k)||(N(k),l(n._tileset)&&(n._tileset.baseScreenSpaceError=k))}}),this.baseScreenSpaceError=1024;let O=Se.observable();Se.defineProperty(this,"skipLevels",{get:function(){return O()},set:function(k){k=Number(k),isNaN(k)||(O(k),l(n._tileset)&&(n._tileset.skipLevels=k))}}),this.skipLevels=1;let U=Se.observable();Se.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return U()},set:function(k){U(k),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=k)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let Y=Se.observable();Se.defineProperty(this,"loadSiblings",{get:function(){return Y()},set:function(k){Y(k),l(n._tileset)&&(n._tileset.loadSiblings=k)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),l(this._tileset)||oCe(this,!0)}Object.defineProperties(_a.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return yCt}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,l(e)){this._properties(e.properties);let t=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],n=t.length;for(let o=0;o<n;++o){let r=t[o];this[r]=this[r]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings,this.hasEnabledWireframe=e._enableDebugWireframe;let i=e.pointCloudShading;this.pointCloudShading=i.attenuation,this.geometricErrorScale=i.geometricErrorScale,this.maximumAttenuation=i.maximumAttenuation?i.maximumAttenuation:0,this.baseResolution=i.baseResolution?i.baseResolution:0,this.eyeDomeLighting=i.eyeDomeLighting,this.eyeDomeLightingStrength=i.eyeDomeLightingStrength,this.eyeDomeLightingRadius=i.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=i9(e,!1),this._pickStatisticsText=i9(e,!0),this._resourceCacheStatisticsText=rCe(),oCe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,xCt):B.WHITE:t.color=b3,this._scene.requestRender()),l(e)&&(B.clone(e.color,b3),e.color=iCe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!v6(t.content)&&(t.color=b3,this._scene.requestRender()),l(e)&&!v6(e.content)&&(B.clone(e.color,b3),e.color=iCe,this._scene.requestRender()),this._tile=e}}});function v6(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!v6(t[i]))return!1;return!0}return!1}_a.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};_a.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};_a.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};_a.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};_a.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};_a.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};_a.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};_a.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};_a.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};_a.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};_a.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new dS(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};_a.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(`
  14035. `),c=a.length,d;if(t.shiftKey)for(d=0;d<c;++d)a[d][0]===" "&&(a[d][1]===" "?(a[d]=a[d].substr(2),r-=2):(a[d]=a[d].substr(1),r-=1));else for(d=0;d<c;++d)a[d]=` ${a[d]}`,r+=2;let u=a.join(`
  14036. `);n.value=n.value.slice(0,i)+u+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};_a.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=i9(e,!1),this._pickStatisticsText=i9(e,!0),this._resourceCacheStatisticsText=rCe())};_a.prototype.isDestroyed=function(){return!1};_a.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Se.getObservable(e,t).dispose()}),me(this)};_a.getStatistics=i9;var o9=_a;function g3(e,t){e=Xn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new o9(t,i);this._viewModel=o,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="3D Tiles Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=Ba.createSection,c=Ba.createCheckbox,d=Ba.createRangeInput,u=Ba.createButton,m=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),f=a(s,"Logging","loggingVisible","toggleLogging"),x=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),_=a(s,"Style","styleVisible","toggleStyle"),C=a(s,"Optimization","optimizationVisible","toggleOptimization"),V=document.createElement("div");V.className="field-group";let L=document.createElement("label");L.className="field-label",L.appendChild(document.createTextNode("Properties: "));let Z=document.createElement("div");Z.setAttribute("data-bind","text: properties"),V.appendChild(L),V.appendChild(Z),m.appendChild(V),m.appendChild(u("Pick Tileset","togglePickTileset","pickActive")),m.appendChild(u("Trim Tiles Cache","trimTilesCache")),m.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let G=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),I=document.createElement("p");I.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),I.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),I.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",G.appendChild(I),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let v=document.createElement("div");v.setAttribute("data-bind","visible: pointCloudShading"),v.appendChild(d("Geometric Error Scale","geometricErrorScale",0,2,.01)),v.appendChild(d("Maximum Attenuation","maximumAttenuation",0,32,1)),v.appendChild(d("Base Resolution","baseResolution",0,1,.01)),v.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(v);let P=document.createElement("div");P.setAttribute("data-bind","visible: eyeDomeLighting"),P.appendChild(d("EDL Strength","eyeDomeLightingStrength",0,2,.1)),P.appendChild(d("EDL Radius","eyeDomeLightingRadius",0,4,.1)),v.appendChild(P),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let w=document.createElement("div");w.appendChild(d("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(w);let F=document.createElement("div");F.setAttribute("data-bind","visible: dynamicScreenSpaceError"),F.appendChild(d("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),F.appendChild(d("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),g.appendChild(F),f.appendChild(c("Performance","performance")),f.appendChild(i),f.appendChild(c("Statistics","showStatistics"));let b=document.createElement("div");b.className="cesium-3dTilesInspector-statistics",b.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),f.appendChild(b),f.appendChild(c("Pick Statistics","showPickStatistics"));let R=document.createElement("div");R.className="cesium-3dTilesInspector-statistics",R.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),f.appendChild(R),f.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let E=document.createElement("div");E.className="cesium-3dTilesInspector-statistics",E.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),f.appendChild(E);let X=document.createElement("div");_.appendChild(X),X.appendChild(document.createTextNode("Color Blend Mode: "));let A=document.createElement("select");A.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),X.appendChild(A);let N=document.createElement("textarea");N.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),X.className="cesium-cesiumInspector-styleEditor",X.appendChild(N);let O=u("Compile (Ctrl+Enter)","compileStyle");X.appendChild(O);let U=document.createElement("div");U.className="cesium-cesiumInspector-error",U.setAttribute("data-bind","text: editorError"),X.appendChild(U),x.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),x.appendChild(c("Geometric Error","showGeometricError")),x.appendChild(c("Rendering Statistics","showRenderingStatistics")),x.appendChild(c("Memory Usage (MB)","showMemoryUsage")),x.appendChild(c("Url","showUrl")),C.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let Y=document.createElement("div");Y.appendChild(d("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),C.appendChild(Y);let k=document.createElement("div");k.appendChild(d("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),C.appendChild(k);let H=document.createElement("div");H.appendChild(d("Min. levels to skip","skipLevels",0,10,1)),C.appendChild(H),C.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),C.appendChild(c("Load siblings of visible tiles","loadSiblings")),Se.applyBindings(o,n)}Object.defineProperties(g3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});g3.prototype.isDestroyed=function(){return!1};g3.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),me(this)};var r9=g3;var JLo=T(S(),1);var ULo=T(S(),1);function _Ct(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let o=parseInt(i,10),r;if(o===7)r="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);o>=c&&(s.push(a+1),o-=c)}r=s.reverse().join(" and ")}t+=`<br>&nbsp;&nbsp;&nbsp;&nbsp;${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function w6(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var TCt=new pn,SCt=new h;function s9(e,t){let n=this,i=e.canvas,o=new Qd(i);this._eventHandler=o,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let r=this._scene.globe;r.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",Se.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=Ln(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Ln(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Ln(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Ln(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Se.getObservable(this,"frustums").subscribe(function(d){n._scene.debugShowFrustums=d,n._scene.requestRender()}),this._frustumPlanesSubscription=Se.getObservable(this,"frustumPlanes").subscribe(function(d){n._scene.debugShowFrustumPlanes=d,n._scene.requestRender()}),this._performanceSubscription=Se.getObservable(this,"performance").subscribe(function(d){d?n._performanceDisplay=new r0({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Ln(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Se.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Ln(function(){if(n.primitiveReferenceFrame){let d=n._primitive.modelMatrix;n._modelMatrixPrimitive=new VM({modelMatrix:d}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=Se.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Ln(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(d){return l(n._modelMatrixPrimitive)&&d.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?d.owner===n._primitive||d.owner===n._primitive._billboardCollection||d.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=Se.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Se.getObservable(this,"wireframe").subscribe(function(d){r._surface.tileProvider._debug.wireframe=d,n._scene.requestRender()}),this._depthFrustumSubscription=Se.getObservable(this,"depthFrustum").subscribe(function(d){n._scene.debugShowDepthFrustum=d,n._scene.requestRender()}),this._incrementDepthFrustum=Ln(function(){let d=n.depthFrustum+1;return n.depthFrustum=w6(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Ln(function(){let d=n.depthFrustum-1;return n.depthFrustum=w6(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Se.getObservable(this,"suspendUpdates").subscribe(function(d){r._surface._debug.suspendLodUpdate=d,d||(n.filterTile=!1)});let s;this._showTileCoordinates=Ln(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new kM({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Se.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Se.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Ln(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Ln(function(){return n.filterTile?(n.suspendUpdates=!0,r._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&r._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=Se.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(d){let u=n._scene.pick({x:d.position.x,y:d.position.y});l(u)&&(n.primitive=l(u.collection)?u.collection:u.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Ln(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Se.getObservable(this,"pickPrimitiveActive").subscribe(function(d){d?o.setInputAction(a,Sn.LEFT_CLICK):o.removeInputAction(Sn.LEFT_CLICK)});function c(d){let u,m=r.ellipsoid,p=n._scene.camera.getPickRay(d.position,TCt),g=r.pick(p,n._scene,SCt);if(l(g)){let f=m.cartesianToCartographic(g),x=r._surface.tileProvider._tilesToRenderByTextureCount;for(let _=0;!u&&_<x.length;++_){let C=x[_];if(l(C))for(let V=0;!u&&V<C.length;++V){let L=C[V];ae.contains(L.rectangle,f)&&(u=L)}}}n.tile=u,n.pickTileActive=!1}this._pickTile=Ln(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Se.getObservable(this,"pickTileActive").subscribe(function(d){d?o.setInputAction(c,Sn.LEFT_CLICK):o.removeInputAction(Sn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(s9.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return Ln(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Ln(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Ln(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Ln(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Ln(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(l(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;l(n)&&l(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});s9.prototype._update=function(){this.frustums&&(this.frustumStatisticText=_Ct(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=w6(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};s9.prototype.isDestroyed=function(){return!1};s9.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),me(this)};var a9=s9;function y3(e,t){e=Xn(e);let n=document.createElement("div"),i=new a9(t,n);this._viewModel=i,this._container=e;let o=document.createElement("div");this._element=o;let r=document.createElement("div");r.textContent="Cesium Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleDropDown"),o.appendChild(r),o.className="cesium-cesiumInspector",o.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",o.appendChild(s);let a=Ba.createSection,c=Ba.createCheckbox,d=a(s,"General","generalVisible","toggleGeneral"),u=c("Show Frustums","frustums"),m=document.createElement("div");m.className="cesium-cesiumInspector-frustumStatistics",m.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),u.appendChild(m),d.appendChild(u),d.appendChild(c("Show Frustum Planes","frustumPlanes")),d.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",d.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),d.appendChild(p);let g=document.createElement("div");d.appendChild(g);let f=document.createElement("span");f.setAttribute("data-bind",'html: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Frustum:"'),g.appendChild(f);let x=document.createElement("span");x.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(x);let _=document.createElement("input");_.type="button",_.value="-",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(_);let C=document.createElement("input");C.type="button",C.value="+",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(C);let V=a(s,"Primitives","primitivesVisible","togglePrimitives"),L=document.createElement("div");L.className="cesium-cesiumInspector-pickSection",V.appendChild(L);let Z=document.createElement("input");Z.type="button",Z.value="Pick a primitive",Z.className="cesium-cesiumInspector-pickButton",Z.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let G=document.createElement("div");G.className="cesium-cesiumInspector-center",G.appendChild(Z),L.appendChild(G),L.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),L.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),L.appendChild(this._primitiveOnly);let I=a(s,"Terrain","terrainVisible","toggleTerrain"),v=document.createElement("div");v.className="cesium-cesiumInspector-pickSection",I.appendChild(v);let P=document.createElement("input");P.type="button",P.value="Pick a tile",P.className="cesium-cesiumInspector-pickButton",P.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),G=document.createElement("div"),G.appendChild(P),G.className="cesium-cesiumInspector-center",v.appendChild(G);let w=document.createElement("div");v.appendChild(w);let F=document.createElement("input");F.type="button",F.value="Parent",F.className="cesium-cesiumInspector-pickButton",F.setAttribute("data-bind","click: selectParent");let b=document.createElement("input");b.type="button",b.value="NW",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: selectNW");let R=document.createElement("input");R.type="button",R.value="NE",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind","click: selectNE");let E=document.createElement("input");E.type="button",E.value="SW",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind","click: selectSW");let X=document.createElement("input");X.type="button",X.value="SE",X.className="cesium-cesiumInspector-pickButton",X.setAttribute("data-bind","click: selectSE");let A=document.createElement("div");A.className="cesium-cesiumInspector-tileText",w.className="cesium-cesiumInspector-frustumStatistics",w.appendChild(A),w.setAttribute("data-bind","visible: hasPickedTile"),A.setAttribute("data-bind","html: tileText");let N=document.createElement("div");N.className="cesium-cesiumInspector-relativeText",N.textContent="Select relative:",w.appendChild(N);let O=document.createElement("table"),U=document.createElement("tr"),Y=document.createElement("tr"),k=document.createElement("td");k.appendChild(F);let H=document.createElement("td");H.appendChild(b);let J=document.createElement("td");J.appendChild(R),U.appendChild(k),U.appendChild(H),U.appendChild(J);let te=document.createElement("td"),z=document.createElement("td");z.appendChild(E);let q=document.createElement("td");q.appendChild(X),Y.appendChild(te),Y.appendChild(z),Y.appendChild(q),O.appendChild(U),O.appendChild(Y),w.appendChild(O),v.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),v.appendChild(c("Show only selected","filterTile","hasPickedTile")),I.appendChild(c("Wireframe","wireframe")),I.appendChild(c("Suspend LOD update","suspendUpdates")),I.appendChild(c("Show tile coordinates","tileCoordinates")),Se.applyBindings(i,this._element)}Object.defineProperties(y3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});y3.prototype.isDestroyed=function(){return!1};y3.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),me(this)};var c9=y3;var cRo=T(S(),1);var tRo=T(S(),1);function x3(e,t){l(t)||(t=document.body),t=Xn(t);let n=this,i=Se.observable(pr.fullscreen),o=Se.observable(pr.enabled),r=t.ownerDocument;this.isFullscreen=void 0,Se.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Se.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&pr.enabled)}}),this.tooltip=void 0,Se.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Ln(function(){pr.fullscreen?pr.exitFullscreen():pr.requestFullscreen(n._fullscreenElement)},Se.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=y(Xn(e),r.body),this._callback=function(){i(pr.fullscreen)},r.addEventListener(pr.changeEventName,this._callback)}Object.defineProperties(x3.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});x3.prototype.isDestroyed=function(){return!1};x3.prototype.destroy=function(){document.removeEventListener(pr.changeEventName,this._callback),me(this)};var l9=x3;var CCt="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",VCt="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function _3(e,t){e=Xn(e);let n=new l9(t,e);n._exitFullScreenPath=VCt,n._enterFullScreenPath=CCt;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),Se.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(_3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});_3.prototype.isDestroyed=function(){return!1};_3.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var d9=_3;var TRo=T(S(),1);var fRo=T(S(),1);var sCe=1e3;function mm(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new hM({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new be,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=cCe,this._handleArrowUp=aCe;let t=this;this._suggestionsVisible=Se.pureComputed(function(){let o=Se.getObservable(t,"_suggestions")().length>0,r=Se.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=Ln(function(i){if(i=y(i,Py.SEARCH),t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)ICt(t);else return GCt(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38;return(r||s)&&o.preventDefault(),!0},this.handleKeyUp=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38,a=o.key==="Enter"||o.keyCode===13;return s?aCe(t):r?cCe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;uCe(t),t.destinationFound(t,o)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,o){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=y(e.autocomplete,!0),this.destinationFound=y(e.destinationFound,mm.flyToDestination),this._focusTextbox=!1,Se.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Se.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){mm._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Se.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Se.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,Se.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(mm.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});mm.prototype.destroy=function(){this._suggestionSubscription.dispose()};function aCe(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],mm._adjustSuggestionsScroll(e,n)}function cCe(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],mm._adjustSuggestionsScroll(e,i)}function LCt(e,t){let n=l(t)?t.availability:void 0;return l(n)?xT(t,[e]).then(function(i){return e=i[0],e.height+=sCe,e}):(e.height+=sCe,Promise.resolve(e))}function RCt(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,s=t,a;return t instanceof ae?W.equalsEpsilon(t.south,t.north,W.EPSILON7)&&W.equalsEpsilon(t.east,t.west,W.EPSILON7)?t=ae.center(t):a=_T(t,n):t=i.cartesianToCartographic(t),l(a)||(a=LCt(t,r)),a.then(function(c){s=i.cartographicToCartesian(c)}).finally(function(){o.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:M.IDENTITY})})}async function ZCt(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function GCt(e,t,n){let i=e._searchText;if(dCe(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let o,r;for(o=0;o<t.length;o++){if(e._wasGeocodeCancelled)return;if(r=await ZCt(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,A6(e);let s=r.value;if(r.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=lCe(e,TL.getCreditsFromResult(s[0]));l(a)||F6(e,t[o].credit);return}e._searchText=`${i} (not found)`}function F6(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function lCe(e,t){return l(t)&&t.forEach(n=>F6(e,n)),t}function A6(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function ECt(e,t){let n=Xn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],r=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=r.offsetTop;s+r.clientHeight>i.clientHeight?i.scrollTop=s+r.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function ICt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function dCe(e){return/^\s*$/.test(e)}function uCe(e){Se.getObservable(e,"_suggestions").removeAll()}async function XCt(e){if(!e.autoComplete)return;let t=e._searchText;if(uCe(e),A6(e),!dCe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,Py.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=TL.getCreditsFromResult(r);o=o&&!l(s),lCe(e,s)}),o&&F6(e,n.credit)}if(e._suggestions.length>=5)return}}mm.flyToDestination=RCt;mm._updateSearchSuggestions=XCt;mm._adjustSuggestionsScroll=ECt;mm.prototype.isDestroyed=function(){return!1};mm.prototype.destroy=function(){return A6(this),me(this)};var u9=mm;var WCt="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",PCt="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function T3(e){let t=Xn(e.container),n=new u9(e);n._startSearchPath=WCt,n._stopSearchPath=PCt;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let o=document.createElement("input");o.type="search",o.className="cesium-geocoder-input",o.setAttribute("placeholder","Enter an address or landmark..."),o.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){o.select()},0)},o.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(o),this._textBox=o;let r=document.createElement("span");r.className="cesium-geocoder-searchButton",r.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(r),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),Se.applyBindings(n,i),Se.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(d){let u=d.target;typeof d.composedPath=="function"&&(u=d.composedPath()[0]),t.contains(u)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(d){n._focusTextbox=!0,n.showSuggestions()},zt.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(T3.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});T3.prototype.isDestroyed=function(){return!1};T3.prototype.destroy=function(){let e=this._container;return zt.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),Se.cleanNode(this._form),Se.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),me(this)};var m9=T3;var WRo=T(S(),1);var LRo=T(S(),1);function mCe(e,t){this._scene=e,this._duration=t;let n=this;this._command=Ln(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Se.track(this,["tooltip"])}Object.defineProperties(mCe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var h9=mCe;function S3(e,t,n){e=Xn(e);let i=new h9(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-home-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(o),Se.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(S3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});S3.prototype.isDestroyed=function(){return!1};S3.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var f9=S3;var DRo=T(S(),1);var FRo=T(S(),1);function vCt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function fCe(e,t){Se.track(e);for(let n=0;n<e.sublayers.length;n++)fCe(e.sublayers[n],t)}function C3(e){return e.modelName==="FullModel"}function pCe(e){return e.modelName==="Overview"}function bCe(e){return pCe(e)||C3(e)}function hCe(e,t){if(bCe(e)){e.visibility=!1;for(let i=0;i<e.sublayers.length;i++)e.sublayers[i].visibility=!0;let n={name:e.name,modelName:e.modelName,disable:Se.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function wCt(e,t){if(bCe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");C3(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function FCt(e,t){try{let n=e.getAttributeNames();for(let i=0;i<n.length;i++)if(n[i]==="BldgLevel"){let o=e.getAttributeValues(n[i]);for(let r=0;r<o.length;r++)t.push(o[r])}t.sort((i,o)=>i-o),t.unshift("All")}catch(n){console.log(`There was an error getting attributes: ${n}`)}}function ACt(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:Se.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:Se.observable(!0),index:-1}],currentLayer:Se.observable(),expandClickHandler:vCt,setOptionDisable:function(i,o){Se.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){wCt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){fCe(n[i],this.viewModel);let o=hCe(n[i],this.viewModel);l(o)&&(pCe(o)||!l(this.viewModel.defaultLayer)&&C3(o))&&(this.viewModel.defaultLayer=o)}if(this.viewModel.topLayers.length===1&&n.length>0){e.show=!1;let i={name:"Full Model",modelName:"FullModel",visibility:e.show,sublayers:e.sublayers};this.viewModel.defaultLayer=hCe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=C3(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return FCt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var p9=ACt;function MCt(e,t){let n=document.getElementById(e),i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=`
  14037. <h3>Building explorer</h3>
  14038. <select
  14039. data-bind="options: topLayers, optionsText: 'name', optionsAfterRender: setOptionDisable, value: currentLayer"
  14040. ></select>
  14041. <div id="bsl-wrapper">
  14042. <h3>Select Level</h3>
  14043. <select data-bind="options: levels, value: currentLevel"></select>
  14044. <h3>Disciplines & Categories</h3>
  14045. <ul class="layersList" data-bind="foreach: sublayers">
  14046. <ul class="layersList" data-bind="foreach: sublayers.sort(function (l, r) { return l.name.localeCompare(r.name) })">
  14047. <li>
  14048. <div class="li-wrapper">
  14049. <span
  14050. class="expandItem"
  14051. data-bind="click: $root.expandClickHandler"
  14052. >+</span
  14053. >
  14054. <input
  14055. type="checkbox"
  14056. data-bind="checked: visibility, valueUpdate: 'input', attr: { id: name}"
  14057. />
  14058. <label data-bind="attr: { for: name}">
  14059. <span data-bind="text: name"></span>
  14060. </label>
  14061. </div>
  14062. <ul class="nested" data-bind="attr: { id: name + '-expander'}">
  14063. <li data-bind="foreach: sublayers.sort(function (l, r) { return l.name.localeCompare(r.name) })">
  14064. <div class="li-wrapper">
  14065. <input
  14066. type="checkbox"
  14067. data-bind="checked: visibility, valueUpdate: 'input', attr: { id: name}"
  14068. />
  14069. <label data-bind="attr: { for: name}">
  14070. <span data-bind="text: name"></span>
  14071. </label>
  14072. </div>
  14073. </li>
  14074. </ul>
  14075. </li>
  14076. </ul>
  14077. </ul>
  14078. </div>`,n.appendChild(i);let o=new p9(t);Se.track(o),Se.applyBindings(o,n),l(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var M6=MCt;var $Ro=T(S(),1);var HRo=T(S(),1);var NCt="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",kCt="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function N6(){this._cameraClicked=new be,this._closeClicked=new be,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Se.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,Se.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?kCt:NCt}}),Se.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}N6.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(N6.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var b9=N6;function V3(e){e=Xn(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-infoBox-close",o.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),o.innerHTML="&times;",t.appendChild(o);let r=document.createElement("iframe");r.className="cesium-infoBox-iframe",r.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),r.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),r.setAttribute("allowfullscreen",!0),t.appendChild(r);let s=new b9;Se.applyBindings(s,t),this._container=e,this._element=t,this._frame=r,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;r.addEventListener("load",function(){let c=r.contentDocument,d=c.createElement("link");d.href=rn("Widgets/InfoBox/InfoBoxDescription.css"),d.rel="stylesheet",d.type="text/css";let u=c.createElement("div");u.className="cesium-infoBox-description",c.head.appendChild(d),c.body.appendChild(u),a._descriptionSubscription=xa(s,"description",function(m){r.style.height="5px",u.innerHTML=m;let p=null,g=u.firstElementChild;if(g!==null&&u.childNodes.length===1){let x=window.getComputedStyle(g);if(x!==null){let _=x["background-color"],C=B.fromCssColorString(_);l(C)&&C.alpha!==0&&(p=x["background-color"])}}t.style["background-color"]=p;let f=u.getBoundingClientRect().height;r.style.height=`${f}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(V3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});V3.prototype.isDestroyed=function(){return!1};V3.prototype.destroy=function(){let e=this._container;return Se.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),me(this)};var g9=V3;var dZo=T(S(),1);var iZo=T(S(),1);function gCe(){this.showInstructions=!1;let e=this;this._command=Ln(function(){e.showInstructions=!e.showInstructions}),this._showClick=Ln(function(){e._touch=!1}),this._showTouch=Ln(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Se.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(gCe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var y9=gCe;function L3(e){let t=Xn(e.container),n=new y9,i=y(e.instructionsInitiallyVisible,!1);n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let o=document.createElement("span");o.className="cesium-navigationHelpButton-wrapper",t.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),o.appendChild(r);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=rn("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let d=document.createElement("button");d.type="button",d.className="cesium-navigation-button cesium-navigation-button-right",d.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let u=document.createElement("img");u.src=rn("Widgets/Images/NavigationHelp/Touch.svg"),u.className="cesium-navigation-button-icon",u.style.width="25px",u.style.height="25px",d.appendChild(u),d.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(d);let m=document.createElement("div");m.className="cesium-click-navigation-help cesium-navigation-help-instructions",m.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),m.innerHTML=` <table> <tr> <td><img src="${rn("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${rn("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${rn("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(m);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${rn("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${rn("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${rn("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${rn("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),Se.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(g){o.contains(g.target)||(n.showInstructions=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(L3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});L3.prototype.isDestroyed=function(){return!1};L3.prototype.destroy=function(){return zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Se.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),me(this)};var x9=L3;var VZo=T(S(),1);var gZo=T(S(),1);function k6(e){this._scene=e.scene,this.lowFrameRateMessage=y(e.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,Se.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Ln(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=ZM.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(k6.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});k6.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),me(this)};var _9=k6;function R3(e){let t=Xn(e.container),n=new _9(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let o=document.createElement("button");o.setAttribute("type","button"),o.className="cesium-performance-watchdog-message-dismiss",o.innerHTML="&times;",o.setAttribute("data-bind","click: dismissMessage"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-performance-watchdog-message",r.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(r),t.appendChild(i),Se.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(R3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});R3.prototype.isDestroyed=function(){return!1};R3.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var T9=R3;var AZo=T(S(),1);var IZo=T(S(),1);function Z3(e){this._scene=e,this._orthographic=e.camera.frustum instanceof an,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Se.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Se.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Ln(function(){t.sceneMode===oe.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new lr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===oe.SCENE2D||t._scene.camera.frustum instanceof an}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=Ln(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Ln(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=oe}Object.defineProperties(Z3.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});Z3.prototype.isDestroyed=function(){return!1};Z3.prototype.destroy=function(){this._eventHelper.removeAll(),me(this)};var S9=Z3;var UCt="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",DCt="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function G3(e,t){e=Xn(e);let n=new S9(t);n._perspectivePath=UCt,n._orthographicPath=DCt;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),Se.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(G3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});G3.prototype.isDestroyed=function(){return!1};G3.prototype.destroy=function(){return this._viewModel.destroy(),zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Se.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),me(this)};var C9=G3;var jZo=T(S(),1);var OZo=T(S(),1);function E3(e,t){this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new lr,this._eventHelper.add(e.morphStart,i),this._duration=y(t,2),this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",Se.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Se.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===oe.SCENE2D?n.tooltip2D:o===oe.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Ln(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Ln(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Ln(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Ln(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=oe}Object.defineProperties(E3.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});E3.prototype.isDestroyed=function(){return!1};E3.prototype.destroy=function(){this._eventHelper.removeAll(),me(this)};var V9=E3;var BCt="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",OCt="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",YCt="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function I3(e,t,n){e=Xn(e);let i=new V9(t,n);i._globePath=BCt,i._flatMapPath=OCt,i._columbusViewPath=YCt;let o=document.createElement("span");o.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',o.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),o.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),o.appendChild(c),Se.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(d){o.contains(d.target)||(i.dropDownVisible=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(I3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});I3.prototype.isDestroyed=function(){return!1};I3.prototype.destroy=function(){return this._viewModel.destroy(),zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Se.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),me(this)};var L9=I3;var lGo=T(S(),1);var nGo=T(S(),1);var HCt=new D,X3="-1000px";function R9(e,t,n){this._scene=e,this._screenPositionX=X3,this._screenPositionY=X3,this._tweens=e.tweens,this._container=y(n,document.body),this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Se.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Se.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),Se.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return Mi.worldToWindowCoordinates(e,i,o)}}R9.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,HCt);if(!l(e))this._screenPositionX=X3,this._screenPositionY=X3;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,r=o*.5;e.x=Math.min(Math.max(e.x,-o),n+o)-r,e.y=Math.min(Math.max(e.y,-o),i+o)-r,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};R9.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Yr.EXPONENTIAL_OUT})};R9.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Yr.EXPONENTIAL_OUT})};Object.defineProperties(R9.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var Z9=R9;function W3(e,t){e=Xn(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",o="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",r=document.createElementNS(i,"svg:svg");r.setAttribute("width",160),r.setAttribute("height",160),r.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),r.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",o),s.appendChild(a),n.appendChild(r);let c=new Z9(t,this._element,this._container);this._viewModel=c,Se.applyBindings(this._viewModel,this._element)}Object.defineProperties(W3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});W3.prototype.isDestroyed=function(){return!1};W3.prototype.destroy=function(){let e=this._container;return Se.cleanNode(this._element),e.removeChild(this._element),me(this)};var G9=W3;var TGo=T(S(),1);var mGo=T(S(),1);function xS(e,t,n){this._color=e,this._height=t,this._base=y(n,0)}xS.prototype.getHeight=function(){return this._height};xS.prototype.getBase=function(){return this._base};xS.prototype.getStartTime=function(){return this._start};xS.prototype.getStopTime=function(){return this._stop};xS.prototype.setRange=function(e,t){this._start=e,this._stop=t};xS.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=j.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=j.secondsDifference(this._stop,e.epochJulian),r=Math.round(e.timeBarWidth*e.getAlpha(o))-i;i<0&&(r+=i,i=0),i+r>e.timeBarWidth&&(r=e.timeBarWidth-i),r>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${r.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var E9=xS;var pGo=T(S(),1);function yCe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new B(.5,.5,.5,1),this.backgroundColor=i||new B(0,0,0,0)}yCe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=j.addSeconds(t.startJulian,t.duration,new j);if(j.lessThan(n,o)&&j.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(j.lessThanOrEquals(n,r)&&j.greaterThanOrEquals(i,o)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let d=j.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new j);!l(a)&&j.greaterThanOrEquals(d,n)?a=s:!l(c)&&j.greaterThanOrEquals(d,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var I9=yCe;var U6=1e12,hm={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},ul={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},Dy=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],zCt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ml(e,t){e=Xn(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=hm.none,this._touchMode=ul.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=KCt(this),this._onMouseUp=JCt(this),this._onMouseMove=QCt(this),this._onMouseWheel=jCt(this),this._onTouchStart=qCt(this),this._onTouchMove=e1t(this),this._onTouchEnd=$Ct(this);let o=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),o.addEventListener("mousedown",this._onMouseDown,!1),o.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),o.addEventListener("mousewheel",this._onMouseWheel,!1),o.addEventListener("touchstart",this._onTouchStart,!1),o.addEventListener("touchmove",this._onTouchMove,!1),o.addEventListener("touchend",this._onTouchEnd,!1),o.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}ml.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};ml.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};ml.prototype.isDestroyed=function(){return!1};ml.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),me(this)};ml.prototype.addHighlightRange=function(e,t,n){let i=new E9(e,t,n);return this._highlightRanges.push(i),this.resize(),i};ml.prototype.addTrack=function(e,t,n,i){let o=new I9(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};ml.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=j.secondsDifference(t,e),this._clock&&this._clock.clockRange!==Br.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=j.secondsDifference(o,i),s=j.secondsDifference(i,this._startJulian),a=j.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=j.addSeconds(this._endJulian,s,new j),this._startJulian=i,this._timeBarSecondsSpan=j.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=j.addSeconds(this._startJulian,a,new j),this._endJulian=o,this._timeBarSecondsSpan=j.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};ml.prototype.zoomFrom=function(e){let t=j.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(j.addSeconds(this._startJulian,t-t*e,new j),j.addSeconds(this._endJulian,n*e-n,new j))};function D6(e){return e<10?`0${e.toString()}`:e.toString()}ml.prototype.makeLabel=function(e){let t=j.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${zCt[t.month-1]} ${t.day} ${t.year} ${D6(t.hour)}:${D6(t.minute)}:${D6(t.second)}${i}`};ml.prototype.smallestTicInPixels=7;ml.prototype._makeTics=function(){let e=this._timeBarEle,t=j.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,o,r=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,d=1e-10,u=0,m=this._timeBarSecondsSpan;m<a?(m=a,this._timeBarSecondsSpan=a,this._endJulian=j.addSeconds(this._startJulian,a,new j)):m>c&&(m=c,this._timeBarSecondsSpan=c,this._endJulian=j.addSeconds(this._startJulian,c,new j));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,f=Math.min(m/p*1e-5,.4),x,_=j.toGregorianDate(g);m>31536e4?x=j.fromDate(new Date(Date.UTC(Math.floor(_.year/100)*100,0))):m>31536e3?x=j.fromDate(new Date(Date.UTC(Math.floor(_.year/10)*10,0))):m>86400?x=j.fromDate(new Date(Date.UTC(_.year,0))):x=j.fromDate(new Date(Date.UTC(_.year,_.month,_.day)));let C=j.secondsDifference(this._startJulian,j.addSeconds(x,f,new j)),V=C+m;this._epochJulian=x;function L(k){return Math.floor(C/k)*k}function Z(k,H){return Math.ceil(k/H+.5)*H}function G(k){return(k-C)/m}function I(k,H){return k-H*Math.round(k/H)}this._rulerEle.innerHTML=this.makeLabel(j.addSeconds(this._endJulian,-a,new j));let v=this._rulerEle.offsetWidth+20;v<30&&(v=180);let P=u;u-=d;let w={startTime:C,startJulian:g,epochJulian:x,duration:m,timeBarWidth:p,getAlpha:G};this._highlightRanges.forEach(function(k){s+=k.render(w)});let F=0,b=0,R=0,E=v/p;E>1&&(E=1),E*=this._timeBarSecondsSpan;let X=-1,A=-1,N=Dy.length,O;for(O=0;O<N;++O){let k=Dy[O];if(++X,F=k,k>E&&k>u)break;A<0&&p*(k/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(A=X)}if(X>0){for(;X>0;)if(--X,Math.abs(I(F,Dy[X]))<1e-5){Dy[X]>=u&&(b=Dy[X]);break}if(A>=0)for(;A<X;){if(Math.abs(I(b,Dy[A]))<1e-5&&Dy[A]>=u){R=Dy[A];break}++A}}u=P,u>d&&R<1e-5&&Math.abs(u-F)>d&&(R=u,u<=F+d&&(b=0));let U=-999999,Y;if(p*(R/this._timeBarSecondsSpan)>=3)for(o=L(R);o<=V;o=Z(o,R))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*G(o)).toString()}px;"></span>`;if(p*(b/this._timeBarSecondsSpan)>=3)for(o=L(b);o<=V;o=Z(o,b))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*G(o)).toString()}px;"></span>`;if(p*(F/this._timeBarSecondsSpan)>=2){this._mainTicSpan=F,V+=F,o=L(F);let k=j.computeTaiMinusUtc(x);for(;o<=V;){let H=j.addSeconds(g,o-C,new j);if(F>2.1){let q=j.computeTaiMinusUtc(H);Math.abs(q-k)>.1&&(o+=q-k,H=j.addSeconds(g,o-C,new j))}let J=Math.round(p*G(o)),te=this.makeLabel(H);this._rulerEle.innerHTML=te,Y=this._rulerEle.offsetWidth,Y<10&&(Y=v);let z=J-(Y/2-1);z>U?(U=z+Y+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${J.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${z.toString()}px;">${te}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${J.toString()}px;"></span>`,o=Z(o,F)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),w.y=0,this._trackList.forEach(function(k){k.render(r._context,w),w.y+=k.height})};ml.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=j.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(j.addSeconds(this._startJulian,this._timelineDrag,new j),j.addSeconds(this._endJulian,this._timelineDrag,new j)))};ml.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=j.addSeconds(this._startJulian,t,new j),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function KCt(e){return function(t){e._mouseMode!==hm.touchOnly&&(t.button===0?(e._mouseMode=hm.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=hm.zoom:e._mouseMode=hm.slide)),t.preventDefault()}}function JCt(e){return function(t){e._mouseMode=hm.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function QCt(e){return function(t){let n;if(e._mouseMode===hm.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===hm.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(j.addSeconds(e._startJulian,i,new j),j.addSeconds(e._endJulian,i,new j))}}else e._mouseMode===hm.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function jCt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;U6=Math.max(Math.min(Math.abs(n),U6),1),n/=U6,e.zoomFrom(Math.pow(1.05,-n))}}function qCt(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=hm.touchOnly,n===1?(i=j.secondsDifference(e._scrubJulian,e._startJulian),o=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+r),Math.abs(t.touches[0].clientX-o)<50?(e._touchMode=ul.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=ul.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=ul.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-r,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=ul.ignore}}function $Ct(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===ul.singleTap?(e._touchMode=ul.scrub,e._onTouchMove(t)):e._touchMode===ul.scrub&&e._onTouchMove(t),e._mouseMode=hm.touchOnly,n!==1?e._touchMode=n>0?ul.ignore:ul.none:e._touchMode===ul.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function e1t(e){return function(t){let n,i,o,r,s,a,c=1,d=e._topDiv.getBoundingClientRect().left;e._touchMode===ul.singleTap&&(e._touchMode=ul.slideZoom),e._mouseMode=hm.touchOnly,e._touchMode===ul.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-d,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===ul.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-d,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-d,s=0),l(r)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=j.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new j)):(n=e._touchState.centerX-r,a=j.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new j)),e.zoomTo(a,j.addSeconds(a,e._timeBarSecondsSpan*c,new j)),e._touchState.centerX=r,e._touchState.spanX=s))}}ml.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var X9=ml;var MGo=T(S(),1);var XGo=T(S(),1);var CCe=T(SCe(),1);function i1t(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function VCe(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function o1t(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(VCe(),e._locked=!1),e._noSleep.disable(),pr.exitFullscreen(),n(!1)):(pr.fullscreen||pr.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=i1t("landscape")),t.useWebVR=!0,n(!0)))}function P3(e,t){let n=this,i=Se.observable(pr.enabled),o=Se.observable(!1);this.isVRMode=void 0,Se.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,Se.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&pr.enabled)}}),this.tooltip=void 0,Se.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=Se.observable(!1);this._isOrthographic=void 0,Se.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new lr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof an)}),this._locked=!1,this._noSleep=new CCe.default,this._command=Ln(function(){o1t(n,e,o,r)},Se.getObservable(this,"isVREnabled")),this._vrElement=y(Xn(t),document.body),this._callback=function(){!pr.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(VCe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(pr.changeEventName,this._callback)}Object.defineProperties(P3.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});P3.prototype.isDestroyed=function(){return!1};P3.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(pr.changeEventName,this._callback),me(this)};var W9=P3;var r1t="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",s1t="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function v3(e,t,n){e=Xn(e);let i=new W9(t,n);i._exitVRPath=s1t,i._enterVRPath=r1t;let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-vrButton",o.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(o),Se.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(v3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});v3.prototype.isDestroyed=function(){return!1};v3.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),me(this)};var P9=v3;var rEo=T(S(),1);var LCe=new ce;function GCe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function a1t(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let o=e.getProperty(i);l(o)&&(n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function c1t(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let r=i[t];/^name$/i.test(r)?n[0]=e.getProperty(r):/name/i.test(r)?n[1]=e.getProperty(r):/^title$/i.test(r)?n[2]=e.getProperty(r):/^(id|identifier)$/i.test(r)?n[3]=e.getProperty(r):/element/i.test(r)?n[4]=e.getProperty(r):/(id|identifier)$/i.test(r)&&(n[5]=e.getProperty(r))}let o=n.length;for(t=0;t<o;t++){let r=n[t];if(l(r)&&r!=="")return r}return"Unnamed Feature"}function RCe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=y(n.id,n.primitive.id);if(i instanceof jo)return i;if(n instanceof Ns)return new jo({name:c1t(n),description:a1t(n),feature:n})}if(l(e.scene.globe))return u1t(e,t.position)}var l1t=new j;function H6(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,o=n.stopTime;j.equals(i,o)&&(o=j.addSeconds(i,W.EPSILON2,l1t)),e.updateFromClock(),e.zoomTo(i,o)}}}var d1t=new h;function u1t(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(o))return;let r=new jo({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!l(s)||s.length===0){e.selectedEntity=ZCe();return}let a=s[0],c=new jo({id:a.name,description:a.description});if(l(a.position)){let d=e.scene.ellipsoid.cartographicToCartesian(a.position,d1t);c.position=new Nc(d)}e.selectedEntity=c},function(){e.selectedEntity===r&&(e.selectedEntity=ZCe())}),r}function ZCe(){return new jo({id:"None",description:"No features found."})}function m1t(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,d=e._fullscreenButton,u=e._infoBox,m=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(d)&&d.viewModel.isFullscreenEnabled&&(d.container.style.visibility=p),l(u)&&(u.container.style.visibility=p),l(m)&&(m.container.style.visibility=p),e._container){let g=t||!l(d)?0:d.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function Ji(e,t){e=Xn(e),t=y(t,y.EMPTY_OBJECT);let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,o=document.createElement("div");o.className="cesium-viewer",e.appendChild(o);let r=document.createElement("div");r.className="cesium-viewer-cesiumWidgetContainer",o.appendChild(r);let s=document.createElement("div");s.className="cesium-viewer-bottom",o.appendChild(s);let a=y(t.scene3DOnly,!1),c,d,u=!1;l(t.clockViewModel)?(d=t.clockViewModel,c=d.clock):(c=new oh,d=new HM(c),u=!0);let m=new nM(r,{baseLayer:n&&l(t.selectedImageryProviderViewModel)||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,shouldAnimate:t.shouldAnimate,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,ellipsoid:t.ellipsoid,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,automaticallyTrackDataSourceClocks:t.automaticallyTrackDataSourceClocks,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,dataSources:t.dataSources,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=m.scene,g=new lr;g.add(c.onTick,Ji.prototype._onTick,this);let f;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let H=document.createElement("div");H.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(H),f=new G9(H,p)}let x;if(!l(t.infoBox)||t.infoBox!==!1){let H=document.createElement("div");H.className="cesium-viewer-infoBoxContainer",o.appendChild(H),x=new g9(H);let J=x.viewModel;g.add(J.cameraClicked,Ji.prototype._onInfoBoxCameraClicked,this),g.add(J.closeClicked,Ji.prototype._onInfoBoxClockClicked,this)}let _=document.createElement("div");_.className="cesium-viewer-toolbar",o.appendChild(_);let C;if(!l(t.geocoder)||t.geocoder!==!1){let H=document.createElement("div");H.className="cesium-viewer-geocoderContainer",_.appendChild(H);let J;l(t.geocoder)&&typeof t.geocoder!="boolean"&&(J=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),C=new m9({container:H,geocoderServices:J,scene:p}),g.add(C.viewModel.search.beforeExecute,Ji.prototype._clearObjects,this)}let V;(!l(t.homeButton)||t.homeButton!==!1)&&(V=new f9(_,p),l(C)&&g.add(V.viewModel.command.afterExecute,function(){let H=C.viewModel;H.searchText="",H.isSearchInProgress&&H.search()}),g.add(V.viewModel.command.beforeExecute,Ji.prototype._clearTrackedObject,this));let L;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(L=new L9(_,p));let Z;t.projectionPicker&&(Z=new C9(_,p));let G,I;if(n){let H=y(t.imageryProviderViewModels,e9()),J=y(t.terrainProviderViewModels,t9());G=new $M(_,{globe:p.globe,imageryProviderViewModels:H,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:J,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),I=_.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(G.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(G.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let v;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let H=!0;try{if(l(window.localStorage)){let J=window.localStorage.getItem("cesium-hasSeenNavHelp");l(J)&&J?H=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}v=new x9({container:_,instructionsInitiallyVisible:y(t.navigationInstructionsInitiallyVisible,H)})}let P;if(!l(t.animation)||t.animation!==!1){let H=document.createElement("div");H.className="cesium-viewer-animationContainer",o.appendChild(H),P=new QM(H,new jM(d))}let w;if(!l(t.timeline)||t.timeline!==!1){let H=document.createElement("div");H.className="cesium-viewer-timelineContainer",o.appendChild(H),w=new X9(H,c),w.addEventListener("settime",GCe,!1),w.zoomTo(c.startTime,c.stopTime)}let F,b,R;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(R=document.createElement("div"),R.className="cesium-viewer-fullscreenContainer",o.appendChild(R),F=new d9(R,t.fullscreenElement),b=xa(F.viewModel,"isFullscreenEnabled",function(H){R.style.display=H?"block":"none",l(w)&&(w.container.style.right=`${R.clientWidth}px`,w.resize())}));let E,X,A;if(t.vrButton){let H=document.createElement("div");H.className="cesium-viewer-vrContainer",o.appendChild(H),E=new P9(H,p,t.fullScreenElement),X=xa(E.viewModel,"isVREnabled",function(J){H.style.display=J?"block":"none",l(F)&&(H.style.right=`${R.clientWidth}px`),l(w)&&(w.container.style.right=`${H.clientWidth}px`,w.resize())}),A=xa(E.viewModel,"isVRMode",function(J){m1t(i,J)})}this._baseLayerPickerDropDown=I,this._fullscreenSubscription=b,this._vrSubscription=X,this._vrModeSubscription=A,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=m,this._selectionIndicator=f,this._infoBox=x,this._clockViewModel=d,this._destroyClockViewModel=u,this._toolbar=_,this._homeButton=V,this._sceneModePicker=L,this._projectionPicker=Z,this._baseLayerPicker=G,this._navigationHelpButton=v,this._animation=P,this._timeline=w,this._fullscreenButton=F,this._vrButton=E,this._geocoder=C,this._eventHelper=g,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(x)||l(f),this._selectedEntity=void 0,this._selectedEntityChanged=new be;let N=this._cesiumWidget.dataSources,O=this._cesiumWidget.dataSourceDisplay;g.add(N.dataSourceAdded,Ji.prototype._onDataSourceAdded,this),g.add(N.dataSourceRemoved,Ji.prototype._onDataSourceRemoved,this),g.add(p.postUpdate,Ji.prototype.resize,this);let U=N.length;for(let H=0;H<U;H++)this._dataSourceAdded(N,N.get(H));this._dataSourceAdded(void 0,O.defaultDataSource),g.add(N.dataSourceAdded,Ji.prototype._dataSourceAdded,this),g.add(N.dataSourceRemoved,Ji.prototype._dataSourceRemoved,this);function Y(H){let J=RCe(i,H);l(J)?K.getValueOrUndefined(J.position,i.clock.currentTime)?i.trackedEntity=J:i.zoomTo(J):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function k(H){i.selectedEntity=RCe(i,H)}m.screenSpaceEventHandler.setInputAction(k,Sn.LEFT_CLICK),m.screenSpaceEventHandler.setInputAction(Y,Sn.LEFT_DOUBLE_CLICK),m._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(Ji.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._cesiumWidget.dataSourceDisplay}},entities:{get:function(){return this._cesiumWidget.entities}},dataSources:{get:function(){return this._cesiumWidget.dataSources}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._cesiumWidget.allowDataSourcesToSuspendAnimation},set:function(e){this._cesiumWidget.allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._cesiumWidget.trackedEntity},set:function(e){this._cesiumWidget.trackedEntity=e}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._cesiumWidget.trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._cesiumWidget.clockTrackedDataSource},set:function(e){this._cesiumWidget.clockTrackedDataSource!==e&&(this._cesiumWidget.clockTrackedDataSource=e,H6(this._timeline,e))}}});Ji.prototype.extend=function(e,t){e(this,t)};Ji.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,o=l(this._animation),r=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(l(a)&&(a.style.maxHeight=`${s}px`),l(this._geocoder)){let f=this._geocoder.searchSuggestionsContainer;f.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,d,u=0,m=5,p=3,g=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let f=this._lastWidth;d=this._animation.container,n>900?(u=169,f<=900&&(d.style.width="169px",d.style.height="112px",this._animation.resize())):n>=600?(u=136,(f<600||f>900)&&(d.style.width="136px",d.style.height="90px",this._animation.resize())):(u=106,(f>600||f===0)&&(d.style.width="106px",d.style.height="70px",this._animation.resize())),m=u+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let f=this._fullscreenButton,x=this._vrButton,_=c.container,C=_.style;p=_.clientHeight+3,C.left=`${u}px`;let V=0;l(f)&&(V+=f.container.clientWidth),l(x)&&(V+=x.container.clientWidth),C.right=`${V}px`,c.resize()}!r&&l(this._fullscreenButton)&&(g=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${m}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${g}px`,this._lastWidth=n,this._lastHeight=i};Ji.prototype.forceResize=function(){this._lastWidth=0,this.resize()};Ji.prototype.render=function(){this._cesiumWidget.render()};Ji.prototype.isDestroyed=function(){return!1};Ji.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(Sn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Sn.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",GCe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._cesiumWidget=this._cesiumWidget.destroy(),me(this)};Ji.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Ji.prototype._onEntityCollectionChanged,this)};Ji.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Ji.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};Ji.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};Ji.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,o=this.selectedEntity,r=l(o)&&this._enableInfoOrSelection;r&&o.isShowing&&o.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(o,!0,LCe)!==ft.FAILED?n=LCe.center:l(o.position)&&(n=o.position.getValue(t,n)),i=l(n));let s=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(s)&&(s.position=h.clone(n,s.position),s.showSelection=r&&i,s.update());let a=l(this._infoBox)?this._infoBox.viewModel:void 0;l(a)&&(a.showInfo=r,a.enableCamera=i,a.isCameraTracking=this.trackedEntity===this.selectedEntity,r?(a.titleText=y(o.name,o.id),a.description=K.getValueOrDefault(o.description,t,"")):(a.titleText="",a.description=""))};Ji.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.selectedEntity===r&&(this.selectedEntity=void 0)}};Ji.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};Ji.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Ji.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};Ji.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};Ji.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&H6(this.timeline,e)};Ji.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&H6(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Ji.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Ji.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};Ji.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};Ji.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var z6=Ji;var cEo=T(S(),1);function h1t(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new r9(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var K6=h1t;var uEo=T(S(),1);function f1t(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new c9(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var J6=f1t;var pEo=T(S(),1);function p1t(e,t){t=y(t,y.EMPTY_OBJECT);let n=!0,i=y(t.flyToOnDrop,!0),o=new be,r=y(t.clearOnDrop,!0),s=y(t.dropTarget,e.container),a=y(t.clampToGround,!0),c=t.proxy;s=Xn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(u){ECe(s,d),s=u,Q6(s,d)}},dropEnabled:{get:function(){return n},set:function(u){u!==n&&(u?Q6(s,d):ECe(s,d),n=u)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(u){r=u}},flyToOnDrop:{get:function(){return i},set:function(u){i=u}},proxy:{get:function(){return c},set:function(u){c=u}},clampToGround:{get:function(){return a},set:function(u){a=u}}});function d(u){_S(u),r&&(e.entities.removeAll(),e.dataSources.removeAll());let m=u.dataTransfer.files,p=m.length;for(let g=0;g<p;g++){let f=m[g],x=new FileReader;x.onload=b1t(e,f,c,a),x.onerror=g1t(e,f),x.readAsText(f)}}Q6(s,d),e.destroy=gM(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=d}function _S(e){e.stopPropagation(),e.preventDefault()}function ECe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",_S,!1),n.removeEventListener("dragover",_S,!1),n.removeEventListener("dragexit",_S,!1))}function Q6(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",_S,!1),e.addEventListener("dragover",_S,!1),e.addEventListener("dragexit",_S,!1)}function b1t(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=DP.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=Wv.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=lw.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=Fv.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}l(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function g1t(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var j6=p1t;var TEo=T(S(),1);function y1t(e,t){t=y(t,y.EMPTY_OBJECT);let n=new T9({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var q6=y1t;var FEo=T(S(),1);var PEo=T(S(),1);var REo=T(S(),1);function ICe(e){let t=e.split(`
  14079. `),n;for(n=0;n<t.length&&!t[n].match(/\S/);n++);if(n===t.length)return"";let i="",o=/^\s*/,s=t[n].match(o)[0].length;for(let a=n;a<t.length;a++){let c=t[a];c.match(o)[0].length>=s&&(c=c.slice(s)),i+=`${c}
  14080. `}return i}function fm(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(o){let{name:r,initialValue:s}=o;t._definedProperties.push(r);let a=o.setPrimitiveFunction;a===!0&&(a=function(u){t._voxelPrimitive[r]=u});let c=o.getPrimitiveFunction;c===!0&&(c=function(){t[r]=t._voxelPrimitive[r]}),l(c)&&t._getPrimitiveFunctions.push(c);let d=Se.observable();return Se.defineProperty(t,r,{get:function(){return d()},set:function(u){typeof s=="number"&&typeof u=="string"&&(u=Number(u),isNaN(u)&&(u=s)),typeof s=="boolean"&&typeof u=="number"&&(u=u===1),d(u),l(a)&&l(t._voxelPrimitive)&&(a(u),e.requestRender())}}),t[r]=s,d}function i(o,r){return function(s){let a=t._voxelPrimitive[o].clone();a[r]=s,t._voxelPrimitive[o]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let o=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=ICe(o)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsBox=o===vi.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===vi.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===vi.CYLINDER}}),n({name:"boundsBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMaxX=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsBoxMinX",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsBoxMinX=t._voxelPrimitive.minBounds.x}}),n({name:"boundsBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMaxY=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsBoxMinY",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsBoxMinY=t._voxelPrimitive.minBounds.y}}),n({name:"boundsBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMaxZ=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsBoxMinZ",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsBoxMinZ=t._voxelPrimitive.minBounds.z}}),n({name:"boundsEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLongitude=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLongitude=t._voxelPrimitive.minBounds.x}}),n({name:"boundsEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxLatitude=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsEllipsoidMinLatitude=t._voxelPrimitive.minBounds.y}}),n({name:"boundsEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMaxHeight=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsEllipsoidMinHeight=t._voxelPrimitive.minBounds.z}}),n({name:"boundsCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMaxRadius=t._voxelPrimitive.maxBounds.x}}),n({name:"boundsCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minBounds","x"),getPrimitiveFunction:function(){t.boundsCylinderMinRadius=t._voxelPrimitive.minBounds.x}}),n({name:"boundsCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMaxHeight=t._voxelPrimitive.maxBounds.y}}),n({name:"boundsCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minBounds","y"),getPrimitiveFunction:function(){t.boundsCylinderMinHeight=t._voxelPrimitive.minBounds.y}}),n({name:"boundsCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMaxAngle=t._voxelPrimitive.maxBounds.z}}),n({name:"boundsCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minBounds","z"),getPrimitiveFunction:function(){t.boundsCylinderMinAngle=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&op(t)},getPrimitiveFunction:function(){t.translationX=M.getTranslation(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&op(t)},getPrimitiveFunction:function(){t.translationY=M.getTranslation(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&op(t)},getPrimitiveFunction:function(){t.translationZ=M.getTranslation(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&op(t)},getPrimitiveFunction:function(){t.scaleX=M.getScale(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&op(t)},getPrimitiveFunction:function(){t.scaleY=M.getScale(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&op(t)},getPrimitiveFunction:function(){t.scaleZ=M.getScale(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&op(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&op(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&op(t)}})}var x1t=new h,_1t=new h,T1t=new Ca,S1t=new $;function op(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,x1t),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,_1t),i=T1t;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=$.fromHeadingPitchRoll(i,S1t),r=$.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=M.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(fm.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),l(e)){this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=ICe(i),l(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,op(t)}}}});fm.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};fm.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};fm.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};fm.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};fm.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};fm.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};fm.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new QT({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};fm.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(`
  14081. `),c=a.length,d;if(t.shiftKey)for(d=0;d<c;++d)a[d][0]===" "&&(a[d][1]===" "?(a[d]=a[d].substr(2),r-=2):(a[d]=a[d].substr(1),r-=1));else for(d=0;d<c;++d)a[d]=` ${a[d]}`,r+=2;let u=a.join(`
  14082. `);n.value=n.value.slice(0,i)+u+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};fm.prototype.isDestroyed=function(){return!1};fm.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Se.getObservable(e,t).dispose()}),me(this)};var v9=fm;function w3(e,t){e=Xn(e);let n=document.createElement("div"),i=new v9(t);this._viewModel=i,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="Voxel Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let r=document.createElement("div");r.className="cesium-cesiumInspector-dropDown",n.appendChild(r);let s=Ba.createSection,a=Ba.createCheckbox,c=Ba.createRangeInput,d=Ba.createButton,u=s(r,"Display","displayVisible","toggleDisplay"),m=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Bounds","boundsVisible","toggleBounds"),g=s(r,"Clipping","clippingVisible","toggleClipping"),f=s(r,"Shader","shaderVisible","toggleShader");u.appendChild(a("Depth Test","depthTest")),u.appendChild(a("Show","show")),u.appendChild(a("Disable Update","disableUpdate")),u.appendChild(a("Debug Draw","debugDraw")),u.appendChild(a("Jitter","jitter")),u.appendChild(a("Nearest Sampling","nearestSampling")),u.appendChild(c("Screen Space Error","screenSpaceError",0,128)),u.appendChild(c("Step Size","stepSize",0,2));let x=10,_=10,C=W.PI;m.appendChild(c("Translation X","translationX",-x,+x)),m.appendChild(c("Translation Y","translationY",-x,+x)),m.appendChild(c("Translation Z","translationZ",-x,+x)),m.appendChild(c("Scale X","scaleX",0,+_)),m.appendChild(c("Scale Y","scaleY",0,+_)),m.appendChild(c("Scale Z","scaleZ",0,+_)),m.appendChild(c("Heading","angleX",-C,+C)),m.appendChild(c("Pitch","angleY",-C,+C)),m.appendChild(c("Roll","angleZ",-C,+C));let V=vi.getMinBounds(vi.BOX),L=vi.getMaxBounds(vi.BOX),Z=h.fromElements(vi.getMinBounds(vi.ELLIPSOID).x,vi.getMinBounds(vi.ELLIPSOID).y,-ne.WGS84.maximumRadius,new h),G=h.fromElements(vi.getMaxBounds(vi.ELLIPSOID).x,vi.getMaxBounds(vi.ELLIPSOID).y,1e7,new h),I=vi.getMinBounds(vi.CYLINDER),v=vi.getMaxBounds(vi.CYLINDER);FL("Max X","Min X","Max Y","Min Y","Max Z","Min Z","boundsBoxMaxX","boundsBoxMinX","boundsBoxMaxY","boundsBoxMinY","boundsBoxMaxZ","boundsBoxMinZ",V,L,"shapeIsBox",p),FL("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","boundsEllipsoidMaxLongitude","boundsEllipsoidMinLongitude","boundsEllipsoidMaxLatitude","boundsEllipsoidMinLatitude","boundsEllipsoidMaxHeight","boundsEllipsoidMinHeight",Z,G,"shapeIsEllipsoid",p),FL("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","boundsCylinderMaxRadius","boundsCylinderMinRadius","boundsCylinderMaxHeight","boundsCylinderMinHeight","boundsCylinderMaxAngle","boundsCylinderMinAngle",I,v,"shapeIsCylinder",p),FL("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ",V,L,"shapeIsBox",g),FL("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight",Z,G,"shapeIsEllipsoid",g),FL("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxHeight","clippingCylinderMinHeight","clippingCylinderMaxAngle","clippingCylinderMinAngle",I,v,"shapeIsCylinder",g);let P=document.createElement("div");f.appendChild(P);let w=document.createElement("textarea");w.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),P.className="cesium-cesiumInspector-styleEditor",P.appendChild(w);let F=d("Compile (Ctrl+Enter)","compileShader");P.appendChild(F);let b=document.createElement("label");b.style.display="block",b.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),P.appendChild(b),Se.applyBindings(i,n)}Object.defineProperties(w3.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});w3.prototype.isDestroyed=function(){return!1};w3.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),me(this)};function FL(e,t,n,i,o,r,s,a,c,d,u,m,p,g,f,x){let _=Ba.createRangeInput,C=p,V=g,L=x.appendChild(document.createElement("div"));L.setAttribute("data-bind",`if: ${f}`),L.appendChild(_(e,s,C.x,V.x)),L.appendChild(_(t,a,C.x,V.x)),L.appendChild(_(n,c,C.y,V.y)),L.appendChild(_(i,d,C.y,V.y)),L.appendChild(_(o,u,C.z,V.z)),L.appendChild(_(r,m,C.z,V.z))}var w9=w3;function C1t(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new w9(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var $6=C1t;globalThis.CESIUM_VERSION="1.123";var V1t="1.123";return YCe(L1t);})();